24RCSID(
"$Id: b4d71316d4d7c0fb95f076d150c985048c850f39 $")
26#include <freeradius-devel/server/base.h>
27#include <freeradius-devel/util/rb.h>
28#include <freeradius-devel/io/application.h>
29#include <freeradius-devel/util/dlist.h>
30#include <freeradius-devel/util/debug.h>
50 for (i = 0; i < 256; i++) {
119 if (te != &tt->
id[te->
id]) {
184 talloc_set_destructor(te->
binding, NULL);
227 memcpy(te->vector, vector,
sizeof(te->vector));
257 te = &tt->
id[packet_id];
264 if (!vector)
return te;
274 if (memcmp(te->vector, vector,
sizeof(te->vector)) != 0)
return NULL;
306 "[%zu] %"PRIu64
" - Allocated at %s:%u to request %p (%s), uctx %p",
311 "[%zu] %"PRIu64
" - Freed at %s:%u",
315 if (extra) extra(log, log_type,
file,
line, entry);
#define fr_cond_assert_msg(_x, _fmt,...)
Calls panic_action ifndef NDEBUG, else logs error and evaluates to value of _x.
#define fr_dlist_init(_head, _type, _field)
Initialise the head structure of a doubly linked list.
static void * fr_dlist_head(fr_dlist_head_t const *list_head)
Return the HEAD item of a list or NULL if the list is empty.
static void * fr_dlist_remove(fr_dlist_head_t *list_head, void *ptr)
Remove an item from the list.
static int fr_dlist_insert_tail(fr_dlist_head_t *list_head, void *ptr)
Insert an item into the tail of a list.
void fr_log(fr_log_t const *log, fr_log_type_t type, char const *file, int line, char const *fmt,...)
Send a server log message to its destination.
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.
int radius_track_entry_update(radius_track_entry_t *te, uint8_t const *vector)
Update a tracking entry with the authentication vector.
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.
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.
int _radius_track_entry_release(char const *file, int line, radius_track_entry_t **te_to_free)
Release a tracking entry.
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.
radius_track_t * radius_track_alloc(TALLOC_CTX *ctx)
Create an radius_track_t.
char const * file
Where the entry was allocated.
fr_dlist_head_t free_list
so we allocate by least recently used
#define radius_track_entry_release(_te)
void * uctx
Result/resumption context.
int line
Where the entry was freed.
uint64_t operation
Incremented each alloc and de-alloc.
unsigned int num_requests
number of requests in the allocation
uint8_t code
packet code (sigh)
radius_track_entry_t id[UINT8_MAX+1]
which ID was used
#define radius_track_entry_reserve(_te_out, _ctx, _tt, _request, _code, _uctx)
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)
uint64_t operation
Used to give an idea of the alloc/free timeline.
request_t * request
as always...
radius_track_entry_t *** binding
Binding chunk we use to release the entry when its parent is freed.
Track one request to a response.
#define fr_strerror_const(_msg)