Defining a security session callback

A security session callback is defined as follows:

CS_RETCODE CS_PUBLIC 
 secsession_cb (conn, 
               numinputs, infmt, inbuf, 
               numoutputs, outfmt, outbuf, outlen)
 CS_CONNECTION    *conn;
 CS_INT                       numinputs;
 CS_DATAFMT            *infmt;
 CS_BYTE                   **inbuf;
 CS_INT                       *numoutputs;
 CS_DATAFMT             *outfmt;
 CS_BYTE                    **outbuf;
 CS_INT                        *outlen;

where:

The callback forwards the security session message data and reads the client’s response with Server-Library calls. See the reference page for srv_negotiate in the Open Server Server-Library/C Reference Manual.

A security session callback returns CS_SUCCEED or CS_FAIL. If the callback returns CS_FAIL, Client-Library aborts the connection attempt. Other return values are illegal: Client-Library responds by raising an error and aborting the connection attempt.