NAME
__pmMakeAuthCookie - generate an authorisation cookie
C SYNOPSIS
#include <pcp/pmapi.h>
#include <pcp/impl.h>
#include <pcp/pmapi_dev.h>
int __pmMakeAuthCookie(unsigned int authnumber, pid_t cli
entid)
cc ... -lpcp
DESCRIPTION
This function is used as part of the PCP 2.0 IPC protocol
extensions, and is part of the authorisation mechanism
which allow authorised client programs to connect to an
unlicensed pmcd(3). It is used by both the authorised
client, and later by pmcd when pmcd compares the cookie
generated by __pmMakeAuthCookie against the number which
the client has sent as part of its context-creation proto
col exchange with pmcd.
It takes two arguments - authnumber, which is the authori
sation number generated by pmcd in the initial exchange in
the creation of a context, and clientid, which is the pro
cess id of the caller. The current implementation simply
returns the bitwise XOR of these two numbers, but a less
obvious mechanism may be put in place at a later stage.
SEE ALSO
PMAPI(3) and __pmNewAuthContext(3).
DIAGNOSTICS
No errors are produced by this function, and the returned
value is the generated authorisation cookie.
CAVEAT
On Irix this routine is part of the libpcp_dev.a, so your
compile lines should include -lpcp_dev and
-DHAVE_DEV_IN_LIBPCP where necessary.
Man(1) output converted with
man2html