The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Functions | Variables
client.c File Reference

Functions to support RADIUS bio handlers for client sockets. More...

#include <freeradius-devel/radius/client.h>
#include <freeradius-devel/radius/client_udp.h>
#include <freeradius-devel/radius/client_tcp.h>
#include <freeradius-devel/radius/client_priv.h>
#include <freeradius-devel/protocol/radius/rfc2865.h>
#include <freeradius-devel/protocol/radius/rfc2866.h>
+ Include dependency graph for client.c:

Go to the source code of this file.

Data Structures

struct  fr_radius_client_bio_retry_t
 

Functions

static int _radius_client_fd_bio_free (fr_radius_client_fd_bio_t *my)
 
fr_bio_packet_tfr_radius_client_bio_alloc (TALLOC_CTX *ctx, fr_radius_client_config_t *cfg, fr_bio_fd_config_t const *fd_cfg)
 
void fr_radius_client_bio_connect (NDEBUG_UNUSED fr_event_list_t *el, NDEBUG_UNUSED int fd, UNUSED int flags, void *uctx)
 
static void fr_radius_client_bio_connect_timer (fr_event_list_t *el, fr_time_t now, void *uctx)
 
static void fr_radius_client_bio_connect_timer (NDEBUG_UNUSED fr_event_list_t *el, UNUSED fr_time_t now, void *uctx)
 We failed to connect in the given timeout, the connection is dead. More...
 
int fr_radius_client_bio_force_id (fr_bio_packet_t *bio, int code, int id)
 
fr_radius_client_bio_info_t const * fr_radius_client_bio_info (fr_bio_packet_t *bio)
 
size_t fr_radius_client_bio_outstanding (fr_bio_packet_t *bio)
 
fr_radius_client_fd_bio_tfr_radius_client_fd_bio_alloc (TALLOC_CTX *ctx, size_t read_size, fr_radius_client_config_t *cfg, fr_bio_fd_config_t const *fd_cfg)
 
int fr_radius_client_fd_bio_cancel (fr_bio_packet_t *bio, fr_packet_t *packet)
 Cancel one packet. More...
 
int fr_radius_client_fd_bio_read (fr_bio_packet_t *bio, void **pctx_p, fr_packet_t **packet_p, UNUSED TALLOC_CTX *out_ctx, fr_pair_list_t *out)
 
int fr_radius_client_fd_bio_write (fr_radius_client_fd_bio_t *my, void *pctx, fr_packet_t *packet, fr_pair_list_t *list)
 
static ssize_t radius_client_retry (fr_bio_t *bio, fr_bio_retry_entry_t *retry_ctx, UNUSED const void *buffer, NDEBUG_UNUSED size_t size)
 
static void radius_client_retry_release (fr_bio_t *bio, fr_bio_retry_entry_t *retry_ctx, fr_bio_retry_release_reason_t reason)
 
static void radius_client_retry_release (fr_bio_t *bio, fr_bio_retry_entry_t *retry_ctx, UNUSED fr_bio_retry_release_reason_t reason)
 
static bool radius_client_retry_response (fr_bio_t *bio, fr_bio_retry_entry_t **retry_ctx_p, UNUSED void *packet_ctx, const void *buffer, UNUSED size_t size)
 
static bool radius_client_retry_response (fr_bio_t *bio, fr_bio_retry_entry_t **retry_ctx_p, void *packet_ctx, const void *buffer, UNUSED size_t size)
 
static void radius_client_retry_sent (fr_bio_t *bio, void *packet_ctx, const void *buffer, size_t size, fr_bio_retry_entry_t *retry_ctx)
 
static void radius_client_retry_sent (fr_bio_t *bio, void *packet_ctx, const void *buffer, UNUSED size_t size, fr_bio_retry_entry_t *retry_ctx)
 
static ssize_t radius_client_rewrite_acct (fr_bio_t *bio, fr_bio_retry_entry_t *retry_ctx, UNUSED const void *buffer, NDEBUG_UNUSED size_t size)
 

Variables

static const fr_radius_packet_code_t allowed_replies [FR_RADIUS_CODE_MAX]
 

Detailed Description

