NAME

catboks_tcpmethod - create Keon 4.x method string

SYNOPSIS

#include <cat/boks.h>

char *catboks_tcpmethod(cat_session *sess, const char *method, char **result, int maxlen);

DESCRIPTION

This function is provided as a glue function between catnet_getnetinfo() and the catboks functions that have a route as argument, that is, catboks_route(), catboks_auth(), and catboks_dbmap().

The function is used to build up access route strings as used by Keon 4.x with format ``method:fromip->?HOST''.

method will be taken from the method parameter. fromip will be taken from the peer_addr element of the catnet_info struct for the CAT_CLIENT_RFD descriptor.

If *result is NULL, the result will be allocated and must be freed by the caller, otherwise *result should point to a buffer that can hold at least maxlen bytes where the result will be stored.

RETURN VALUES

If the function is successful, the pointer to result is returned regardless of whether or not the buffer is supplied.

An empty string is returned if overflow occurs or if too few arguments are given.

SEE ALSO

cat, catboks