Radcli library 1.4.0
A simple radius library
Loading...
Searching...
No Matches
Functions
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_openlog (char const *ident)
 

Detailed Description

Miscellaneous functions.

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)

Opens system log

This function is a wrapper over openlog() in systems which support it. Don't call it if you already call openlog().

Parameters
identthe name of the program.
Examples
radexample.c.

Definition at line 36 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.