The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Functions
list.c File Reference

Functions to deal with outgoing lists / sets of packets. More...

#include "radius.h"
#include "tcp.h"
#include "list.h"
#include <fcntl.h>
#include <freeradius-devel/util/udp.h>
#include <freeradius-devel/util/syserror.h>
+ Include dependency graph for list.c:

Go to the source code of this file.

Data Structures

struct  fr_packet_list_s
 
struct  fr_packet_socket_t
 

Macros

#define FNV_MAGIC_PRIME   (0x01000193)
 
#define ID_i   ((i + start_i) & SOCKOFFSET_MASK)
 
#define ID_j   ((j + start_j) & 0x1f)
 
#define ID_k   ((k + start_k) & 0x07)
 
#define MAX_SOCKETS   (256)
 
#define SOCK2OFFSET(_sockfd)   ((_sockfd * FNV_MAGIC_PRIME) & SOCKOFFSET_MASK)
 
#define SOCKOFFSET_MASK   (MAX_SOCKETS - 1)
 

Functions

int8_t fr_packet_cmp (void const *a_v, void const *b_v)
 
fr_packet_list_tfr_packet_list_create (int alloc_id)
 
int fr_packet_list_fd_set (fr_packet_list_t *pl, fd_set *set)
 
fr_packet_tfr_packet_list_find (fr_packet_list_t *pl, fr_packet_t *request)
 
fr_packet_tfr_packet_list_find_byreply (fr_packet_list_t *pl, fr_packet_t *reply)
 
void fr_packet_list_free (fr_packet_list_t *pl)
 
bool fr_packet_list_id_alloc (fr_packet_list_t *pl, int proto, fr_packet_t *request, void **pctx)
 
bool fr_packet_list_id_free (fr_packet_list_t *pl, fr_packet_t *request, bool yank)
 
bool fr_packet_list_insert (fr_packet_list_t *pl, fr_packet_t *request)
 
uint32_t fr_packet_list_num_elements (fr_packet_list_t *pl)
 
uint32_t fr_packet_list_num_incoming (fr_packet_list_t *pl)
 
uint32_t fr_packet_list_num_outgoing (fr_packet_list_t *pl)
 
fr_packet_tfr_packet_list_recv (fr_packet_list_t *pl, fd_set *set, uint32_t max_attributes, bool require_ma)
 
bool fr_packet_list_socket_add (fr_packet_list_t *pl, int sockfd, int proto, fr_ipaddr_t *dst_ipaddr, uint16_t dst_port, void *ctx)
 
bool fr_packet_list_socket_del (fr_packet_list_t *pl, int sockfd)
 
bool fr_packet_list_socket_freeze (fr_packet_list_t *pl, int sockfd)
 
bool fr_packet_list_socket_thaw (fr_packet_list_t *pl, int sockfd)
 
bool fr_packet_list_yank (fr_packet_list_t *pl, fr_packet_t *request)
 
void fr_request_from_reply (fr_packet_t *request, fr_packet_t const *reply)
 
static fr_packet_socket_tfr_socket_find (fr_packet_list_t *pl, int sockfd)
 

Detailed Description

Functions to deal with outgoing lists / sets of packets.

Id
88f29cf4609e07ea86a224e0006ea542a536e2cd

Definition in file list.c.


Data Structure Documentation

◆ fr_packet_list_s

struct fr_packet_list_s

Definition at line 106 of file list.c.

+ Collaboration diagram for fr_packet_list_s:
Data Fields
int alloc_id
int last_recv
uint32_t num_outgoing
int num_sockets
fr_packet_socket_t sockets[MAX_SOCKETS]
fr_rb_tree_t * tree

◆ fr_packet_socket_t

struct fr_packet_socket_t

Definition at line 82 of file list.c.

+ Collaboration diagram for fr_packet_socket_t:
Data Fields
void * ctx
bool dont_use
int dst_any
uint8_t id[32]
uint32_t num_outgoing
fr_socket_t socket
int src_any

Macro Definition Documentation

◆ FNV_MAGIC_PRIME

#define FNV_MAGIC_PRIME   (0x01000193)

Definition at line 97 of file list.c.

◆ ID_i

#define ID_i   ((i + start_i) & SOCKOFFSET_MASK)

◆ ID_j

#define ID_j   ((j + start_j) & 0x1f)

◆ ID_k

