skip_getInfo(3N)

NAME
skip_getInfo - Retrieve SKIP parameters associated to a socket

SYNOPSIS
cc [ flag ... ] file ... -lskipapi [ library ... ]

#include <skipapi.h>
int skip_getInfo(int cnx, skip_info_t *info, int sense);

DESCRIPTION
skip_getInfo() allows an application to retrieve SKIP ACL parameters for a given active socket cnx. The sense parameter indicates whether the application wants to check for input or output trafic. Setting sense to SKIP_IN will query the SKIP ACL for incoming IP packets. Setting sense to SKIP_OUT will do the same job for outgoing IP packet. Only SKIP_IN and SKIP_OUT are valid values for sense. The info argument must be allocated by the caller of skip_getInfo(). It will be filled in by skip_getInfo() with the retreived parameters from the SKIP ACL. The parameters of interest for a given connection are summarized below:

unsigned char  version;        /* SKIP version           */
unsigned char  kij_alg;        /* key encryption alg     */
unsigned char  kp_alg;         /* traffic encryption alg */
unsigned char  mac_alg;        /* ah alg                 */
unsigned char  comp_alg;       /* compression alg        */
skip_name      s_mkeyid;       /* sender master key id   */
skip_name      r_mkeyid;       /* receiver master key id */
A "skip_name" is defined as follow:

typedef struct {
        unsigned char   nsid;
        int             len;
        char            name[SKIP_MAXVARSZ];
} skip_name;
The nsid field can take the values of 0 (not present), 1 or 8. The len corresponds to the size of value of the master key ID.

RETURN VALUES
Upon successful completion, skip_getInfo() returns SKIP_OK; otherwise, it returns an error code as listed below.

ERRORS

SKIP_ERR_BADIFLIST
    The skip_getInfo() has not been able to find which network interface was configured in the system.

SKIP_ERR_MULTIHOMED
    For security reasons, the current version of skip_getInfo() is not allowed to run on multi-homed systems.

SKIP_ERR_BADIFNAME
    skip_getInfo() has not been able to find the default network interface.

SKIP_ERR_NOSKIPIF
    SKIP is not present on the default network interface.

SKIP_ERR_NULLINFO
    The info argument is not valid or null.

SKIP_ERR_BADSENSE
    The required traffic sense is not valid. Only SKIP_IN or SKIP_OUT senses are allowed.

SKIP_ERR_BADCNX
    The given cnx argument does not represent a valid socket.

SKIP_ERR_BADAF
    The cnx argument does not correspond to a valid AF_INET socket.

SKIP_ERR_DEVIO
    File I/O error occured when accessing the SKIP driver.

SKIP_ERR_NOTFOUND
    No SKIP ACL entry was found for the cnx socket connection.

SEE ALSO
skip_getEvent(3),

NOTES
Only root can call skip_getInfo(). The call to skip_getInfo() will always fail on a multi homed system. The skip_info sample illustrates how to use the skip_getInfo() function.