15 #include <boost/shared_ptr.hpp> 162 void closeSockets()
const;
169 bool equals(
const CfgIface& other)
const;
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);
222 void useSocketType(
const uint16_t family,
const SocketType& socket_type);
237 void useSocketType(
const uint16_t family,
238 const std::string& socket_type_name);
242 return (socket_type_);
246 std::string socketTypeToText()
const;
261 std::string outboundTypeToText()
const;
267 static OutboundIface textToOutboundIface(
const std::string& txt);
274 SocketType textToSocketType(
const std::string& socket_type_name)
const;
282 return (equals(other));
291 return (!equals(other));
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_;
509 #endif // CFG_IFACE_H void setServiceSocketsRequireAll(bool require_all)
Set flag that Kea must successfully bind all socket services on init.
bool operator==(const CfgIface &other) const
Equality operator.
Exception thrown when invalid socket type has been specified for the given family.
SocketType getSocketType() const
Returns DHCP socket type used by the server.
NoSuchAddress(const char *file, size_t line, const char *what)
boost::shared_ptr< ReconnectCtl > ReconnectCtlPtr
Pointer to an instance of ReconnectCtl.
Exception thrown when specified interface name is invalid.
Base class for user context.
NoSuchIface(const char *file, size_t line, const char *what)
SocketType
Socket type used by the DHCPv4 server.
Raw socket, used for direct DHCPv4 traffic.
boost::shared_ptr< Element > ElementPtr
boost::shared_ptr< CfgIface > CfgIfacePtr
A pointer to the CfgIface .
Exception thrown when specified unicast address is not assigned to the interface specified.
InvalidIfaceName(const char *file, size_t line, const char *what)
Exception thrown when specified interface doesn't exist in a system.
Represents a single network interface.
static OpenSocketsFailedCallback open_sockets_failed_callback_
Optional callback function to invoke if all retries of the opening sockets fail.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
DuplicateAddress(const char *file, size_t line, const char *what)
void setReDetect(bool re_detect)
Set the re-detect flag.
Abstract class for configuration Cfg_* classes.
void setServiceSocketsRetryWaitTime(uint32_t interval)
Set the socket service binding retry interval between attempts.
static const char * ALL_IFACES_KEYWORD
Keyword used to enable all interfaces.
uint32_t getServiceSocketsMaxRetries() const
Indicates the maximum number of service sockets bind attempts.
InvalidSocketType(const char *file, size_t line, const char *what)
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-lfc.
DuplicateIfaceName(const char *file, size_t line, const char *what)
bool getServiceSocketsRequireAll() const
Indicates that Kea must successfully bind all socket services on init.
uint32_t getServiceSocketsRetryWaitTime() const
Indicates the socket service binding retry interval between attempts.
Exception thrown when duplicated interface names specified.
Server sends responses over the same interface on which queries are received.
boost::shared_ptr< const CfgIface > ConstCfgIfacePtr
A pointer to the const CfgIface.
util::ReconnectCtlPtr getReconnectCtl() const
Get the reconnect controller.
Exception thrown when duplicated address specified.
void setServiceSocketsMaxRetries(uint32_t max_retries)
Set a maximum number of service sockets bind attempts.
bool operator!=(const CfgIface &other) const
Inequality operator.
std::function< void(util::ReconnectCtlPtr)> OpenSocketsFailedCallback
Represents a callback invoked if all retries of the opening sockets fail.
OutboundIface
Indicates how outbound interface is selected for relayed traffic.