Radcli library 1.5.3
A simple radius library
Loading...
Searching...
No Matches
radcli.h File Reference

Public API of the radcli library. More...

#include <sys/types.h>
#include <stdint.h>
#include <stdio.h>
#include <time.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <netdb.h>

Go to the source code of this file.

Data Structures

struct  server
struct  dict_attr
struct  dict_value
struct  dict_vendor
struct  rc_value_pair
struct  send_data

Macros

#define AUTH_PASS_LEN   (8 * 16) /* multiple of 16 */
#define AUTH_ID_LEN   64
#define RC_BUFFER_LEN   8192
#define RC_MAX_PACKET_LEN   4096 /* RFC 2865: maximum RADIUS packet size */
#define RC_NAME_LENGTH   64
#define MAX_SECRET_LENGTH   (16 * 16) /* MUST be multiple of 16 */
#define RADCLI_VENDOR_MASK   0xffffffff
#define VENDOR_BIT_SIZE   32
#define RADCLI_VENDOR_ATTR_SET(attr, vendor)
#define VENDOR(x)
#define ATTRID(x)
#define PW_MAX_MSG_SIZE   4096
#define RC_SERVER_MAX   8
#define AUTH_LOCAL_FST   (1<<0)
#define AUTH_RADIUS_FST   (1<<1)
#define AUTH_LOCAL_SND   (1<<2)
#define AUTH_RADIUS_SND   (1<<3)
#define AUTH_HDR_LEN   20
#define CHAP_VALUE_LENGTH   16
#define PW_AUTH_UDP_PORT   1812
#define PW_ACCT_UDP_PORT   1813
#define PW_DUMB   0
 1 and 2 are defined in FRAMED PROTOCOLS.
#define PW_AUTH_ONLY   3
#define PW_ALL   255
#define MGMT_POLL_SECRET   "Hardlyasecret"
 Default for Merit radiusd.
#define AUTH_STRING_LEN   253 /* maximum of 253 */
#define AUTH_VECTOR_LEN   16
#define RC_MIN(a, b)
#define RC_MAX(a, b)
#define PATH_MAX   1024
#define ENV_SIZE   128
#define test_config   rc_test_config
#define rc_log   syslog
#define _RADCLI_GCC_VERSION   (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)

Typedefs

typedef enum rc_type rc_type
typedef struct rc_conf rc_handle
typedef struct server SERVER
typedef enum rc_socket_type rc_socket_type
typedef enum rc_attr_type rc_attr_type
typedef enum rc_standard_codes rc_standard_codes
typedef enum rc_attr_id rc_attr_id
typedef enum rc_service_type rc_service_type
typedef enum rc_framed_protocol rc_framed_protocol
typedef enum rc_framed_routing_type rc_framed_routing_type
typedef enum rc_framed_comp rc_framed_comp
typedef enum rc_login_service_type rc_login_service_type
typedef enum rc_termination_action rc_termination_action
typedef enum rc_acct_status_type rc_acct_status_type
typedef enum rc_acct_terminate_cause rc_acct_terminate_cause
typedef enum rc_nas_port_type rc_nas_port_type
typedef enum rc_acct_auth_type rc_acct_auth_type
typedef enum rc_vendor_pec rc_vendor_type
typedef struct dict_attr DICT_ATTR
typedef struct dict_value DICT_VALUE
typedef struct dict_vendor DICT_VENDOR
typedef enum rc_send_status rc_send_status
typedef struct rc_value_pair VALUE_PAIR
typedef struct send_data SEND_DATA
typedef struct rc_aaa_ctx_st RC_AAA_CTX

Enumerations

