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();
134 callout_handle->setArgument(
"response4", rsp);
143 if ((callout_handle->getStatus() == CalloutHandle::NEXT_STEP_SKIP) ||
144 (callout_handle->getStatus() == CalloutHandle::NEXT_STEP_DROP)) {
147 .arg(rsp->getLabel());
151 callout_handle->getArgument(
"response4", rsp);
154 Pkt4o6Ptr rsp6 = boost::dynamic_pointer_cast<Pkt4o6>(rsp);
161 .arg(rsp6->getLabel())
162 .arg(rsp6->getName())
163 .arg(
static_cast<int>(rsp6->getType()))
164 .arg(rsp6->getRemoteAddr())
165 .arg(rsp6->getRemotePort())
166 .arg(rsp6->getIface())
167 .arg(rsp->getLabel())
169 .arg(
static_cast<int>(rsp->getType()));
173 .arg(rsp6->getLabel())
174 .arg(rsp6->getName())
175 .arg(
static_cast<int>(rsp6->getType()))
176 .arg(rsp6->toText());
178 ipc.
send(rsp6->getPkt6());
183 }
catch (
const std::exception& e) {
185 .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
SrvConfigPtr getStagingCfg()
Returns a pointer to the staging configuration.
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 send(const Pkt6Ptr &pkt)
Send message over IPC.
Pkt6Ptr receive()
Receive message over IPC.
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.
static void processStatsSent(const Pkt4Ptr &response)
Updates statistics for transmitted packets.
static int getHookIndexBuffer4Send()
Returns the index for "buffer4_send" hook point.
void processPacket(Pkt4Ptr &query, Pkt4Ptr &rsp, bool allow_packet_park=true)
Process a single incoming DHCPv4 packet.
static IfaceMgr & instance()
IfaceMgr is a singleton class.
void addExternalSocket(int socketfd, SocketCallback callback)
Adds external socket and a callback.
Represents DHCPv4-over-DHCPv6 packet.
RAII object enabling copying options retrieved from the packet.
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.