34#include <netinet/in.h>
37#include <sys/socket.h>
53#define AUTH_PASS_LEN (8 * 16)
56#define RC_BUFFER_LEN 8192
57#define RC_MAX_PACKET_LEN 4096
59#define RC_NAME_LENGTH 64
61#define MAX_SECRET_LENGTH (16 * 16)
63#define RADCLI_VENDOR_MASK 0xffffffff
64#define VENDOR_BIT_SIZE 32
65#define RADCLI_VENDOR_ATTR_SET(attr, vendor) ((attr)|((uint64_t)((vendor)&RADCLI_VENDOR_MASK)) << VENDOR_BIT_SIZE)
67#define VENDOR(x) (((x) >> VENDOR_BIT_SIZE) & 0xffffffff)
68#define ATTRID(x) ((x) & 0xffffffff)
70#define PW_MAX_MSG_SIZE 4096
81#define RC_SERVER_MAX 8
83#define AUTH_LOCAL_FST (1<<0)
84#define AUTH_RADIUS_FST (1<<1)
85#define AUTH_LOCAL_SND (1<<2)
86#define AUTH_RADIUS_SND (1<<3)
89typedef struct rc_conf rc_handle;
97 char *name[RC_SERVER_MAX];
98 uint16_t port[RC_SERVER_MAX];
99 char *secret[RC_SERVER_MAX];
112#define AUTH_HDR_LEN 20
113#define CHAP_VALUE_LENGTH 16
115#define PW_AUTH_UDP_PORT 1812
116#define PW_ACCT_UDP_PORT 1813
136 PW_ACCOUNTING_REQUEST=4,
137 PW_ACCOUNTING_RESPONSE=5,
138 PW_ACCOUNTING_STATUS=6,
139 PW_PASSWORD_REQUEST=7,
141 PW_PASSWORD_REJECT=9,
142 PW_ACCOUNTING_MESSAGE=10,
143 PW_ACCESS_CHALLENGE=11,
286 PW_CALLBACK_FRAMED=4,
290 PW_AUTHENTICATE_ONLY=8,
291 PW_CALLBACK_NAS_PROMPT=9
310 PW_BROADCAST_LISTEN=3
319 PW_VAN_JACOBSON_TCP_IP=1,
320 PW_IPX_HEADER_COMPRESSION=2,
350 PW_STATUS_MODEM_START=4,
351 PW_STATUS_MODEM_STOP=5,
363 PW_ACCT_IDLE_TIMEOUT=4,
364 PW_ACCT_SESSION_TIMEOUT=5,
372 PW_PORT_PREEMPTED=13,
373 PW_PORT_SUSPENDED=14,
374 PW_SERVICE_UNAVAILABLE=15,
403 VENDOR_MICROSOFT = 311,
404 VENDOR_ROARING_PENGUIN = 10055
408enum rc_vendor_attr_microsoft {
409 PW_MS_CHAP_CHALLENGE = 11,
410 PW_MS_CHAP_RESPONSE = 1,
411 PW_MS_CHAP2_RESPONSE = 25,
412 PW_MS_CHAP2_SUCCESS = 26,
413 PW_MS_MPPE_ENCRYPTION_POLICY= 7,
414 PW_MS_MPPE_ENCRYPTION_TYPE= 8,
415 PW_MS_MPPE_ENCRYPTION_TYPES=PW_MS_MPPE_ENCRYPTION_TYPE,
416 PW_MS_CHAP_MPPE_KEYS = 12,
417 PW_MS_MPPE_SEND_KEY = 16,
418 PW_MS_MPPE_RECV_KEY = 17,
419 PW_MS_PRIMARY_DNS_SERVER= 28,
420 PW_MS_SECONDARY_DNS_SERVER= 29,
421 PW_MS_PRIMARY_NBNS_SERVER= 30,
422 PW_MS_SECONDARY_NBNS_SERVER= 31,
426enum rc_vendor_attr_roaringpenguin {
427 PW_RP_UPSTREAM_LIMIT =1,
428 PW_RP_DOWNSTREAM_LIMIT =2,
433#define PW_AUTH_ONLY 3
454 char attrname[RC_NAME_LENGTH +1];
455 char name[RC_NAME_LENGTH + 1];
465 char vendorname[RC_NAME_LENGTH +1];
471#define MGMT_POLL_SECRET "Hardlyasecret"
487# define AUTH_STRING_LEN 253
525#define AUTH_VECTOR_LEN 16
540#define RC_MIN(a, b) ((a) < (b) ? (a) : (b))
543#define RC_MAX(a, b) ((a) > (b) ? (a) : (b))
636VALUE_PAIR *
rc_avpair_add (rc_handle
const *rh, VALUE_PAIR **list, uint32_t attrid,
void const *pval,
int len, uint32_t vendorspec);
638VALUE_PAIR *
rc_avpair_new (rc_handle
const *rh, uint32_t attrid,
void const *pval,
int len, uint32_t vendorspec);
639VALUE_PAIR *
rc_avpair_gen(rc_handle
const *rh, VALUE_PAIR *pair,
unsigned char const *ptr,
640 int length, uint32_t vendorspec);
641void rc_avpair_remove (VALUE_PAIR **list, uint32_t attrid, uint32_t vendorspec);
642VALUE_PAIR *
rc_avpair_get (VALUE_PAIR *vp, uint32_t attrid, uint32_t vendorspec);
646int rc_avpair_parse (rc_handle
const *rh,
char const *buffer, VALUE_PAIR **first_pair);
647int rc_avpair_tostr (rc_handle
const *rh, VALUE_PAIR *pair,
char *name,
int ln,
char *value,
int lv);
648char *
rc_avpair_log(rc_handle
const *rh, VALUE_PAIR *pair,
char *buf,
size_t buf_len);
658void rc_buildreq(rc_handle
const *rh, SEND_DATA *data,
int code,
char *
server,
unsigned short port,
659 char *secret,
int timeout,
int retries);
660int rc_auth(rc_handle *rh, uint32_t client_port, VALUE_PAIR *send,
661 VALUE_PAIR **received,
char *msg);
662int rc_auth_proxy(rc_handle *rh, VALUE_PAIR *send, VALUE_PAIR **received,
char *msg);
663int rc_acct(rc_handle *rh, uint32_t client_port, VALUE_PAIR *send);
684int rc_acct_async(rc_handle *rh, uint32_t client_port, VALUE_PAIR *send);
686int rc_check(rc_handle *rh,
char *host,
char *secret,
unsigned short port,
char *msg);
688int rc_aaa(rc_handle *rh, uint32_t client_port, VALUE_PAIR *send, VALUE_PAIR **received,
691 VALUE_PAIR **received,
694 rc_type type, uint32_t client_port,
695 VALUE_PAIR *send, VALUE_PAIR **received,
700int rc_add_config(rc_handle *rh,
char const *option_name,
char const *option_val,
char const *source,
int line);
703char *
rc_conf_str(rc_handle
const *rh,
char const *optname);
704int rc_conf_int(rc_handle
const *rh,
char const *optname);
705SERVER *
rc_conf_srv(rc_handle
const *rh,
char const *optname);
709 struct addrinfo** info,
char *secret,
rc_type type);
715#define test_config rc_test_config
722DICT_ATTR *
rc_dict_addattr(rc_handle *rh,
char const * namestr, uint32_t value,
int type, uint32_t vendorspec);
723DICT_VALUE *
rc_dict_addval(rc_handle *rh,
char const * attrstr,
char const * namestr, uint32_t value);
724DICT_VENDOR *
rc_dict_addvend(rc_handle *rh,
char const * vendorname, uint32_t value);
730DICT_VENDOR *
rc_dict_getvend (rc_handle
const *rh, uint32_t vendorspec);
731DICT_VALUE *
rc_dict_getval(rc_handle
const *rh, uint32_t value,
char const *attrname);
744int rc_get_srcaddr(
struct sockaddr *lia,
const struct sockaddr *ria);
765#define _RADCLI_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
766#if !defined RADCLI_INTERNAL_BUILD
767# if _RADCLI_GCC_VERSION >= 30100
768# define _RADCLI_GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__))
771char *
rc_mksid(
void) _RADCLI_GCC_ATTR_DEPRECATED;
unsigned short rc_getport(int type)
Get the port number for the supplied request type.
void rc_setdebug(int debug)
Set debug logging level.
int rc_get_srcaddr(struct sockaddr *lia, const struct sockaddr *ria)
Find outbound interface address for a given destination.
void rc_openlog(char const *ident)
Open the system log for radcli messages.
int rc_own_hostname(char *hostname, int len)
Get the hostname of this machine.
void rc_avpair_remove(VALUE_PAIR **list, uint32_t attrid, uint32_t vendorspec)
Removes an attribute-value pair from the given list.
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.
int rc_avpair_get_raw(VALUE_PAIR *vp, char **res, unsigned *res_size)
Get the raw value of the given attribute value-pair.
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.
rc_socket_type rc_get_socket_type(rc_handle *rh)
Returns the type of the socket used.
VALUE_PAIR * rc_avpair_next(VALUE_PAIR *t)
Iterates through the attribute-value pairs.
rc_handle * rc_new(void)
Initialises new Radius Client handle.
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.
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.
int rc_auth_proxy(rc_handle *rh, VALUE_PAIR *send, VALUE_PAIR **received, char *msg)
Builds an authentication request for proxying.
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...
struct rc_aaa_ctx_st RC_AAA_CTX
int rc_avpair_get_uint32(VALUE_PAIR *vp, uint32_t *res)
Get the integer value of the given attribute value-pair.
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.
DICT_ATTR * rc_dict_addattr(rc_handle *rh, char const *namestr, uint32_t value, int type, uint32_t vendorspec)
Add attribute to dictionary.
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.
void rc_avpair_get_attr(VALUE_PAIR *vp, unsigned *type, unsigned *id)
Get the attribute ID and type of the given attribute value-pair.
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.
void rc_destroy(rc_handle *rh)
Destroys Radius Client handle reclaiming all memory.
DICT_VENDOR * rc_dict_findvend(rc_handle const *rh, char const *vendorname)
Lookup a DICT_VENDOR by its name.
int rc_acct_proxy(rc_handle *rh, VALUE_PAIR *send)
Builds an accounting request with the value_pairs at send.
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.
void rc_avpair_free(VALUE_PAIR *pair)
Frees all value_pairs in the list.
int rc_read_dictionary_from_buffer(rc_handle *rh, char const *buf, size_t size)
Initialize the dictionary from Buffer.
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.
VALUE_PAIR * rc_avpair_copy(VALUE_PAIR *p)
Return a copy of the existing list "p" ala strdup().
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.
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...
int rc_avpair_assign(VALUE_PAIR *vp, void const *pval, int len)
Assigns the given value to an attribute-value pair.
DICT_VALUE * rc_dict_findval(rc_handle const *rh, char const *valname)
Lookup a DICT_VALUE by its name.
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.
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.
int rc_avpair_parse(rc_handle const *rh, char const *buffer, VALUE_PAIR **first_pair)
Parses the buffer to extract the attribute-value pairs.
rc_handle * rc_read_config(char const *filename)
Read the global config file.
int rc_read_dictionary(rc_handle *rh, char const *filename)
Initialize the dictionary.
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.
int rc_conf_int(rc_handle const *rh, char const *optname)
Get the value of a config option as an integer.
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.
DICT_VENDOR * rc_dict_getvend(rc_handle const *rh, uint32_t vendorspec)
Lookup a DICT_VENDOR by its IANA number.
char * rc_conf_str(rc_handle const *rh, char const *optname)
Get the value of a config option.
int rc_test_config(rc_handle *rh, char const *filename)
Tests the configuration the user supplied.
DICT_ATTR * rc_dict_getattr(rc_handle const *rh, uint64_t attribute)
Lookup a DICT_ATTR by attribute number.
void rc_dict_free(rc_handle *rh)
Frees the allocated dictionary.
rc_handle * rc_config_init(rc_handle *rh)
Initialise a configuration structure for programmatic configuration.
void rc_config_free(rc_handle *rh)
Frees allocated config values.
DICT_VALUE * rc_dict_addval(rc_handle *rh, char const *attrstr, char const *namestr, uint32_t value)
Add value to dictionary.
int rc_find_server_addr(rc_handle const *rh, char const *server_name, struct addrinfo **info, char *secret, rc_type type)
Locate a server in the rh config or if not found, check for a servers file.
DICT_VENDOR * rc_dict_addvend(rc_handle *rh, char const *vendorname, uint32_t value)
Add vendor to dictionary.
SERVER * rc_conf_srv(rc_handle const *rh, char const *optname)
Get the value of a config option.
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.
void rc_aaa_ctx_free(RC_AAA_CTX *ctx)
Deinitializes an RC_AAA_CTX structure.
void rc_avpair_insert(VALUE_PAIR **a, VALUE_PAIR *p, VALUE_PAIR *b)
Insert a VALUE_PAIR into a list.
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...
DICT_ATTR * rc_dict_findattr(rc_handle const *rh, char const *attrname)
Lookup a DICT_ATTR by its name.
int rc_add_config(rc_handle *rh, char const *option_name, char const *option_val, char const *source, int line)
Allow a config option to be added to rc_handle from inside a program.
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.
int rc_apply_config(rc_handle *rh)
Apply configuration and initialise the transport.
@ ACCT
Request for accounting server.
@ AUTH
Request for authentication server.
@ PW_NAS_PORT_ID_STRING
Its type is string.
@ PW_ACCT_LINK_COUNT
Its type is integer.
@ PW_ACCT_INPUT_GIGAWORDS
Its type is integer.
@ PW_ORIGINATING_LINE_INFO
Its type is string.
@ PW_USER_REALM
Its type is string.
@ PW_TUNNEL_CLIENT_ENDPOINT
Its type is string.
@ PW_FILTER_ID
Its type is string.
@ PW_DIGEST_NONCE
Its type is string.
@ PW_FRAMED_POOL
Its type is string.
@ PW_NAS_IDENTIFIER
Its type is string.
@ PW_ACCT_SESSION_TIME
Its type is integer.
@ PW_NAS_PORT_TYPE
Its type is integer.
@ PW_ARAP_FEATURES
Its type is string.
@ PW_ACCT_INPUT_OCTETS
Its type is integer.
@ PW_ACCT_TUNNEL_PACKETS_LOST
Its type is integer.
@ PW_DIGEST_REALM
Its type is string.
@ PW_TUNNEL_TYPE
Its type is string.
@ PW_ACCT_STATUS_TYPE
Its type is integer.
@ PW_USER_ID
Its type is string.
@ PW_FRAMED_INTERFACE_ID
Its type is string.
@ PW_TERMINATION_ACTION
Its type is integer.
@ PW_ACCT_TUNNEL_CONNECTION
Its type is string.
@ PW_DIGEST_USER_NAME
Its type is string.
@ PW_CHAP_PASSWORD
Its type is string.
@ PW_OLD_PASSWORD
Its type is string - deprecated.
@ PW_FRAMED_APPLETALK_NETWORK
Its type is integer.
@ PW_ACCT_INPUT_PACKETS
Its type is integer.
@ PW_NAS_IP_ADDRESS
Its type is ipaddr.
@ PW_FRAMED_ROUTING
Its type is integer.
@ PW_ACCT_SESSION_ID
Its type is string.
@ PW_FRAMED_IP_ADDRESS
Its type is ipaddr.
@ PW_CONNECT_INFO
Its type is string.
@ PW_PASSWORD_RETRY
Its type is integer.
@ PW_PROXY_STATE
Its type is string.
@ PW_TUNNEL_SERVER_ENDPOINT
Its type is string.
@ PW_LOGIN_LAT_NODE
Its type is string.
@ PW_ACCT_OUTPUT_PACKETS
Its type is integer.
@ PW_EVENT_TIMESTAMP
Its type is integer.
@ PW_TUNNEL_ASSIGNMENT_ID
Its type is string.
@ PW_DIGEST_URI
Its type is string.
@ PW_SESSION_TIMEOUT
Its type is integer.
@ PW_DIGEST_QOP
Its type is string.
@ PW_FRAMED_IPV6_ROUTE
Its type is string.
@ PW_NAS_PORT
Its type is integer.
@ PW_DIGEST_BODY_DIGEST
Its type is string.
@ PW_ACCT_OUTPUT_GIGAWORDS
Its type is integer.
@ PW_DNS_SERVER_IPV6_ADDRESS
Its type is ipaddr6.
@ PW_FRAMED_COMPRESSION
Its type is integer.
@ PW_EGRESS_VLANID
Its type is string.
@ PW_FRAMED_IPV6_ADDRESS
Its type is ipaddr6.
@ PW_SERVICE_TYPE
Its type is integer.
@ PW_TUNNEL_PREFERENCE
Its type is string.
@ PW_PORT_LIMIT
Its type is integer.
@ PW_CUI
Its type is string.
@ PW_LOGIN_LAT_SERVICE
Its type is string.
@ PW_FRAMED_IPV6_POOL
Its type is string.
@ PW_TUNNEL_CLIENT_AUTH_ID
Its type is string.
@ PW_NAS_IPV6_ADDRESS
Its type is string.
@ PW_CALLED_STATION_ID
Its type is string.
@ PW_DIGEST_ATTRIBUTES
Its type is string.
@ PW_FRAMED_APPLETALK_LINK
Its type is integer.
@ PW_CALLING_STATION_ID
Its type is string.
@ PW_LOGIN_CALLBACK_NUMBER
Its type is string.
@ PW_EXPIRATION
Its type is date - deprecated.
@ PW_ARAP_SECURITY
Its type is integer.
@ PW_USER_PRIORITY_TABLE
Its type is string.
@ PW_PROMPT
Its type is integer.
@ PW_FRAMED_IPV6_PREFIX
Its type is string.
@ PW_TUNNEL_MEDIUM_TYPE
Its type is integer.
@ PW_DIGEST_NONCE_COUNT
Its type is string.
@ PW_EAP_MESSAGE
Its type is string.
@ PW_FRAMED_IP_NETMASK
Its type is ipaddr.
@ PW_LOGIN_PORT
Its type is integer.
@ PW_FRAMED_IPX_NETWORK
Its type is integer.
@ PW_DIGEST_ALGORITHM
Its type is string.
@ PW_ACCT_TERMINATE_CAUSE
Its type is integer.
@ PW_LOGIN_LAT_GROUP
Its type is string.
@ PW_TUNNEL_PASSWORD
Its type is string.
@ PW_LOGIN_IPV6_HOST
Its type is string.
@ PW_ROUTE_IPV6_INFORMATION
Its type is ipv6prefix.
@ PW_EAP_KEY_NAME
Its type is string.
@ PW_DIGEST_RESPONSE
Its type is string.
@ PW_FRAMED_MTU
Its type is integer.
@ PW_LOGIN_LAT_PORT
Its type is string.
@ PW_ACCT_MULTI_SESSION_ID
Its type is string.
@ PW_ACCT_OUTPUT_OCTETS
Its type is integer.
@ PW_FRAMED_APPLETALK_ZONE
Its type is string.
@ PW_DIGEST_CNONCE
Its type is string.
@ PW_TUNNEL_SERVER_AUTH_ID
Its type is string.
@ PW_ARAP_SECURITY_DATA
Its type is string.
@ PW_LOGIN_SERVICE
Its type is integer.
@ PW_DIGEST_METHOD
Its type is string.
@ PW_TUNNEL_PRIVATE_GROUP_ID
Its type is string.
@ PW_LOGIN_IP_HOST
Its type is ipaddr.
@ PW_ACCT_DELAY_TIME
Its type is integer.
@ PW_STATE
Its type is string.
@ PW_EGRESS_VLAN_NAME
Its type is string.
@ PW_ERROR_CAUSE
Its type is integer.
@ PW_USER_NAME
Its type is string.
@ PW_MESSAGE_AUTHENTICATOR
Its type is string.
@ PW_DELEGATED_IPV6_PREFIX
Its type is ipv6prefix.
@ PW_REPLY_MESSAGE
Its type is string.
@ PW_VENDOR_SPECIFIC
Its type is string.
@ PW_CHAP_CHALLENGE
Its type is string.
@ PW_ACCT_AUTHENTIC
Its type is integer.
@ PW_USER_PASSWORD
Its type is string.
@ PW_INGRESS_FILTERS
Its type is integer.
@ PW_CHARGEABLE_USER_IDENTITY
Its type is string.
@ PW_FRAMED_PROTOCOL
Its type is integer.
@ PW_ARAP_ZONE_ACCESS
Its type is integer.
@ PW_FRAMED_CALLBACK_ID
Its type is string.
@ PW_ARAP_CHALLENGE_RESPONSE
Its type is string.
@ PW_NAS_FILTER_RULE
Its type is string.
@ PW_IDLE_TIMEOUT
Its type is integer.
@ PW_ARAP_PASSWORD
Its type is string.
@ PW_FRAMED_ROUTE
Its type is string.
@ PW_ACCT_INTERIM_INTERVAL
Its type is integer.
@ PW_CONFIGURATION_TOKEN
Its type is string.
@ PW_CLASS
Its type is string.
@ PW_TYPE_IPADDR
The attribute is an IPv4 address in host-byte order.
@ PW_TYPE_IPV6ADDR
The attribute is an 128-bit IPv6 address.
@ PW_TYPE_MAX
Maximum number of types (last+1)
@ PW_TYPE_IPV6PREFIX
The attribute is an IPv6 prefix; the lvalue will indicate its size.
@ PW_TYPE_INTEGER
The attribute is a 32-bit integer.
@ PW_TYPE_DATE
The attribute contains a 32-bit number indicating the seconds since epoch.
@ PW_TYPE_STRING
The attribute is a printable string.
@ RC_SOCKET_UDP
Plain UDP socket.
@ RC_SOCKET_TCP
Plain TCP socket.
@ RC_SOCKET_DTLS
DTLS socket.
@ RC_SOCKET_TLS
TLS socket.
int rc_tls_fd(rc_handle *rh)
Returns the file descriptor of the TLS/DTLS session.
int rc_check_tls(rc_handle *rh)
Check established TLS/DTLS channels for operation and reconnect if needed.
char * rc_mksid(void) _RADCLI_GCC_ATTR_DEPRECATED
Generate a "unique" session-ID string.
rc_attr_type type
string, int, etc..
uint64_t value
attribute index and vendor number; use VENDOR() and ATTRID() to separate.
char name[RC_NAME_LENGTH+1]
attribute name.
rc_attr_type type
attribute type.
uint64_t attribute
attribute numeric value of type rc_attr_id including vendor; use VENDOR() and ATTRID() to separate.
uint32_t lvalue
attribute value if type is PW_TYPE_INTEGER, PW_TYPE_DATE or PW_TYPE_IPADDR.
char strvalue[AUTH_STRING_LEN+1]
contains attribute value in other cases.
char name[RC_NAME_LENGTH+1]
attribute name if known.
int timeout
Session timeout in seconds.
char * secret
Shared secret of RADIUS server.
uint8_t seq_nbr
Packet sequence number.
int svc_port
RADIUS protocol destination port.
char * server
Name/address of RADIUS server.
VALUE_PAIR * send_pairs
More a/v pairs to send.
VALUE_PAIR * receive_pairs
Where to place received a/v pairs.
uint8_t code
RADIUS packet code.
double deadtime_ends[RC_SERVER_MAX]
unused