From: Francis Dupont Date: Sat, 1 Aug 2020 09:38:41 +0000 (+0200) Subject: [#1329] Added versions and current host X-Git-Tag: Kea-1.8.0~132 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2090d0613a67d20358e17df660002b7977525b6f;p=thirdparty%2Fkea.git [#1329] Added versions and current host --- diff --git a/doc/devel/Makefile.am b/doc/devel/Makefile.am index d34221ded6..6562151616 100644 --- a/doc/devel/Makefile.am +++ b/doc/devel/Makefile.am @@ -23,6 +23,9 @@ EXTRA_DIST += images/assign-lease4.uml EXTRA_DIST += images/buildCfgOptionList.png EXTRA_DIST += images/buildCfgOptionList.svg EXTRA_DIST += images/buildCfgOptionList.uml +EXTRA_DIST += images/currentHost4.png +EXTRA_DIST += images/currentHost4.svg +EXTRA_DIST += images/currentHost4.uml EXTRA_DIST += images/lease-states.png EXTRA_DIST += images/lease-states.svg EXTRA_DIST += images/lease-states.uml diff --git a/doc/devel/images/appendRequestedOptions.png b/doc/devel/images/appendRequestedOptions.png index 40ae1ffcee..943dc6f9bc 100644 Binary files a/doc/devel/images/appendRequestedOptions.png and b/doc/devel/images/appendRequestedOptions.png differ diff --git a/doc/devel/images/appendRequestedOptions.svg b/doc/devel/images/appendRequestedOptions.svg index 9496aac83b..5b3079e3ee 100644 --- a/doc/devel/images/appendRequestedOptions.svg +++ b/doc/devel/images/appendRequestedOptions.svg @@ -1,7 +1,7 @@ -Append requested optionsget configured option listget parameter request list (PRL) from queryget configured options in dhcp4 spacepush back option code to PRLfor each persistent optionfor each item from configured option listget configured options in dhcp4 spaceadd option to responsefirstfoundnot found or already foundfor each item from configured option listyesoption is not set in responsenofor each code in PRLINIT-REBOOT stateLease allocatedGet existing lease by client idGet existing lease by hardware addressGet authoritativeupdate DDNSSend ACKCheck Subnetentry pointGet server idGet hintGet hardware address and client idProcess hostnameRequest leaseNo lease allocatedexit pointSend NAKexit pointNo responseexit pointINIT-REBOOT stateLease allocatedGet existing lease by client idGet existing lease by hardware addressGet authoritativeupdate DDNSSend ACKCheck Subnetentry pointGet server idGet hintGet hardware address and client idProcess hostnameRequest leaseNo lease allocatedexit pointSend NAKexit pointNo responseexit pointno subnetno lease allocatedSubnet SelectionSet subnet to the selected subnetHas client a lease for its client id?Iterate on allowed subnets for client idSet subnet to the by client id leaseHas client a matching lease?Iterate on allowed subnets for hardware addressSet subnet to the matching leaseHas an address reservation?Set subnet to address reservation subnetGet subnet host reservation modeIs subnet host reservation mode global?Get global host reservationGet subnet host reservationReturn current host reservationno client id optionmatch-client-id is false or no leasefound a leasenot found by client id, try by hardware addressno hardware addressno lease or client id mismatchfound a leasenot foundyesnoyesnoreturn global host reservationreturn subnet host reservation \ No newline at end of file diff --git a/doc/devel/images/currentHost4.uml b/doc/devel/images/currentHost4.uml new file mode 100644 index 0000000000..688c5b96b6 --- /dev/null +++ b/doc/devel/images/currentHost4.uml @@ -0,0 +1,58 @@ +@startuml + +title currentHost DHCPv4 (Kea 1.7.11) + +agent "Subnet Selection" as entry + +agent "Set subnet to the selected subnet" as setSelected + +agent "Has client a lease for its client id?" as clientid_lookup + +agent "Iterate on allowed subnets for client id" as clientid_iterate + +agent "Set subnet to the by client id lease" as found_clientid + +agent "Has client a matching lease?" as hwaddr_lookup + +agent "Iterate on allowed subnets for hardware address" as hwaddr_iterate + +agent "Set subnet to the matching lease" as found_hwaddr + +agent "Has an address reservation?" as hasAddressReservation + +agent "Set subnet to address reservation subnet" as setAddressReservation + +agent "Get subnet host reservation mode" as getHRmode + +agent "Is subnet host reservation mode global?" as checkHRmode + +agent "Get global host reservation" as global + +agent "Get subnet host reservation" as bySubnet + +agent "Return current host reservation" as return + +entry --> setSelected +setSelected --> clientid_lookup +clientid_lookup ---> hwaddr_lookup : no client id option +clientid_lookup --> clientid_iterate +clientid_iterate -> clientid_iterate : match-client-id is false or no lease +clientid_iterate --> found_clientid : found a lease +found_clientid ----> hasAddressReservation +clientid_iterate --> hwaddr_lookup : not found by client id, try by hardware address +hwaddr_lookup ---> hasAddressReservation : no hardware address +hwaddr_lookup --> hwaddr_iterate +hwaddr_iterate -> hwaddr_iterate : no lease or client id mismatch +hwaddr_iterate --> found_hwaddr : found a lease +found_hwaddr ----> hasAddressReservation +hwaddr_iterate --> hasAddressReservation : not found +hasAddressReservation --> setAddressReservation : yes +hasAddressReservation --> getHRmode : no +setAddressReservation --> getHRmode +getHRmode --> checkHRmode +checkHRmode --> global : yes +checkHRmode --> bySubnet : no +global --> return : return global host reservation +bySubnet --> return : return subnet host reservation + +@enduml \ No newline at end of file diff --git a/doc/devel/images/lease-states.png b/doc/devel/images/lease-states.png index 5277b937d9..192d93600a 100644 Binary files a/doc/devel/images/lease-states.png and b/doc/devel/images/lease-states.png differ diff --git a/doc/devel/images/lease-states.svg b/doc/devel/images/lease-states.svg index ff42ec4926..3956f34106 100644 --- a/doc/devel/images/lease-states.svg +++ b/doc/devel/images/lease-states.svg @@ -1,10 +1,10 @@ -lease statesFreenot in the lease databaseAssignedAssigned expiredDeclinedDeclined expiredExpired-ReclaimedFreenot in the lease databaseAssignedAssigned expiredDeclinedDeclined expiredExpired-Reclaimedassignmentrelease queryafter valid lifetimeremovereuseremoveMain LoopEvent LoopWait for next eventCheck ShutdownTimeoutSignalHandle SignalExternal SocketHandle External SocketDHCP QueryProcess QueryI/O ServiceExecute ready handlerMain LoopEvent LoopWait for next eventCheck ShutdownTimeoutSignalHandle SignalExternal SocketHandle External SocketDHCP QueryProcess QueryI/O ServiceExecute ready handlerget next eventno ready handlerdashed arrow means prioritydashed arrow means priorityProcess Query on its Message TypeProcess DiscoverProcess RequestProcess ReleaseProcess DeclineProcess InformReceive queryinputService EnabledCallout buffer4_receivehookUnpack queryClassify queryCallout pkt4_receivehookCheck DROP classAvoid same client race in multi-threade modepostpone processing or dropCallout lease4_committedhookParkCallout pkt4_sendSend responsePack responseCallout buffer4_sendoutputDrop packeterrorProcess Query on its Message TypeProcess DiscoverProcess RequestProcess ReleaseProcess DeclineProcess InformReceive queryinputService EnabledCallout buffer4_receivehookUnpack queryClassify queryCallout pkt4_receivehookCheck DROP classAvoid same client race in multi-threade modepostpone processing or dropCallout lease4_committedhookParkCallout pkt4_sendSend responsePack responseCallout buffer4_sendoutputDrop packeterrorservice is enabledservice is disabledCONTINUEDROPdashed arrow means asynchronous processingdashed arrow means asynchronous processingCheck requested addressGet lease for requested addressCheck client leaseAllocate a new leaseAllocate or reuse leaseAllocate unreserved leaseCheck lease for reserved addressCheck out-of-pool addressCheck requested leaseCheck renewCreate a new leaseDelete old leaseGet candidate leaseReuse expired leaseReclaim expired leaseupdate lease informationCallout lease4_selecthookUpdate leaseIterate pools and subnetsPick addressCheck reserved addressedCheck already in use by another threadCheck leaseFind client leaseentry pointCheck requested reservationGet reservationUpdate requested addressReturn no leaseexit pointReturn renewed leaseexit pointReturn leaseexit pointCheck requested addressGet lease for requested addressCheck client leaseAllocate a new leaseAllocate or reuse leaseAllocate unreserved leaseCheck lease for reserved addressCheck out-of-pool addressCheck requested leaseCheck renewCreate a new leaseDelete old leaseGet candidate leaseReuse expired leaseReclaim expired leaseupdate lease informationCallout lease4_selecthookUpdate leaseIterate pools and subnetsPick addressCheck reserved addressedCheck already in use by another threadCheck leaseFind client leaseentry pointCheck requested reservationGet reservationUpdate requested addressReturn no leaseexit pointReturn renewed leaseexit pointReturn leaseexit pointhas requested address (hint)no requested address (hint)no conflicting reservationexpired leaseno leaseA lease was assignedAdd reserved classesClassify required classesBuild configured option listAppend requested optionsAppend requested vendor optionsAppend basic optionsSet fixed fieldsEntry pointSelect subnethook pointFind host reservationAdd either KNOWN or UNKNOWN classClassify (2nd pass)Process client nameAssign a leaseAdjust interface dataAppend server IDon success exit pointReturn no responseon error exit pointA lease was assignedAdd reserved classesClassify required classesBuild configured option listAppend requested optionsAppend requested vendor optionsAppend basic optionsSet fixed fieldsEntry pointSelect subnethook pointFind host reservationAdd either KNOWN or UNKNOWN classClassify (2nd pass)Process client nameAssign a leaseAdjust interface dataAppend server IDon success exit pointReturn no responseon error exit pointhook set DROPRelayedSet address for lookupTry incoming interfaceTry addressRelay address matches subnetRelay address matches shared networkCheck client classSet relay addressSet client addressSet source addressInterface matches subnetInterface matches shared networkCheck client classSet interface addressCheck subnet prefixCheck client classEntry pointTry RAI link selectTry subnet selection optionFound a subnetFound no subnetCallout subnet4_selectReturn a subnetReturn no subnetDrop queryRelayedSet address for lookupTry incoming interfaceTry addressRelay address matches subnetRelay address matches shared networkCheck client classSet relay addressSet client addressSet source addressInterface matches subnetInterface matches shared networkCheck client classSet interface addressCheck subnet prefixCheck client classEntry pointTry RAI link selectTry subnet selection optionFound a subnetFound no subnetCallout subnet4_selectReturn a subnetReturn no subnetDrop queryrelayedCONTINUE and subnet setSKIP or subnet not setDROPDROP