dhcp4o6.dox 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this
  5. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  6. /**
  7. @page dhcpv4o6Dhcp4 DHCPv4-over-DHCPv6 DHCPv4 Server Side
  8. Kea supports DHCPv4-over-DHCPv6 using cooperating DHCPv6 and DHCPv4
  9. servers. This section describes the DHCPv4 server side. For its
  10. DHCPv6 counter-part, see @ref dhcpv4o6Dhcp6.
  11. @section Dhcp4to6Ipc DHCPv6-to-DHCPv4 Inter Process Communication
  12. The @c Dhcp4to6Ipc class is derived from the base @c Dhcp4o6IpcBase as
  13. a singleton class (by the static @ref isc::dhcp::Dhcp4to6Ipc::instance
  14. function). @ref isc::dhcp::Dhcp4to6Ipc::open is called to open IPC
  15. UDP sockets and to register @ref isc::dhcp::Dhcp4to6Ipc::handler on
  16. external sockets on the @c IfaceMgr.
  17. @section dhcp4to6Receive DHCPv4-over-DHCPv6 Packet Processing
  18. DHCPv6 DHCPv4-QUERY messages are forwarded by the DHCPv6 server on the IPC.
  19. The interface manager (@c IfaceMgr) using the external socket mechanism
  20. invokes @ref isc::dhcp::Dhcp4to6Ipc::handler, the packet is received using
  21. (inherited) @ref isc::dhcp::Dhcp4o6IpcBase::receive which decodes and strips
  22. the ISC Vendor option.
  23. The handler verifies there is one and only one DHCPv4-Message option
  24. and extracts it. @ref isc::dhcp::Dhcpv4Srv::processPacket processes
  25. the DHCPv4 query as a @c Pkt4o6 instance and builds the
  26. DHCPv4-over-DHCPv6 response.
  27. Registered callouts for "buffer4_send" are called (@ref
  28. dhcpv4HooksBuffer4Send, note all the other DHCPv4 hook points are
  29. served during the standard processing). The response is sent back
  30. to the DHCPv6 server on the IPC.
  31. @section dhcp4to6Specific Modified DHCPv4 Routines
  32. For a @c Pkt4o6 query the @ref isc::dhcp::Dhcpv4Exchange::initResponse
  33. performs some extra steps (@ref isc::dhcp::Dhcpv4Exchange::initResponse4o6):
  34. the DHCPv6 response is built and the response member is reset to
  35. a @c Pkt4o6 instance with DHCPv4 and DHCPv6 parts.
  36. The subnet selection (@ref isc::dhcp::Dhcpv4Srv::selectSubnet) is specialized
  37. for @c Pkt4o6 queries (@ref isc::dhcp::Dhcpv4Srv::selectSubnet4o6):
  38. the subnet selector class (@c SubnetSelector) is filled using DHCPv4 and
  39. DHCPv6 information and the @ref isc::dhcp::CfgSubnets4::selectSubnet4o6
  40. function is called (instead of @ref isc::dhcp::CfgSubnets4::selectSubnet).
  41. In @ref isc::dhcp::Dhcpv4Srv::adjustIfaceData for @c Pkt4o6 queries
  42. the local address is set to the incoming interface assigned address
  43. (same case than for a broadcast local address).
  44. In @ref isc::dhcp::Dhcpv4Srv::adjustRemoteAddr for @c Pkt4o6 queries the
  45. remote address is set to the query one (which is in fact an IPv6 address).
  46. In @ref isc::dhcp::Dhcpv4Srv::acceptDirectRequest @c Pkt4o6 queries are
  47. accepted (they are considered as being relayed).
  48. */