Functions to support RADIUS bio handlers for client sockets.

Id
7f8aab3f8a75c54077bed48ae18e2d3647dc3f3f

Definition in file client.c.


Data Structure Documentation

◆ fr_radius_client_bio_retry_t

struct fr_radius_client_bio_retry_t

Definition at line 35 of file client.c.

Data Fields
uint32_t initial initial value
size_t offset offset to Acct-Delay-Time value
uint32_t start Unix time we started sending this packet.

Function Documentation

◆ _radius_client_fd_bio_free()

static int _radius_client_fd_bio_free ( fr_radius_client_fd_bio_t my)
static

Definition at line 64 of file client.c.

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

◆ fr_radius_client_bio_alloc()

fr_bio_packet_t* fr_radius_client_bio_alloc ( TALLOC_CTX *  ctx,
fr_radius_client_config_t cfg,
fr_bio_fd_config_t const *  fd_cfg 
)

Definition at line 50 of file client.c.

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

◆ fr_radius_client_bio_connect()

void fr_radius_client_bio_connect ( NDEBUG_UNUSED fr_event_list_t el,
NDEBUG_UNUSED int  fd,
UNUSED int  flags,
void *  uctx 
)

Definition at line 701 of file client.c.

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

◆ fr_radius_client_bio_connect_timer() [1/2]

static void fr_radius_client_bio_connect_timer ( fr_event_list_t el,
fr_time_t  now,
void *  uctx 
)
static
+ Here is the caller graph for this function:

◆ fr_radius_client_bio_connect_timer() [2/2]

static void fr_radius_client_bio_connect_timer ( NDEBUG_UNUSED fr_event_list_t el,
UNUSED fr_time_t  now,
void *  uctx 
)
static

We failed to connect in the given timeout, the connection is dead.

Definition at line 691 of file client.c.

+ Here is the call graph for this function:

◆ fr_radius_client_bio_force_id()

int fr_radius_client_bio_force_id ( fr_bio_packet_t bio,
int  code,
int  id 
)

Definition at line 671 of file client.c.

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

◆ fr_radius_client_bio_info()

fr_radius_client_bio_info_t const* fr_radius_client_bio_info ( fr_bio_packet_t bio)

Definition at line 663 of file client.c.

+ Here is the caller graph for this function:

◆ fr_radius_client_bio_outstanding()

size_t fr_radius_client_bio_outstanding ( fr_bio_packet_t bio)

Definition at line 651 of file client.c.

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

◆ fr_radius_client_fd_bio_alloc()

fr_radius_client_fd_bio_t* fr_radius_client_fd_bio_alloc ( TALLOC_CTX *  ctx,
size_t  read_size,
fr_radius_client_config_t cfg,
fr_bio_fd_config_t const *  fd_cfg 
)

Definition at line 74 of file client.c.

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

◆ fr_radius_client_fd_bio_cancel()

int fr_radius_client_fd_bio_cancel ( fr_bio_packet_t bio,
fr_packet_t packet 
)

Cancel one packet.

The packet can have a reply, or not. It doesn't matter.

This also frees any IDs associated with the packet.

Definition at line 566 of file client.c.

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

◆ fr_radius_client_fd_bio_read()

int fr_radius_client_fd_bio_read ( fr_bio_packet_t bio,
void **  pctx_p,
fr_packet_t **  packet_p,
UNUSED TALLOC_CTX *  out_ctx,
fr_pair_list_t out 
)

Definition at line 587 of file client.c.

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

◆ fr_radius_client_fd_bio_write()

int fr_radius_client_fd_bio_write ( fr_radius_client_fd_bio_t my,
void *  pctx,
fr_packet_t packet,
fr_pair_list_t list 
)

Definition at line 187 of file client.c.

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

◆ radius_client_retry()

static ssize_t radius_client_retry ( fr_bio_t bio,
fr_bio_retry_entry_t retry_ctx,
UNUSED const void *  buffer,
NDEBUG_UNUSED size_t  size 
)
static

Definition at line 312 of file client.c.

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

◆ radius_client_retry_release() [1/2]

