Kea 2.5.8
dhcp4o6_ipc.h
Go to the documentation of this file.
1// Copyright (C) 2015-2017 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
16#include <dhcp/pkt6.h>
17#include <boost/noncopyable.hpp>
18#include <stdint.h>
19
20namespace isc {
21namespace dhcp {
22
24class Dhcp4o6IpcError : public Exception {
25public:
26 Dhcp4o6IpcError(const char* file, size_t line, const char* what) :
27 isc::Exception(file, line, what) { };
28};
29
61class Dhcp4o6IpcBase : public boost::noncopyable {
62public:
63
68 };
69
70protected:
75
77 virtual ~Dhcp4o6IpcBase();
78
88 int open(uint16_t port, EndpointType endpoint_type);
89
90public:
91
93 virtual void open() = 0;
94
96 void close();
97
105
117 void send(const Pkt6Ptr& pkt);
118
119protected:
120
122 uint16_t port_;
123
126};
127
128} // namespace isc
129} // namespace dhcp
130
131#endif
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
This class implements the communication between the DHCPv4 and DHCPv6 servers to allow for transmissi...
Definition: dhcp4o6_ipc.h:61
void send(const Pkt6Ptr &pkt)
Send message over IPC.
Definition: dhcp4o6_ipc.cc:225
virtual ~Dhcp4o6IpcBase()
Destructor.
Definition: dhcp4o6_ipc.cc:35
Pkt6Ptr receive()
Receive message over IPC.
Definition: dhcp4o6_ipc.cc:127
uint16_t port_
Port number configured for IPC communication.
Definition: dhcp4o6_ipc.h:122
EndpointType
Endpoint type: DHCPv4 or DHCPv6 server.
Definition: dhcp4o6_ipc.h:65
void close()
Close communication socket.
Definition: dhcp4o6_ipc.cc:118
virtual void open()=0
Open communication socket (for derived classes).
Dhcp4o6IpcBase()
Constructor.
Definition: dhcp4o6_ipc.cc:33
int socket_fd_
Socket descriptor.
Definition: dhcp4o6_ipc.h:125
Exception thrown when error occurs as a result of use of IPC.
Definition: dhcp4o6_ipc.h:24
Dhcp4o6IpcError(const char *file, size_t line, const char *what)
Definition: dhcp4o6_ipc.h:26
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.