29const std::vector<uint16_t> DHCP_SPECIFIC_OPTIONS = {
40 DHO_DHCP_CLIENT_IDENTIFIER
44const size_t BOOT_VENDOR_SPACE_SIZE = 64;
50static_assert(BOOT_MIN_SIZE == 300,
"BOOT_MIN_SIZE is not 300");
87 query->addClass(
"BOOTP");
91 .arg(query->getLabel());
99 }
catch (
const std::exception& ex) {
103 .arg(query->getRemoteAddr().toText())
104 .arg(query->getLocalAddr().toText())
105 .arg(query->getIface())
110 static_cast<int64_t
>(1));
112 static_cast<int64_t
>(1));
143 if (!query->inClass(
"BOOTP")) {
155 for (uint16_t code : DHCP_SPECIFIC_OPTIONS) {
156 while (response->delOption(code))
163 .arg(response->getLabel());
169 if (size < BOOT_MIN_SIZE) {
170 size_t delta = BOOT_MIN_SIZE - size;
171 std::vector<uint8_t> zeros(delta, 0);
174 }
catch (
const std::exception& ex) {
176 .arg(response->getLabel())
191 if (proc_name !=
"kea-dhcp4") {
193 <<
", expected kea-dhcp4");
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.
int buffer4_receive(CalloutHandle &handle)
This callout is called at the "buffer4_receive" hook.
const isc::log::MessageID BOOTP_LOAD
const isc::log::MessageID BOOTP_PACKET_UNPACK_FAILED
const isc::log::MessageID BOOTP_PACKET_PACK
const isc::log::MessageID BOOTP_UNLOAD
const isc::log::MessageID BOOTP_PACKET_OPTIONS_SKIPPED
const isc::log::MessageID BOOTP_BOOTP_QUERY
const isc::log::MessageID BOOTP_PACKET_PACK_FAIL
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
A generic exception that is thrown if a function is called in a prohibited way.
A generic exception that is thrown when an unexpected error condition occurs.
static const size_t DHCPV4_PKT_HDR_LEN
specifies DHCPv4 packet header length (fixed part)
Exception thrown during option unpacking This exception is thrown when an error has occurred,...
Per-packet callout handle.
CalloutNextStep
Specifies allowed next steps.
@ NEXT_STEP_DROP
drop the packet
@ NEXT_STEP_SKIP
skip the next processing step
CalloutNextStep getStatus() const
Returns the next processing step.
void setStatus(const CalloutNextStep next)
Sets the next processing step.
void getArgument(const std::string &name, T &value) const
Get argument.
static std::string getProcName()
returns the process name This value is used as when forming the default PID file name
static StatsMgr & instance()
Statistics Manager accessor method.
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
void writeData(const void *data, size_t len)
Copy an arbitrary length of data into the buffer.
size_t getLength() const
Return the length of data written in the buffer.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
void addValue(const std::string &name, const int64_t value)
Records incremental integer observation.
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
#define LOG_DEBUG(LOGGER, LEVEL, MESSAGE)
Macro to conveniently test debug output and log it.
isc::log::Logger bootp_logger("bootp-hooks")
@ DHO_DHCP_MAX_MESSAGE_SIZE
@ DHO_DHCP_REBINDING_TIME
@ DHO_DHCP_SERVER_IDENTIFIER
@ DHO_DHCP_REQUESTED_ADDRESS
@ DHO_DHCP_OPTION_OVERLOAD
@ DHO_DHCP_PARAMETER_REQUEST_LIST
boost::shared_ptr< Pkt4 > Pkt4Ptr
A pointer to Pkt4 object.
@ DHCP_NOTYPE
Message Type option missing.
const int DBGLVL_TRACE_BASIC
Trace basic operations.
Defines the logger used by the top-level component of kea-lfc.