Radcli library 1.5.2
A simple radius library
Loading...
Searching...
No Matches
Miscellaneous API

Miscellaneous functions. More...

Functions

unsigned short rc_getport (int type)
int rc_own_hostname (char *hostname, int len)
int rc_get_srcaddr (struct sockaddr *lia, const struct sockaddr *ria)
void rc_own_bind_addr (rc_handle *rh, struct sockaddr_storage *lia)
void rc_setdebug (int debug)
void rc_openlog (char const *ident)

Detailed Description

Miscellaneous functions.

All radcli error and informational messages are emitted via syslog(3) (facility LOG_DAEMON by default). An application controls where those messages go by calling openlog(3) with its own ident and facility before making any radcli calls. The rc_openlog() and rc_setdebug() functions below are kept for source compatibility with older code; new code should use openlog(3) and the clientdebug config option directly.

Function Documentation

◆ rc_get_srcaddr()

int rc_get_srcaddr ( struct sockaddr * lia,
const struct sockaddr * ria )

Find outbound interface address for a given destination

Given remote address find local address which the system will use as a source address for sending datagrams to that remote address.

Parameters
[out]lialocal address.
[in]riathe remote address.
Returns
OK_RC on success. NETUNREACH_RC if network is unreachable (i.e. no route to destination). ERROR_RC for all other failures. Address is filled into the first argument.

Definition at line 124 of file ip_util.c.

◆ rc_getport()

unsigned short rc_getport ( int type)

Get the port number for the supplied request type

Parameters
typeAUTH or ACCT.
Returns
the port number.

Definition at line 63 of file ip_util.c.

◆ rc_openlog()

void rc_openlog ( char const * ident)

Open the system log for radcli messages

Deprecated
New code should call openlog(3) directly. radcli emits all messages via syslog(3); opening the log with your application's own ident and facility before the first radcli call is sufficient. This function is a thin wrapper around openlog() retained for source compatibility with freeradius-client and radiusclient-ng.
Parameters
identprogram name passed to openlog(3).

Definition at line 54 of file log.c.

◆ rc_own_bind_addr()

void rc_own_bind_addr ( rc_handle * rh,
struct sockaddr_storage * lia )

Find our source address

Get the IP address to be used as a source address for sending requests in host order.

Parameters
rha handle to parsed configuration
liathe local address to listen to

Definition at line 164 of file ip_util.c.

◆ rc_own_hostname()

int rc_own_hostname ( char * hostname,
int len )

Get the hostname of this machine

Parameters
hostnamewill hold the name of the host.
lenthe size of hostname.
Returns
-1 on failure, 0 on success.

Definition at line 81 of file ip_util.c.

◆ rc_setdebug()

void rc_setdebug ( int debug)

Set debug logging level

Deprecated
Prefer setting clientdebug in the configuration file (rc_read_config()) or rc_add_config(). Using this function bypasses the config file and is retained only for source compatibility with freeradius-client and radiusclient-ng.
Parameters
debugdebug level; 0 disables debug output, positive values enable it.

Definition at line 39 of file log.c.