All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Typedefs | Enumerations | Functions
listen.h File Reference

Listener API. More...

#include <freeradius-devel/pcap.h>
+ Include dependency graph for listen.h:

Go to the source code of this file.

Data Structures

struct  listen_socket_t
 
struct  rad_listen
 

Typedefs

typedef struct fr_protocol_t fr_protocol_t
 
typedef struct listen_socket_t listen_socket_t
 
typedef void(* rad_listen_debug_t )(REQUEST *, RADIUS_PACKET *, bool received)
 
typedef int(* rad_listen_decode_t )(rad_listen_t *, REQUEST *)
 
typedef int(* rad_listen_encode_t )(rad_listen_t *, REQUEST *)
 
typedef int(* rad_listen_print_t )(rad_listen_t const *, char *, size_t)
 
typedef int(* rad_listen_recv_t )(rad_listen_t *)
 
typedef int(* rad_listen_send_t )(rad_listen_t *, REQUEST *)
 
typedef enum RAD_LISTEN_STATUS RAD_LISTEN_STATUS
 
typedef struct rad_listen rad_listen_t
 
typedef enum RAD_LISTEN_TYPE RAD_LISTEN_TYPE
 

Enumerations

enum  RAD_LISTEN_STATUS {
  RAD_LISTEN_STATUS_INIT = 0,
  RAD_LISTEN_STATUS_KNOWN,
  RAD_LISTEN_STATUS_FROZEN,
  RAD_LISTEN_STATUS_EOL,
  RAD_LISTEN_STATUS_REMOVE_NOW
}
 
enum  RAD_LISTEN_TYPE {
  RAD_LISTEN_NONE = 0,
  RAD_LISTEN_PROXY,
  RAD_LISTEN_AUTH,
  RAD_LISTEN_ACCT,
  RAD_LISTEN_DETAIL,
  RAD_LISTEN_VQP,
  RAD_LISTEN_DHCP,
  RAD_LISTEN_COMMAND,
  RAD_LISTEN_COA,
  RAD_LISTEN_MAX
}
 

Functions

RADCLIENTclient_listener_find (rad_listen_t *listener, fr_ipaddr_t const *ipaddr, uint16_t src_port)
 
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_flag)
 Search for listeners in the server. More...
 
rad_listen_tproxy_new_listener (TALLOC_CTX *ctx, home_server_t *home, uint16_t src_port)
 

Detailed Description

Listener API.

Id:
d627624eedf6ac3ddeaaddd3eef59f5d13f5bf8b

Binds sockets to protocol encoders/decoders.

Definition in file listen.h.


Data Structure Documentation

struct listen_socket_t

Definition at line 117 of file listen.h.

+ Collaboration diagram for listen_socket_t:
Data Fields
int broadcast
RADCLIENT * client
RADCLIENT_LIST * clients
fr_event_t * ev
home_server_t * home
char const * interface
time_t last_packet
fr_socket_limit_t limit
uint32_t max_rate
fr_ipaddr_t my_ipaddr
uint16_t my_port
time_t opened
fr_ipaddr_t other_ipaddr
uint16_t other_port
RADIUS_PACKET * packet
struct listen_socket_t * parent
int proto
uint32_t rate_pps_now
uint32_t rate_pps_old
time_t rate_time
uint32_t recv_buff Socket receive buffer size we only allow configuration of SO_RCVBUF, as SO_SNDBUF controls the maximum datagram size.
struct rad_listen

Definition at line 69 of file listen.h.

+ Collaboration diagram for rad_listen:
Data Fields
rbtree_t * children
int count
CONF_SECTION const * cs
void * data
rad_listen_debug_t debug
rad_listen_decode_t decode
bool dual
rad_listen_encode_t encode
int fd
rad_listen_t * next
bool nodup
rad_listen_t * parent
rad_listen_print_t print
fr_protocol_t * proto
rad_listen_recv_t recv
rad_listen_send_t send
char const * server
fr_stats_t stats
int status
bool synchronous
RAD_LISTEN_TYPE type
uint32_t workers

Typedef Documentation

typedef struct fr_protocol_t fr_protocol_t

Definition at line 60 of file listen.h.

typedef void(* rad_listen_debug_t)(REQUEST *, RADIUS_PACKET *, bool received)

Definition at line 65 of file listen.h.

typedef int(* rad_listen_decode_t)(rad_listen_t *, REQUEST *)

Definition at line 67 of file listen.h.

typedef int(* rad_listen_encode_t)(rad_listen_t *, REQUEST *)

Definition at line 66 of file listen.h.

typedef int(* rad_listen_print_t)(rad_listen_t const *, char *, size_t)

Definition at line 64 of file listen.h.

typedef int(* rad_listen_recv_t)(rad_listen_t *)

Definition at line 62 of file listen.h.

typedef int(* rad_listen_send_t)(rad_listen_t *, REQUEST *)

Definition at line 63 of file listen.h.

typedef struct rad_listen rad_listen_t

Definition at line 59 of file listen.h.

Enumeration Type Documentation

Enumerator
RAD_LISTEN_STATUS_INIT 
RAD_LISTEN_STATUS_KNOWN 
RAD_LISTEN_STATUS_FROZEN 
RAD_LISTEN_STATUS_EOL 
RAD_LISTEN_STATUS_REMOVE_NOW 

Definition at line 51 of file listen.h.

Enumerator
RAD_LISTEN_NONE 
RAD_LISTEN_PROXY 
RAD_LISTEN_AUTH 
RAD_LISTEN_ACCT 
RAD_LISTEN_DETAIL 
RAD_LISTEN_VQP 
RAD_LISTEN_DHCP 
RAD_LISTEN_COMMAND 
RAD_LISTEN_COA 
RAD_LISTEN_MAX 

Definition at line 38 of file listen.h.

Function Documentation

RADCLIENT* client_listener_find ( rad_listen_t listener,
fr_ipaddr_t const *  ipaddr,
uint16_t  src_port 
)

Definition at line 344 of file listen.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int listen_bootstrap ( CONF_SECTION server,
CONF_SECTION cs,
char const *  server_name 
)

Definition at line 109 of file listen.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void listen_free ( rad_listen_t **  head)

Free a linked list of listeners.

Parameters
headof list to free.

Definition at line 3233 of file listen.c.

+ Here is the caller graph for this function:

int listen_init ( rad_listen_t **  head,
bool  spawn_workers 
)

Search for listeners in the server.

Parameters
[out]headWhere to write listener. Must point to a NULL pointer.
[in]spawn_workersWhether we're spawning child threads.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 3123 of file listen.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

rad_listen_t* proxy_new_listener ( TALLOC_CTX *  ctx,
home_server_t home,
uint16_t  src_port 
)

Definition at line 2927 of file listen.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: