Kea 3.3.3
dhcp4o6_ipc.h
Go to the documentation of this file.
1// Copyright (C) 2015-2026 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef DHCP4O6_IPC_H
8#define DHCP4O6_IPC_H
9
14
15#include <dhcp/pkt6.h>
17
18#include <cstdint>
19
20#include <boost/noncopyable.hpp>
21
22namespace isc {
23namespace dhcp {
24
26class Dhcp4o6IpcError : public Exception {
27public:
28 Dhcp4o6IpcError(const char* file, size_t line, const char* what) :
29 isc::Exception(file, line, what) { }
30};
31
63class Dhcp4o6IpcBase : public boost::noncopyable {
64public:
65
67 enum EndpointType : uint16_t {
70 };
71
72protected:
77
79 virtual ~Dhcp4o6IpcBase();
80
90 int open(uint16_t port, EndpointType endpoint_type);
91
92public:
93
95 virtual void open() = 0;
96
98 void close();
99
107
119 void send(const Pkt6Ptr& pkt);
120
121protected:
122
124 uint16_t port_;
125
128};
129
130} // namespace isc
131} // namespace dhcp
132
133#endif
Exception(const char *file, size_t line, const char *what)
Constructor for a given type for exceptions with file name and file line number.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
void send(const Pkt6Ptr &pkt)
Send message over IPC.
virtual ~Dhcp4o6IpcBase()
Destructor.
Pkt6Ptr receive()
Receive message over IPC.
uint16_t port_
Port number configured for IPC communication.
void close()
Close communication socket.
virtual void open()=0
Open communication socket (for derived classes).
Dhcp4o6IpcBase()
Constructor.
int socket_fd_
Socket descriptor.
EndpointType
Endpoint type: DHCPv4 or DHCPv6 server.
Definition dhcp4o6_ipc.h:67
Dhcp4o6IpcError(const char *file, size_t line, const char *what)
Definition dhcp4o6_ipc.h:28
boost::shared_ptr< Pkt6 > Pkt6Ptr
A pointer to Pkt6 packet.
Definition pkt6.h:31
Defines the logger used by the top-level component of kea-lfc.