#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/modules.h>
#include <freeradius-devel/rad_assert.h>
#include <freeradius-devel/process.h>
#include <freeradius-devel/protocol.h>
#include <freeradius-devel/modpriv.h>
#include <freeradius-devel/net.h>
#include <freeradius-devel/detail.h>
#include <freeradius-devel/udp.h>
#include "command.c"
Go to the source code of this file.
Data Structures | |
struct | listen_config_t |
Macros | |
#define | ADDSTRING(_x) strlcpy(buffer, _x, bufsize);FORWARD |
#define | FORWARD len = strlen(buffer); if (len >= (bufsize + 1)) return 0;buffer += len;bufsize -= len |
#define | NO_LISTENER { .name = "undefined", } |
#define | WAS_PROXIED (request->proxy) |
Typedefs | |
typedef struct listen_config_t | listen_config_t |
Functions | |
static int | _listen_config_free (listen_config_t *lc) |
static int | _listener_free (rad_listen_t *this) |
static int | acct_socket_recv (rad_listen_t *listener) |
static int | acct_socket_send (rad_listen_t *listener, REQUEST *request) |
static int | auth_socket_recv (rad_listen_t *listener) |
static int | auth_socket_send (rad_listen_t *listener, REQUEST *request) |
RADCLIENT * | client_listener_find (rad_listen_t *listener, fr_ipaddr_t const *ipaddr, uint16_t src_port) |
static int | client_socket_decode (UNUSED rad_listen_t *listener, REQUEST *request) |
static int | client_socket_encode (UNUSED rad_listen_t *listener, REQUEST *request) |
static int | coa_socket_recv (rad_listen_t *listener) |
static int | command_tcp_recv (rad_listen_t *listener) |
static int | command_tcp_send (rad_listen_t *listener, REQUEST *request) |
static int | command_write_magic (int newfd, listen_socket_t *sock) |
void | common_packet_debug (REQUEST *request, RADIUS_PACKET *packet, bool received) |
static void | common_socket_free (rad_listen_t *this) |
int | common_socket_open (CONF_SECTION *cs, rad_listen_t *this) |
int | common_socket_parse (CONF_SECTION *cs, rad_listen_t *this) |
int | common_socket_print (rad_listen_t const *this, char *buffer, size_t bufsize) |
static int | do_proxy (REQUEST *request) |
static int | dual_tcp_accept (rad_listen_t *listener) |
static int | dual_tcp_recv (rad_listen_t *listener) |
static rad_listen_t * | listen_alloc (TALLOC_CTX *ctx, RAD_LISTEN_TYPE type, fr_protocol_t *proto) |
static int | listen_bind (rad_listen_t *this) |
int | listen_bootstrap (CONF_SECTION *server, CONF_SECTION *cs, char const *server_name) |
void | listen_free (rad_listen_t **head) |
Free a linked list of listeners. More... | |
int | listen_init (rad_listen_t **head, bool spawn_workers) |
Search for listeners in the server. More... | |
static rad_listen_t * | listen_parse (listen_config_t *lc) |
static int | listener_cmp (void const *one, void const *two) |
rad_listen_t * | listener_find_byipaddr (fr_ipaddr_t const *ipaddr, uint16_t port, int proto) |
Find a listener associated with an IP address/port/transport proto. More... | |
RADCLIENT_LIST * | listener_find_client_list (fr_ipaddr_t const *ipaddr, uint16_t port, int proto) |
Find client list associated with a listener. More... | |
static int | listener_unlink (UNUSED void *ctx, UNUSED void *data) |
rad_listen_t * | proxy_new_listener (TALLOC_CTX *ctx, home_server_t *home, uint16_t src_port) |
static int | proxy_socket_decode (UNUSED rad_listen_t *listener, REQUEST *request) |
static int | proxy_socket_encode (UNUSED rad_listen_t *listener, REQUEST *request) |
static int | proxy_socket_recv (rad_listen_t *listener) |
static int | proxy_socket_send (rad_listen_t *listener, REQUEST *request) |
static int | proxy_socket_tcp_recv (rad_listen_t *listener) |
int | rad_coa_recv (REQUEST *request) |
int | rad_status_server (REQUEST *request) |
static int | stats_socket_recv (rad_listen_t *listener) |
Variables | |
static CONF_PARSER | limit_config [] |
static listen_config_t * | listen_config = NULL |
static TALLOC_CTX * | listen_ctx = NULL |
static fr_protocol_t | master_listen [] |
static CONF_PARSER | performance_config [] |
struct listen_config_t |
Data Fields | ||
---|---|---|
CONF_SECTION * | cs | configuration for this listener |
lt_dlhandle * | handle | to dynamically loaded library (if any) |
rad_listen_t * | listener | created from this configuration |
struct listen_config_t * | next | the next listener |
fr_protocol_t * | proto |
same as Listen-Socket-Type pointer to the protocol handler. |
CONF_SECTION * | server | encapsulating server configuratiuon |
char const * | server_name | name of the virtual server (if any) |
RAD_LISTEN_TYPE | type |
#define FORWARD len = strlen(buffer); if (len >= (bufsize + 1)) return 0;buffer += len;bufsize -= len |
#define WAS_PROXIED (request->proxy) |
typedef struct listen_config_t listen_config_t |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
RADCLIENT* client_listener_find | ( | rad_listen_t * | listener, |
fr_ipaddr_t const * | ipaddr, | ||
uint16_t | src_port | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
void common_packet_debug | ( | REQUEST * | request, |
RADIUS_PACKET * | packet, | ||
bool | received | ||
) |
|
static |
int common_socket_open | ( | CONF_SECTION * | cs, |
rad_listen_t * | this | ||
) |
int common_socket_parse | ( | CONF_SECTION * | cs, |
rad_listen_t * | this | ||
) |
int common_socket_print | ( | rad_listen_t const * | this, |
char * | buffer, | ||
size_t | bufsize | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
int listen_bootstrap | ( | CONF_SECTION * | server, |
CONF_SECTION * | cs, | ||
char const * | server_name | ||
) |
void listen_free | ( | rad_listen_t ** | head | ) |
int listen_init | ( | rad_listen_t ** | head, |
bool | spawn_workers | ||
) |
Search for listeners in the server.
[out] | head | Where to write listener. Must point to a NULL pointer. |
[in] | spawn_workers | Whether we're spawning child threads. |
Definition at line 3123 of file listen.c.
|
static |
|
static |
rad_listen_t* listener_find_byipaddr | ( | fr_ipaddr_t const * | ipaddr, |
uint16_t | port, | ||
int | proto | ||
) |
Find a listener associated with an IP address/port/transport proto.
[in] | ipaddr | listener is bound to. |
[in] | port | listener is bound to. |
[in] | proto | of listener, one of the IPPROTO_* macros. |
Definition at line 3302 of file listen.c.
RADCLIENT_LIST* listener_find_client_list | ( | fr_ipaddr_t const * | ipaddr, |
uint16_t | port, | ||
int | proto | ||
) |
Find client list associated with a listener.
[in] | ipaddr | listener is bound to. |
[in] | port | listener is bound to. |
[in] | proto | of listener, one of the IPPROTO_* macros. |
Definition at line 3264 of file listen.c.
rad_listen_t* proxy_new_listener | ( | TALLOC_CTX * | ctx, |
home_server_t * | home, | ||
uint16_t | src_port | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
int rad_coa_recv | ( | REQUEST * | request | ) |
int rad_status_server | ( | REQUEST * | request | ) |
|
static |
|
static |
|
static |
|
static |
|
static |