The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
client.h
Go to the documentation of this file.
1#pragma once
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16 */
17
18/**
19 * $Id: f243bd836c349ab82cea72d09ad4cabee1c2fd95 $
20 *
21 * @file protocols/radius/client.h
22 * @brief RADIUS bio handlers for outgoing RADIUS client sockets
23 *
24 * @copyright 2024 Network RADIUS SAS (legal@networkradius.com)
25 */
26RCSIDH(radius_client_h, "$Id: f243bd836c349ab82cea72d09ad4cabee1c2fd95 $")
27
28#include <freeradius-devel/radius/radius.h>
29#include <freeradius-devel/radius/bio.h>
30#include <freeradius-devel/bio/packet.h>
31#include <freeradius-devel/bio/fd.h>
32#include <freeradius-devel/bio/retry.h>
33
34typedef struct {
37
39
41
43
45
47 uint64_t proxy_state;
48
49 bool outgoing[FR_RADIUS_CODE_MAX]; //!< allowed outgoing packet types
50
51 fr_retry_config_t retry[FR_RADIUS_CODE_MAX]; //!< default retry configuration for each packet type
53
54typedef struct {
56
58
59 size_t outstanding; //!< total number of outstanding packets.
60
61 fr_time_t mrs_time; //!< Most recent sent time which had a reply.
62 fr_time_t last_reply; //!< When we last received a reply.
63 fr_time_t first_sent; //!< first time we sent a packet since going idle
64 fr_time_t last_sent; //!< last time we sent a packet.
65 fr_time_t last_idle; //!< last time we had nothing to do
66
69
71
73
75
77
78int fr_radius_client_bio_force_id(fr_bio_packet_t *bio, int code, int id);
79
80void fr_radius_client_bio_connect(fr_event_list_t *el, int fd, int flags, void *uctx);
#define RCSIDH(h, id)
Definition build.h:484
@ FR_RADIUS_CODE_MAX
Maximum possible protocol code.
Definition defs.h:53
Configuration for sockets.
Definition fd.h:81
Run-time status of the socket.
Definition fd.h:124
Stores all information relating to an event list.
Definition event.c:411
fr_radius_bio_verify_t verify
Definition client.h:38
fr_event_list_t * el
Definition client.h:35
fr_time_t last_reply
When we last received a reply.
Definition client.h:62
size_t outstanding
total number of outstanding packets.
Definition client.h:59
fr_time_t mrs_time
Most recent sent time which had a reply.
Definition client.h:61
int fr_radius_client_fd_bio_cancel(fr_bio_packet_t *bio, fr_packet_t *packet)
Cancel one packet.
Definition client.c:566
fr_time_t last_sent
last time we sent a packet.
Definition client.h:64
fr_bio_retry_info_t const * retry_info
Definition client.h:67
fr_bio_retry_config_t retry_cfg
Definition client.h:40
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 client.c:50
fr_bio_fd_info_t const * fd_info
Definition client.h:57
fr_bio_packet_cb_funcs_t packet_cb_cfg
Definition client.h:42
void fr_radius_client_bio_connect(fr_event_list_t *el, int fd, int flags, void *uctx)
int fr_radius_client_bio_force_id(fr_bio_packet_t *bio, int code, int id)
Definition client.c:671
fr_time_t first_sent
first time we sent a packet since going idle
Definition client.h:63
fr_time_t last_idle
last time we had nothing to do
Definition client.h:65
size_t fr_radius_client_bio_outstanding(fr_bio_packet_t *bio)
Definition client.c:651
fr_time_delta_t connection_timeout
Definition client.h:44
fr_radius_client_bio_info_t const * fr_radius_client_bio_info(fr_bio_packet_t *bio)
Definition client.c:663
Definition log.h:96
A time delta, a difference in time measured in nanoseconds.
Definition time.h:80
"server local" time.
Definition time.h:69
static fr_event_list_t * el
int nonnull(2, 5))