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);
141 .arg(pkt->getLabel());
145 callout_handle->getArgument(
"response6", pkt);
149 .arg(pkt->getLabel())
151 .arg(
static_cast<int>(pkt->getType()))
160 }
catch (
const std::exception& e) {
162 .arg(pkt->getLabel())
A generic exception that is thrown if a parameter given to a method would refer to or modify out-of-r...
static CfgMgr & instance()
returns a single instance of Configuration Manager
SrvConfigPtr getStagingCfg()
Returns a pointer to the staging configuration.
This class implements the communication between the DHCPv4 and DHCPv6 servers to allow for transmissi...
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 DHCPv6 server side.
static void handler(int)
On receive handler.
Dhcp6to4Ipc()
Constructor.
virtual void open()
Open communication socket.
static Dhcp6to4Ipc & instance()
Returns pointer to the sole instance of Dhcp6to4Ipc.
static uint16_t client_port
static void processStatsSent(const Pkt6Ptr &response)
Updates statistics for transmitted packets.
static uint16_t checkRelaySourcePort(const Pkt6Ptr &query)
Used for DHCPv4-over-DHCPv6 too.
static int getHookIndexBuffer6Send()
Returns the index of the buffer6_send hook.
static IfaceMgr & instance()
IfaceMgr is a singleton class.
void addExternalSocket(int socketfd, SocketCallback callback)
Adds external socket and a callback.
bool send(const Pkt6Ptr &pkt)
Sends an IPv6 packet.
RAII object enabling copying options retrieved from the 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.
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
void clear()
Clear buffer content.
Defines the Dhcp6to4Ipc 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 DHCP6_DHCP4O6_RECEIVING
const isc::log::MessageID DHCP6_DHCP4O6_PACKET_RECEIVED
const isc::log::MessageID DHCP6_DHCP4O6_RESPONSE_DATA
const int DBG_DHCP6_HOOKS
Debug level used to trace hook related operations.
isc::log::Logger packet6_logger(DHCP6_PACKET_LOGGER_NAME)
Logger for processed packets.
isc::hooks::CalloutHandlePtr getCalloutHandle(const T &pktptr)
CalloutHandle Store.
const int DBG_DHCP6_DETAIL_DATA
This level is used to log the contents of packets received and sent.
const isc::log::MessageID DHCP6_DHCP4O6_SEND_FAIL
const isc::log::MessageID DHCP6_DHCP4O6_RECEIVE_FAIL
boost::shared_ptr< Pkt6 > Pkt6Ptr
A pointer to Pkt6 packet.
const int DBG_DHCP6_BASIC
Debug level used to trace basic operations within the code.
const isc::log::MessageID DHCP6_HOOK_BUFFER_SEND_SKIP
const int DBG_DHCP6_DETAIL
Debug level used to trace detailed errors.
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.