enum  rc_type { AUTH = 0 , ACCT = 1 }
enum  rc_socket_type { RC_SOCKET_UDP = 0 , RC_SOCKET_TLS = 1 , RC_SOCKET_DTLS = 2 , RC_SOCKET_TCP = 3 }
enum  rc_attr_type {
  PW_TYPE_STRING =0 , PW_TYPE_INTEGER =1 , PW_TYPE_IPADDR =2 , PW_TYPE_DATE =3 ,
  PW_TYPE_IPV6ADDR =4 , PW_TYPE_IPV6PREFIX =5 , PW_TYPE_MAX =6
}
enum  rc_standard_codes {
  PW_ACCESS_REQUEST =1 , PW_ACCESS_ACCEPT =2 , PW_ACCESS_REJECT =3 , PW_ACCOUNTING_REQUEST =4 ,
  PW_ACCOUNTING_RESPONSE =5 , PW_ACCOUNTING_STATUS =6 , PW_PASSWORD_REQUEST =7 , PW_PASSWORD_ACK =8 ,
  PW_PASSWORD_REJECT =9 , PW_ACCOUNTING_MESSAGE =10 , PW_ACCESS_CHALLENGE =11 , PW_STATUS_SERVER =12 ,
  PW_STATUS_CLIENT =13
}
enum  rc_attr_id {
  PW_USER_NAME =1 , PW_USER_PASSWORD =2 , PW_CHAP_PASSWORD =3 , PW_NAS_IP_ADDRESS =4 ,
  PW_NAS_PORT =5 , PW_SERVICE_TYPE =6 , PW_FRAMED_PROTOCOL =7 , PW_FRAMED_IP_ADDRESS =8 ,
  PW_FRAMED_IP_NETMASK =9 , PW_FRAMED_ROUTING =10 , PW_FILTER_ID =11 , PW_FRAMED_MTU =12 ,
  PW_FRAMED_COMPRESSION =13 , PW_LOGIN_IP_HOST =14 , PW_LOGIN_SERVICE =15 , PW_LOGIN_PORT =16 ,
  PW_OLD_PASSWORD =17 , PW_REPLY_MESSAGE =18 , PW_LOGIN_CALLBACK_NUMBER =19 , PW_FRAMED_CALLBACK_ID =20 ,
  PW_EXPIRATION =21 , PW_FRAMED_ROUTE =22 , PW_FRAMED_IPX_NETWORK =23 , PW_STATE =24 ,
  PW_CLASS =25 , PW_VENDOR_SPECIFIC =26 , PW_SESSION_TIMEOUT =27 , PW_IDLE_TIMEOUT =28 ,
  PW_TERMINATION_ACTION =29 , PW_CALLED_STATION_ID =30 , PW_CALLING_STATION_ID =31 , PW_NAS_IDENTIFIER =32 ,
  PW_PROXY_STATE =33 , PW_LOGIN_LAT_SERVICE =34 , PW_LOGIN_LAT_NODE =35 , PW_LOGIN_LAT_GROUP =36 ,
  PW_FRAMED_APPLETALK_LINK =37 , PW_FRAMED_APPLETALK_NETWORK =38 , PW_FRAMED_APPLETALK_ZONE =39 , PW_ACCT_STATUS_TYPE =40 ,
  PW_ACCT_DELAY_TIME =41 , PW_ACCT_INPUT_OCTETS =42 , PW_ACCT_OUTPUT_OCTETS =43 , PW_ACCT_SESSION_ID =44 ,
  PW_ACCT_AUTHENTIC =45 , PW_ACCT_SESSION_TIME =46 , PW_ACCT_INPUT_PACKETS =47 , PW_ACCT_OUTPUT_PACKETS =48 ,
  PW_ACCT_TERMINATE_CAUSE =49 , PW_ACCT_MULTI_SESSION_ID =50 , PW_ACCT_LINK_COUNT =51 , PW_ACCT_INPUT_GIGAWORDS =52 ,
  PW_ACCT_OUTPUT_GIGAWORDS =53 , PW_EVENT_TIMESTAMP =55 , PW_EGRESS_VLANID =56 , PW_INGRESS_FILTERS =57 ,
  PW_EGRESS_VLAN_NAME =58 , PW_USER_PRIORITY_TABLE =59 , PW_CHAP_CHALLENGE =60 , PW_NAS_PORT_TYPE =61 ,
  PW_PORT_LIMIT =62 , PW_LOGIN_LAT_PORT =63 , PW_TUNNEL_TYPE =64 , PW_TUNNEL_MEDIUM_TYPE =65 ,
  PW_TUNNEL_CLIENT_ENDPOINT =66 , PW_TUNNEL_SERVER_ENDPOINT =67 , PW_ACCT_TUNNEL_CONNECTION =68 , PW_TUNNEL_PASSWORD =69 ,
  PW_ARAP_PASSWORD =70 , PW_ARAP_FEATURES =71 , PW_ARAP_ZONE_ACCESS =72 , PW_ARAP_SECURITY =73 ,
  PW_ARAP_SECURITY_DATA =74 , PW_PASSWORD_RETRY =75 , PW_PROMPT =76 , PW_CONNECT_INFO =77 ,
  PW_CONFIGURATION_TOKEN =78 , PW_EAP_MESSAGE =79 , PW_MESSAGE_AUTHENTICATOR =80 , PW_TUNNEL_PRIVATE_GROUP_ID =81 ,
  PW_TUNNEL_ASSIGNMENT_ID =82 , PW_TUNNEL_PREFERENCE =83 , PW_ARAP_CHALLENGE_RESPONSE =84 , PW_ACCT_INTERIM_INTERVAL =85 ,
  PW_ACCT_TUNNEL_PACKETS_LOST =86 , PW_NAS_PORT_ID_STRING =87 , PW_FRAMED_POOL =88 , PW_CHARGEABLE_USER_IDENTITY =89 ,
  PW_CUI =89 , PW_TUNNEL_CLIENT_AUTH_ID =90 , PW_TUNNEL_SERVER_AUTH_ID =91 , PW_NAS_FILTER_RULE =92 ,
  PW_ORIGINATING_LINE_INFO =94 , PW_NAS_IPV6_ADDRESS =95 , PW_FRAMED_INTERFACE_ID =96 , PW_FRAMED_IPV6_PREFIX =97 ,
  PW_LOGIN_IPV6_HOST =98 , PW_FRAMED_IPV6_ROUTE =99 , PW_FRAMED_IPV6_POOL =100 , PW_ERROR_CAUSE =101 ,
  PW_EAP_KEY_NAME =102 , PW_DELEGATED_IPV6_PREFIX =123 , PW_FRAMED_IPV6_ADDRESS =168 , PW_DNS_SERVER_IPV6_ADDRESS =169 ,
  PW_ROUTE_IPV6_INFORMATION =170 , PW_DIGEST_RESPONSE =206 , PW_DIGEST_ATTRIBUTES =207 , PW_DIGEST_REALM =1063 ,
  PW_DIGEST_NONCE =1064 , PW_DIGEST_METHOD =1065 , PW_DIGEST_URI =1066 , PW_DIGEST_QOP =1067 ,
  PW_DIGEST_ALGORITHM =1068 , PW_DIGEST_BODY_DIGEST =1069 , PW_DIGEST_CNONCE =1070 , PW_DIGEST_NONCE_COUNT =1071 ,
  PW_DIGEST_USER_NAME =1072 , PW_USER_ID =222 , PW_USER_REALM =223
}
enum  rc_service_type {
  PW_LOGIN =1 , PW_FRAMED =2 , PW_CALLBACK_LOGIN =3 , PW_CALLBACK_FRAMED =4 ,
  PW_OUTBOUND =5 , PW_ADMINISTRATIVE =6 , PW_NAS_PROMPT =7 , PW_AUTHENTICATE_ONLY =8 ,
  PW_CALLBACK_NAS_PROMPT =9
}
enum  rc_framed_protocol {
  PW_PPP =1 , PW_SLIP =2 , PW_ARA = 3 , PW_GANDALF =4 ,
  PW_XYLOGICS =5
}
enum  rc_framed_routing_type { PW_NONE =0 , PW_BROADCAST =1 , PW_LISTEN =2 , PW_BROADCAST_LISTEN =3 }
enum  rc_framed_comp { PW_COMP_NONE =0 , PW_VAN_JACOBSON_TCP_IP =1 , PW_IPX_HEADER_COMPRESSION =2 , PW_COMP_LZS =3 }
enum  rc_login_service_type {
  PW_TELNET =0 , PW_RLOGIN =1 , PW_TCP_CLEAR =2 , PW_PORTMASTER =3 ,
  PW_LAT =4 , PW_X25_PAD =5 , PW_X25_T3POS =6
}
enum  rc_termination_action { PW_DEFAULT =0 , PW_RADIUS_REQUEST =1 }
enum  rc_acct_status_type {
  PW_STATUS_START =1 , PW_STATUS_STOP =2 , PW_STATUS_ALIVE =3 , PW_STATUS_MODEM_START =4 ,
  PW_STATUS_MODEM_STOP =5 , PW_STATUS_CANCEL =6 , PW_ACCOUNTING_ON =7 , PW_ACCOUNTING_OFF =8
}
enum  rc_acct_terminate_cause {
  PW_USER_REQUEST =1 , PW_LOST_CARRIER =2 , PW_LOST_SERVICE =3 , PW_ACCT_IDLE_TIMEOUT =4 ,
  PW_ACCT_SESSION_TIMEOUT =5 , PW_ADMIN_RESET =6 , PW_ADMIN_REBOOT =7 , PW_PORT_ERROR =8 ,
  PW_NAS_ERROR =9 , PW_NAS_REQUEST =10 , PW_NAS_REBOOT =11 , PW_PORT_UNNEEDED =12 ,
  PW_PORT_PREEMPTED =13 , PW_PORT_SUSPENDED =14 , PW_SERVICE_UNAVAILABLE =15 , PW_CALLBACK =16 ,
  PW_USER_ERROR =17 , PW_HOST_REQUEST =18
}
enum  rc_nas_port_type {
  PW_ASYNC =0 , PW_SYNC =1 , PW_ISDN_SYNC =2 , PW_ISDN_SYNC_V120 =3 ,
  PW_ISDN_SYNC_V110 =4 , PW_VIRTUAL =5
}
enum  rc_acct_auth_type { PW_RADIUS =1 , PW_LOCAL =2 , PW_REMOTE =3 }
enum  rc_vendor_pec { VENDOR_NONE =0 , VENDOR_MICROSOFT = 311 , VENDOR_ROARING_PENGUIN = 10055 }
enum  rc_vendor_attr_microsoft {
  PW_MS_CHAP_CHALLENGE = 11 , PW_MS_CHAP_RESPONSE = 1 , PW_MS_CHAP2_RESPONSE = 25 , PW_MS_CHAP2_SUCCESS = 26 ,
  PW_MS_MPPE_ENCRYPTION_POLICY = 7 , PW_MS_MPPE_ENCRYPTION_TYPE = 8 , PW_MS_MPPE_ENCRYPTION_TYPES =PW_MS_MPPE_ENCRYPTION_TYPE , PW_MS_CHAP_MPPE_KEYS = 12 ,
  PW_MS_MPPE_SEND_KEY = 16 , PW_MS_MPPE_RECV_KEY = 17 , PW_MS_PRIMARY_DNS_SERVER = 28 , PW_MS_SECONDARY_DNS_SERVER = 29 ,
  PW_MS_PRIMARY_NBNS_SERVER = 30 , PW_MS_SECONDARY_NBNS_SERVER = 31
}
enum  rc_vendor_attr_roaringpenguin { PW_RP_UPSTREAM_LIMIT =1 , PW_RP_DOWNSTREAM_LIMIT =2 }
enum  rc_send_status {
  NETUNREACH_RC =-4 , BADRESPID_RC =-3 , BADRESP_RC =-2 , ERROR_RC =-1 ,
  OK_RC =0 , TIMEOUT_RC =1 , REJECT_RC =2 , CHALLENGE_RC =3
}

