The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions
track.c File Reference

Tracking RADUS client packets. More...

#include <freeradius-devel/server/base.h>
#include <freeradius-devel/util/rb.h>
#include <freeradius-devel/io/application.h>
#include <freeradius-devel/util/dlist.h>
#include <freeradius-devel/util/debug.h>
#include "track.h"
#include "rlm_radius.h"
+ Include dependency graph for track.c:

Go to the source code of this file.

Functions

int _radius_track_entry_release (char const *file, int line, radius_track_entry_t **te_to_free)
 Release a tracking entry. More...
 
static int _radius_track_entry_release_on_free (radius_track_entry_t ***te_p)
 Ensures the entry is released when the ctx passed to radius_track_entry_reserve is freed. 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 *tt, bool flag)
 Use Request Authenticator (or not) as an Identifier. More...
 
static int8_t te_cmp (void const *one, void const *two)
 Compare two radius_track_entry_t. More...
 

Detailed Description

Tracking RADUS client packets.

Id
80a69d6923beb24d2eb02f2eee7f3813bd8cedf4

Definition in file track.c.

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_release_on_free()

static int _radius_track_entry_release_on_free ( radius_track_entry_t ***  te_p)
static

Ensures the entry is released when the ctx passed to radius_track_entry_reserve is freed.

Parameters
[in]te_pEntry to release.
Returns
0

Definition at line 84 of file track.c.

+ Here is the caller 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.

◆ te_cmp()

static int8_t te_cmp ( void const *  one,
void const *  two 
)
static

Compare two radius_track_entry_t.

Definition at line 69 of file track.c.

+ Here is the caller graph for this function: