NAME

catgen_infopath - set info search path for a session

SYNOPSIS

#include <cat/gen.h>

int catgen_infopath(cat_session *sess, const char *service, int port);

DESCRIPTION

This function sets the search path for a session. The search path is used when relative name lookups are used to obtain data from the info tree (see catinfo).

The sess argument is the session in which this search path is to be installed.

The service argument is the service name of the Agent and has the format service-version. It may be supplied as NULL if unknown.

The port argument is the local TCP port. Use -1 to ignore the port part of the path.

In order of precedence, the installed search path will become:

  .gen.override
  .sessions.<id>
  .tcp.s<port>
  .services.<service>
  .global

This function also creates the private info node, .sessions.id, for the session, where the id is the numeric identifier returned by cat_getsessid.

RETURN VALUES

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

NOTES

If the service is unknown (supplied as NULL), this function tries to find it as the service parameter under the ``.gen.override'', ``.sessions.<id>'', and ``.tcp.s<port>'' branches. If the service is also not found there, the service part will not be included in the search path.

SEE ALSO

cat, catgen, catinfo

catgen_fixservice, catgen_getint, catgen_newnode, catgen_servicepath, catgen_set