NAME

catboks_init - initialize Keon Security Server 4.x communication

SYNOPSIS

#include <cat/boks.h>

int catboks_init(unsigned short port, char *nodekey, int cachettl, char *myaddress, int nservers, char **servers);

DESCRIPTION

This function sets the communications parameters for calls to a Keon Security Server 4.x.

The port, if non-zero, is the Keon 4.x domain port (with default value 6500).

The nodekey argument is the Keon 4.x node key for the local host, either in plain text or as the hash used in BoKS key files.

The cachettl argument defines the time-to-live for cached results. If cachettl is zero, caching is disabled; if cachettl is negative, a default value of 120 seconds is used.

The myaddress argument is optional. myaddress can be set to an IP address, in dotted-decimal format, for inclusion in the protocol headers where it identifies the current host. This may be necessary for machines with multiple interfaces or if calls pass through a firewall.

A specific list of Keon 4.x servers can be specified in the servers array. This array specifies the hostnames of the servers as strings. nservers is the number of servers in the servers array.

RESULT CACHE

Most calls to the server can be cached. If the same call is made within a time period determined by the cachettl argument above, the cached result is reused and no call is made to the server.

Fast cache
Data is cached for cachettl seconds. Used by the catboks_checkserno function. The catboks_auth function also uses this cache if called with a NULL prog argument.

Medium cache
Data is cached for 3 times cachettl seconds. Used by the catboks_dbmap function.

Slow cache
Data is cached for 5 times cachettl seconds. Used by the catboks_certtouser, catboks_route and catboks_getcakey functions.

Other functions cache no return values or make no calls to the server.

RETURN VALUES

The function returns 0 if successful, or a negative code on error.

SEE ALSO

cat, catboks