The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Typedefs | Functions
track.h File Reference
#include "rlm_radius.h"
#include <freeradius-devel/util/dlist.h>
+ Include dependency graph for track.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  radius_track_entry_s
 Track one request to a response. More...
 
union  radius_track_entry_s.__unnamed160__
 
struct  radius_track_s
 

Macros

#define radius_track_entry_release(_te)    _radius_track_entry_release( __FILE__, __LINE__, _te)
 
#define radius_track_entry_reserve(_te_out, _ctx, _tt, _request, _code, _uctx)    _radius_track_entry_reserve( __FILE__, __LINE__, _te_out, _ctx, _tt, _request, _code, _uctx)
 

Typedefs

typedef struct radius_track_entry_s radius_track_entry_t
 
typedef void(* radius_track_log_extra_t) (fr_log_t const *log, fr_log_type_t log_type, char const *file, int line, radius_track_entry_t *te)
 
typedef struct radius_track_s radius_track_t
 

Functions

int _radius_track_entry_release (char const *file, int line, radius_track_entry_t **te)
 Release a tracking entry. More...
 
int _radius_track_entry_reserve (char const *file, int line, radius_track_entry_t **te_out, TALLOC_CTX *ctx, radius_track_t *tt, request_t *request, uint8_t code, void *uctx))
 Allocate a tracking entry. More...
 
radius_track_tradius_track_alloc (TALLOC_CTX *ctx)
 Create an radius_track_t. More...
 
radius_track_entry_tradius_track_entry_find (radius_track_t *tt, uint8_t packet_id, uint8_t const *vector))
 Find a tracking entry from a request authenticator. More...
 
int radius_track_entry_update (radius_track_entry_t *te, uint8_t const *vector)
 Update a tracking entry with the authentication vector. More...
 
void radius_track_state_log (fr_log_t const *log, fr_log_type_t log_type, char const *file, int line, radius_track_t *tt, radius_track_log_extra_t extra)
 Print out the state of every tracking entry. More...
 
void radius_track_use_authenticator (radius_track_t *te, bool flag)
 Use Request Authenticator (or not) as an Identifier. More...
 

Data Structure Documentation

◆ radius_track_entry_s

struct radius_track_entry_s

Track one request to a response.

Definition at line 36 of file track.h.

+ Collaboration diagram for radius_track_entry_s:
Data Fields
union radius_track_entry_s __unnamed__
radius_track_entry_t *** binding Binding chunk we use to release the entry when its parent is freed.

We also zero out the tracking entry field in the parent.

uint8_t code packet code (sigh)
char const * file Where the entry was allocated.
uint8_t id our ID
int line Where the entry was freed.
fr_rb_node_t node Entry in the tracking tree.
uint64_t operation Used to give an idea of the alloc/free timeline.
request_t * request as always...
radius_track_t * tt
void * uctx Result/resumption context.

◆ radius_track_entry_s.__unnamed160__

union radius_track_entry_s.__unnamed160__

Definition at line 52 of file track.h.

Data Fields
fr_dlist_t entry For free list.
uint8_t vector[RADIUS_AUTH_VECTOR_LENGTH] copy of the request authenticator.

◆ radius_track_s

struct radius_track_s

Definition at line 64 of file track.h.

+ Collaboration diagram for radius_track_s:
Data Fields
fr_dlist_head_t free_list so we allocate by least recently used
radius_track_entry_t id[UINT8_MAX+1] which ID was used
int next_id next ID to allocate
unsigned int num_requests number of requests in the allocation
uint64_t operation Incremented each alloc and de-alloc.
fr_rb_tree_t * subtree[UINT8_MAX+1] for Original-Request-Authenticator
bool use_authenticator whether to use the request authenticator as an ID

Macro Definition Documentation

◆ radius_track_entry_release

#define radius_track_entry_release (   _te)     _radius_track_entry_release( __FILE__, __LINE__, _te)

Definition at line 95 of file track.h.

◆ radius_track_entry_reserve

