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

Structures and functions for packet manipulation. More...

Go to the source code of this file.

Macros

#define fr_packet2myptr(TYPE, MEMBER, PTR)   (TYPE *) (((char *)PTR) - offsetof(TYPE, MEMBER))
 

Typedefs

typedef struct fr_packet_list_t fr_packet_list_t
 

Functions

int fr_is_inaddr_any (fr_ipaddr_t *ipaddr)
 Determine if an address is the INADDR_ANY address for its address family. More...
 
int fr_packet_cmp (RADIUS_PACKET const *a, RADIUS_PACKET const *b)
 
void fr_packet_header_print (FILE *fp, RADIUS_PACKET *packet, bool received)
 
fr_packet_list_tfr_packet_list_create (int alloc_id)
 
int fr_packet_list_fd_set (fr_packet_list_t *pl, fd_set *set)
 
RADIUS_PACKET ** fr_packet_list_find (fr_packet_list_t *pl, RADIUS_PACKET *request)
 
RADIUS_PACKET ** fr_packet_list_find_byreply (fr_packet_list_t *pl, RADIUS_PACKET *reply)
 
void fr_packet_list_free (fr_packet_list_t *pl)
 
bool fr_packet_list_id_alloc (fr_packet_list_t *pl, int proto, RADIUS_PACKET **request_p, void **pctx)
 
bool fr_packet_list_id_free (fr_packet_list_t *pl, RADIUS_PACKET *request, bool yank)
 
bool fr_packet_list_insert (fr_packet_list_t *pl, RADIUS_PACKET **request_p)
 
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)
 
RADIUS_PACKETfr_packet_list_recv (fr_packet_list_t *pl, fd_set *set)
 
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)
 
int fr_packet_list_walk (fr_packet_list_t *pl, void *ctx, rb_walker_t callback)
 
bool fr_packet_list_yank (fr_packet_list_t *pl, RADIUS_PACKET *request)
 
void fr_request_from_reply (RADIUS_PACKET *request, RADIUS_PACKET const *reply)
 
int fr_socket (fr_ipaddr_t *ipaddr, uint16_t port)
 

Detailed Description

Structures and functions for packet manipulation.

Id:
5fb7226db232b84b356c5539b485df035bdd224b

Definition in file packet.h.

Macro Definition Documentation

#define fr_packet2myptr (   TYPE,
  MEMBER,
  PTR 
)    (TYPE *) (((char *)PTR) - offsetof(TYPE, MEMBER))

Definition at line 77 of file packet.h.

Typedef Documentation

Definition at line 38 of file packet.h.

Function Documentation

int fr_is_inaddr_any ( fr_ipaddr_t ipaddr)

Determine if an address is the INADDR_ANY address for its address family.

Parameters
ipaddrto check.
Returns
  • 0 if it's not.
  • 1 if it is.
  • -1 on error.

Definition at line 91 of file packet.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int fr_packet_cmp ( RADIUS_PACKET const *  a,
RADIUS_PACKET const *  b 
)

Definition at line 40 of file packet.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fr_packet_header_print ( FILE *  fp,
RADIUS_PACKET packet,
bool  received 
)

Definition at line 962 of file packet.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

fr_packet_list_t* fr_packet_list_create ( int  alloc_id)

Definition at line 464 of file packet.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int fr_packet_list_fd_set ( fr_packet_list_t pl,
fd_set *  set 
)

Definition at line 874 of file packet.c.

+ Here is the caller graph for this function:

RADIUS_PACKET** fr_packet_list_find ( fr_packet_list_t pl,
RADIUS_PACKET request 
)

Definition at line 501 of file packet.c.

+ Here is the call graph for this function:

RADIUS_PACKET** fr_packet_list_find_byreply ( fr_packet_list_t pl,
RADIUS_PACKET reply 
)

Definition at line 514 of file packet.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fr_packet_list_free ( fr_packet_list_t pl)

Definition at line 452 of file packet.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool fr_packet_list_id_alloc ( fr_packet_list_t pl,
int  proto,
RADIUS_PACKET **  request_p,
void **  pctx 
)

Definition at line 611 of file packet.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 830 of file packet.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool fr_packet_list_insert ( fr_packet_list_t pl,
RADIUS_PACKET **  request_p 
)

Definition at line 493 of file packet.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t fr_packet_list_num_elements ( fr_packet_list_t pl)

Definition at line 584 of file packet.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t fr_packet_list_num_incoming ( fr_packet_list_t pl)

Definition at line 940 of file packet.c.

+ Here is the call graph for this function:

uint32_t fr_packet_list_num_outgoing ( fr_packet_list_t pl)

Definition at line 952 of file packet.c.

+ Here is the caller graph for this function:

RADIUS_PACKET* fr_packet_list_recv ( fr_packet_list_t pl,
fd_set *  set 
)

Definition at line 901 of file packet.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 356 of file packet.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool fr_packet_list_socket_del ( fr_packet_list_t pl,
int  sockfd 
)

Definition at line 338 of file packet.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool fr_packet_list_socket_freeze ( fr_packet_list_t pl,
int  sockfd 
)

Definition at line 305 of file packet.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool fr_packet_list_socket_thaw ( fr_packet_list_t pl,
int  sockfd 
)

Definition at line 324 of file packet.c.

+ Here is the call graph for this function:

int fr_packet_list_walk ( fr_packet_list_t pl,
void *  ctx,
rb_walker_t  callback 
)

Definition at line 867 of file packet.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool fr_packet_list_yank ( fr_packet_list_t pl,
RADIUS_PACKET request 
)

Definition at line 571 of file packet.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fr_request_from_reply ( RADIUS_PACKET request,
RADIUS_PACKET const *  reply 
)

Definition at line 118 of file packet.c.

int fr_socket ( fr_ipaddr_t ipaddr,
uint16_t  port 
)

Definition at line 136 of file packet.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: