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) {
85 .arg(
"DHCPv4 message option not present");
87 }
else if (msgs.size() > 1) {
89 .arg(
"more than one DHCPv4 message option");
97 .arg(
"null DHCPv4 message option");
122 callout_handle->deleteAllArguments();
128 callout_handle->setArgument(
"response4", rsp);
137 if ((callout_handle->getStatus() == CalloutHandle::NEXT_STEP_SKIP) ||
138 (callout_handle->getStatus() == CalloutHandle::NEXT_STEP_DROP)) {
140 DHCP4_HOOK_BUFFER_SEND_SKIP)
141 .arg(rsp->getLabel());
145 callout_handle->getArgument(
"response4", rsp);
148 Pkt4o6Ptr rsp6 = boost::dynamic_pointer_cast<Pkt4o6>(rsp);
155 .arg(rsp6->getLabel())
156 .arg(rsp6->getName())
157 .arg(static_cast<int>(rsp6->getType()))
158 .arg(rsp6->getRemoteAddr())
159 .arg(rsp6->getRemotePort())
160 .arg(rsp6->getIface())
161 .arg(rsp->getLabel())
163 .arg(static_cast<int>(rsp->getType()));
166 DHCP4_DHCP4O6_RESPONSE_DATA)
167 .arg(rsp6->getLabel())
168 .arg(rsp6->getName())
169 .arg(static_cast<int>(rsp6->getType()))
170 .arg(rsp6->toText());
172 ipc.
send(rsp6->getPkt6());
177 }
catch (
const std::exception& e) {
179 .arg(rsp->getLabel())
static int getHookIndexBuffer4Send()
Returns the index for "buffer4_send" hook point.
virtual void open()
Open communication socket.
void addExternalSocket(int socketfd, SocketCallback callback)
Adds external socket and a callback.
static CfgMgr & instance()
returns a single instance of Configuration Manager
boost::shared_ptr< Option > OptionPtr
virtual void open()=0
Open communication socket (for derived classes).
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
This class implements the communication between the DHCPv4 and DHCPv6 servers to allow for transmissi...
static Dhcp4to6Ipc & instance()
Returns pointer to the sole instance of Dhcp4to6Ipc.
RAII object enabling copying options retrieved from the packet.
isc::log::Logger packet4_logger(DHCP4_PACKET_LOGGER_NAME)
Logger for processed packets.
const int DBG_DHCP4_BASIC
Debug level used to trace basic operations within the code.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< Pkt6 > Pkt6Ptr
A pointer to Pkt6 packet.
int socket_fd_
Socket descriptor.
void processPacket(Pkt4Ptr &query, Pkt4Ptr &rsp, bool allow_packet_park=true)
Process a single incoming DHCPv4 packet.
const int DBG_DHCP4_DETAIL_DATA
This level is used to log the contents of packets received and sent.
A generic exception that is thrown when an unexpected error condition occurs.
static void handler()
On receive handler.
boost::shared_ptr< Pkt4 > Pkt4Ptr
A pointer to Pkt4 object.
const int DBG_DHCP4_DETAIL
Debug level used to trace detailed errors.
std::multimap< unsigned int, OptionPtr > OptionCollection
A collection of DHCP (v4 or v6) options.
const int DBG_DHCP4_HOOKS
Debug level used to trace hook related operations.
static void processStatsSent(const Pkt4Ptr &response)
Updates statistics for transmitted packets.
Defines the logger used by the top-level component of kea-dhcp-ddns.
boost::shared_ptr< CalloutHandle > CalloutHandlePtr
A shared pointer to a CalloutHandle object.
isc::log::Logger hooks_logger("hooks")
Hooks Logger.
boost::shared_ptr< Pkt4o6 > Pkt4o6Ptr
A pointer to Pkt4o6 object.
static IfaceMgr & instance()
IfaceMgr is a singleton class.
#define LOG_DEBUG(LOGGER, LEVEL, MESSAGE)
Macro to conveniently test debug output and log it.
Pkt6Ptr receive()
Receive message over IPC.
static ControlledDhcpv4Srv * getInstance()
Returns pointer to the sole instance of Dhcpv4Srv.
A generic exception that is thrown if a parameter given to a method would refer to or modify out-of-r...
void close()
Close communication socket.
Defines the Dhcp4o6Ipc class.
void send(const Pkt6Ptr &pkt)
Send message over IPC.
Handles DHCPv4-over-DHCPv6 IPC on the DHCPv4 server side.
isc::hooks::CalloutHandlePtr getCalloutHandle(const T &pktptr)
CalloutHandle Store.
Represents DHCPv4-over-DHCPv6 packet.
Contains declarations for loggers used by the DHCPv4 server component.
SrvConfigPtr getStagingCfg()
Returns a pointer to the staging configuration.