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

Structures and functions for packet manipulation. More...

#include <freeradius-devel/build.h>
#include <freeradius-devel/missing.h>
#include <freeradius-devel/util/inet.h>
#include <freeradius-devel/util/pair.h>
#include <freeradius-devel/util/rb.h>
#include <freeradius-devel/util/socket.h>
#include <freeradius-devel/util/talloc.h>
#include <freeradius-devel/util/time.h>
+ Include dependency graph for packet.h:

Go to the source code of this file.

Data Structures

struct  fr_packet_t
 

Macros

#define PACKET_VERIFY(_x)   fr_cond_assert(_x)
 
#define RADIUS_AUTH_VECTOR_LENGTH   16
 

Functions

fr_packet_tfr_packet_alloc (TALLOC_CTX *ctx, bool new_vector)
 Allocate a new fr_packet_t. More...
 
fr_packet_tfr_packet_alloc_reply (TALLOC_CTX *ctx, fr_packet_t *)
 Allocate a new fr_packet_t response. More...
 
void fr_packet_free (fr_packet_t **)
 Free a fr_packet_t. More...
 

Detailed Description

Structures and functions for packet manipulation.

Definition in file packet.h.


Data Structure Documentation

◆ fr_packet_t

struct fr_packet_t

Definition at line 56 of file packet.h.

+ Collaboration diagram for fr_packet_t:
Data Fields
unsigned int code Packet code (type).
uint8_t * data Packet data (body).
size_t data_len Length of packet data.
int id Packet ID (used to link requests/responses).
fr_rb_node_t node Allows insertion into the list.c rbtree, may be removed in future.
size_t partial
fr_socket_t socket This packet was received on.
fr_time_t timestamp When we received the packet.
void * uctx
uint8_t vector[RADIUS_AUTH_VECTOR_LENGTH] RADIUS authentication vector.

Macro Definition Documentation

◆ PACKET_VERIFY

#define PACKET_VERIFY (   _x)    fr_cond_assert(_x)

Definition at line 42 of file packet.h.

◆ RADIUS_AUTH_VECTOR_LENGTH

#define RADIUS_AUTH_VECTOR_LENGTH   16

Definition at line 45 of file packet.h.

Function Documentation

◆ fr_packet_alloc()

fr_packet_t* fr_packet_alloc ( TALLOC_CTX *  ctx,
bool  new_vector 
)

Allocate a new fr_packet_t.

Parameters
ctxthe context in which the packet is allocated. May be NULL if the packet is not associated with a request_t.
new_vectorif true a new request authenticator will be generated.
Returns

Definition at line 38 of file packet.c.

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

◆ fr_packet_alloc_reply()

fr_packet_t* fr_packet_alloc_reply ( TALLOC_CTX *  ctx,
fr_packet_t packet 
)

Allocate a new fr_packet_t response.

Parameters
ctxthe context in which the packet is allocated. May be NULL if the packet is not associated with a request_t.
packetThe request packet.
Returns

Definition at line 63 of file packet.c.

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

◆ fr_packet_free()

void fr_packet_free ( fr_packet_t **  packet_p)

Free a fr_packet_t.

Definition at line 89 of file packet.c.

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