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