25 RCSID(
"$Id: f753e259b5d9826882fc06effa42bff7bdd8ca74 $")
27 #include <freeradius-devel/bio/packet.h>
28 #include <freeradius-devel/radius/server_udp.h>
29 #include <freeradius-devel/radius/server_priv.h>
54 dedup_ctx->
uctx = ctx;
55 ctx->
dedup = dedup_ctx;
86 if (rcode < 0)
return rcode;
112 if (!
my)
return NULL;
125 if (!
my->dedup)
goto fail;
126 my->dedup->uctx =
my;
128 my->common.bio =
my->dedup;
void * uctx
user ctx, caller can manually set it.
fr_bio_t * fr_bio_dedup_alloc(TALLOC_CTX *ctx, size_t max_saved, fr_bio_dedup_receive_t receive, fr_bio_dedup_release_t release, fr_bio_dedup_get_item_t get_item, fr_bio_dedup_config_t const *cfg, fr_bio_t *next)
Allocate a fr_bio_dedup_t.
void * uctx
user-writable context
size_t packet_size
size of the cached packet data
uint8_t * packet
cached packet data for finding duplicates
fr_bio_dedup_release_reason_t
Configuration for sockets.
int fr_bio_mem_set_verify(fr_bio_t *bio, fr_bio_verify_t verify, void *verify_ctx, bool datagram)
Set the verification function for memory bios.
fr_bio_verify_action_t fr_radius_bio_verify_datagram(UNUSED fr_bio_t *bio, void *verify_ctx, UNUSED void *packet_ctx, const void *data, size_t *size)
And verify a datagram packet.
bool fr_rb_insert(fr_rb_tree_t *tree, void const *data)
bool fr_rb_delete(fr_rb_tree_t *tree, void const *data)
void * fr_rb_find(fr_rb_tree_t const *tree, void const *data)
int fr_radius_server_fd_bio_read(fr_bio_packet_t *bio, UNUSED void **packet_ctx_p, fr_packet_t **packet_p, TALLOC_CTX *out_ctx, fr_pair_list_t *out)
fr_radius_server_fd_bio_t * fr_radius_server_fd_bio_alloc(TALLOC_CTX *ctx, size_t read_size, fr_radius_server_config_t *cfg, fr_bio_fd_config_t const *fd_cfg)
int fr_radius_server_fd_bio_write(fr_bio_packet_t *bio, UNUSED void *pctx, fr_packet_t *reply, fr_pair_list_t *list)
fr_bio_dedup_entry_t * dedup
fr_bio_dedup_config_t dedup_cfg
static bool radius_server_dedup_receive(fr_bio_t *bio, fr_bio_dedup_entry_t *dedup_ctx, void *packet_ctx)
static fr_bio_dedup_entry_t * radius_server_dedup_get_item(UNUSED fr_bio_t *bio, void *packet_ctx)
fr_bio_packet_t * fr_radius_server_udp_bio_alloc(TALLOC_CTX *ctx, fr_radius_server_config_t *cfg, fr_bio_fd_config_t const *fd_cfg)
Allocate a RADIUS bio for receiving packets from clients.
static void radius_server_dedup_release(fr_bio_t *bio, fr_bio_dedup_entry_t *dedup_ctx, UNUSED fr_bio_dedup_release_reason_t reason)
static int fr_radius_server_udp_bio_read(fr_bio_packet_t *bio, void **packet_ctx_p, fr_packet_t **packet_p, TALLOC_CTX *out_ctx, fr_pair_list_t *out)
static size_t char ** out