Kea 2.7.4
|
A DHCPv6 packet handling class using datagram sockets. More...
#include <pkt_filter_inet6.h>
Public Member Functions | |
virtual bool | isSocketReceivedTimeSupported () const |
Check if the socket received time is supported. | |
virtual SocketInfo | openSocket (const Iface &iface, const isc::asiolink::IOAddress &addr, const uint16_t port, const bool join_multicast) |
Opens a socket. | |
virtual Pkt6Ptr | receive (const SocketInfo &socket_info) |
Receives DHCPv6 message on the interface. | |
virtual int | send (const Iface &iface, uint16_t sockfd, const Pkt6Ptr &pkt) |
Sends DHCPv6 message through a specified interface and socket. | |
Public Member Functions inherited from isc::dhcp::PktFilter6 | |
virtual | ~PktFilter6 () |
Virtual Destructor. | |
Additional Inherited Members | |
Static Public Member Functions inherited from isc::dhcp::PktFilter6 | |
static bool | joinMulticast (int sock, const std::string &ifname, const std::string &mcast) |
Joins IPv6 multicast group on a socket. | |
A DHCPv6 packet handling class using datagram sockets.
This class opens a datagram IPv6/UDPv6 socket. It also implements functions to send and receive DHCPv6 messages through this socket. It is a default class to be used by IfaceMgr
to access IPv6 sockets.
Definition at line 21 of file pkt_filter_inet6.h.
|
virtual |
Check if the socket received time is supported.
If true, then packets received through this filter will include a SOCKET_RECEIVED event in its event stack.
Definition at line 26 of file pkt_filter_inet6.cc.
|
virtual |
Opens a socket.
This function opens an IPv6 socket on an interface and binds it to a specified UDP port and IP address. The addr
value may be set to "::" in which case the address is unspecified and the socket is bound to in6addr_any.
iface | Interface descriptor. |
addr | Address on the interface to be used to send packets. |
port | Port number. |
join_multicast | A boolean parameter which indicates whether socket should join All_DHCP_Relay_Agents_and_servers multicast group. |
isc::dhcp::SocketConfigError | if error occurred when opening or configuring a socket. |
Implements isc::dhcp::PktFilter6.
Definition at line 35 of file pkt_filter_inet6.cc.
References ALL_DHCP_RELAY_AGENTS_AND_SERVERS, isc_throw, isc::asiolink::IOAddress::isV6LinkLocal(), isc::asiolink::IOAddress::isV6Multicast(), isc::dhcp::PktFilter6::joinMulticast(), isc::asiolink::IOAddress::toBytes(), and isc::asiolink::IOAddress::toText().
|
virtual |
Receives DHCPv6 message on the interface.
This function receives a single DHCPv6 message through a socket open on a specified interface. This function will block if there is no message waiting on the specified socket. Therefore the IfaceMgr
must first check that there is any message on the socket (using select function) prior to calling this function.
If the message is received through the socket bound to "any" (in6addr_any) address this function will drop this message if it has been sent to an address other than multicast or link-local.
socket_info | A structure holding socket information. |
isc::dhcp::SocketReadError | if error occurred during packet reception. |
Implements isc::dhcp::PktFilter6.
Definition at line 162 of file pkt_filter_inet6.cc.
References isc::util::io::internal::convertPktInfo6(), isc_throw, isc::dhcp::IfaceMgr::RCVBUFSIZE, and isc::dhcp::UNSET_IFINDEX.
|
virtual |
Sends DHCPv6 message through a specified interface and socket.
The function sends a DHCPv6 message through a specified interface and socket. In general, there may be multiple sockets open on a single interface as a single interface may have multiple IPv6 addresses.
iface | Interface to be used to send packet. |
sockfd | A socket descriptor |
pkt | A packet to be sent. |
isc::dhcp::SocketWriteError | if error occurred when sending a packet. |
Implements isc::dhcp::PktFilter6.
Definition at line 292 of file pkt_filter_inet6.cc.
References isc::util::io::internal::convertPktInfo6(), isc_throw, and isc_throw_assert.