NAME

catsock_parent - set a callback to handle parent commands to the Agent.

SYNOPSIS

#include <cat/cat.h>

int catsock_parent(catsock_parentfunc *func, void *parent_handle)

DESCRIPTION

This function registers the callback function func to be called by the framework when data is available from the parent, catd, given the parent_handle.

The form taken by parent_handle is platform-specific. On Windows NT, parent_handle is a hex encoded handle and a valid handle to pass to ReadFile(). On UNIX, parent_handle is a file descriptor in decimal, usually set to 0. The parent_handle is passed as a command line argument to the Agent in -C [parent_handle].

The func should look as follows:

   int catsock_parentfunc(char *);

The objective is to let the parent control the Agent and tell it or reread its configuration, to start or stop listening to specific ports, etc.

RETURN VALUES

The function returns CAT_OK if successful, and a negative value on error.

SEE ALSO

cat, catnet, catgen

catsock_run, catgen_parentcmd