![]() |
Kea 3.1.1
|
RADIUS server class. More...
#include <client_server.h>
Public Member Functions | |
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. | |
virtual | ~Server () |
Destructor. | |
unsigned | getDeadtime () const |
Get deadtime. | |
std::chrono::steady_clock::time_point | getDeadtimeEnd () const |
Get deadtime end. | |
asiolink::IOAddress | getLocalAddress () const |
Get local address. | |
asiolink::IOAddress | getPeerAddress () const |
Get peer address. | |
uint16_t | getPeerPort () const |
Get peer port. | |
std::string | getSecret () const |
Get secret. | |
unsigned | getTimeout () const |
Get timeout. | |
void | setDeadtime (const unsigned deadtime) |
Set deadtime. | |
void | setDeadtimeEnd (const std::chrono::steady_clock::time_point &deadtime_end) |
Set deadtime end. | |
void | setLocalAddress (const asiolink::IOAddress &local_addr) |
Set local address. | |
void | setPeerPort (const uint16_t peer_port) |
Set peer port. | |
void | setSecret (const std::string &secret) |
Set secret. | |
void | setTimeout (const unsigned timeout) |
Set timeout. | |
data::ElementPtr | toElement () const override |
Unparse server. | |
![]() | |
virtual | ~CfgToElement () |
Destructor. | |
Static Public Member Functions | |
static asiolink::IOAddress | getAddress (const std::string &name) |
Get an address from a name. | |
static asiolink::IOAddress | getSrcAddress (const asiolink::IOAddress &dest) |
Get the source address from a destination address. | |
Protected Attributes | |
unsigned | deadtime_ |
Deadtime i.e. hold-down delay. | |
std::chrono::steady_clock::time_point | deadtime_end_ |
Deadtime end i.e. | |
asiolink::IOAddress | local_addr_ |
Local address. | |
boost::scoped_ptr< std::mutex > | mutex_ |
Mutex to protect the state. | |
const asiolink::IOAddress | peer_addr_ |
Peer address. | |
uint16_t | peer_port_ |
Peer port. | |
std::string | secret_ |
Secret. | |
unsigned | timeout_ |
Timeout. | |
RADIUS server class.
Definition at line 40 of file client_server.h.
|
inline |
Constructor.
peer_addr | The peer/server address. |
peer_port | The peer/server port. |
local_addr | The local/client address. |
secret | The shared secret (must not be empty). |
timeout | The timeout in seconds. |
deadtime | The hold-down delay (0 means disabled). |
Definition at line 63 of file client_server.h.
References deadtime_, deadtime_end_, local_addr_, mutex_, peer_addr_, peer_port_, secret_, setLocalAddress(), setSecret(), setTimeout(), and timeout_.
|
virtual |
|
static |
Get an address from a name.
name | the FQDN. |
Definition at line 56 of file client_server.cc.
References AddrInfo::addrinfo_, isc::asiolink::IOAddress::fromBytes(), and isc_throw.
Referenced by isc::radius::RadiusServerParser::parse().
|
inline |
Get deadtime.
Definition at line 140 of file client_server.h.
References deadtime_.
steady_clock::time_point isc::radius::Server::getDeadtimeEnd | ( | ) | const |
Get deadtime end.
Definition at line 179 of file client_server.cc.
References deadtime_end_, and mutex_.
|
inline |
Get local address.
Definition at line 104 of file client_server.h.
References local_addr_.
|
inline |
Get peer address.
Definition at line 83 of file client_server.h.
References peer_addr_.
|
inline |
Get peer port.
Definition at line 90 of file client_server.h.
References peer_port_.
|
inline |
|
static |
Get the source address from a destination address.
dest | the destination address. |
Definition at line 77 of file client_server.cc.
References isc::asiolink::IOAddress::fromBytes(), isc_throw, and isc::asiolink::IOAddress::toBytes().
Referenced by isc::radius::RadiusServerParser::parse().
|
inline |
Get timeout.
Definition at line 128 of file client_server.h.
References timeout_.
|
inline |
Set deadtime.
Definition at line 145 of file client_server.h.
References deadtime_, and deadtime_end_.
void isc::radius::Server::setDeadtimeEnd | ( | const std::chrono::steady_clock::time_point & | deadtime_end | ) |
Set deadtime end.
deadtime_end | new date of the end of hold-down. |
Definition at line 186 of file client_server.cc.
References deadtime_end_, and mutex_.
void isc::radius::Server::setLocalAddress | ( | const asiolink::IOAddress & | local_addr | ) |
Set local address.
local_addr | new local address. |
Definition at line 153 of file client_server.cc.
References isc::asiolink::IOAddress::getFamily(), isc_throw, local_addr_, peer_addr_, and isc::asiolink::IOAddress::toText().
Referenced by Server().
|
inline |
Set peer port.
peer_port | new peer port. |
Definition at line 97 of file client_server.h.
References peer_port_.
void isc::radius::Server::setSecret | ( | const std::string & | secret | ) |
Set secret.
secret | new secret (must not be empty). |
Definition at line 171 of file client_server.cc.
References isc_throw, and secret_.
Referenced by Server().
void isc::radius::Server::setTimeout | ( | const unsigned | timeout | ) |
Set timeout.
timeout | new timeout in seconds. |
Definition at line 162 of file client_server.cc.
References isc_throw, and timeout_.
Referenced by Server().
|
overridevirtual |
Unparse server.
Implements isc::data::CfgToElement.
Definition at line 193 of file client_server.cc.
References Element::create(), Element::createMap(), deadtime_, deadtime_end_, local_addr_, mutex_, peer_addr_, peer_port_, secret_, and timeout_.
|
protected |
Deadtime i.e. hold-down delay.
Definition at line 185 of file client_server.h.
Referenced by Server(), getDeadtime(), setDeadtime(), and toElement().
|
protected |
Deadtime end i.e.
date of hold-down end.
Definition at line 190 of file client_server.h.
Referenced by Server(), getDeadtimeEnd(), setDeadtime(), setDeadtimeEnd(), and toElement().
|
protected |
Local address.
Definition at line 176 of file client_server.h.
Referenced by Server(), getLocalAddress(), setLocalAddress(), and toElement().
|
protected |
Mutex to protect the state.
Definition at line 193 of file client_server.h.
Referenced by Server(), getDeadtimeEnd(), setDeadtimeEnd(), and toElement().
|
protected |
Peer address.
Definition at line 170 of file client_server.h.
Referenced by Server(), getPeerAddress(), setLocalAddress(), and toElement().
|
protected |
Peer port.
Definition at line 173 of file client_server.h.
Referenced by Server(), getPeerPort(), setPeerPort(), and toElement().
|
protected |
Secret.
Definition at line 179 of file client_server.h.
Referenced by Server(), ~Server(), getSecret(), setSecret(), and toElement().
|
protected |
Timeout.
Definition at line 182 of file client_server.h.
Referenced by Server(), getTimeout(), setTimeout(), and toElement().