Radcli library 1.3.1
A simple radius library
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
15#ifndef RADCLI_H
16#define RADCLI_H
17
18#include <sys/types.h>
19/*
20 * Include for C99 uintX_t defines is stdint.h on most systems. Solaris uses
21 * inttypes.h instead. Comment out the stdint include if you get an error,
22 * and uncomment the inttypes.h include.
23 */
24#include <stdint.h>
25/* #include <inttypes.h> */
26#include <stdio.h>
27#include <time.h>
28
29/* for struct in6_addr */
30#include <netinet/in.h>
31
32/* for struct addrinfo and sockaddr_storage */
33#include <sys/socket.h>
34#include <netdb.h>
35
36/* *INDENT-OFF* */
37#ifdef __cplusplus
38extern "C" {
39#endif
40/* *INDENT-ON* */
41
49#define AUTH_PASS_LEN (7 * 16) /* multiple of 16 */
50#define AUTH_ID_LEN 64
51
52#define RC_BUFFER_LEN 8192
53
54#define RC_NAME_LENGTH 32
55
56#define MAX_SECRET_LENGTH (6 * 16) /* MUST be multiple of 16 */
57
58#define VENDOR_BIT_SIZE 32
59#define VENDOR(x) (((x) >> VENDOR_BIT_SIZE) & 0xffffffff)
60#define ATTRID(x) ((x) & 0xffffffff)
61
62#define PW_MAX_MSG_SIZE 4096
63
66typedef enum rc_type {
67 AUTH = 0,
68 ACCT = 1
70
71/* defines for config.c */
72
73#define RC_SERVER_MAX 8
74
75#define AUTH_LOCAL_FST (1<<0)
76#define AUTH_RADIUS_FST (1<<1)
77#define AUTH_LOCAL_SND (1<<2)
78#define AUTH_RADIUS_SND (1<<3)
79
80struct rc_conf;
81typedef struct rc_conf rc_handle;
82
87typedef struct server {
88 int max;
89 char *name[RC_SERVER_MAX];
90 uint16_t port[RC_SERVER_MAX];
91 char *secret[RC_SERVER_MAX];
92 double deadtime_ends[RC_SERVER_MAX];
93} SERVER;
94
97typedef enum rc_socket_type {
101 RC_SOCKET_TCP = 3
103
104#define AUTH_HDR_LEN 20
105#define CHAP_VALUE_LENGTH 16
106
107#define PW_AUTH_UDP_PORT 1812
108#define PW_ACCT_UDP_PORT 1813
109
112typedef enum rc_attr_type {
119 PW_TYPE_MAX=6
121
124typedef enum rc_standard_codes {
125 PW_ACCESS_REQUEST=1,
126 PW_ACCESS_ACCEPT=2,
127 PW_ACCESS_REJECT=3,
128 PW_ACCOUNTING_REQUEST=4,
129 PW_ACCOUNTING_RESPONSE=5,
130 PW_ACCOUNTING_STATUS=6,
131 PW_PASSWORD_REQUEST=7,
132 PW_PASSWORD_ACK=8,
133 PW_PASSWORD_REJECT=9,
134 PW_ACCOUNTING_MESSAGE=10,
135 PW_ACCESS_CHALLENGE=11,
136 PW_STATUS_SERVER=12,
137 PW_STATUS_CLIENT=13
139
142typedef enum rc_attr_id {
245
249
251
264
267 PW_USER_REALM=223
269
270/* Integer Translations */
271
274typedef enum rc_service_type {
275 PW_LOGIN=1,
276 PW_FRAMED=2,
277 PW_CALLBACK_LOGIN=3,
278 PW_CALLBACK_FRAMED=4,
279 PW_OUTBOUND=5,
280 PW_ADMINISTRATIVE=6,
281 PW_NAS_PROMPT=7,
282 PW_AUTHENTICATE_ONLY=8,
283 PW_CALLBACK_NAS_PROMPT=9
285
288typedef enum rc_framed_protocol {
289 PW_PPP=1,
290 PW_SLIP=2,
291 PW_ARA= 3,
292 PW_GANDALF=4,
293 PW_XYLOGICS=5
295
299 PW_NONE=0,
300 PW_BROADCAST=1,
301 PW_LISTEN=2,
302 PW_BROADCAST_LISTEN=3
304
309typedef enum rc_framed_comp {
310 PW_COMP_NONE=0,
311 PW_VAN_JACOBSON_TCP_IP=1,
312 PW_IPX_HEADER_COMPRESSION=2,
313 PW_COMP_LZS=3
315
319 PW_TELNET=0,
320 PW_RLOGIN=1,
321 PW_TCP_CLEAR=2,
322 PW_PORTMASTER=3,
323 PW_LAT=4,
324 PW_X25_PAD=5,
325 PW_X25_T3POS=6
327
331 PW_DEFAULT=0,
332 PW_RADIUS_REQUEST=1
334
335
339 PW_STATUS_START=1,
340 PW_STATUS_STOP=2,
341 PW_STATUS_ALIVE=3,
342 PW_STATUS_MODEM_START=4,
343 PW_STATUS_MODEM_STOP=5,
344 PW_STATUS_CANCEL=6,
345 PW_ACCOUNTING_ON=7,
346 PW_ACCOUNTING_OFF=8
348
352 PW_USER_REQUEST=1,
353 PW_LOST_CARRIER=2,
354 PW_LOST_SERVICE=3,
355 PW_ACCT_IDLE_TIMEOUT=4,
356 PW_ACCT_SESSION_TIMEOUT=5,
357 PW_ADMIN_RESET=6,
358 PW_ADMIN_REBOOT=7,
359 PW_PORT_ERROR=8,
360 PW_NAS_ERROR=9,
361 PW_NAS_REQUEST=10,
362 PW_NAS_REBOOT=11,
363 PW_PORT_UNNEEDED=12,
364 PW_PORT_PREEMPTED=13,
365 PW_PORT_SUSPENDED=14,
366 PW_SERVICE_UNAVAILABLE=15,
367 PW_CALLBACK=16,
368 PW_USER_ERROR=17,
369 PW_HOST_REQUEST=18
371
374typedef enum rc_nas_port_type {
375 PW_ASYNC=0,
376 PW_SYNC=1,
377 PW_ISDN_SYNC=2,
378 PW_ISDN_SYNC_V120=3,
379 PW_ISDN_SYNC_V110=4,
380 PW_VIRTUAL=5
382
385typedef enum rc_acct_auth_type {
386 PW_RADIUS=1,
387 PW_LOCAL=2,
388 PW_REMOTE=3
390
393typedef enum rc_vendor_pec {
394 VENDOR_NONE=0,
395 VENDOR_MICROSOFT = 311,
396 VENDOR_ROARING_PENGUIN = 10055
397} rc_vendor_type;
398
399/* Vendor RADIUS attribute-value pairs for MICROSOFT */
400enum rc_vendor_attr_microsoft {
401 PW_MS_CHAP_CHALLENGE = 11, /* string */
402 PW_MS_CHAP_RESPONSE = 1, /* string */
403 PW_MS_CHAP2_RESPONSE = 25, /* string */
404 PW_MS_CHAP2_SUCCESS = 26, /* string */
405 PW_MS_MPPE_ENCRYPTION_POLICY= 7, /* string */
406 PW_MS_MPPE_ENCRYPTION_TYPE= 8, /* string */
407 PW_MS_MPPE_ENCRYPTION_TYPES=PW_MS_MPPE_ENCRYPTION_TYPE,
408 PW_MS_CHAP_MPPE_KEYS = 12, /* string */
409 PW_MS_MPPE_SEND_KEY = 16, /* string */
410 PW_MS_MPPE_RECV_KEY = 17, /* string */
411 PW_MS_PRIMARY_DNS_SERVER= 28, /* ipaddr */
412 PW_MS_SECONDARY_DNS_SERVER= 29, /* ipaddr */
413 PW_MS_PRIMARY_NBNS_SERVER= 30, /* ipaddr */
414 PW_MS_SECONDARY_NBNS_SERVER= 31, /* ipaddr */
415};
416
417/* Vendor RADIUS attribute-value pairs for Roaring Penguin: Bandwidth bit rate limits */
418enum rc_vendor_attr_roaringpenguin {
419 PW_RP_UPSTREAM_LIMIT =1, /* integer */
420 PW_RP_DOWNSTREAM_LIMIT =2, /* integer */
421};
422
423/* PROHIBIT PROTOCOL */
424#define PW_DUMB 0
425#define PW_AUTH_ONLY 3
426#define PW_ALL 255
427
428/* Server data structures */
429
430typedef struct dict_attr
431{
432 char name[RC_NAME_LENGTH + 1];
433 uint64_t value;
435 struct dict_attr *next;
436} DICT_ATTR;
437
438typedef struct dict_value
439{
440 char attrname[RC_NAME_LENGTH +1];
441 char name[RC_NAME_LENGTH + 1];
442 uint32_t value;
443 struct dict_value *next;
444} DICT_VALUE;
445
446typedef struct dict_vendor
447{
448 char vendorname[RC_NAME_LENGTH +1];
449 uint32_t vendorpec;
450 struct dict_vendor *next;
452
453/* don't change this, as it has to be the same as in the Merit radiusd code */
454#define MGMT_POLL_SECRET "Hardlyasecret"
455
458typedef enum rc_send_status {
459 NETUNREACH_RC=-4,
460 BADRESPID_RC=-3,
461 BADRESP_RC=-2,
462 ERROR_RC=-1,
463 OK_RC=0,
464 TIMEOUT_RC=1,
465 REJECT_RC=2,
466 CHALLENGE_RC=3
468
469
470# define AUTH_STRING_LEN 253 /* maximum of 253 */
471
475typedef struct rc_value_pair
476{
477 char name[RC_NAME_LENGTH + 1];
478 uint64_t attribute;
480 uint32_t lvalue;
481 char strvalue[AUTH_STRING_LEN + 1];
482 struct rc_value_pair *next;
483 char pad[32];
484} VALUE_PAIR;
485
486typedef struct send_data /* Used to pass information to sendserver() function */
487{
488 uint8_t code;
489 uint8_t seq_nbr;
490 char *server;
492 char *secret;
494 int retries;
497} SEND_DATA;
498
499#define AUTH_VECTOR_LEN 16
500
501struct rc_aaa_ctx_st;
502typedef struct rc_aaa_ctx_st RC_AAA_CTX;
503
504#ifndef RC_MIN
505#define RC_MIN(a, b) ((a) < (b) ? (a) : (b))
506#endif
507#ifndef RC_MAX
508#define RC_MAX(a, b) ((a) > (b) ? (a) : (b))
509#endif
510
511#ifndef PATH_MAX
512#define PATH_MAX 1024
513#endif
514
515#define ENV_SIZE 128
516
567/* avpair.c */
568
569VALUE_PAIR *rc_avpair_add (rc_handle const *rh, VALUE_PAIR **list, uint32_t attrid, void const *pval, int len, uint32_t vendorspec);
570int rc_avpair_assign (VALUE_PAIR *vp, void const *pval, int len);
571VALUE_PAIR *rc_avpair_new (rc_handle const *rh, uint32_t attrid, void const *pval, int len, uint32_t vendorspec);
572VALUE_PAIR *rc_avpair_gen(rc_handle const *rh, VALUE_PAIR *pair, unsigned char const *ptr,
573 int length, uint32_t vendorspec);
574void rc_avpair_remove (VALUE_PAIR **list, uint32_t attrid, uint32_t vendorspec);
575VALUE_PAIR *rc_avpair_get (VALUE_PAIR *vp, uint32_t attrid, uint32_t vendorspec);
578void rc_avpair_free (VALUE_PAIR *pair);
579int rc_avpair_parse (rc_handle const *rh, char const *buffer, VALUE_PAIR **first_pair);
580int rc_avpair_tostr (rc_handle const *rh, VALUE_PAIR *pair, char *name, int ln, char *value, int lv);
581char *rc_avpair_log(rc_handle const *rh, VALUE_PAIR *pair, char *buf, size_t buf_len);
583
584int rc_avpair_get_uint32 (VALUE_PAIR *vp, uint32_t *res);
585int rc_avpair_get_in6 (VALUE_PAIR *vp, struct in6_addr *res, unsigned *prefix);
586int rc_avpair_get_raw (VALUE_PAIR *vp, char **res, unsigned *res_size);
587void rc_avpair_get_attr (VALUE_PAIR *vp, unsigned *type, unsigned *id);
588
589/* buildreq.c */
590
591void rc_buildreq(rc_handle const *rh, SEND_DATA *data, int code, char *server, unsigned short port,
592 char *secret, int timeout, int retries);
593int rc_auth(rc_handle *rh, uint32_t client_port, VALUE_PAIR *send,
594 VALUE_PAIR **received, char *msg);
595int rc_auth_proxy(rc_handle *rh, VALUE_PAIR *send, VALUE_PAIR **received, char *msg);
596int rc_acct(rc_handle *rh, uint32_t client_port, VALUE_PAIR *send);
597int rc_acct_proxy(rc_handle *rh, VALUE_PAIR *send);
598int rc_check(rc_handle *rh, char *host, char *secret, unsigned short port, char *msg);
599
600int rc_aaa(rc_handle *rh, uint32_t client_port, VALUE_PAIR *send, VALUE_PAIR **received,
601 char *msg, int add_nas_port, rc_standard_codes request_type);
602int rc_aaa_ctx(rc_handle *rh, RC_AAA_CTX **ctx, uint32_t client_port, VALUE_PAIR *send,
603 VALUE_PAIR **received,
604 char *msg, int add_nas_port, rc_standard_codes request_type);
605int rc_aaa_ctx_server(rc_handle *rh, RC_AAA_CTX **ctx, SERVER *aaaserver,
606 rc_type type, uint32_t client_port,
607 VALUE_PAIR *send, VALUE_PAIR **received,
608 char *msg, int add_nas_port, rc_standard_codes request_type);
609
610/* config.c */
611
612int rc_add_config(rc_handle *rh, char const *option_name, char const *option_val, char const *source, int line);
613rc_handle *rc_config_init(rc_handle *rh);
614rc_handle *rc_read_config(char const *filename);
615char *rc_conf_str(rc_handle const *rh, char const *optname);
616int rc_conf_int(rc_handle const *rh, char const *optname);
617SERVER *rc_conf_srv(rc_handle const *rh, char const *optname);
618int rc_test_config(rc_handle *rh, char const *filename);
619int rc_apply_config(rc_handle *rh);
620int rc_find_server_addr (rc_handle const *rh, char const *server_name,
621 struct addrinfo** info, char *secret, rc_type type);
622void rc_config_free(rc_handle *rh);
623rc_handle *rc_new(void);
624void rc_destroy(rc_handle *rh);
625rc_socket_type rc_get_socket_type(rc_handle * rh);
626
627#define test_config rc_test_config
628
629/* dict.c */
630
631int rc_read_dictionary (rc_handle *rh, char const *filename);
632int rc_read_dictionary_from_buffer (rc_handle *rh, char const *buf, size_t size);
633
634DICT_ATTR *rc_dict_addattr(rc_handle *rh, char const * namestr, uint32_t value, int type, uint32_t vendorspec);
635DICT_VALUE *rc_dict_addval(rc_handle *rh, char const * attrstr, char const * namestr, uint32_t value);
636DICT_VENDOR *rc_dict_addvend(rc_handle *rh, char const * vendorname, uint32_t value);
637
638DICT_ATTR *rc_dict_getattr(rc_handle const *rh, uint64_t attribute);
639DICT_ATTR *rc_dict_findattr(rc_handle const *rh, char const *attrname);
640DICT_VALUE *rc_dict_findval(rc_handle const *rh, char const *valname);
641DICT_VENDOR *rc_dict_findvend(rc_handle const *rh, char const *vendorname);
642DICT_VENDOR *rc_dict_getvend (rc_handle const *rh, uint32_t vendorspec);
643DICT_VALUE *rc_dict_getval(rc_handle const *rh, uint32_t value, char const *attrname);
644void rc_dict_free(rc_handle *rh);
645
646/* tls.c */
647
648int rc_tls_fd(rc_handle * rh);
649int rc_check_tls(rc_handle * rh);
650
651/* ip_util.c */
652
653unsigned short rc_getport(int type);
654int rc_own_hostname(char *hostname, int len);
655struct sockaddr;
656int rc_get_srcaddr(struct sockaddr *lia, const struct sockaddr *ria);
657
658/* log.c */
659
660void rc_setdebug(int debug);
661void rc_openlog(char const *ident);
662/* to provide compatibility with any old applications that may have
663 * been using rc_log() */
664#define rc_log syslog
665
666/* sendserver.c */
667
668int rc_send_server (rc_handle *rh, SEND_DATA *data, char *msg,
669 rc_type type);
670
671/* aaa_ctx.c */
672void rc_aaa_ctx_free(RC_AAA_CTX *ctx);
673const char *rc_aaa_ctx_get_secret(RC_AAA_CTX *ctx);
674const void *rc_aaa_ctx_get_vector(RC_AAA_CTX *ctx);
675
676/* obsolete functions */
677#define _RADCLI_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
678#if !defined RADCLI_INTERNAL_BUILD
679# if _RADCLI_GCC_VERSION >= 30100
680# define _RADCLI_GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__))
681# endif
682#endif
683char *rc_mksid(void) _RADCLI_GCC_ATTR_DEPRECATED;
684
685
686/* *INDENT-OFF* */
687#ifdef __cplusplus
688}
689#endif
690/* *INDENT-ON* */
691
692#endif /* RADCLI_H */
unsigned short rc_getport(int type)
Definition: ip_util.c:63
int rc_get_srcaddr(struct sockaddr *lia, const struct sockaddr *ria)
Definition: ip_util.c:124
void rc_openlog(char const *ident)
Definition: log.c:36
int rc_own_hostname(char *hostname, int len)
Definition: ip_util.c:81
void rc_avpair_remove(VALUE_PAIR **list, uint32_t attrid, uint32_t vendorspec)
Definition: avpair.c:69
rc_acct_status_type
Definition: radcli.h:338
DICT_VALUE * rc_dict_getval(rc_handle const *rh, uint32_t value, char const *attrname)
Definition: dict.c:632
rc_acct_terminate_cause
Definition: radcli.h:351
int rc_avpair_get_raw(VALUE_PAIR *vp, char **res, unsigned *res_size)
Definition: avpair.c:1035
char * rc_avpair_log(rc_handle const *rh, VALUE_PAIR *pair, char *buf, size_t buf_len)
Definition: avpair.c:952
rc_socket_type rc_get_socket_type(rc_handle *rh)
Definition: config.c:1148
VALUE_PAIR * rc_avpair_next(VALUE_PAIR *t)
Definition: avpair.c:112
rc_handle * rc_new(void)
Definition: config.c:1096
rc_nas_port_type
Definition: radcli.h:374
const void * rc_aaa_ctx_get_vector(RC_AAA_CTX *ctx)
Definition: aaa_ctx.c:52
int rc_acct(rc_handle *rh, uint32_t client_port, VALUE_PAIR *send)
Definition: buildreq.c:274
rc_type
Definition: radcli.h:66
int rc_auth_proxy(rc_handle *rh, VALUE_PAIR *send, VALUE_PAIR **received, char *msg)
Definition: buildreq.c:257
rc_framed_comp
Definition: radcli.h:309
int rc_auth(rc_handle *rh, uint32_t client_port, VALUE_PAIR *send, VALUE_PAIR **received, char *msg)
Definition: buildreq.c:235
int rc_avpair_get_uint32(VALUE_PAIR *vp, uint32_t *res)
Definition: avpair.c:982
rc_termination_action
Definition: radcli.h:330
void rc_buildreq(rc_handle const *rh, SEND_DATA *data, int code, char *server, unsigned short port, char *secret, int timeout, int retries)
Definition: buildreq.c:41
DICT_ATTR * rc_dict_addattr(rc_handle *rh, char const *namestr, uint32_t value, int type, uint32_t vendorspec)
Definition: dict.c:38
int rc_avpair_get_in6(VALUE_PAIR *vp, struct in6_addr *res, unsigned *prefix)
Definition: avpair.c:1003
void rc_avpair_get_attr(VALUE_PAIR *vp, unsigned *type, unsigned *id)
Definition: avpair.c:1055
rc_vendor_pec
Definition: radcli.h:393
VALUE_PAIR * rc_avpair_gen(rc_handle const *rh, VALUE_PAIR *pair, unsigned char const *ptr, int length, uint32_t vendorspec)
Definition: avpair.c:271
void rc_destroy(rc_handle *rh)
Definition: config.c:1127
DICT_VENDOR * rc_dict_findvend(rc_handle const *rh, char const *vendorname)
Definition: dict.c:599
rc_acct_auth_type
Definition: radcli.h:385
int rc_acct_proxy(rc_handle *rh, VALUE_PAIR *send)
Definition: buildreq.c:287
const char * rc_aaa_ctx_get_secret(RC_AAA_CTX *ctx)
Definition: aaa_ctx.c:41
void rc_avpair_free(VALUE_PAIR *pair)
Definition: avpair.c:537
int rc_read_dictionary_from_buffer(rc_handle *rh, char const *buf, size_t size)
Definition: dict.c:507
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)
Definition: buildreq.c:70
VALUE_PAIR * rc_avpair_copy(VALUE_PAIR *p)
Definition: avpair.c:450
int rc_avpair_tostr(rc_handle const *rh, VALUE_PAIR *pair, char *name, int ln, char *value, int lv)
Definition: avpair.c:831
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)
Definition: buildreq.c:215
rc_send_status
Definition: radcli.h:458
int rc_avpair_assign(VALUE_PAIR *vp, void const *pval, int len)
Definition: avpair.c:135
DICT_VALUE * rc_dict_findval(rc_handle const *rh, char const *valname)
Definition: dict.c:578
int rc_send_server(rc_handle *rh, SEND_DATA *data, char *msg, rc_type type)
Definition: sendserver.c:232
int rc_avpair_parse(rc_handle const *rh, char const *buffer, VALUE_PAIR **first_pair)
Definition: avpair.c:601
rc_handle * rc_read_config(char const *filename)
Definition: config.c:568
int rc_read_dictionary(rc_handle *rh, char const *filename)
Definition: dict.c:472
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)
Definition: buildreq.c:111
int rc_check(rc_handle *rh, char *host, char *secret, unsigned short port, char *msg)
Definition: buildreq.c:303
DICT_VENDOR * rc_dict_getvend(rc_handle const *rh, uint32_t vendorspec)
Definition: dict.c:615
char * rc_conf_str(rc_handle const *rh, char const *optname)
Definition: config.c:708
rc_standard_codes
Definition: radcli.h:124
int rc_test_config(rc_handle *rh, char const *filename)
Definition: config.c:778
DICT_ATTR * rc_dict_getattr(rc_handle const *rh, uint64_t attribute)
Definition: dict.c:532
void rc_dict_free(rc_handle *rh)
Definition: dict.c:653
rc_service_type
Definition: radcli.h:274
rc_framed_protocol
Definition: radcli.h:288
rc_handle * rc_config_init(rc_handle *rh)
Definition: config.c:349
void rc_config_free(rc_handle *rh)
Definition: config.c:1062
rc_login_service_type
Definition: radcli.h:318
DICT_VALUE * rc_dict_addval(rc_handle *rh, char const *attrstr, char const *namestr, uint32_t value)
Definition: dict.c:81
int rc_find_server_addr(rc_handle const *rh, char const *server_name, struct addrinfo **info, char *secret, rc_type type)
Definition: config.c:912
DICT_VENDOR * rc_dict_addvend(rc_handle *rh, char const *vendorname, uint32_t value)
Definition: dict.c:122
SERVER * rc_conf_srv(rc_handle const *rh, char const *optname)
Definition: config.c:758
VALUE_PAIR * rc_avpair_add(rc_handle const *rh, VALUE_PAIR **list, uint32_t attrid, void const *pval, int len, uint32_t vendorspec)
Definition: avpair.c:46
rc_framed_routing_type
Definition: radcli.h:298
void rc_aaa_ctx_free(RC_AAA_CTX *ctx)
Definition: aaa_ctx.c:62
void rc_avpair_insert(VALUE_PAIR **a, VALUE_PAIR *p, VALUE_PAIR *b)
Definition: avpair.c:485
rc_attr_id
Definition: radcli.h:142
VALUE_PAIR * rc_avpair_get(VALUE_PAIR *vp, uint32_t attrid, uint32_t vendorspec)
Definition: avpair.c:433
rc_attr_type
Definition: radcli.h:112
DICT_ATTR * rc_dict_findattr(rc_handle const *rh, char const *attrname)
Definition: dict.c:555
int rc_add_config(rc_handle *rh, char const *option_name, char const *option_val, char const *source, int line)
Definition: config.c:294
VALUE_PAIR * rc_avpair_new(rc_handle const *rh, uint32_t attrid, void const *pval, int len, uint32_t vendorspec)
Definition: avpair.c:193
rc_socket_type
Definition: radcli.h:97
int rc_apply_config(rc_handle *rh)
Definition: config.c:500
@ ACCT
Request for accounting server.
Definition: radcli.h:68
@ AUTH
Request for authentication server.
Definition: radcli.h:67
@ PW_NAS_PORT_ID_STRING
Its type is string.
Definition: radcli.h:228
@ PW_ACCT_LINK_COUNT
Its type is integer.
Definition: radcli.h:193
@ PW_ACCT_INPUT_GIGAWORDS
Its type is integer.
Definition: radcli.h:194
@ PW_ORIGINATING_LINE_INFO
Its type is string.
Definition: radcli.h:235
@ PW_USER_REALM
Its type is string.
Definition: radcli.h:267
@ PW_TUNNEL_CLIENT_ENDPOINT
Its type is string.
Definition: radcli.h:207
@ PW_FILTER_ID
Its type is string.
Definition: radcli.h:153
@ PW_DIGEST_NONCE
Its type is string.
Definition: radcli.h:255
@ PW_FRAMED_POOL
Its type is string.
Definition: radcli.h:229
@ PW_NAS_IDENTIFIER
Its type is string.
Definition: radcli.h:174
@ PW_ACCT_SESSION_TIME
Its type is integer.
Definition: radcli.h:188
@ PW_NAS_PORT_TYPE
Its type is integer.
Definition: radcli.h:202
@ PW_ARAP_FEATURES
Its type is string.
Definition: radcli.h:212
@ PW_ACCT_INPUT_OCTETS
Its type is integer.
Definition: radcli.h:184
@ PW_ACCT_TUNNEL_PACKETS_LOST
Its type is integer.
Definition: radcli.h:227
@ PW_DIGEST_REALM
Its type is string.
Definition: radcli.h:254
@ PW_TUNNEL_TYPE
Its type is string.
Definition: radcli.h:205
@ PW_ACCT_STATUS_TYPE
Its type is integer.
Definition: radcli.h:182
@ PW_USER_ID
Its type is string.
Definition: radcli.h:266
@ PW_FRAMED_INTERFACE_ID
Its type is string.
Definition: radcli.h:237
@ PW_TERMINATION_ACTION
Its type is integer.
Definition: radcli.h:171
@ PW_ACCT_TUNNEL_CONNECTION
Its type is string.
Definition: radcli.h:209
@ PW_DIGEST_USER_NAME
Its type is string.
Definition: radcli.h:263
@ PW_CHAP_PASSWORD
Its type is string.
Definition: radcli.h:145
@ PW_OLD_PASSWORD
Its type is string - deprecated.
Definition: radcli.h:159
@ PW_FRAMED_APPLETALK_NETWORK
Its type is integer.
Definition: radcli.h:180
@ PW_ACCT_INPUT_PACKETS
Its type is integer.
Definition: radcli.h:189
@ PW_NAS_IP_ADDRESS
Its type is ipaddr.
Definition: radcli.h:146
@ PW_FRAMED_ROUTING
Its type is integer.
Definition: radcli.h:152
@ PW_ACCT_SESSION_ID
Its type is string.
Definition: radcli.h:186
@ PW_FRAMED_IP_ADDRESS
Its type is ipaddr.
Definition: radcli.h:150
@ PW_CONNECT_INFO
Its type is string.
Definition: radcli.h:218
@ PW_PASSWORD_RETRY
Its type is integer.
Definition: radcli.h:216
@ PW_PROXY_STATE
Its type is string.
Definition: radcli.h:175
@ PW_TUNNEL_SERVER_ENDPOINT
Its type is string.
Definition: radcli.h:208
@ PW_LOGIN_LAT_NODE
Its type is string.
Definition: radcli.h:177
@ PW_ACCT_OUTPUT_PACKETS
Its type is integer.
Definition: radcli.h:190
@ PW_EVENT_TIMESTAMP
Its type is integer.
Definition: radcli.h:196
@ PW_TUNNEL_ASSIGNMENT_ID
Its type is string.
Definition: radcli.h:223
@ PW_DIGEST_URI
Its type is string.
Definition: radcli.h:257
@ PW_SESSION_TIMEOUT
Its type is integer.
Definition: radcli.h:169
@ PW_DIGEST_QOP
Its type is string.
Definition: radcli.h:258
@ PW_FRAMED_IPV6_ROUTE
Its type is string.
Definition: radcli.h:240
@ PW_NAS_PORT
Its type is integer.
Definition: radcli.h:147
@ PW_DIGEST_BODY_DIGEST
Its type is string.
Definition: radcli.h:260
@ PW_ACCT_OUTPUT_GIGAWORDS
Its type is integer.
Definition: radcli.h:195
@ PW_DNS_SERVER_IPV6_ADDRESS
Its type is ipaddr6.
Definition: radcli.h:247
@ PW_FRAMED_COMPRESSION
Its type is integer.
Definition: radcli.h:155
@ PW_EGRESS_VLANID
Its type is string.
Definition: radcli.h:197
@ PW_FRAMED_IPV6_ADDRESS
Its type is ipaddr6.
Definition: radcli.h:246
@ PW_SERVICE_TYPE
Its type is integer.
Definition: radcli.h:148
@ PW_TUNNEL_PREFERENCE
Its type is string.
Definition: radcli.h:224
@ PW_PORT_LIMIT
Its type is integer.
Definition: radcli.h:203
@ PW_CUI
Its type is string.
Definition: radcli.h:231
@ PW_LOGIN_LAT_SERVICE
Its type is string.
Definition: radcli.h:176
@ PW_FRAMED_IPV6_POOL
Its type is string.
Definition: radcli.h:241
@ PW_TUNNEL_CLIENT_AUTH_ID
Its type is string.
Definition: radcli.h:232
@ PW_NAS_IPV6_ADDRESS
Its type is string.
Definition: radcli.h:236
@ PW_CALLED_STATION_ID
Its type is string.
Definition: radcli.h:172
@ PW_DIGEST_ATTRIBUTES
Its type is string.
Definition: radcli.h:253
@ PW_FRAMED_APPLETALK_LINK
Its type is integer.
Definition: radcli.h:179
@ PW_CALLING_STATION_ID
Its type is string.
Definition: radcli.h:173
@ PW_LOGIN_CALLBACK_NUMBER
Its type is string.
Definition: radcli.h:161
@ PW_EXPIRATION
Its type is date - deprecated.
Definition: radcli.h:163
@ PW_ARAP_SECURITY
Its type is integer.
Definition: radcli.h:214
@ PW_USER_PRIORITY_TABLE
Its type is string.
Definition: radcli.h:200
@ PW_PROMPT
Its type is integer.
Definition: radcli.h:217
@ PW_FRAMED_IPV6_PREFIX
Its type is string.
Definition: radcli.h:238
@ PW_TUNNEL_MEDIUM_TYPE
Its type is integer.
Definition: radcli.h:206
@ PW_DIGEST_NONCE_COUNT
Its type is string.
Definition: radcli.h:262
@ PW_EAP_MESSAGE
Its type is string.
Definition: radcli.h:220
@ PW_FRAMED_IP_NETMASK
Its type is ipaddr.
Definition: radcli.h:151
@ PW_LOGIN_PORT
Its type is integer.
Definition: radcli.h:158
@ PW_FRAMED_IPX_NETWORK
Its type is integer.
Definition: radcli.h:165
@ PW_DIGEST_ALGORITHM
Its type is string.
Definition: radcli.h:259
@ PW_ACCT_TERMINATE_CAUSE
Its type is integer.
Definition: radcli.h:191
@ PW_LOGIN_LAT_GROUP
Its type is string.
Definition: radcli.h:178
@ PW_TUNNEL_PASSWORD
Its type is string.
Definition: radcli.h:210
@ PW_LOGIN_IPV6_HOST
Its type is string.
Definition: radcli.h:239
@ PW_ROUTE_IPV6_INFORMATION
Its type is ipv6prefix.
Definition: radcli.h:248
@ PW_EAP_KEY_NAME
Its type is string.
Definition: radcli.h:243
@ PW_DIGEST_RESPONSE
Its type is string.
Definition: radcli.h:252
@ PW_FRAMED_MTU
Its type is integer.
Definition: radcli.h:154
@ PW_LOGIN_LAT_PORT
Its type is string.
Definition: radcli.h:204
@ PW_ACCT_MULTI_SESSION_ID
Its type is string.
Definition: radcli.h:192
@ PW_ACCT_OUTPUT_OCTETS
Its type is integer.
Definition: radcli.h:185
@ PW_FRAMED_APPLETALK_ZONE
Its type is string.
Definition: radcli.h:181
@ PW_DIGEST_CNONCE
Its type is string.
Definition: radcli.h:261
@ PW_TUNNEL_SERVER_AUTH_ID
Its type is string.
Definition: radcli.h:233
@ PW_ARAP_SECURITY_DATA
Its type is string.
Definition: radcli.h:215
@ PW_LOGIN_SERVICE
Its type is integer.
Definition: radcli.h:157
@ PW_DIGEST_METHOD
Its type is string.
Definition: radcli.h:256
@ PW_TUNNEL_PRIVATE_GROUP_ID
Its type is string.
Definition: radcli.h:222
@ PW_LOGIN_IP_HOST
Its type is ipaddr.
Definition: radcli.h:156
@ PW_ACCT_DELAY_TIME
Its type is integer.
Definition: radcli.h:183
@ PW_STATE
Its type is string.
Definition: radcli.h:166
@ PW_EGRESS_VLAN_NAME
Its type is string.
Definition: radcli.h:199
@ PW_ERROR_CAUSE
Its type is integer.
Definition: radcli.h:242
@ PW_USER_NAME
Its type is string.
Definition: radcli.h:143
@ PW_MESSAGE_AUTHENTICATOR
Its type is string.
Definition: radcli.h:221
@ PW_DELEGATED_IPV6_PREFIX
Its type is ipv6prefix.
Definition: radcli.h:244
@ PW_REPLY_MESSAGE
Its type is string.
Definition: radcli.h:160
@ PW_VENDOR_SPECIFIC
Its type is string.
Definition: radcli.h:168
@ PW_CHAP_CHALLENGE
Its type is string.
Definition: radcli.h:201
@ PW_ACCT_AUTHENTIC
Its type is integer.
Definition: radcli.h:187
@ PW_USER_PASSWORD
Its type is string.
Definition: radcli.h:144
@ PW_INGRESS_FILTERS
Its type is integer.
Definition: radcli.h:198
@ PW_CHARGEABLE_USER_IDENTITY
Its type is string.
Definition: radcli.h:230
@ PW_FRAMED_PROTOCOL
Its type is integer.
Definition: radcli.h:149
@ PW_ARAP_ZONE_ACCESS
Its type is integer.
Definition: radcli.h:213
@ PW_FRAMED_CALLBACK_ID
Its type is string.
Definition: radcli.h:162
@ PW_ARAP_CHALLENGE_RESPONSE
Its type is string.
Definition: radcli.h:225
@ PW_NAS_FILTER_RULE
Its type is string.
Definition: radcli.h:234
@ PW_IDLE_TIMEOUT
Its type is integer.
Definition: radcli.h:170
@ PW_ARAP_PASSWORD
Its type is string.
Definition: radcli.h:211
@ PW_FRAMED_ROUTE
Its type is string.
Definition: radcli.h:164
@ PW_ACCT_INTERIM_INTERVAL
Its type is integer.
Definition: radcli.h:226
@ PW_CONFIGURATION_TOKEN
Its type is string.
Definition: radcli.h:219
@ PW_CLASS
Its type is string.
Definition: radcli.h:167
@ PW_TYPE_IPADDR
The attribute is an IPv4 address in host-byte order.
Definition: radcli.h:115
@ PW_TYPE_IPV6ADDR
The attribute is an 128-bit IPv6 address.
Definition: radcli.h:117
@ PW_TYPE_MAX
Maximum number of types (last+1)
Definition: radcli.h:119
@ PW_TYPE_IPV6PREFIX
The attribute is an IPv6 prefix; the lvalue will indicate its size.
Definition: radcli.h:118
@ PW_TYPE_INTEGER
The attribute is a 32-bit integer.
Definition: radcli.h:114
@ PW_TYPE_DATE
The attribute contains a 32-bit number indicating the seconds since epoch.
Definition: radcli.h:116
@ PW_TYPE_STRING
The attribute is a printable string.
Definition: radcli.h:113
@ RC_SOCKET_UDP
Plain UDP socket.
Definition: radcli.h:98
@ RC_SOCKET_TCP
Plain TCP socket.
Definition: radcli.h:101
@ RC_SOCKET_DTLS
DTLS socket.
Definition: radcli.h:100
@ RC_SOCKET_TLS
TLS socket.
Definition: radcli.h:99
int rc_tls_fd(rc_handle *rh)
Definition: tls.c:433
int rc_check_tls(rc_handle *rh)
Definition: tls.c:464
rc_attr_type type
string, int, etc..
Definition: radcli.h:434
uint64_t value
attribute index and vendor number; use VENDOR() and ATTRID() to separate.
Definition: radcli.h:433
char name[RC_NAME_LENGTH+1]
attribute name.
Definition: radcli.h:432
rc_attr_type type
attribute type.
Definition: radcli.h:479
char pad[32]
unused pad
Definition: radcli.h:483
uint64_t attribute
attribute numeric value of type rc_attr_id including vendor; use VENDOR() and ATTRID() to separate.
Definition: radcli.h:478
uint32_t lvalue
attribute value if type is PW_TYPE_INTEGER, PW_TYPE_DATE or PW_TYPE_IPADDR.
Definition: radcli.h:480
char strvalue[AUTH_STRING_LEN+1]
contains attribute value in other cases.
Definition: radcli.h:481
char name[RC_NAME_LENGTH+1]
attribute name if known.
Definition: radcli.h:477
int timeout
Session timeout in seconds.
Definition: radcli.h:493
char * secret
Shared secret of RADIUS server.
Definition: radcli.h:492
uint8_t seq_nbr
Packet sequence number.
Definition: radcli.h:489
int svc_port
RADIUS protocol destination port.
Definition: radcli.h:491
char * server
Name/addrress of RADIUS server.
Definition: radcli.h:490
VALUE_PAIR * send_pairs
More a/v pairs to send.
Definition: radcli.h:495
VALUE_PAIR * receive_pairs
Where to place received a/v pairs.
Definition: radcli.h:496
uint8_t code
RADIUS packet code.
Definition: radcli.h:488
Definition: radcli.h:87
double deadtime_ends[RC_SERVER_MAX]
unused
Definition: radcli.h:92