#define radius_track_entry_reserve (   _te_out,
  _ctx,
  _tt,
  _request,
  _code,
  _uctx 
)     _radius_track_entry_reserve( __FILE__, __LINE__, _te_out, _ctx, _tt, _request, _code, _uctx)

Definition at line 87 of file track.h.

Typedef Documentation

◆ radius_track_entry_t

Definition at line 1 of file track.h.

◆ radius_track_log_extra_t

typedef void(* radius_track_log_extra_t) (fr_log_t const *log, fr_log_type_t log_type, char const *file, int line, radius_track_entry_t *te)

Definition at line 100 of file track.h.

◆ radius_track_t

Definition at line 1 of file track.h.

Function Documentation

◆ _radius_track_entry_release()

int _radius_track_entry_release ( char const *  file,
int  line,
radius_track_entry_t **  te_to_free 
)

Release a tracking entry.

Parameters
[in]fileAllocation was released in.
[in]lineAllocation was released on.
[in,out]te_to_freeThe radius_track_entry_t allocated via radius_track_entry_reserve.
Returns
  • <0 on error
  • 0 on success

Definition at line 209 of file track.c.

+ Here is the call graph for this function:

◆ _radius_track_entry_reserve()

int _radius_track_entry_reserve ( char const *  file,
int  line,
radius_track_entry_t **  te_out,
TALLOC_CTX *  ctx,
radius_track_t tt,
request_t request,
uint8_t  code,
void *  uctx 
)

Allocate a tracking entry.

Parameters
[in]fileThe allocation was made in.
[in]lineThe allocation was made on.
[out]te_outWhere the tracking entry should be written. If ctx is not-null, then this pointer must remain valid for the lifetime of the ctx.
[in]ctxIf not-null, the tracking entry release will be bound to the lifetime of the talloc chunk.
[in]ttThe radius_track_t tracking table.
[in]requestThe request which will send the proxied packet.
[in]codeOf the outbound request.
[in]uctxThe context to associate with the request
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 109 of file track.c.

+ Here is the call graph for this function:

◆ radius_track_alloc()

radius_track_t* radius_track_alloc ( TALLOC_CTX *  ctx)

Create an radius_track_t.

Parameters
ctxthe talloc ctx
Returns
  • NULL on error
  • radius_track_t on success

Definition at line 42 of file track.c.

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

◆ radius_track_entry_find()

radius_track_entry_t* radius_track_entry_find ( radius_track_t tt,
uint8_t  packet_id,
uint8_t const *  vector 
)

Find a tracking entry from a request authenticator.

Parameters
ttThe radius_track_t tracking table
packet_idThe ID from the RADIUS header
vectorThe Request Authenticator (may be NULL)
Returns
  • NULL on "not found"
  • radius_track_entry_t on success

Definition at line 338 of file track.c.

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

◆ radius_track_entry_update()

int radius_track_entry_update ( radius_track_entry_t te,
uint8_t const *  vector 
)

Update a tracking entry with the authentication vector.

Parameters
teThe radius_track_entry_t, via radius_track_entry_reserve()
vectorThe authentication vector for the packet we're sending
Returns
  • <0 on error
  • 0 on success

Definition at line 293 of file track.c.

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

◆ radius_track_state_log()

void radius_track_state_log ( fr_log_t const *  log,
fr_log_type_t  log_type,
char const *  file,
int  line,
radius_track_t tt,
radius_track_log_extra_t  extra 
)

Print out the state of every tracking entry.

Parameters
[in]logdestination.
[in]log_typeType of log message.
[in]filethis function was called in.
[in]linethis function was called on.
[in]ttTable to print.
[in]extraCallback function for printing extra detail.

Definition at line 425 of file track.c.

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

◆ radius_track_use_authenticator()

void radius_track_use_authenticator ( radius_track_t tt,
bool  flag 
)

Use Request Authenticator (or not) as an Identifier.

Parameters
ttThe radius_track_t tracking table
flagWhether or not to use it.

Definition at line 408 of file track.c.