Functions

VALUE_PAIRrc_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.
int rc_avpair_assign (VALUE_PAIR *vp, void const *pval, int len)
 Assigns the given value to an attribute-value pair.
VALUE_PAIRrc_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.
VALUE_PAIRrc_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_avpair_remove (VALUE_PAIR **list, uint32_t attrid, uint32_t vendorspec)
 Removes an attribute-value pair from the given list.
VALUE_PAIRrc_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 list.
VALUE_PAIRrc_avpair_copy (VALUE_PAIR *p)
 Return a copy of the existing list "p" ala strdup().
void rc_avpair_insert (VALUE_PAIR **a, VALUE_PAIR *p, VALUE_PAIR *b)
 Insert a VALUE_PAIR into a list.
void rc_avpair_free (VALUE_PAIR *pair)
 Frees all value_pairs in the list.
int rc_avpair_parse (rc_handle const *rh, char const *buffer, VALUE_PAIR **first_pair)
 Parses the buffer to extract the attribute-value pairs.
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.
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.
VALUE_PAIRrc_avpair_next (VALUE_PAIR *t)
 Iterates through the attribute-value pairs.
int rc_avpair_get_uint32 (VALUE_PAIR *vp, uint32_t *res)
 Get the integer value of the given attribute value-pair.
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.
int rc_avpair_get_raw (VALUE_PAIR *vp, char **res, unsigned *res_size)
 Get the raw 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.
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.
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 server.
int rc_auth_proxy (rc_handle *rh, VALUE_PAIR *send, VALUE_PAIR **received, char *msg)
 Builds an authentication request for proxying.
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_acct_proxy (rc_handle *rh, VALUE_PAIR *send)
 Builds an accounting request with the value_pairs at send.
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_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.
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 submits it to a server.
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.
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_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.
rc_handle * rc_config_init (rc_handle *rh)
 Initialise a configuration structure for programmatic configuration.
