7#ifndef RADIUS_CLIENT_SERVER_H
8#define RADIUS_CLIENT_SERVER_H
20#include <boost/enable_shared_from_this.hpp>
21#include <boost/scoped_ptr.hpp>
22#include <boost/shared_ptr.hpp>
34static constexpr uint16_t PW_AUTH_UDP_PORT = 1812;
37static constexpr uint16_t PW_ACCT_UDP_PORT = 1813;
65 const unsigned timeout,
const unsigned deadtime = 0)
118 void setSecret(
const std::string& secret);
161 void setDeadtimeEnd(
const std::chrono::steady_clock::time_point& deadtime_end);
The IOAddress class represents an IP addresses (version agnostic)
void setPeerPort(const uint16_t peer_port)
Set peer port.
void setTimeout(const unsigned timeout)
Set timeout.
asiolink::IOAddress local_addr_
Local address.
boost::scoped_ptr< std::mutex > mutex_
Mutex to protect the state.
void setSecret(const std::string &secret)
Set secret.
asiolink::IOAddress getLocalAddress() const
Get local address.
void setLocalAddress(const asiolink::IOAddress &local_addr)
Set local address.
const asiolink::IOAddress peer_addr_
Peer address.
data::ElementPtr toElement() const override
Unparse server.
unsigned deadtime_
Deadtime i.e. hold-down delay.
virtual ~Server()
Destructor.
unsigned getTimeout() const
Get timeout.
Server(const asiolink::IOAddress &peer_addr, const uint16_t peer_port, const asiolink::IOAddress &local_addr, const std::string &secret, const unsigned timeout, const unsigned deadtime=0)
Constructor.
static asiolink::IOAddress getSrcAddress(const asiolink::IOAddress &dest)
Get the source address from a destination address.
unsigned getDeadtime() const
Get deadtime.
std::chrono::steady_clock::time_point deadtime_end_
Deadtime end i.e.
void setDeadtime(const unsigned deadtime)
Set deadtime.
std::chrono::steady_clock::time_point getDeadtimeEnd() const
Get deadtime end.
static asiolink::IOAddress getAddress(const std::string &name)
Get an address from a name.
uint16_t getPeerPort() const
Get peer port.
unsigned timeout_
Timeout.
void setDeadtimeEnd(const std::chrono::steady_clock::time_point &deadtime_end)
Set deadtime end.
std::string secret_
Secret.
uint16_t peer_port_
Peer port.
std::string getSecret() const
Get secret.
asiolink::IOAddress getPeerAddress() const
Get peer address.
boost::shared_ptr< Element > ElementPtr
std::vector< ServerPtr > Servers
Type of RADIUS server collection.
boost::shared_ptr< Server > ServerPtr
Type of shared pointers to a RADIUS server object.
Defines the logger used by the top-level component of kea-lfc.
Abstract class for configuration Cfg_* classes.