15 #include <boost/lexical_cast.hpp>
19 #include <sys/socket.h>
20 #include <netinet/in.h>
28 IOEndpoint::create(
const int protocol,
const IOAddress& address,
29 const unsigned short port)
31 if (protocol == IPPROTO_UDP) {
33 }
else if (protocol == IPPROTO_TCP) {
37 "IOEndpoint creation attempt for unsupported protocol: " <<
51 return (!
operator==(other));
64 os <<
":" << boost::lexical_cast<
string>(endpoint.
getPort());
ostream & operator<<(ostream &os, const IOEndpoint &endpoint)
Insert the IOEndpoint as a string into stream.
bool operator!=(const Element &a, const Element &b)
The UDPEndpoint class is a concrete derived class of IOEndpoint that represents an endpoint of a UDP ...
virtual short getProtocol() const =0
Returns the protocol number of the endpoint (TCP, UDP...)
bool operator==(const Element &a, const Element &b)
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
The TCPEndpoint class is a concrete derived class of IOEndpoint that represents an endpoint of a TCP ...
virtual short getFamily() const =0
Returns the address family of the endpoint.
virtual IOAddress getAddress() const =0
Returns the address of the endpoint.
Defines the logger used by the top-level component of kea-dhcp-ddns.
A wrapper interface for the ASIO library.
An exception that is thrown if an error occurs within the IO module.
virtual uint16_t getPort() const =0
Returns the port of the endpoint.
The IOAddress class represents an IP addresses (version agnostic)
The IOEndpoint class is an abstract base class to represent a communication endpoint.