15#include <boost/shared_ptr.hpp>
184 void openSockets(
const uint16_t family,
const uint16_t port,
185 const bool use_bcast =
true);
208 void use(
const uint16_t family,
const std::string& iface_name);
238 const std::string& socket_type_name);
242 return (socket_type_);
303 re_detect_ = re_detect;
310 service_socket_require_all_ = require_all;
317 return (service_socket_require_all_);
324 service_sockets_retry_wait_time_ = interval;
331 return (service_sockets_retry_wait_time_);
338 service_sockets_max_retries_ = max_retries;
345 return (service_sockets_max_retries_);
352 return (reconnect_ctl_);
377 static bool multipleAddressesPerInterfaceActive();
390 void setState(
const uint16_t family,
const bool inactive,
391 const bool loopback_inactive)
const;
403 void setIfaceAddrsState(
const uint16_t family,
const bool active,
414 static void socketOpenErrorHandler(
const std::string& errmsg);
432 static std::pair<bool, bool> openSocketsForFamily(
const uint16_t family,
434 const bool can_use_bcast,
435 const bool skip_opened);
457 const uint16_t family,
const uint16_t port,
458 const bool can_use_bcast);
461 typedef std::set<std::string> IfaceSet;
468 typedef std::multimap<std::string, asiolink::IOAddress> ExplicitAddressMap;
472 ExplicitAddressMap address_map_;
485 bool service_socket_require_all_;
488 uint32_t service_sockets_retry_wait_time_;
491 uint32_t service_sockets_max_retries_;
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.
Represents selection of interfaces for DHCP server.
static const char * ALL_IFACES_KEYWORD
Keyword used to enable all interfaces.
void closeSockets() const
Convenience function which closes all open sockets.
std::string socketTypeToText() const
Returns the socket type in the textual format.
void setReDetect(bool re_detect)
Set the re-detect flag.
void setServiceSocketsRetryWaitTime(uint32_t interval)
Set the socket service binding retry interval between attempts.
void reset()
Puts the interface configuration into default state.
uint32_t getServiceSocketsRetryWaitTime() const
Indicates the socket service binding retry interval between attempts.
OutboundIface
Indicates how outbound interface is selected for relayed traffic.
@ USE_ROUTING
Server uses routing to determine the right interface to send response.
@ SAME_AS_INBOUND
Server sends responses over the same interface on which queries are received.
std::function< void(util::ReconnectCtlPtr)> OpenSocketsFailedCallback
Represents a callback invoked if all retries of the opening sockets fail.
util::ReconnectCtlPtr getReconnectCtl() const
Get the reconnect controller.
OutboundIface getOutboundIface() const
Returns outbound interface selection mode.
SocketType getSocketType() const
Returns DHCP socket type used by the server.
bool getServiceSocketsRequireAll() const
Indicates that Kea must successfully bind all socket services on init.
bool operator!=(const CfgIface &other) const
Inequality operator.
void openSockets(const uint16_t family, const uint16_t port, const bool use_bcast=true)
Tries to open sockets on selected interfaces.
static OutboundIface textToOutboundIface(const std::string &txt)
Converts text to outbound interface selection mode.
void use(const uint16_t family, const std::string &iface_name)
Select interface to be used to receive DHCP traffic.
bool equals(const CfgIface &other) const
Compares two CfgIface objects for equality.
SocketType
Socket type used by the DHCPv4 server.
@ SOCKET_UDP
Datagram socket, i.e. IP/UDP socket.
@ SOCKET_RAW
Raw socket, used for direct DHCPv4 traffic.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
void setServiceSocketsRequireAll(bool require_all)
Set flag that Kea must successfully bind all socket services on init.
std::string outboundTypeToText() const
Returns outbound interface selection mode as string.
void setOutboundIface(const OutboundIface &outbound_iface)
Sets outbound interface selection mode.
void setServiceSocketsMaxRetries(uint32_t max_retries)
Set a maximum number of service sockets bind attempts.
SocketType textToSocketType(const std::string &socket_type_name) const
Converts the socket type in the textual format to the type represented by the SocketType.
bool operator==(const CfgIface &other) const
Equality operator.
static OpenSocketsFailedCallback open_sockets_failed_callback_
Optional callback function to invoke if all retries of the opening sockets fail.
void useSocketType(const uint16_t family, const SocketType &socket_type)
Sets the specified socket type to be used by the server.
uint32_t getServiceSocketsMaxRetries() const
Indicates the maximum number of service sockets bind attempts.
Exception thrown when duplicated address specified.
DuplicateAddress(const char *file, size_t line, const char *what)
Exception thrown when duplicated interface names specified.
DuplicateIfaceName(const char *file, size_t line, const char *what)
Represents a single network interface.
Exception thrown when specified interface name is invalid.
InvalidIfaceName(const char *file, size_t line, const char *what)
Exception thrown when invalid socket type has been specified for the given family.
InvalidSocketType(const char *file, size_t line, const char *what)
Exception thrown when specified unicast address is not assigned to the interface specified.
NoSuchAddress(const char *file, size_t line, const char *what)
Exception thrown when specified interface doesn't exist in a system.
NoSuchIface(const char *file, size_t line, const char *what)
boost::shared_ptr< Element > ElementPtr
boost::shared_ptr< const CfgIface > ConstCfgIfacePtr
A pointer to the const CfgIface.
boost::shared_ptr< CfgIface > CfgIfacePtr
A pointer to the CfgIface .
boost::shared_ptr< ReconnectCtl > ReconnectCtlPtr
Pointer to an instance of ReconnectCtl.
Defines the logger used by the top-level component of kea-lfc.
Abstract class for configuration Cfg_* classes.
Base class for user context.