#define ID_k   ((k + start_k) & 0x07)

◆ MAX_SOCKETS

#define MAX_SOCKETS   (256)

Definition at line 98 of file list.c.

◆ SOCK2OFFSET

#define SOCK2OFFSET (   _sockfd)    ((_sockfd * FNV_MAGIC_PRIME) & SOCKOFFSET_MASK)

Definition at line 100 of file list.c.

◆ SOCKOFFSET_MASK

#define SOCKOFFSET_MASK   (MAX_SOCKETS - 1)

Definition at line 99 of file list.c.

Function Documentation

◆ fr_packet_cmp()

int8_t fr_packet_cmp ( void const *  a_v,
void const *  b_v 
)

Definition at line 43 of file list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_packet_list_create()

fr_packet_list_t* fr_packet_list_create ( int  alloc_id)

Definition at line 276 of file list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_packet_list_fd_set()

int fr_packet_list_fd_set ( fr_packet_list_t pl,
fd_set *  set 
)

Definition at line 645 of file list.c.

+ Here is the caller graph for this function:

◆ fr_packet_list_find()

fr_packet_t* fr_packet_list_find ( fr_packet_list_t pl,
fr_packet_t request 
)

Definition at line 311 of file list.c.

+ Here is the call graph for this function:

◆ fr_packet_list_find_byreply()

fr_packet_t* fr_packet_list_find_byreply ( fr_packet_list_t pl,
fr_packet_t reply 
)

Definition at line 323 of file list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_packet_list_free()

void fr_packet_list_free ( fr_packet_list_t pl)

Definition at line 264 of file list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_packet_list_id_alloc()

bool fr_packet_list_id_alloc ( fr_packet_list_t pl,
int  proto,
fr_packet_t request,
void **  pctx 
)

Definition at line 395 of file list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_packet_list_id_free()

bool fr_packet_list_id_free ( fr_packet_list_t pl,
fr_packet_t request,
bool  yank 
)

Definition at line 621 of file list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_packet_list_insert()

bool fr_packet_list_insert ( fr_packet_list_t pl,
fr_packet_t request 
)

Definition at line 303 of file list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_packet_list_num_elements()

uint32_t fr_packet_list_num_elements ( fr_packet_list_t pl)

Definition at line 368 of file list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_packet_list_num_incoming()

uint32_t fr_packet_list_num_incoming ( fr_packet_list_t pl)

Definition at line 708 of file list.c.

+ Here is the call graph for this function:

◆ fr_packet_list_num_outgoing()

uint32_t fr_packet_list_num_outgoing ( fr_packet_list_t pl)

Definition at line 720 of file list.c.

◆ fr_packet_list_recv()

fr_packet_t* fr_packet_list_recv ( fr_packet_list_t pl,
fd_set *  set,
uint32_t  max_attributes,
bool  require_ma 
)

Definition at line 672 of file list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_packet_list_socket_add()

bool fr_packet_list_socket_add ( fr_packet_list_t pl,
int  sockfd,
int  proto,
fr_ipaddr_t dst_ipaddr,
uint16_t  dst_port,
void *  ctx 
)

Definition at line 187 of file list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_packet_list_socket_del()

bool fr_packet_list_socket_del ( fr_packet_list_t pl,
int  sockfd 
)

Definition at line 169 of file list.c.

+ Here is the call graph for this function:

◆ fr_packet_list_socket_freeze()

bool fr_packet_list_socket_freeze ( fr_packet_list_t pl,
int  sockfd 
)

Definition at line 136 of file list.c.

+ Here is the call graph for this function:

◆ fr_packet_list_socket_thaw()

bool fr_packet_list_socket_thaw ( fr_packet_list_t pl,
int  sockfd 
)

Definition at line 155 of file list.c.

+ Here is the call graph for this function:

◆ fr_packet_list_yank()

bool fr_packet_list_yank ( fr_packet_list_t pl,
fr_packet_t request 
)

Definition at line 361 of file list.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_request_from_reply()

void fr_request_from_reply ( fr_packet_t request,
fr_packet_t const *  reply 
)

Definition at line 72 of file list.c.

+ Here is the call graph for this function:

◆ fr_socket_find()

static fr_packet_socket_t* fr_socket_find ( fr_packet_list_t pl,
int  sockfd 
)
static

Definition at line 121 of file list.c.

+ Here is the caller graph for this function: