Store information about a client connection
#include <sys/neutrino.h> int ConnectClientInfo( int scoid, struct _client_info * info int ngroups ); int ConnectClientInfo_r( int scoid, struct _client_info * info int ngroups );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
These calls get information about a client connection identified by scoid, and store it in the buffer that info points to.
The ConnectClientInfo() and ConnectClientInfo_r() functions are identical except in the way they indicate errors. See the Returns section for details.
A server uses these functions to determine whether or not a client has permission to access a resource. For example, in a resource manager, it would be called on an open() connection request.
The _client_info structure has at least the following members:
The nd (node descriptor) is a temporary numeric description of a remote node; ND_LOCAL_NODE (or 0) is the descriptor for the local node. For more information, see the Qnet Networking chapter of the System Architecture guide.
To: | Use this function: |
---|---|
Compare two nd objects | ND_NODE_CMP() |
Convert a nd to text | netmgr_ndtostr() |
Convert text to a nd | netmgr_strtond() |
The cred member of the _client_info is a _cred_info structure that includes at least the following members:
The ngroups argument to ConnectClientInfo() indicates the size of the grouplist array. If the group array size is zero, the ngroups member of the _cred_info is set to the number of groups available.
The only difference between these functions is the way they indicate errors:
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
ConnectServerInfo(), _msg_info, MsgInfo(), MsgReceivev(), ND_NODE_CMP(), netmgr_ndtostr(), netmgr_remote_nd(), netmgr_strtond()