1@startuml 2 3title DHCPv4 packet processing (Kea 1.8.0) 4 5agent "Receive query" as receivePacket 6note left : input 7 8agent "Service Enabled" as isServiceEnabled 9 10agent "Callout buffer4_receive" as buffer4_receive 11note right : hook 12 13agent "Unpack query" as unpack 14 15agent "Classify query" as classify 16 17agent "Callout pkt4_receive" as pkt4_receive 18note right : hook 19 20agent "Check DROP class" as drop_class 21 22agent "Avoid same client race in multi-threaded mode" as same_client 23note right : postpone processing or drop 24 25rectangle "Process Query on its Message Type" as process { 26 agent "Process Discover" as processDiscover 27 agent "Process Request" as processRequest 28 agent "Process Release" as processRelease 29 agent "Process Decline" as processDecline 30 agent "Process Inform" as processInform 31} 32 33agent "Callout leases4_committed" as leases4_committed 34note right : hook 35 36agent "Park" as park 37 38agent "Callout pkt4_send" as pkt4_send 39 40agent "Send response" as send 41 42agent "Pack response" as pack 43 44agent "Callout buffer4_send" as buffer4_send 45 46agent "Send response" as send 47note left : output 48 49agent "Drop packet" as drop 50note left : error 51 52receivePacket --> isServiceEnabled 53isServiceEnabled --> buffer4_receive : service is enabled 54isServiceEnabled ----> drop : service is disabled 55buffer4_receive --> unpack : CONTINUE 56buffer4_receive --> classify : SKIP 57buffer4_receive ----> drop : DROP 58unpack --> classify 59unpack ---> drop : on error 60classify --> pkt4_receive 61pkt4_receive --> drop_class : CONTINUE 62pkt4_receive ---> drop : DROP 63drop_class --> same_client 64drop_class ---> drop : query in DROP class 65same_client ---> process 66same_client ---> drop : queries from the same client possible race 67process ---> drop : unknown message type 68processDiscover --> leases4_committed 69processDiscover ---> drop : on error 70processRequest --> leases4_committed 71processRequest ---> drop : on error 72processRelease --> leases4_committed 73processRelease ---> drop : on error 74processDecline --> leases4_committed 75processDecline ---> drop : on error 76processInform --> leases4_committed 77processInform ---> drop : on error 78leases4_committed --> pkt4_send : CONTINUE 79leases4_committed ---> drop : DROP 80leases4_committed --> park : PARK 81park -[dashed]-> pkt4_send : unpark 82pkt4_send --> pack : CONTINUE 83pkt4_send --> buffer4_send : SKIP 84pkt4_send ---> drop : DROP 85pack --> buffer4_send 86buffer4_send --> send : CONTINUE 87buffer4_send ---> drop : DROP 88send -[hidden]-> drop 89 90footer dashed arrow means asynchronous processing 91 92@enduml 93