skip_getEvent(3N)

NAME
skip_getEvent - Register to receive SKIP ACL notifications

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

#include <signal.h>
#include <skipapi.h>
int skip_getEvent(skip_event_t *sevent, int mode);

DESCRIPTION
skip_getEvent() allows an application to receive SKIP ACL notifications. The SKIP ACL sends a notification each time its configuration has been changed. This will be the case if the access control mode has been turned from OFF to ON (or vice versa) or if an entry has been added or deleted. The notification is sent to an application in the form of a SIGPOLL signal. In order to be able to receive these notification, an application must call skip_getEvent( with the mode argument set to SKIP_GET_EVENT_ON. The application must have been prepared to handle SIGPOLL signals using sigset() for example. The caller must allocate memory for the sevent argument. The sevent argument should be passed to any sub-sequent call to skip_getEvent(). Once an application is not interested any more to receive SKIP ACL notifications, it must call skip_getEvent() with the mode argument set to SKIP_GET_EVENT_OFF and the previous sevent argument. When the call to skip_getEvent() it can then free the memory allocated for the sevent argument.

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

ERRORS

SKIP_ERR_BADIFLIST
    The skip_getEvent() 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_getEvent() is not allowed to run on multi-homed systems.

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

SKIP_ERR_NOSKIPIF
    SKIP is not present on the default network interface.

SKIP_ERR_NULLARG
    The caller of skip_getEvent() didn't provide a valid sevent argument.

SKIP_ERR_ISREG
    The caller of skip_getEvent() has already registered to receive SKIP ACL notifications.

SKIP_ERR_NOMEM
    The skip_getEvent() has not been able to allocate internal object due to lack of memory.

SKIP_ERR_PERMS
    The caller skip_getEvent() is not allowed to get access to the SKIP ACL. Only root can call skip_getEvent().

SKIP_ERR_NOTREG
    The caller of skip_getEvent() was not registered to receive SKIP ACL notifications.

SKIP_ERR_BADEVENT
    The required notification mode is not valid. Only SKIP_GET_EVENT_ON or SKIP_GET_EVENT_OFF modes are allowed.

SEE ALSO
skip_getInfo(3), signal(2), sigset(3C), sigaction(2).

NOTES
Only root can call skip_getEvent(). The call to skip_getEvent() will always fail on a multi homed system. It is the responsability of the application itself to determine what has been changed in the SKIP ACL.