30 uint16_t Dhcp6to4Ipc::client_port = 0;
36 return (dhcp6to4_ipc);
51 if ((old_fd == -1) && (
socket_fd_ != old_fd)) {
68 .arg(static_cast<int>(pkt->getType()))
69 .arg(pkt->getRemoteAddr().toText())
70 .arg(pkt->getRemotePort())
71 .arg(pkt->getIface());
73 }
catch (
const std::exception& e) {
97 uint8_t msg_type = buf[0];
102 pkt->setRemotePort(relay_port ? relay_port : DHCP6_SERVER_PORT);
104 pkt->setRemotePort(DHCP6_CLIENT_PORT);
116 callout_handle->deleteAllArguments();
128 callout_handle->setArgument(
"response6", pkt);
137 if ((callout_handle->getStatus() == CalloutHandle::NEXT_STEP_SKIP) ||
138 (callout_handle->getStatus() == CalloutHandle::NEXT_STEP_DROP)) {
141 .arg(pkt->getLabel());
145 callout_handle->getArgument(
"response6", pkt);
149 .arg(static_cast<int>(pkt->getType())).arg(pkt->toText());
157 }
catch (
const std::exception& e) {
static uint16_t client_port
const isc::log::MessageID DHCP6_DHCP4O6_RECEIVE_FAIL
isc::log::Logger packet6_logger(DHCP6_PACKET_LOGGER_NAME)
Logger for processed packets.
void addExternalSocket(int socketfd, SocketCallback callback)
Adds external socket and a callback.
static Dhcp6to4Ipc & instance()
Returns pointer to the sole instance of Dhcp6to4Ipc.
static CfgMgr & instance()
returns a single instance of Configuration Manager
const int DBG_DHCP6_HOOKS
Debug level used to trace hook related operations.
virtual void open()=0
Open communication socket (for derived classes).
const int DBG_DHCP6_BASIC
Debug level used to trace basic operations within the code.
static void processStatsSent(const Pkt6Ptr &response)
Updates statistics for transmitted packets.
#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...
virtual void open()
Open communication socket.
RAII object enabling copying options retrieved from the packet.
Handles DHCPv4-over-DHCPv6 IPC on the DHCPv6 server side.
bool send(const Pkt6Ptr &pkt)
Sends an IPv6 packet.
#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.
const isc::log::MessageID DHCP6_DHCP4O6_SEND_FAIL
const isc::log::MessageID DHCP6_DHCP4O6_RECEIVING
int socket_fd_
Socket descriptor.
const isc::log::MessageID DHCP6_HOOK_BUFFER_SEND_SKIP
Wrapper class around callout handle which automatically resets handle's state.
static int getHookIndexBuffer6Send()
Returns the index of the buffer6_send hook.
Defines the Dhcp6to4Ipc class.
void clear()
Clear buffer content.
const int DBG_DHCP6_DETAIL
Debug level used to trace detailed errors.
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
Defines the logger used by the top-level component of kea-dhcp-ddns.
const isc::log::MessageID DHCP6_RESPONSE_DATA
const int DBG_DHCP6_DETAIL_DATA
This level is used to log the contents of packets received and sent.
boost::shared_ptr< CalloutHandle > CalloutHandlePtr
A shared pointer to a CalloutHandle object.
isc::log::Logger hooks_logger("hooks")
Hooks Logger.
const isc::log::MessageID DHCP6_DHCP4O6_PACKET_RECEIVED
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.
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.
isc::hooks::CalloutHandlePtr getCalloutHandle(const T &pktptr)
CalloutHandle Store.
static void handler(int)
On receive handler.
static uint16_t checkRelaySourcePort(const Pkt6Ptr &query)
Used for DHCPv4-over-DHCPv6 too.
SrvConfigPtr getStagingCfg()
Returns a pointer to the staging configuration.