7#ifndef RADIUS_CLIENT_SERVER_H
8#define RADIUS_CLIENT_SERVER_H
21#include <boost/enable_shared_from_this.hpp>
22#include <boost/scoped_ptr.hpp>
23#include <boost/shared_ptr.hpp>
35static constexpr uint16_t PW_AUTH_PORT = 1812;
38static constexpr uint16_t PW_ACCT_PORT = 1813;
41static constexpr uint16_t PW_TLS_PORT = 2083;
81 const std::string& secret,
const unsigned timeout,
82 const unsigned deadtime = 0)
143 void setSecret(
const std::string& secret);
186 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.
asiolink::TlsContextPtr getTlsContext() const
Get TLS context.
Server(const asiolink::IOAddress &peer_addr, const uint16_t peer_port, const asiolink::IOAddress &local_addr, const asiolink::TlsContextPtr &tls_context, const std::string &secret, const unsigned timeout, const unsigned deadtime=0)
Constructor.
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.
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.
asiolink::TlsContextPtr tls_context_
TLS context.
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< TlsContext > TlsContextPtr
The type of shared pointers to TlsContext objects.
boost::shared_ptr< Element > ElementPtr
RadiusProtocol
Transport protocols.
std::vector< ServerPtr > Servers
Type of RADIUS server collection.
boost::shared_ptr< Server > ServerPtr
Type of shared pointers to a RADIUS server object.
string protocolToText(const int proto)
Transport protocol to text.
Defines the logger used by the top-level component of kea-lfc.
Abstract class for configuration Cfg_* classes.