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