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