Kea
1.9.9-git
|
Packet handling class using Linux Packet Filtering. More...
#include <pkt_filter_lpf.h>
Public Member Functions | |
virtual bool | isDirectResponseSupported () const |
Check if packet can be sent to the host without address directly. More... | |
virtual SocketInfo | openSocket (Iface &iface, const isc::asiolink::IOAddress &addr, const uint16_t port, const bool receive_bcast, const bool send_bcast) |
Open primary and fallback socket. More... | |
virtual Pkt4Ptr | receive (Iface &iface, const SocketInfo &socket_info) |
Receive packet over specified socket. More... | |
virtual int | send (const Iface &iface, uint16_t sockfd, const Pkt4Ptr &pkt) |
Send packet over specified socket. More... | |
Public Member Functions inherited from isc::dhcp::PktFilter | |
virtual | ~PktFilter () |
Virtual Destructor. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from isc::dhcp::PktFilter | |
virtual int | openFallbackSocket (const isc::asiolink::IOAddress &addr, const uint16_t port) |
Default implementation to open a fallback socket. More... | |
Packet handling class using Linux Packet Filtering.
This class provides methods to send and receive DHCPv4 messages using raw sockets and Linux Packet Filtering. It is used by isc::dhcp::IfaceMgr
to send DHCPv4 messages to the hosts which don't have an IPv4 address assigned yet.
Definition at line 23 of file pkt_filter_lpf.h.
|
inlinevirtual |
Check if packet can be sent to the host without address directly.
This class supports direct responses to the host without address.
Implements isc::dhcp::PktFilter.
Definition at line 31 of file pkt_filter_lpf.h.
|
virtual |
Open primary and fallback socket.
iface | Interface descriptor. |
addr | Address on the interface to be used to send packets. |
port | Port number. |
receive_bcast | Configure socket to receive broadcast messages |
send_bcast | Configure socket to send broadcast messages. |
Implements isc::dhcp::PktFilter.
Definition at line 132 of file pkt_filter_lpf.cc.
References isc::dhcp::Iface::getIndex(), isc::dhcp::Iface::getName(), isc_throw, and isc::asiolink::IOAddress::toUint32().
|
virtual |
Receive packet over specified socket.
iface | interface |
socket_info | structure holding socket information |
isc::NotImplemented | always |
Implements isc::dhcp::PktFilter.
Definition at line 217 of file pkt_filter_lpf.cc.
References isc::dhcp::decodeEthernetHeader(), isc::dhcp::decodeIpUdpHeader(), isc::dhcp::DHCPDISCOVER, isc::dhcp::SocketInfo::fallbackfd_, isc::dhcp::Iface::getIndex(), isc::util::InputBuffer::getLength(), isc::dhcp::Iface::getName(), isc::util::InputBuffer::getPosition(), isc::util::InputBuffer::readVector(), and isc::dhcp::SocketInfo::sockfd_.
|
virtual |
Send packet over specified socket.
iface | interface to be used to send packet |
sockfd | socket descriptor |
pkt | packet to be sent |
isc::NotImplemented | always |
Implements isc::dhcp::PktFilter.
Definition at line 292 of file pkt_filter_lpf.cc.
References isc::util::OutputBuffer::getData(), isc::dhcp::Iface::getHWType(), isc::dhcp::Iface::getIndex(), isc::util::OutputBuffer::getLength(), isc::dhcp::Iface::getMac(), isc::dhcp::Iface::getMacLen(), isc_throw, isc::util::OutputBuffer::writeData(), isc::dhcp::writeEthernetHeader(), and isc::dhcp::writeIpUdpHeader().