34 return (dhcp4to6_ipc);
49 if ((old_fd == -1) && (
socket_fd_ != old_fd)) {
67 .arg(
static_cast<int>(pkt->getType()))
68 .arg(pkt->getRemoteAddr().toText())
69 .arg(pkt->getRemotePort())
70 .arg(pkt->getIface());
72 }
catch (
const std::exception& e) {
86 .arg(
"DHCPv4 message option not present");
88 }
else if (msgs.size() > 1) {
91 .arg(
"more than one DHCPv4 message option");
100 .arg(
"null DHCPv4 message option");
125 callout_handle->deleteAllArguments();
134 ScopedEnableOptionsCopy<Pkt4> response4_options_copy(rsp);
137 callout_handle->setArgument(
"response4", rsp);
150 .arg(rsp->getLabel());
154 callout_handle->getArgument(
"response4", rsp);
157 Pkt4o6Ptr rsp6 = boost::dynamic_pointer_cast<Pkt4o6>(rsp);
164 .arg(rsp6->getLabel())
165 .arg(rsp6->getName())
166 .arg(
static_cast<int>(rsp6->getType()))
167 .arg(rsp6->getRemoteAddr())
168 .arg(rsp6->getRemotePort())
169 .arg(rsp6->getIface())
170 .arg(rsp->getLabel())
172 .arg(
static_cast<int>(rsp->getType()));
176 .arg(rsp6->getLabel())
177 .arg(rsp6->getName())
178 .arg(
static_cast<int>(rsp6->getType()))
179 .arg(rsp6->toText());
181 ipc.send(rsp6->getPkt6());
186 }
catch (
const std::exception& e) {
188 .arg(rsp->getLabel())
A generic exception that is thrown if a parameter given to a method would refer to or modify out-of-r...
A generic exception that is thrown when an unexpected error condition occurs.
static CfgMgr & instance()
returns a single instance of Configuration Manager
static ControlledDhcpv4Srv * getInstance()
Returns pointer to the sole instance of Dhcpv4Srv.
This class implements the communication between the DHCPv4 and DHCPv6 servers to allow for transmissi...
void close()
Close communication socket.
virtual void open()=0
Open communication socket (for derived classes).
int socket_fd_
Socket descriptor.
Handles DHCPv4-over-DHCPv6 IPC on the DHCPv4 server side.
static Dhcp4to6Ipc & instance()
Returns pointer to the sole instance of Dhcp4to6Ipc.
virtual void open()
Open communication socket.
static void handler(int)
On receive handler.
Dhcp4to6Ipc()
Constructor.
static void processStatsSent(const Pkt4Ptr &response)
Updates statistics for transmitted packets.
static int getHookIndexBuffer4Send()
Returns the index for "buffer4_send" hook point.
static IfaceMgr & instance()
IfaceMgr is a singleton class.
Represents DHCPv4-over-DHCPv6 packet.
@ NEXT_STEP_DROP
drop the packet
@ NEXT_STEP_SKIP
skip the next processing step
static bool calloutsPresent(int index)
Are callouts present?
static void callCallouts(int index, CalloutHandle &handle)
Calls the callouts for a given hook.
Wrapper class around callout handle which automatically resets handle's state.
Contains declarations for loggers used by the DHCPv4 server component.
Defines the Dhcp4o6Ipc class.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
#define LOG_DEBUG(LOGGER, LEVEL, MESSAGE)
Macro to conveniently test debug output and log it.
const isc::log::MessageID DHCP4_DHCP4O6_PACKET_SEND
const int DBG_DHCP4_DETAIL
Debug level used to trace detailed errors.
boost::shared_ptr< Pkt4 > Pkt4Ptr
A pointer to Pkt4 object.
const int DBG_DHCP4_DETAIL_DATA
This level is used to log the contents of packets received and sent.
std::multimap< unsigned int, OptionPtr > OptionCollection
A collection of DHCP (v4 or v6) options.
const isc::log::MessageID DHCP4_DHCP4O6_RECEIVING
boost::shared_ptr< Pkt4o6 > Pkt4o6Ptr
A pointer to Pkt4o6 object.
isc::hooks::CalloutHandlePtr getCalloutHandle(const T &pktptr)
CalloutHandle Store.
const isc::log::MessageID DHCP4_DHCP4O6_RESPONSE_DATA
const int DBG_DHCP4_BASIC
Debug level used to trace basic operations within the code.
isc::log::Logger packet4_logger(DHCP4_PACKET_LOGGER_NAME)
Logger for processed packets.
boost::shared_ptr< Pkt6 > Pkt6Ptr
A pointer to Pkt6 packet.
const isc::log::MessageID DHCP4_DHCP4O6_BAD_PACKET
const int DBG_DHCP4_HOOKS
Debug level used to trace hook related operations.
const isc::log::MessageID DHCP4_HOOK_BUFFER_SEND_SKIP
const isc::log::MessageID DHCP4_DHCP4O6_PACKET_RECEIVED
const isc::log::MessageID DHCP4_DHCP4O6_PACKET_SEND_FAIL
boost::shared_ptr< Option > OptionPtr
const isc::log::MessageID DHCP4_DHCP4O6_RECEIVE_FAIL
isc::log::Logger hooks_logger("hooks")
Hooks Logger.
boost::shared_ptr< CalloutHandle > CalloutHandlePtr
A shared pointer to a CalloutHandle object.
Defines the logger used by the top-level component of kea-lfc.