Kea 2.5.8
bootp_callouts.cc File Reference
#include <config.h>
#include <bootp_log.h>
#include <hooks/hooks.h>
#include <dhcp/pkt4.h>
#include <process/daemon.h>
#include <stats/stats_mgr.h>
#include <vector>
+ Include dependency graph for bootp_callouts.cc:

Go to the source code of this file.

Functions

int buffer4_receive (CalloutHandle &handle)
 This callout is called at the "buffer4_receive" hook.
 
int load (LibraryHandle &)
 This function is called when the library is loaded.
 
int multi_threading_compatible ()
 This function is called to retrieve the multi-threading compatibility.
 
int pkt4_send (CalloutHandle &handle)
 This callout is called at the "pkt4_send" hook.
 
int unload ()
 This function is called when the library is unloaded.
 

Function Documentation

◆ buffer4_receive()

int buffer4_receive ( CalloutHandle handle)

This callout is called at the "buffer4_receive" hook.

Ignore DHCP and BOOTREPLY messages. Remaining packets should be BOOTP requests so add the BOOTP client class and set the message type to DHCPREQUEST.

Parameters
handleCalloutHandle.
Returns
0 upon success, non-zero otherwise.

Definition at line 68 of file bootp_callouts.cc.

References isc::stats::StatsMgr::addValue(), BOOTP_BOOTP_QUERY, isc::bootp::bootp_logger, BOOTP_PACKET_OPTIONS_SKIPPED, BOOTP_PACKET_UNPACK_FAILED, isc::dhcp::BOOTREQUEST, isc::log::DBGLVL_TRACE_BASIC, isc::dhcp::DHCP_NOTYPE, isc::dhcp::DHCPREQUEST, isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::stats::StatsMgr::instance(), LOG_DEBUG, isc::hooks::CalloutHandle::NEXT_STEP_DROP, isc::hooks::CalloutHandle::NEXT_STEP_SKIP, isc::hooks::CalloutHandle::setStatus(), and isc::Exception::what().

+ Here is the call graph for this function:

◆ load()

int load ( LibraryHandle )

This function is called when the library is loaded.

Returns
always 0.

Definition at line 189 of file bootp_callouts.cc.

References BOOTP_LOAD, isc::bootp::bootp_logger, isc::process::Daemon::getProcName(), isc_throw, and LOG_INFO.

+ Here is the call graph for this function:

◆ multi_threading_compatible()

int multi_threading_compatible ( )

This function is called to retrieve the multi-threading compatibility.

Returns
1 which means compatible with multi-threading.

Definition at line 210 of file bootp_callouts.cc.

◆ pkt4_send()

int pkt4_send ( CalloutHandle handle)

This callout is called at the "pkt4_send" hook.

Remove DHCP specific options and pad the buffer to 300 octets.

Parameters
handleCalloutHandle.
Returns
0 upon success, non-zero otherwise.

Definition at line 132 of file bootp_callouts.cc.

References isc::bootp::bootp_logger, BOOTP_PACKET_PACK, BOOTP_PACKET_PACK_FAIL, isc::log::DBGLVL_TRACE_BASIC, isc::hooks::CalloutHandle::getArgument(), isc::util::OutputBuffer::getLength(), isc::hooks::CalloutHandle::getStatus(), isc_throw, LOG_DEBUG, LOG_ERROR, isc::hooks::CalloutHandle::NEXT_STEP_DROP, isc::hooks::CalloutHandle::NEXT_STEP_SKIP, isc::hooks::CalloutHandle::setStatus(), and isc::util::OutputBuffer::writeData().

+ Here is the call graph for this function:

◆ unload()

int unload ( )

This function is called when the library is unloaded.

Returns
always 0.

Definition at line 202 of file bootp_callouts.cc.

References isc::bootp::bootp_logger, BOOTP_UNLOAD, and LOG_INFO.