ct_labels

Description

Define a security label or clear security labels for a connection.

Syntax

CS_RETCODE ct_labels(connection, action,
                  labelname, namelen, labelvalue,
                  valuelen, outlen)
 
 CS_CONNECTION     *connection;
 CS_INT                       action;
 CS_CHAR                   *labelname;
 CS_INT                       namelen;
 CS_CHAR                   *labelvalue;
 CS_INT                       valuelen;
 CS_INT                       *outlen;

Parameters

connection

A pointer to a CS_CONNECTION structure. A CS_CONNECTION structure contains information about a particular client/server connection.

*connection must represent a closed connection.

action

One of the following symbolic values:

Value of action

Result

CS_SET

Sets a security label

CS_CLEAR

Clears all security labels previously specified for this connection

labelname

If action is CS_SET, labelname points to the name of the security label being set.

If action is CS_CLEAR, labelname must be NULL.

namelen

The length, in bytes, of *labelname. If *labelname is null-terminated, pass namelen as CS_NULLTERM.

Security label names must be at least 1 byte long and no more than CS_MAX_NAME bytes long.

If action is CS_CLEAR, pass namelen as CS_UNUSED.

labelvalue

If action is CS_SET, labelvalue points to the value of the security label being set.

If action is CS_CLEAR, labelvalue must be NULL.

valuelen

The length, in bytes, of *labelvalue. If *labelvalue is null-terminated, pass valuelen as CS_NULLTERM.

Security label values must be at least 1-byte long.

If action is CS_CLEAR, pass valuelen as CS_UNUSED.

outlen

This parameter is currently unused and must be passed as NULL.

Returns

ct_labels returns the following values:

Return value

Meaning

CS_SUCCEED

The routine completed successfully.

CS_FAIL

The routine failed.

CS_BUSY

An asynchronous operation is already pending for this connection. See “Asynchronous programming”.

Usage

See also

ct_callback, ct_con_props, ct_connect