Radcli library 2.0.0
A simple radius library -- legacy API reference
Loading...
Searching...
No Matches
radcli.h
1/*
2 * Copyright (C) 1995,1996,1997,1998 Lars Fenneberg
3 *
4 * Copyright 1992 Livingston Enterprises, Inc.
5 *
6 * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan
7 * and Merit Network, Inc. All Rights Reserved
8 *
9 * See the file COPYRIGHT for the respective terms and conditions.
10 * If the file is missing contact me at lf@elemental.net
11 * and I'll send you a copy.
12 *
13 */
14
18
19#ifndef RADCLI_H
20#define RADCLI_H
21
22#ifndef RADCLI_SUPPRESS_LEGACY_WARNING
23#warning "radcli.h/-lradcli is the legacy, frozen API. New code should use \
24<radcli/radcli2.h> (-lradcli2). See https://radcli.github.io/radcli/ for \
25the new API's documentation, or define RADCLI_SUPPRESS_LEGACY_WARNING to \
26silence this warning."
27#endif
28
29#include <sys/types.h>
30/*
31 * Include for C99 uintX_t defines is stdint.h on most systems. Solaris uses
32 * inttypes.h instead. Comment out the stdint include if you get an error,
33 * and uncomment the inttypes.h include.
34 */
35#include <stdint.h>
36/* #include <inttypes.h> */
37#include <stdio.h>
38#include <time.h>
39
40/* for struct in6_addr */
41#include <netinet/in.h>
42
43/* for struct addrinfo and sockaddr_storage */
44#include <sys/socket.h>
45#include <netdb.h>
46
47/* *INDENT-OFF* */
48#ifdef __cplusplus
49extern "C" {
50#endif
51/* *INDENT-ON* */
52
59
60#define AUTH_PASS_LEN (8 * 16) /* multiple of 16 */
61#define AUTH_ID_LEN 64
62
63#define RC_BUFFER_LEN 8192
64#define RC_MAX_PACKET_LEN 4096 /* RFC 2865: maximum RADIUS packet size */
65
66#define RC_NAME_LENGTH 64
67
68#define MAX_SECRET_LENGTH (16 * 16) /* MUST be multiple of 16 */
69
70#define RADCLI_VENDOR_MASK 0xffffffff
71#define VENDOR_BIT_SIZE 32
72#define RADCLI_VENDOR_ATTR_SET(attr, vendor) ((attr)|((uint64_t)((vendor)&RADCLI_VENDOR_MASK)) << VENDOR_BIT_SIZE)
73
74#define VENDOR(x) (((x) >> VENDOR_BIT_SIZE) & 0xffffffff)
75#define ATTRID(x) ((x) & 0xffffffff)
76
77#define PW_MAX_MSG_SIZE 4096
78
81typedef enum rc_type {
82 AUTH = 0,
83 ACCT = 1
84} rc_type;
85
86/* defines for config.c */
87
88#define RC_SERVER_MAX 8
89
90#define AUTH_LOCAL_FST (1<<0)
91#define AUTH_RADIUS_FST (1<<1)
92#define AUTH_LOCAL_SND (1<<2)
93#define AUTH_RADIUS_SND (1<<3)
94
95struct rc_conf;
96typedef struct rc_conf rc_handle;
97
102typedef struct server {
103 int max;
104 char *name[RC_SERVER_MAX];
105 uint16_t port[RC_SERVER_MAX];
106 char *secret[RC_SERVER_MAX];
107 double deadtime_ends[RC_SERVER_MAX];
108} SERVER;
109
118
119#define AUTH_HDR_LEN 20
120#define CHAP_VALUE_LENGTH 16
121
122#define PW_AUTH_UDP_PORT 1812
123#define PW_ACCT_UDP_PORT 1813
124
136
139typedef enum rc_standard_codes {
140 PW_ACCESS_REQUEST=1,
141 PW_ACCESS_ACCEPT=2,
142 PW_ACCESS_REJECT=3,
143 PW_ACCOUNTING_REQUEST=4,
144 PW_ACCOUNTING_RESPONSE=5,
145 PW_ACCOUNTING_STATUS=6,
146 PW_PASSWORD_REQUEST=7,
147 PW_PASSWORD_ACK=8,
148 PW_PASSWORD_REJECT=9,
149 PW_ACCOUNTING_MESSAGE=10,
150 PW_ACCESS_CHALLENGE=11,
151 PW_STATUS_SERVER=12,
152 PW_STATUS_CLIENT=13
154
155/* rc_attr_id (the numeric PW_* attribute IDs), rc_service_type,
156 * rc_framed_protocol, rc_framed_routing_type, rc_framed_comp,
157 * rc_login_service_type, rc_termination_action, rc_acct_status_type,
158 * rc_acct_terminate_cause, rc_nas_port_type, rc_acct_auth_type, and
159 * rc_vendor_pec/rc_vendor_type live in radcli-defs.h, shared with
160 * radcli2.h so both headers use the same numeric IDs/VALUEs. */
161#include <radcli/radcli-defs.h>
162
163/* Integer Translations */
164
165/* Vendor RADIUS attribute-value pairs for MICROSOFT */
166enum rc_vendor_attr_microsoft {
167 PW_MS_CHAP_CHALLENGE = 11, /* string */
168 PW_MS_CHAP_RESPONSE = 1, /* string */
169 PW_MS_CHAP2_RESPONSE = 25, /* string */
170 PW_MS_CHAP2_SUCCESS = 26, /* string */
171 PW_MS_MPPE_ENCRYPTION_POLICY= 7, /* string */
172 PW_MS_MPPE_ENCRYPTION_TYPE= 8, /* string */
173 PW_MS_MPPE_ENCRYPTION_TYPES=PW_MS_MPPE_ENCRYPTION_TYPE,
174 PW_MS_CHAP_MPPE_KEYS = 12, /* string */
175 PW_MS_MPPE_SEND_KEY = 16, /* string */
176 PW_MS_MPPE_RECV_KEY = 17, /* string */
177 PW_MS_PRIMARY_DNS_SERVER= 28, /* ipaddr */
178 PW_MS_SECONDARY_DNS_SERVER= 29, /* ipaddr */
179 PW_MS_PRIMARY_NBNS_SERVER= 30, /* ipaddr */
180 PW_MS_SECONDARY_NBNS_SERVER= 31, /* ipaddr */
181};
182
183/* Vendor RADIUS attribute-value pairs for Roaring Penguin: Bandwidth bit rate limits */
184enum rc_vendor_attr_roaringpenguin {
185 PW_RP_UPSTREAM_LIMIT =1, /* integer */
186 PW_RP_DOWNSTREAM_LIMIT =2, /* integer */
187};
188
189/* PROHIBIT PROTOCOL */
190#define PW_DUMB 0
191#define PW_AUTH_ONLY 3
192#define PW_ALL 255
193
194/* Server data structures */
195
199typedef struct dict_attr
200{
201 char name[RC_NAME_LENGTH + 1];
202 uint64_t value;
204 struct dict_attr *next;
205} DICT_ATTR;
206
210typedef struct dict_value
211{
212 char attrname[RC_NAME_LENGTH +1];
213 char name[RC_NAME_LENGTH + 1];
214 uint32_t value;
215 struct dict_value *next;
216} DICT_VALUE;
217
221typedef struct dict_vendor
222{
223 char vendorname[RC_NAME_LENGTH +1];
224 uint32_t vendorpec;
225 struct dict_vendor *next;
226} DICT_VENDOR;
227
228/* don't change this, as it has to be the same as in the Merit radiusd code */
229#define MGMT_POLL_SECRET "Hardlyasecret"
230
233typedef enum rc_send_status {
234 NETUNREACH_RC=-4,
235 BADRESPID_RC=-3,
236 BADRESP_RC=-2,
237 ERROR_RC=-1,
238 OK_RC=0,
239 TIMEOUT_RC=1,
240 REJECT_RC=2,
241 CHALLENGE_RC=3
243
244
245# define AUTH_STRING_LEN 253 /* maximum of 253 */
246
254typedef struct rc_value_pair
255{
256 char name[RC_NAME_LENGTH + 1];
257 uint64_t attribute;
259 uint32_t lvalue;
260 char strvalue[AUTH_STRING_LEN + 1];
261 struct rc_value_pair *next;
262 char pad[32];
263} VALUE_PAIR;
264
270typedef struct send_data
271{
272 uint8_t code;
273 uint8_t seq_nbr;
274 char *server;
276 char *secret;
278 int retries;
279 VALUE_PAIR *send_pairs;
280 VALUE_PAIR *receive_pairs;
281} SEND_DATA;
282
283#define AUTH_VECTOR_LEN 16
284
285struct rc_aaa_ctx_st;
295typedef struct rc_aaa_ctx_st RC_AAA_CTX;
296
297#ifndef RC_MIN
298#define RC_MIN(a, b) ((a) < (b) ? (a) : (b))
299#endif
300#ifndef RC_MAX
301#define RC_MAX(a, b) ((a) > (b) ? (a) : (b))
302#endif
303
304#ifndef PATH_MAX
305#define PATH_MAX 1024
306#endif
307
308#define ENV_SIZE 128
309
311
312/* See doc/mainpage-legacy.md for the introduction/quick-start content that
313 * used to live here as \mainpage -- USE_MDFILE_AS_MAINPAGE now supplies the
314 * legacy Doxygen pass's main page, and an explicit \mainpage in this header
315 * would take precedence over it. */
316
320
324
328
332
333/* avpair.c */
334
335VALUE_PAIR *rc_avpair_add (rc_handle const *rh, VALUE_PAIR **list, uint32_t attrid, void const *pval, int len, uint32_t vendorspec);
336int rc_avpair_assign (VALUE_PAIR *vp, void const *pval, int len);
337VALUE_PAIR *rc_avpair_new (rc_handle const *rh, uint32_t attrid, void const *pval, int len, uint32_t vendorspec);
338VALUE_PAIR *rc_avpair_gen(rc_handle const *rh, VALUE_PAIR *pair, unsigned char const *ptr,
339 int length, uint32_t vendorspec);
340void rc_avpair_remove (VALUE_PAIR **list, uint32_t attrid, uint32_t vendorspec);
341VALUE_PAIR *rc_avpair_get (VALUE_PAIR *vp, uint32_t attrid, uint32_t vendorspec);
342VALUE_PAIR *rc_avpair_copy(VALUE_PAIR *p);
343void rc_avpair_insert(VALUE_PAIR **a, VALUE_PAIR *p, VALUE_PAIR *b);
344void rc_avpair_free (VALUE_PAIR *pair);
345int rc_avpair_parse (rc_handle const *rh, char const *buffer, VALUE_PAIR **first_pair);
346int rc_avpair_tostr (rc_handle const *rh, VALUE_PAIR *pair, char *name, int ln, char *value, int lv);
347char *rc_avpair_log(rc_handle const *rh, VALUE_PAIR *pair, char *buf, size_t buf_len);
348VALUE_PAIR *rc_avpair_next(VALUE_PAIR *t);
349
350int rc_avpair_get_uint32 (VALUE_PAIR *vp, uint32_t *res);
351int rc_avpair_get_in6 (VALUE_PAIR *vp, struct in6_addr *res, unsigned *prefix);
352int rc_avpair_get_raw (VALUE_PAIR *vp, char **res, unsigned *res_size);
353void rc_avpair_get_attr (VALUE_PAIR *vp, unsigned *type, unsigned *id);
354
355/* buildreq.c */
356
357void rc_buildreq(rc_handle const *rh, SEND_DATA *data, int code, char *server, unsigned short port,
358 char *secret, int timeout, int retries);
359int rc_auth(rc_handle *rh, uint32_t client_port, VALUE_PAIR *send,
360 VALUE_PAIR **received, char *msg);
361int rc_auth_proxy(rc_handle *rh, VALUE_PAIR *send, VALUE_PAIR **received, char *msg);
362int rc_acct(rc_handle *rh, uint32_t client_port, VALUE_PAIR *send);
363int rc_acct_proxy(rc_handle *rh, VALUE_PAIR *send);
364
365int rc_acct_async(rc_handle *rh, uint32_t client_port, VALUE_PAIR *send);
366
367int rc_check(rc_handle *rh, char *host, char *secret, unsigned short port, char *msg);
368
369int rc_aaa(rc_handle *rh, uint32_t client_port, VALUE_PAIR *send, VALUE_PAIR **received,
370 char *msg, int add_nas_port, rc_standard_codes request_type);
371int rc_aaa_ctx(rc_handle *rh, RC_AAA_CTX **ctx, uint32_t client_port, VALUE_PAIR *send,
372 VALUE_PAIR **received,
373 char *msg, int add_nas_port, rc_standard_codes request_type);
374int rc_aaa_ctx_server(rc_handle *rh, RC_AAA_CTX **ctx, SERVER *aaaserver,
375 rc_type type, uint32_t client_port,
376 VALUE_PAIR *send, VALUE_PAIR **received,
377 char *msg, int add_nas_port, rc_standard_codes request_type);
378
379/* config.c */
380
381int rc_add_config(rc_handle *rh, char const *option_name, char const *option_val, char const *source, int line);
382rc_handle *rc_config_init(rc_handle *rh);
383rc_handle *rc_read_config(char const *filename);
384char *rc_conf_str(rc_handle const *rh, char const *optname);
385int rc_conf_int(rc_handle const *rh, char const *optname);
386SERVER *rc_conf_srv(rc_handle const *rh, char const *optname);
387int rc_test_config(rc_handle *rh, char const *filename);
388int rc_apply_config(rc_handle *rh);
389int rc_find_server_addr (rc_handle const *rh, char const *server_name,
390 struct addrinfo** info, char *secret, rc_type type);
391void rc_config_free(rc_handle *rh);
392rc_handle *rc_new(void);
393void rc_destroy(rc_handle *rh);
394rc_socket_type rc_get_socket_type(rc_handle * rh);
395
396#define test_config rc_test_config
397
398/* dict.c */
399
400int rc_read_dictionary (rc_handle *rh, char const *filename);
401int rc_read_dictionary_from_buffer (rc_handle *rh, char const *buf, size_t size);
402
403DICT_ATTR *rc_dict_addattr(rc_handle *rh, char const * namestr, uint32_t value, int type, uint32_t vendorspec);
404DICT_VALUE *rc_dict_addval(rc_handle *rh, char const * attrstr, char const * namestr, uint32_t value);
405DICT_VENDOR *rc_dict_addvend(rc_handle *rh, char const * vendorname, uint32_t value);
406
407DICT_ATTR *rc_dict_getattr(rc_handle const *rh, uint64_t attribute);
408DICT_ATTR *rc_dict_findattr(rc_handle const *rh, char const *attrname);
409DICT_VALUE *rc_dict_findval(rc_handle const *rh, char const *valname);
410DICT_VENDOR *rc_dict_findvend(rc_handle const *rh, char const *vendorname);
411DICT_VENDOR *rc_dict_getvend (rc_handle const *rh, uint32_t vendorspec);
412DICT_VALUE *rc_dict_getval(rc_handle const *rh, uint32_t value, char const *attrname);
413void rc_dict_free(rc_handle *rh);
414
415/* tls.c */
416
417int rc_tls_fd(rc_handle * rh);
418int rc_check_tls(rc_handle * rh);
419
420/* ip_util.c */
421
422unsigned short rc_getport(int type);
423int rc_own_hostname(char *hostname, int len);
424struct sockaddr;
425int rc_get_srcaddr(struct sockaddr *lia, const struct sockaddr *ria);
426
427/* log.c */
428
429void rc_setdebug(int debug);
430void rc_openlog(char const *ident);
431/* to provide compatibility with any old applications that may have
432 * been using rc_log() */
433#define rc_log syslog
434
435/* sendserver.c */
436
437int rc_send_server (rc_handle *rh, SEND_DATA *data, char *msg,
438 rc_type type);
439
440/* aaa_ctx.c */
441void rc_aaa_ctx_free(RC_AAA_CTX *ctx);
442const char *rc_aaa_ctx_get_secret(RC_AAA_CTX *ctx);
443const void *rc_aaa_ctx_get_vector(RC_AAA_CTX *ctx);
444
445/* obsolete functions */
446#define _RADCLI_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
447#if !defined RADCLI_INTERNAL_BUILD
448# if _RADCLI_GCC_VERSION >= 30100
449# define _RADCLI_GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__))
450# endif
451#endif
452char *rc_mksid(void) _RADCLI_GCC_ATTR_DEPRECATED;
453
454
455/* *INDENT-OFF* */
456#ifdef __cplusplus
457}
458#endif
459/* *INDENT-ON* */
460
461#endif /* RADCLI_H */
void rc_avpair_remove(VALUE_PAIR **list, uint32_t attrid, uint32_t vendorspec)
Removes an attribute-value pair from the given list.
Definition avpair.c:70
DICT_VALUE * rc_dict_getval(rc_handle const *rh, uint32_t value, char const *attrname)
Get DICT_VALUE based on attribute name and integer value number.
Definition dict.c:164
int rc_avpair_get_raw(VALUE_PAIR *vp, char **res, unsigned *res_size)
Get the raw value of the given attribute value-pair.
Definition avpair.c:1039
char * rc_avpair_log(rc_handle const *rh, VALUE_PAIR *pair, char *buf, size_t buf_len)
Format a sequence of attribute value pairs into a printable string.
Definition avpair.c:954
VALUE_PAIR * rc_avpair_next(VALUE_PAIR *t)
Iterates through the attribute-value pairs.
Definition avpair.c:113
const void * rc_aaa_ctx_get_vector(RC_AAA_CTX *ctx)
Returns a pointer request vector used in the request. It is of AUTH_VECTOR_LEN size.
Definition aaa_ctx.c:52
int rc_acct(rc_handle *rh, uint32_t client_port, VALUE_PAIR *send)
Builds an accounting request for port id nas_port with the value_pairs at send.
Definition buildreq.c:332
rc_type
Definition radcli.h:81
int rc_auth_proxy(rc_handle *rh, VALUE_PAIR *send, VALUE_PAIR **received, char *msg)
Builds an authentication request for proxying.
Definition buildreq.c:315
int rc_auth(rc_handle *rh, uint32_t client_port, VALUE_PAIR *send, VALUE_PAIR **received, char *msg)
Builds an authentication request for port id nas_port with the value_pairs send and submits it to a s...
Definition buildreq.c:293
struct rc_aaa_ctx_st RC_AAA_CTX
Definition radcli.h:295
int rc_avpair_get_uint32(VALUE_PAIR *vp, uint32_t *res)
Get the integer value of the given attribute value-pair.
Definition avpair.c:986
void rc_buildreq(rc_handle const *rh, SEND_DATA *data, int code, char *server, unsigned short port, char *secret, int timeout, int retries)
Build a skeleton RADIUS request using information from the config file.
Definition buildreq.c:38
DICT_ATTR * rc_dict_addattr(rc_handle *rh, char const *namestr, uint32_t value, int type, uint32_t vendorspec)
Add attribute to dictionary.
Definition dict.c:59
int rc_avpair_get_in6(VALUE_PAIR *vp, struct in6_addr *res, unsigned *prefix)
Get the IPv6 address and prefix value of the given attribute value-pair.
Definition avpair.c:1007
void rc_avpair_get_attr(VALUE_PAIR *vp, unsigned *type, unsigned *id)
Get the attribute ID and type of the given attribute value-pair.
Definition avpair.c:1059
VALUE_PAIR * rc_avpair_gen(rc_handle const *rh, VALUE_PAIR *pair, unsigned char const *ptr, int length, uint32_t vendorspec)
Decode a raw RADIUS attribute buffer into a VALUE_PAIR list.
Definition avpair.c:444
DICT_VENDOR * rc_dict_findvend(rc_handle const *rh, char const *vendorname)
Lookup a DICT_VENDOR by its name.
Definition dict.c:141
int rc_acct_proxy(rc_handle *rh, VALUE_PAIR *send)
Builds an accounting request with the value_pairs at send.
Definition buildreq.c:345
const char * rc_aaa_ctx_get_secret(RC_AAA_CTX *ctx)
Returns the secret available in this context. It is the secret value used in the request.
Definition aaa_ctx.c:41
void rc_avpair_free(VALUE_PAIR *pair)
Frees all value_pairs in the list.
Definition avpair.c:569
int rc_aaa_ctx(rc_handle *rh, RC_AAA_CTX **ctx, uint32_t client_port, VALUE_PAIR *send, VALUE_PAIR **received, char *msg, int add_nas_port, rc_standard_codes request_type)
Builds an authentication/accounting request and submits it to a server, optionally returning context.
Definition buildreq.c:156
VALUE_PAIR * rc_avpair_copy(VALUE_PAIR *p)
Return a copy of the existing list "p" ala strdup().
Definition avpair.c:482
int rc_avpair_tostr(rc_handle const *rh, VALUE_PAIR *pair, char *name, int ln, char *value, int lv)
Translate an av_pair into printable strings.
Definition avpair.c:838
int rc_aaa(rc_handle *rh, uint32_t client_port, VALUE_PAIR *send, VALUE_PAIR **received, char *msg, int add_nas_port, rc_standard_codes request_type)
Builds an authentication/accounting request for port id nas_port with the value_pairs send and submit...
Definition buildreq.c:273
rc_send_status
Definition radcli.h:233
int rc_avpair_assign(VALUE_PAIR *vp, void const *pval, int len)
Assigns the given value to an attribute-value pair.
Definition avpair.c:136
DICT_VALUE * rc_dict_findval(rc_handle const *rh, char const *valname)
Lookup a DICT_VALUE by its name.
Definition dict.c:130
int rc_send_server(rc_handle *rh, SEND_DATA *data, char *msg, rc_type type)
Sends a request to a RADIUS server and waits for the reply.
Definition send.c:238
int rc_acct_async(rc_handle *rh, uint32_t client_port, VALUE_PAIR *send)
Sends an accounting request to every configured accounting server without waiting for a reply.
Definition buildreq.c:432
int rc_avpair_parse(rc_handle const *rh, char const *buffer, VALUE_PAIR **first_pair)
Parses the buffer to extract the attribute-value pairs.
Definition avpair.c:631
int rc_aaa_ctx_server(rc_handle *rh, RC_AAA_CTX **ctx, SERVER *aaaserver, rc_type type, uint32_t client_port, VALUE_PAIR *send, VALUE_PAIR **received, char *msg, int add_nas_port, rc_standard_codes request_type)
Builds an authentication/accounting request and submits it to a specific server.
Definition buildreq.c:195
int rc_check(rc_handle *rh, char *host, char *secret, unsigned short port, char *msg)
Asks the server hostname on the specified port for a status message.
Definition buildreq.c:453
DICT_VENDOR * rc_dict_getvend(rc_handle const *rh, uint32_t vendorspec)
Lookup a DICT_VENDOR by its IANA number.
Definition dict.c:152
rc_standard_codes
Definition radcli.h:139
DICT_ATTR * rc_dict_getattr(rc_handle const *rh, uint64_t attribute)
Lookup a DICT_ATTR by attribute number.
Definition dict.c:107
DICT_VALUE * rc_dict_addval(rc_handle *rh, char const *attrstr, char const *namestr, uint32_t value)
Add value to dictionary.
Definition dict.c:78
DICT_VENDOR * rc_dict_addvend(rc_handle *rh, char const *vendorname, uint32_t value)
Add vendor to dictionary.
Definition dict.c:96
VALUE_PAIR * rc_avpair_add(rc_handle const *rh, VALUE_PAIR **list, uint32_t attrid, void const *pval, int len, uint32_t vendorspec)
Adds an attribute-value pair to the given list.
Definition avpair.c:47
void rc_aaa_ctx_free(RC_AAA_CTX *ctx)
Deinitializes an RC_AAA_CTX structure.
Definition aaa_ctx.c:62
void rc_avpair_insert(VALUE_PAIR **a, VALUE_PAIR *p, VALUE_PAIR *b)
Insert a VALUE_PAIR into a list.
Definition avpair.c:517
VALUE_PAIR * rc_avpair_get(VALUE_PAIR *vp, uint32_t attrid, uint32_t vendorspec)
Find the first attribute value-pair (which matches the given attribute) from the specified value-pair...
Definition avpair.c:465
rc_attr_type
Definition radcli.h:127
DICT_ATTR * rc_dict_findattr(rc_handle const *rh, char const *attrname)
Lookup a DICT_ATTR by its name.
Definition dict.c:119
VALUE_PAIR * rc_avpair_new(rc_handle const *rh, uint32_t attrid, void const *pval, int len, uint32_t vendorspec)
Make a new attribute-value pair with given parameters.
Definition avpair.c:197
rc_socket_type
Definition radcli.h:112
@ ACCT
Request for accounting server.
Definition radcli.h:83
@ AUTH
Request for authentication server.
Definition radcli.h:82
@ PW_TYPE_IPADDR
The attribute is an IPv4 address in host-byte order.
Definition radcli.h:130
@ PW_TYPE_IPV6ADDR
The attribute is an 128-bit IPv6 address.
Definition radcli.h:132
@ PW_TYPE_MAX
Maximum number of types (last+1).
Definition radcli.h:134
@ PW_TYPE_IPV6PREFIX
The attribute is an IPv6 prefix; the lvalue will indicate its size.
Definition radcli.h:133
@ PW_TYPE_INTEGER
The attribute is a 32-bit integer.
Definition radcli.h:129
@ PW_TYPE_DATE
The attribute contains a 32-bit number indicating the seconds since epoch.
Definition radcli.h:131
@ PW_TYPE_STRING
The attribute is a printable string.
Definition radcli.h:128
@ RC_SOCKET_UDP
Plain UDP socket.
Definition radcli.h:113
@ RC_SOCKET_TCP
Plain TCP socket.
Definition radcli.h:116
@ RC_SOCKET_DTLS
DTLS socket.
Definition radcli.h:115
@ RC_SOCKET_TLS
TLS socket.
Definition radcli.h:114
rc_attr_type type
string, int, etc..
Definition radcli.h:203
uint64_t value
attribute index and vendor number; use VENDOR() and ATTRID() to separate.
Definition radcli.h:202
char name[RC_NAME_LENGTH+1]
attribute name.
Definition radcli.h:201
rc_attr_type type
attribute type.
Definition radcli.h:258
char pad[32]
unused pad
Definition radcli.h:262
uint64_t attribute
attribute numeric value of type rc_attr_id including vendor; use VENDOR() and ATTRID() to separate.
Definition radcli.h:257
uint32_t lvalue
attribute value if type is PW_TYPE_INTEGER, PW_TYPE_DATE or PW_TYPE_IPADDR.
Definition radcli.h:259
char strvalue[AUTH_STRING_LEN+1]
contains attribute value in other cases.
Definition radcli.h:260
char name[RC_NAME_LENGTH+1]
attribute name if known.
Definition radcli.h:256
int timeout
Session timeout in seconds.
Definition radcli.h:277
char * secret
Shared secret of RADIUS server.
Definition radcli.h:276
uint8_t seq_nbr
Packet sequence number.
Definition radcli.h:273
int svc_port
RADIUS protocol destination port.
Definition radcli.h:275
char * server
Name/address of RADIUS server.
Definition radcli.h:274
VALUE_PAIR * send_pairs
More a/v pairs to send.
Definition radcli.h:279
VALUE_PAIR * receive_pairs
Where to place received a/v pairs.
Definition radcli.h:280
uint8_t code
RADIUS packet code.
Definition radcli.h:272
double deadtime_ends[RC_SERVER_MAX]
unused
Definition radcli.h:107