static void radius_client_retry_release ( fr_bio_t bio,
fr_bio_retry_entry_t retry_ctx,
fr_bio_retry_release_reason_t  reason 
)
static

Definition at line 512 of file client.c.

+ Here is the call graph for this function:

◆ radius_client_retry_release() [2/2]

static void radius_client_retry_release ( fr_bio_t bio,
fr_bio_retry_entry_t retry_ctx,
UNUSED fr_bio_retry_release_reason_t  reason 
)
static
+ Here is the caller graph for this function:

◆ radius_client_retry_response() [1/2]

static bool radius_client_retry_response ( fr_bio_t bio,
fr_bio_retry_entry_t **  retry_ctx_p,
UNUSED void *  packet_ctx,
const void *  buffer,
UNUSED size_t  size 
)
static
+ Here is the caller graph for this function:

◆ radius_client_retry_response() [2/2]

static bool radius_client_retry_response ( fr_bio_t bio,
fr_bio_retry_entry_t **  retry_ctx_p,
void *  packet_ctx,
const void *  buffer,
UNUSED size_t  size 
)
static

Definition at line 447 of file client.c.

+ Here is the call graph for this function:

◆ radius_client_retry_sent() [1/2]

static void radius_client_retry_sent ( fr_bio_t bio,
void *  packet_ctx,
const void *  buffer,
size_t  size,
fr_bio_retry_entry_t retry_ctx 
)
static

Definition at line 383 of file client.c.

+ Here is the call graph for this function:

◆ radius_client_retry_sent() [2/2]

static void radius_client_retry_sent ( fr_bio_t bio,
void *  packet_ctx,
const void *  buffer,
UNUSED size_t  size,
fr_bio_retry_entry_t retry_ctx 
)
static
+ Here is the caller graph for this function:

◆ radius_client_rewrite_acct()

static ssize_t radius_client_rewrite_acct ( fr_bio_t bio,
fr_bio_retry_entry_t retry_ctx,
UNUSED const void *  buffer,
NDEBUG_UNUSED size_t  size 
)
static

Definition at line 331 of file client.c.

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

Variable Documentation

◆ allowed_replies

const fr_radius_packet_code_t allowed_replies[FR_RADIUS_CODE_MAX]
static
Initial value:
= {
}
@ FR_RADIUS_CODE_ACCESS_CHALLENGE
RFC2865 - Access-Challenge.
Definition: defs.h:43
@ FR_RADIUS_CODE_ACCESS_REQUEST
RFC2865 - Access-Request.
Definition: defs.h:33
@ FR_RADIUS_CODE_DISCONNECT_REQUEST
RFC3575/RFC5176 - Disconnect-Request.
Definition: defs.h:46
@ FR_RADIUS_CODE_DISCONNECT_ACK
RFC3575/RFC5176 - Disconnect-Ack (positive)
Definition: defs.h:47
@ FR_RADIUS_CODE_COA_REQUEST
RFC3575/RFC5176 - CoA-Request.
Definition: defs.h:49
@ FR_RADIUS_CODE_ACCESS_ACCEPT
RFC2865 - Access-Accept.
Definition: defs.h:34
@ FR_RADIUS_CODE_ACCOUNTING_RESPONSE
RFC2866 - Accounting-Response.
Definition: defs.h:37
@ FR_RADIUS_CODE_COA_NAK
RFC3575/RFC5176 - CoA-Nak (not willing to perform)
Definition: defs.h:51
@ FR_RADIUS_CODE_COA_ACK
RFC3575/RFC5176 - CoA-Ack (positive)
Definition: defs.h:50
@ FR_RADIUS_CODE_DISCONNECT_NAK
RFC3575/RFC5176 - Disconnect-Nak (not willing to perform)
Definition: defs.h:48
@ FR_RADIUS_CODE_PROTOCOL_ERROR
RFC7930 - Protocol-Error (generic NAK)
Definition: defs.h:52
@ FR_RADIUS_CODE_ACCOUNTING_REQUEST
RFC2866 - Accounting-Request.
Definition: defs.h:36
@ FR_RADIUS_CODE_ACCESS_REJECT
RFC2865 - Access-Reject.
Definition: defs.h:35

Definition at line 296 of file client.c.