From: Tomek Mrugalski Date: Fri, 5 Jul 2013 12:23:17 +0000 (+0200) Subject: [2995] First set of changes after review. X-Git-Tag: bind10-1.2.0beta1-release~340^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bdeeb21d2f97586d4bf754b4a1156412810ef441;p=thirdparty%2Fkea.git [2995] First set of changes after review. --- diff --git a/src/bin/dhcp6/dhcp6_hooks.dox b/src/bin/dhcp6/dhcp6_hooks.dox index b58330b45a..1b8d16f5e2 100644 --- a/src/bin/dhcp6/dhcp6_hooks.dox +++ b/src/bin/dhcp6/dhcp6_hooks.dox @@ -44,6 +44,49 @@ @section dhcpv6HooksHookPoints Hooks in the DHCPv6 Server +The following list is ordered by appearance of specific hook points during +packet processing. Hook points that are not specific to packet processing +(e.g. lease expiration) will be added to the end of this list. + + @subsection dhcpv6HooksPkt6Receive pkt6_receive + + - @b Arguments: + - name: @b pkt6, type: isc::dhcp::Pkt6Ptr, direction: in/out + + - @b Description: this callout is executed when an incoming DHCPv6 + packet is received and its content is parsed. The sole argument - + pkt6 - contains a pointer to an isc::dhcp::Pkt6 object that contains all + information regarding incoming packet, including its source and + destination addresses, interface over which it was received, a list + of all options present within and relay information. See Pkt6 class + definition for details. All fields of the Pkt6 class can be + modified at this time, except data_ (which contains incoming packet + as raw buffer, but that information was already parsed, so it + doesn't make sense to modify it at this time). + + - Skip flag action: If any callout sets the skip flag, the server will + drop the packet and will not do anything with it except logging a drop + reason if debugging is enabled. + +@subsection dhcpv6HooksSubnet6Select subnet6_select + + - @b Arguments: + - name: @b pkt6, type: isc::dhcp::Pkt6Ptr, direction: in/out + - name: @b subnet6, type: isc::dhcp::Subnet6Ptr, direction: in/out + - name: @b subnet6collection, type: const isc::dhcp::Subnet6Collection&, direction: in + + - @b Description: this callout is executed when a subnet is being + selected for incoming packet. All parameters, addresses and + prefixes will be assigned from that subnet. Callout can select a + different subnet if it wishes so. The list of all subnets currently + configured is provided as 'subnet6collection'. The list itself must + not be modified. + + - Skip flag action: If any callout installed on 'subnet6_select' + sets the skip flag, the server will not select any subnet. Packet processing + will continue, but will be severely limited (i.e. only global options + will be assigned). + @subsection dhcpv6HooksLeaseSelect lease6_select - @b Arguments: @@ -67,26 +110,6 @@ - Skip flag action: the "skip" flag is ignored by the server on this hook. - @subsection dhcpv6HooksPkt6Receive pkt6_receive - - - @b Arguments: - - name: @b pkt6, type: isc::dhcp::Pkt6Ptr, direction: in/out - - - @b Description: this callout is executed when an incoming DHCPv6 - packet is received and its content is parsed. The sole argument - - pkt6 - contains a pointer to an isc::dhcp::Pkt6 object that contains all - information regarding incoming packet, including its source and - destination addresses, interface over which it was received, a list - of all options present within and relay information. See Pkt6 class - definition for details. All fields of the Pkt6 class can be - modified at this time, except data_ (which contains incoming packet - as raw buffer, but that information was already parsed, so it - doesn't make sense to modify it at this time). - - - Skip flag action: If any callout sets the skip flag, the server will - drop the packet and will not do anything with it except logging a drop - reason if debugging is enabled. - @subsection dhcpv6HooksPkt6Send pkt6_send - @b Arguments: @@ -101,28 +124,11 @@ modified at this time, except bufferOut_. (This is scratch space used for constructing the packet after all pkt6_send callouts are complete, so any changes to that field will be overwritten.) - - - Skip flag action: if any callout sets the skip - flag, the server will drop the packet and will not do anything with - it, except logging a drop reason if debugging is enabled. - -@subsection dhcpv6HooksSubnet6Select subnet6_select - - - @b Arguments: - - name: @b pkt6, type: isc::dhcp::Pkt6Ptr, direction: in/out - - name: @b subnet6, type: isc::dhcp::Subnet6Ptr, direction: in/out - - name: @b subnet6collection, type: const isc::dhcp::Subnet6Collection&, direction: in - - @b Description: this callout is executed when a subnet is being - selected for incoming packet. All parameters, addresses and - prefixes will be assigned from that subnet. Callout can select a - different subnet if it wishes so. The list of all subnets currently - configured is provided as 'subnet6collection'. The list itself must - not be modified. - - - Skip flag action: If any callout installed on 'subnet6_select' - sets the skip flag, the server will not select any subnet. Packet processing - will continue, but will be severely limited (i.e. only global options - will be assigned). + - Skip flag action: if any callout sets the skip + flag, the server will drop this response packet. However, the original + request packet from a client was processed, so server's state was likely + changed (e.g. lease was allocated). This flag will merely stop the + change to be communicated to the client. */ diff --git a/src/bin/dhcp6/dhcp6_messages.mes b/src/bin/dhcp6/dhcp6_messages.mes index c0caf147e6..95fb3864ab 100644 --- a/src/bin/dhcp6/dhcp6_messages.mes +++ b/src/bin/dhcp6/dhcp6_messages.mes @@ -67,15 +67,16 @@ lease and other information. % DHCP6_HOOK_PACKET_RCVD_SKIP received DHCPv6 packet was dropped, because a callout set skip flag. This debug message is printed when a callout installed on pkt6_received -hook point sets skip flag. This flag instructs the server to skip the next processing -stage, which would be to handle the packet. This effectively means drop the packet. +hook point sets skip flag. For this particular hook point, the setting +of the flag by a callout instructs the server to drop the packet. % DHCP6_HOOK_PACKET_SEND_SKIP Prepared DHCPv6 response was not sent, because a callout set skip flag. This debug message is printed when a callout installed on pkt6_send -hook point sets skip flag. This flag instructs the server to skip the next processing -stage, which would be to send a response. This effectively means that the client will -not get any response, even though the server processed client's request and acted on -it (e.g. could possible allocate a lease). +hook point sets skip flag. For this particular hook point, the setting +of the flag by a callout instructs the server to drop the packet. This +effectively means that the client will not get any response, even though +the server processed client's request and acted on it (e.g. possibly +allocated a lease). % DHCP6_HOOK_SUBNET6_SELECT_SKIP No subnet was selected, because a callout set skip flag. This debug message is printed when a callout installed on subnet6_select diff --git a/src/bin/dhcp6/dhcp6_srv.h b/src/bin/dhcp6/dhcp6_srv.h index d57f895a33..d1c7bb6bf6 100644 --- a/src/bin/dhcp6/dhcp6_srv.h +++ b/src/bin/dhcp6/dhcp6_srv.h @@ -366,10 +366,6 @@ private: isc::hooks::CalloutHandlePtr getCalloutHandle(const Pkt6Ptr& pkt); - void packetProcessStart(const Pkt6Ptr& pkt); - - void packetProcessEnd(const Pkt6Ptr& pkt); - /// Indexes for registered hook points int hook_index_pkt6_receive_; int hook_index_subnet6_select_;