rc_handle * rc_read_config (char const *filename)
 Read the global config file.
char * rc_conf_str (rc_handle const *rh, char const *optname)
 Get the value of a config option.
int rc_conf_int (rc_handle const *rh, char const *optname)
 Get the value of a config option as an integer.
SERVERrc_conf_srv (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.
int rc_apply_config (rc_handle *rh)
 Apply configuration and initialise the transport.
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.
void rc_config_free (rc_handle *rh)
 Frees allocated config values.
rc_handle * rc_new (void)
 Initialises new Radius Client handle.
void rc_destroy (rc_handle *rh)
 Destroys Radius Client handle reclaiming all memory.
rc_socket_type rc_get_socket_type (rc_handle *rh)
 Returns the type of the socket used.
int rc_read_dictionary (rc_handle *rh, char const *filename)
 Initialize the dictionary.
int rc_read_dictionary_from_buffer (rc_handle *rh, char const *buf, size_t size)
 Initialize the dictionary from Buffer.
DICT_ATTRrc_dict_addattr (rc_handle *rh, char const *namestr, uint32_t value, int type, uint32_t vendorspec)
 Add attribute to dictionary.
DICT_VALUErc_dict_addval (rc_handle *rh, char const *attrstr, char const *namestr, uint32_t value)
 Add value to dictionary.
DICT_VENDORrc_dict_addvend (rc_handle *rh, char const *vendorname, uint32_t value)
 Add vendor to dictionary.
DICT_ATTRrc_dict_getattr (rc_handle const *rh, uint64_t attribute)
 Lookup a DICT_ATTR by attribute number.
DICT_ATTRrc_dict_findattr (rc_handle const *rh, char const *attrname)
 Lookup a DICT_ATTR by its name.
DICT_VALUErc_dict_findval (rc_handle const *rh, char const *valname)
 Lookup a DICT_VALUE by its name.
DICT_VENDORrc_dict_findvend (rc_handle const *rh, char const *vendorname)
 Lookup a DICT_VENDOR by its name.
DICT_VENDORrc_dict_getvend (rc_handle const *rh, uint32_t vendorspec)
 Lookup a DICT_VENDOR by its IANA number.
DICT_VALUErc_dict_getval (rc_handle const *rh, uint32_t value, char const *attrname)
 Get DICT_VALUE based on attribute name and integer value number.
void rc_dict_free (rc_handle *rh)
 Frees the allocated dictionary.
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.
unsigned short rc_getport (int type)
 Get the port number for the supplied request type.
int rc_own_hostname (char *hostname, int len)
 Get the hostname of this machine.
int rc_get_srcaddr (struct sockaddr *lia, const struct sockaddr *ria)
 Find outbound interface address for a given destination.
void rc_setdebug (int debug)
 Set debug logging level.
void rc_openlog (char const *ident)
 Open the system log for radcli messages.
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.
void rc_aaa_ctx_free (RC_AAA_CTX *ctx)
 Deinitializes an RC_AAA_CTX structure.
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.
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.
char * rc_mksid (void) _RADCLI_GCC_ATTR_DEPRECATED
 Generate a "unique" session-ID string.

Detailed Description

Public API of the radcli library.

Definition in file radcli.h.

Macro Definition Documentation

◆ _RADCLI_GCC_VERSION

#define _RADCLI_GCC_VERSION   (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)

Definition at line 765 of file radcli.h.

◆ rc_log

#define rc_log   syslog

Definition at line 752 of file radcli.h.

◆ test_config

#define test_config   rc_test_config

Definition at line 715 of file radcli.h.

Function Documentation

◆ rc_mksid()

char * rc_mksid ( void )

Generate a "unique" session-ID string.

Deprecated
This function is retained only for source compatibility with freeradius-client and radiusclient-ng. It returns a pointer to a static non-reentrant buffer that is overwritten on each call, making it unsafe in multi-threaded applications. Use snprintf into your own buffer instead:
char sid[15];
snprintf(sid, sizeof(sid), "%08lX%04X", (unsigned long)time(NULL), getpid());
Returns
pointer to a static buffer containing the ID string; overwritten by subsequent calls.

Definition at line 107 of file util.c.