28 RCSID(
"$Id: 6135eef1544f1f564159c0274dbfdaa6ed66cde6 $")
30 #include <freeradius-devel/util/conf.h>
31 #include <freeradius-devel/util/syserror.h>
32 #include <freeradius-devel/util/atexit.h>
33 #include <freeradius-devel/util/pair_legacy.h>
34 #include <freeradius-devel/util/time.h>
35 #include <freeradius-devel/util/event.h>
36 #include <freeradius-devel/server/packet.h>
37 #include <freeradius-devel/radius/list.h>
38 #include <freeradius-devel/radius/radius.h>
39 #include <freeradius-devel/util/chap.h>
40 #include <freeradius-devel/radius/client.h>
42 #ifdef HAVE_OPENSSL_SSL_H
43 #include <openssl/ssl.h>
60 #define pair_update_request(_attr, _da) do { \
61 _attr = fr_pair_find_by_da(&request->request_pairs, NULL, _da); \
63 _attr = fr_pair_afrom_da(request, _da); \
64 fr_assert(_attr != NULL); \
65 fr_pair_append(&request->request_pairs, _attr); \
149 fprintf(stderr,
"Usage: radclient [options] server[:port] <command> [<secret>]\n");
151 fprintf(stderr,
" <command> One of auth, acct, status, coa, disconnect or auto.\n");
152 fprintf(stderr,
" -4 Use IPv4 address of server\n");
153 fprintf(stderr,
" -6 Use IPv6 address of server.\n");
154 fprintf(stderr,
" -C [<client_ip>:]<client_port> Client source port and source IP address. Port values may be 1..65535\n");
155 fprintf(stderr,
" -c <count> Send each packet 'count' times.\n");
156 fprintf(stderr,
" -d <raddb> Set user dictionary directory (defaults to " RADDBDIR
").\n");
157 fprintf(stderr,
" -D <dictdir> Set main dictionary directory (defaults to " DICTDIR
").\n");
158 fprintf(stderr,
" -f <file>[:<file>] Read packets from file, not stdin.\n");
159 fprintf(stderr,
" If a second file is provided, it will be used to verify responses\n");
160 fprintf(stderr,
" -F Print the file name, packet number and reply code.\n");
161 fprintf(stderr,
" -h Print usage help information.\n");
162 fprintf(stderr,
" -i <id> Set request id to 'id'. Values may be 0..255\n");
163 fprintf(stderr,
" -p <num> Send 'num' packets from a file in parallel.\n");
164 fprintf(stderr,
" -P <proto> Use proto (tcp or udp) for transport.\n");
165 fprintf(stderr,
" -r <retries> If timeout, retry sending the packet 'retries' times.\n");
166 fprintf(stderr,
" -s Print out summary information of auth results.\n");
167 fprintf(stderr,
" -S <file> read secret from file, not command line.\n");
168 fprintf(stderr,
" -t <timeout> Wait 'timeout' seconds before retrying (may be a floating point number).\n");
169 fprintf(stderr,
" -v Show program version information.\n");
170 fprintf(stderr,
" -x Debugging mode.\n");
190 #if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x30000000L
191 # include <openssl/provider.h>
193 static OSSL_PROVIDER *openssl_default_provider = NULL;
194 static OSSL_PROVIDER *openssl_legacy_provider = NULL;
201 openssl_default_provider = OSSL_PROVIDER_load(NULL,
"default");
202 if (!openssl_default_provider) {
203 ERROR(
"(TLS) Failed loading default provider");
212 openssl_legacy_provider = OSSL_PROVIDER_load(NULL,
"legacy");
213 if (!openssl_legacy_provider) {
214 ERROR(
"(TLS) Failed loading legacy provider");
223 if (openssl_default_provider && !OSSL_PROVIDER_unload(openssl_default_provider)) {
224 ERROR(
"Failed unloading default provider");
226 openssl_default_provider = NULL;
228 if (openssl_legacy_provider && !OSSL_PROVIDER_unload(openssl_legacy_provider)) {
229 ERROR(
"Failed unloading legacy provider");
231 openssl_legacy_provider = NULL;
234 #define openssl3_init()
235 #define openssl3_free()
250 char const *password)
267 for (i = 0; i < challenge->vp_length; i++) {
289 svp = getservbyname(
name,
"udp");
292 return ntohs(svp->s_port);
305 if (*port == 0) *port =
getport(
"radius");
310 if (*port == 0) *port =
getport(
"radacct");
323 if (*port == 0) *port = 0;
365 for (i = 0; i <
vp->vp_length; i++) {
366 if (
vp->vp_octets[i] < 32) {
380 FILE *packets, *filters = NULL;
384 bool packets_done =
false;
392 if (strcmp(files->
packets,
"-") != 0) {
393 packets = fopen(files->
packets,
"r");
403 filters = fopen(files->
filters,
"r");
428 request->
files = files;
430 request->
num = num++;
449 REDEBUG(
"Error parsing \"%s\"", input);
457 WARN(
"Skipping \"%s\": No Attributes", files->
packets);
469 &request->
filter, filters, &filters_done) < 0) {
474 if (filters_done && !packets_done) {
475 REDEBUG(
"Differing number of packets/filters in %s:%s "
480 if (!filters_done && packets_done) {
481 REDEBUG(
"Differing number of packets/filters in %s:%s "
539 request->
name =
vp->vp_strvalue;
587 REDEBUG(
"Packet-Type must be defined,"
588 "or a well known RADIUS port");
592 REDEBUG(
"Can't determine expected &reply.Packet-Type for Packet-Type %i",
622 REDEBUG(
"Can't determine expected Packet-Type for &reply.Packet-Type %i",
633 REDEBUG(
"Can't determine destination port");
668 }
while (!packets_done);
670 if (packets != stdin) fclose(packets);
671 if (filters) fclose(filters);
681 if (packets != stdin) fclose(packets);
682 if (filters) fclose(filters);
703 ERROR(
"No server was given, and request %" PRIu64
" in file %s did not contain "
712 ERROR(
"Request was \"auto\", and request %" PRIu64
" in file %s did not contain Packet-Type",
735 #ifdef STATIC_ANALYZER
763 vector = challenge->vp_octets;
778 DEBUG(
"WARNING: No password in the request");
823 int fd_errno,
UNUSED void *uctx)
862 switch (reply->
code) {
902 RDEBUG(
"%s: Response passed filter", request->
name);
906 REDEBUG(
"%s: Response for failed filter", request->
name);
923 if (!request->
done) {
1019 int ret = EXIT_SUCCESS;
1021 char const *raddb_dir = RADDBDIR;
1022 char const *dict_dir = DICTDIR;
1024 char filesecret[256];
1026 int do_summary =
false;
1053 talloc_set_log_stderr();
1071 .socket_type = SOCK_DGRAM,
1097 .require_message_authenticator =
false,
1108 while ((c = getopt(argc, argv,
"46c:C:d:D:f:Fi:hp:P:r:sS:t:vx")) != -1)
switch (c) {
1129 if (strchr(optarg,
':')) {
1131 optarg, -1, AF_UNSPEC,
true,
false) < 0) {
1132 fr_perror(
"Failed parsing source address");
1139 if (tmp < 1 || tmp > 65535)
usage();
1168 p = strchr(optarg, c);
1171 p = strchr(optarg, c);
1177 MEM(files->
packets = talloc_strndup(files, optarg, p - optarg));
1189 if (!isdigit((
uint8_t) *optarg))
1205 parallel = strtoul(optarg, &end, 10);
1211 if (!strcmp(optarg,
"tcp")) {
1214 }
else if (!strcmp(optarg,
"udp")) {
1235 fp = fopen(optarg,
"r");
1240 if (fgets(filesecret,
sizeof(filesecret), fp) == NULL) {
1247 p = filesecret + strlen(filesecret) - 1;
1248 while ((p >= filesecret) &&
1254 if (strlen(filesecret) < 2) {
1255 ERROR(
"Secret in %s is too short", optarg);
1266 fr_perror(
"Failed parsing timeout value");
1285 argc -= (optind - 1);
1286 argv += (optind - 1);
1288 if ((argc < 3) || ((
secret == NULL) && (argc < 4))) {
1289 ERROR(
"Insufficient arguments");
1296 if (!isdigit((
uint8_t) argv[2][0])) {
1299 ERROR(
"Unrecognised request type \"%s\"", argv[2]);
1326 if (strcmp(argv[1],
"-") != 0) {
1381 "Failed to initialize the dictionaries");
1417 ERROR(
"Failed parsing input files");
1426 ERROR(
"Nothing to send");
1520 "\tAccepted : %" PRIu64
"\n"
1521 "\tRejected : %" PRIu64
"\n"
1522 "\tLost : %" PRIu64
"\n"
1523 "\tPassed filter : %" PRIu64
"\n"
1524 "\tFailed filter : %" PRIu64,
static int const char char buffer[256]
int fr_atexit_global_setup(void)
Setup the atexit handler, should be called at the start of a program's execution.
int fr_atexit_global_trigger_all(void)
Cause all global free triggers to fire.
static int fr_bio_packet_read(fr_bio_packet_t *bio, void **request_ctx_p, fr_packet_t **packet_p, TALLOC_CTX *out_ctx, fr_pair_list_t *out)
Read a packet from a packet BIO.
static int fr_bio_packet_write(fr_bio_packet_t *bio, void *request_ctx, fr_packet_t *packet, fr_pair_list_t *list)
Write a packet to a packet BIO.
fr_retry_config_t retry_config
base retry config
fr_event_list_t * el
event list
#define NEVER_RETURNS
Should be placed before the function return type.
void fr_chap_encode(uint8_t out[static 1+FR_CHAP_CHALLENGE_LENGTH], uint8_t id, uint8_t const *challenge, size_t challenge_len, char const *password, size_t password_len)
Encode a CHAP password.
int fr_fault_setup(TALLOC_CTX *ctx, char const *cmd, char const *program)
Registers signal handlers to execute panic_action on fatal signal.
#define fr_exit_now(_x)
Exit without calling atexit() handlers, producing a log message in debug builds.
fr_radius_packet_code_t
RADIUS packet codes.
@ FR_RADIUS_CODE_ACCESS_CHALLENGE
RFC2865 - Access-Challenge.
@ FR_RADIUS_CODE_ACCESS_REQUEST
RFC2865 - Access-Request.
@ FR_RADIUS_CODE_DISCONNECT_REQUEST
RFC3575/RFC5176 - Disconnect-Request.
@ FR_RADIUS_CODE_MAX
Maximum possible protocol code.
@ FR_RADIUS_CODE_DISCONNECT_ACK
RFC3575/RFC5176 - Disconnect-Ack (positive)
@ FR_RADIUS_CODE_STATUS_SERVER
RFC2865/RFC5997 - Status Server (request)
@ FR_RADIUS_CODE_COA_REQUEST
RFC3575/RFC5176 - CoA-Request.
@ FR_RADIUS_CODE_ACCESS_ACCEPT
RFC2865 - Access-Accept.
@ FR_RADIUS_CODE_ACCOUNTING_RESPONSE
RFC2866 - Accounting-Response.
@ FR_RADIUS_CODE_COA_NAK
RFC3575/RFC5176 - CoA-Nak (not willing to perform)
@ FR_RADIUS_CODE_UNDEFINED
Packet code has not been set.
@ FR_RADIUS_CODE_COA_ACK
RFC3575/RFC5176 - CoA-Ack (positive)
@ FR_RADIUS_CODE_DISCONNECT_NAK
RFC3575/RFC5176 - Disconnect-Nak (not willing to perform)
@ FR_RADIUS_CODE_ACCOUNTING_REQUEST
RFC2866 - Accounting-Request.
@ FR_RADIUS_CODE_ACCESS_REJECT
RFC2865 - Access-Reject.
#define FR_ACCT_UDP_PORT_ALT
#define FR_AUTH_UDP_PORT_ALT
static fr_time_delta_t timeout
#define fr_dict_autofree(_to_free)
fr_dict_attr_t const ** out
Where to write a pointer to the resolved fr_dict_attr_t.
fr_dict_t const ** out
Where to write a pointer to the loaded/resolved fr_dict_t.
int fr_dict_attr_autoload(fr_dict_attr_autoload_t const *to_load)
Process a dict_attr_autoload element to load/verify a dictionary attribute.
fr_dict_t * fr_dict_unconst(fr_dict_t const *dict)
Coerce to non-const.
#define fr_dict_autoload(_to_load)
int fr_dict_read(fr_dict_t *dict, char const *dict_dir, char const *filename)
Read supplementary attribute definitions into an existing dictionary.
fr_dict_gctx_t * fr_dict_global_ctx_init(TALLOC_CTX *ctx, bool free_at_exit, char const *dict_dir)
Initialise the global protocol hashes.
Specifies an attribute which must be present for the module to function.
Specifies a dictionary which must be loaded/loadable for the module to function.
#define fr_dlist_foreach(_list_head, _type, _iter)
Iterate over the contents of a list.
static void * fr_dlist_next(fr_dlist_head_t const *list_head, void const *ptr)
Get the next item in a list.
static void fr_dlist_talloc_free(fr_dlist_head_t *head)
Free all items in a doubly linked list (with talloc)
static unsigned int fr_dlist_num_elements(fr_dlist_head_t const *head)
Return the number of elements in the dlist.
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 int fr_dlist_insert_tail(fr_dlist_head_t *list_head, void *ptr)
Insert an item into the tail of a list.
static void * fr_dlist_remove(fr_dlist_head_t *list_head, void *ptr)
Remove an item from the list.
static void * fr_dlist_prev(fr_dlist_head_t const *list_head, void const *ptr)
Get the previous item in a list.
#define fr_dlist_talloc_init(_head, _type, _field)
Initialise the head structure of a doubly linked list.
Head of a doubly linked list.
#define fr_event_fd_insert(...)
@ FR_EVENT_FILTER_IO
Combined filter for read/write functions/.
#define fr_event_filter_update(...)
#define FR_EVENT_RESUME(_s, _f)
Re-add the filter for a func from kevent.
#define FR_EVENT_SUSPEND(_s, _f)
Temporarily remove the filter for a func from kevent.
Callbacks for the FR_EVENT_FILTER_IO filter.
Structure describing a modification to a filter's state.
fr_bio_fd_info_t const * fr_bio_fd_info(fr_bio_t *bio)
Returns a pointer to the bio-specific information.
fr_socket_t socket
as connected socket
uint16_t src_port
our port
@ FR_BIO_FD_CONNECTED
connected client sockets (UDP or TCP)
fr_ipaddr_t dst_ipaddr
their IP address
fr_bio_fd_type_t type
accept, connected, unconnected, etc.
int socket_type
SOCK_STREAM or SOCK_DGRAM.
uint16_t dst_port
their port
fr_ipaddr_t src_ipaddr
our IP address
Configuration for sockets.
Run-time status of the socket.
int fr_inet_pton_port(fr_ipaddr_t *out, uint16_t *port_out, char const *value, ssize_t inlen, int af, bool resolve, bool mask)
Parses IPv4/6 address + port, to fr_ipaddr_t and integer (port)
char const * fr_bio_strerror(ssize_t error)
int packet_global_init(void)
Initialises the Net.
void fr_packet_pairs_to_packet(fr_packet_t *packet, fr_pair_list_t const *list)
Convert pairs to information in a packet.
void packet_global_free(void)
fr_event_list_t * fr_event_list_alloc(TALLOC_CTX *ctx, fr_event_status_cb_t status, void *status_uctx)
Initialise a new event list.
void fr_event_loop_exit(fr_event_list_t *el, int code)
Signal an event loop exit with the specified code.
int fr_event_fd_delete(fr_event_list_t *el, int fd, fr_event_filter_t filter)
Remove a file descriptor from the event loop.
int fr_event_loop(fr_event_list_t *el)
Run an event loop.
Stores all information relating to an event list.
void fr_log_perror(fr_log_t const *log, fr_log_type_t type, char const *file, int line, fr_log_perror_format_t const *rules, char const *fmt,...)
Drain any outstanding messages from the fr_strerror buffers.
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.
@ L_DST_STDOUT
Log to stdout.
@ L_DBG
Only displayed when debugging is enabled.
fr_packet_t * fr_packet_alloc(TALLOC_CTX *ctx, bool new_vector)
Allocate a new fr_packet_t.
void fr_packet_free(fr_packet_t **packet_p)
Free a fr_packet_t.
@ FR_TYPE_STRING
String of printable characters.
@ FR_TYPE_UINT32
32 Bit unsigned integer.
@ FR_TYPE_OCTETS
Raw octets.
int mschap_nt_password_hash(uint8_t out[static NT_DIGEST_LENGTH], char const *password)
Converts Unicode password to 16-byte NT hash with MD4.
#define RADIUS_AUTH_VECTOR_LENGTH
fr_pair_t * fr_pair_find_by_da(fr_pair_list_t const *list, fr_pair_t const *prev, fr_dict_attr_t const *da)
Find the first pair with a matching da.
fr_pair_t * fr_pair_afrom_da(TALLOC_CTX *ctx, fr_dict_attr_t const *da)
Dynamically allocate a new attribute and assign a fr_dict_attr_t.
int fr_pair_value_memdup(fr_pair_t *vp, uint8_t const *src, size_t len, bool tainted)
Copy data into an "octets" data type.
void fr_pair_validate_debug(fr_pair_t const *failed[2])
Write an error to the library errorbuff detailing the mismatch.
int fr_pair_value_strdup(fr_pair_t *vp, char const *src, bool tainted)
Copy data into an "string" data type.
int fr_pair_append(fr_pair_list_t *list, fr_pair_t *to_add)
Add a VP to the end of the list.
int fr_pair_delete_by_da(fr_pair_list_t *list, fr_dict_attr_t const *da)
Delete matching pairs from the specified list.
fr_pair_t * fr_pair_delete(fr_pair_list_t *list, fr_pair_t *vp)
Remove fr_pair_t from a list and free.
bool fr_pair_validate(fr_pair_t const *failed[2], fr_pair_list_t *filter, fr_pair_list_t *list)
Uses fr_pair_cmp to verify all fr_pair_ts in list match the filter defined by check.
void fr_pair_list_init(fr_pair_list_t *list)
Initialise a pair list header.
int fr_pair_value_bstrndup(fr_pair_t *vp, char const *src, size_t len, bool tainted)
Copy data into a "string" type value pair.
fr_pair_t * fr_pair_find_by_da_nested(fr_pair_list_t const *list, fr_pair_t const *prev, fr_dict_attr_t const *da)
Find a pair with a matching fr_dict_attr_t, by walking the nested fr_dict_attr_t tree.
int8_t fr_pair_cmp_by_da(void const *a, void const *b)
Order attributes by their da, and tag.
int fr_pair_value_memdup_buffer_shallow(fr_pair_t *vp, uint8_t const *src, bool tainted)
Assign a talloced buffer to a "octets" type value pair.
int fr_pair_list_afrom_file(TALLOC_CTX *ctx, fr_dict_t const *dict, fr_pair_list_t *out, FILE *fp, bool *pfiledone)
Read valuepairs from the fp up to End-Of-File.
int fr_radius_global_init(void)
void fr_radius_global_free(void)
fr_table_num_sorted_t const fr_radius_request_name_table[]
char const * fr_radius_packet_name[FR_RADIUS_CODE_MAX]
int fr_radius_allow_reply(int code, bool allowed[static FR_RADIUS_CODE_MAX])
bool allowed[FR_RADIUS_CODE_MAX]
allowed outgoing packet types
fr_radius_bio_verify_t verify
fr_bio_retry_config_t retry_cfg
fr_retry_config_t retry[FR_RADIUS_CODE_MAX]
default retry configuration for each packet type
bool outgoing[FR_RADIUS_CODE_MAX]
allowed outgoing packet types
void fr_radius_packet_log(fr_log_t const *log, fr_packet_t *packet, fr_pair_list_t *list, bool received)
static void client_connect(fr_event_list_t *el, int fd, UNUSED int flags, void *uctx)
static fr_dict_attr_t const * attr_packet_type
static fr_dict_attr_t const * attr_request_authenticator
static int send_one_packet(fr_bio_packet_t *client, rc_request_t *request)
static fr_dict_attr_t const * attr_user_password
static int getport(char const *name)
static char const * radclient_version
static int _rc_request_free(rc_request_t *request)
fr_dict_autoload_t radclient_dict[]
static void client_read(fr_event_list_t *el, int fd, UNUSED int flags, void *uctx)
static int radclient_sane(rc_request_t *request)
static TALLOC_CTX * autofree
static fr_bio_fd_config_t fd_config
static fr_bio_packet_t * client_bio
int main(int argc, char **argv)
static fr_dict_t const * dict_freeradius
static fr_dict_attr_t const * attr_chap_password
static fr_radius_client_config_t client_config
static fr_radius_client_bio_info_t const * client_info
static fr_dict_attr_t const * attr_ms_chap_response
static fr_event_update_t const resume_write[]
static fr_dict_t const * dict_radius
static fr_dict_attr_t const * attr_ms_chap_challenge
static fr_dict_attr_t const * attr_chap_challenge
static int _loop_status(UNUSED fr_time_t now, fr_time_delta_t wake, UNUSED void *ctx)
fr_dict_attr_autoload_t radclient_dict_attr[]
static fr_dict_attr_t const * attr_cleartext_password
static bool print_filename
static fr_dict_attr_t const * attr_radclient_test_name
static rc_request_t * current
static int radclient_init(TALLOC_CTX *ctx, rc_file_pair_t *files)
static int mschapv1_encode(fr_packet_t *packet, fr_pair_list_t *list, char const *password)
static bool already_hex(fr_pair_t *vp)
static fr_dict_attr_t const * attr_user_name
static void client_write(fr_event_list_t *el, int fd, UNUSED int flags, void *uctx)
static fr_dlist_head_t rc_request_list
static fr_bio_fd_info_t const * fd_info
static void radclient_get_port(fr_radius_packet_code_t type, uint16_t *port)
static fr_dict_attr_t const * attr_ms_chap_password
#define pair_update_request(_attr, _da)
static NEVER_RETURNS void client_error(UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED int flags, int fd_errno, UNUSED void *uctx)
static fr_event_update_t const pause_write[]
static NEVER_RETURNS void usage(void)
static fr_radius_packet_code_t radclient_get_code(uint16_t port)
Structures for the radclient utility.
uint64_t num
The number (within the file) of the request were reading.
fr_pair_t * password
Password.Cleartext.
uint64_t accepted
Requests to which we received a accept.
fr_packet_t * reply
The incoming response.
fr_pair_list_t request_pairs
uint64_t rejected
Requests to which we received a reject.
char const * packets
The file containing the request packet.
uint64_t lost
Requests to which we received no response.
bool done
Whether the request is complete.
fr_pair_list_t filter
If the reply passes the filter, then the request passes.
uint64_t failed
Requests which failed a filter.
fr_pair_list_t reply_pairs
uint64_t passed
Requests which passed a filter.
fr_radius_packet_code_t filter_code
Expected code of the response packet.
char const * name
Test name (as specified in the request).
char const * filters
The file containing the definition of the packet we want to match.
fr_packet_t * packet
The outgoing request.
rc_file_pair_t * files
Request and response file names.
#define RADIUS_MAX_ATTRIBUTES
#define FR_RADIUS_PACKET_CODE_VALID(_x)
uint32_t fr_rand(void)
Return a 32-bit random number.
void fr_rand_buffer(void *start, size_t length)
fr_packet_t * packet
Incoming request.
fr_packet_t * reply
Outgoing response.
#define reply_pairs
Convenience macro for accessing the reply list.
void smbdes_mschap(uint8_t const win_password[16], uint8_t const *challenge, uint8_t *response)
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)
fr_bio_t * fr_radius_client_bio_get_fd(fr_bio_packet_t *bio)
int fr_radius_client_fd_bio_cancel(fr_bio_packet_t *bio, fr_packet_t *packet)
Cancel one packet.
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)
int fr_radius_client_bio_connect(fr_bio_packet_t *bio)
Try to connect a socket.
MEM(pair_append_request(&vp, attr_eap_aka_sim_identity) >=0)
fr_aka_sim_id_type_t type
#define fr_time()
Allow us to arbitrarily manipulate time.
fr_log_dst_t dst
Log destination.
int fd
File descriptor to write messages to.
bool print_level
sometimes we don't want log levels printed
Stores an attribute, a value and various bits of other data.
fr_dict_attr_t const *_CONST da
Dictionary attribute defines the attribute number, vendor and type of the pair.
char const * fr_syserror(int num)
Guaranteed to be thread-safe version of strerror.
#define fr_table_value_by_str(_table, _name, _def)
Convert a string to a value using a sorted or ordered table.
#define talloc_autofree_context
The original function is deprecated, so replace it with our version.
fr_slen_t fr_time_delta_from_str(fr_time_delta_t *out, char const *in, size_t inlen, fr_time_res_t hint)
Create fr_time_delta_t from a string.
static int64_t fr_time_delta_unwrap(fr_time_delta_t time)
static fr_time_delta_t fr_time_delta_from_sec(int64_t sec)
A time delta, a difference in time measured in nanoseconds.
static fr_event_list_t * el
#define FR_DICTIONARY_FILE
unsigned int code
Packet code (type).
fr_socket_t socket
This packet was received on.
int id
Packet ID (used to link requests/responses).
uint8_t * data
Packet data (body).
uint8_t vector[RADIUS_AUTH_VECTOR_LENGTH]
RADIUS authentication vector.
fr_pair_t * fr_pair_list_head(fr_pair_list_t const *list)
Get the head of a valuepair list.
bool fr_pair_list_empty(fr_pair_list_t const *list)
Is a valuepair list empty.
fr_pair_t * fr_pair_list_next(fr_pair_list_t const *list, fr_pair_t const *item))
Get the next item in a valuepair list after a specific entry.
void fr_pair_list_sort(fr_pair_list_t *list, fr_cmp_t cmp)
Sort a doubly linked list of fr_pair_ts using merge sort.
fr_time_delta_t irt
Initial transmission time.
int af
AF_INET, AF_INET6, or AF_UNIX.
int fd
File descriptor if this is a live socket.
void fr_perror(char const *fmt,...)
Print the current error to stderr with a prefix.
void fr_strerror_clear(void)
Clears all pending messages from the talloc pools.
char const * fr_strerror(void)
Get the last library error.
int fr_check_lib_magic(uint64_t magic)
Check if the application linking to the library has the correct magic number.
#define RADIUSD_VERSION_BUILD(_x)
Create a version string for a utility in the suite of FreeRADIUS utilities.
#define RADIUSD_MAGIC_NUMBER
#define fr_box_time_delta(_val)