WHOSON(3)

NAME
wso_login, wso_logout, wso_query, wso_version - API functions to access whoson database

SYNOPSYS
#include <whoson.h>

int wso_login(char *addr, char *name, char *retbuf, int buflen)

int wso_logout(char *addr, char *retbuf, int buflen)

int wso_query(char *addr, char *retbuf, int buflen)

char *wso_version(void)

DESCRIPTION
wso_login() adds an entry to the whoson database (or replaces existing entry with the same key)

wso_logout() deletes entry from the database

wso_query() requests the database entry

wso_version() returns the character string with the version number of the API and build date.

addr parameter is the IP address of the remote system specified as a character string, usually in dotted quad notation (e.g. "123.45.67.89"). This is the key identifying unique entries in the WHOSON database. name parameter is the user accounting information (e.g. userid).

The file /etc/whoson.conf(5) defines how the API functions should contact the whosond(8) server.

RETURN VALUES
Upon completion, wso_login() wso_logout() and wso_query() return an integer return code, and the buffer retbuf is filled with relevant information if appropriate. Return code -1 means that the request could not be completed, return code 0 or +1 mean that the request was successfully completed. For wso_query() function, return code 0 means that the requested address is present in the database. In this case, retbuf may contain the data that was previously passed to a wso_login() call for the same addr as the value of the name parameter.

In other cases, retbuf may or may not contain description of the situation, e.g. the text "Access denied" or "Not found" or something like that.

If the retbuf parameter is NULL or the buflen parameter is zero, no attempt is made to fill the buffer.

Normally, when filling the database, you can blindly call wso_login() (and wso_logout() if appropriate) and ignore the return code. When querying the database, return code 0 means that the address is in the database, return code +1 means that the address is not in the database, and return code -1 means that the information is unavailable or inaccessable.

ENVIRONMENT
WHOSON_VERBOSE Verbose debug messages are enabled if this variable is present in the environment (its value is ignored).

WHOSON_CONFIG May be set to the pathname of an alternative configuration file.

COPYRIGHT
Public domain

SEE ALSO
whosond(8), whoson.conf(5)