HP-UX Reference (11i v3 07/02) - 3 Library Functions A-M (vol 6)
e
EvmConnSubscribe(3) EvmConnSubscribe(3)
NAME
EvmConnSubscribe(), EvmConnRegistrationGet(), EvmConnTemplateScan() - establish a subscription for
event notification
SYNOPSIS
#include <evm/evm.h>
EvmStatus_t EvmConnRegistrationGet(
EvmConnection_t
connection,
const EvmString_t
event_class,
EvmPointer_t
user_arg );
EvmStatus_t EvmConnSubscribe(
EvmConnection_t
connection,
void *
unused,
EvmString_t
filter_string );
EvmStatus_t EvmConnTemplateScan(
EvmConnection_t
connection,
const EvmString_t
filter_string,
EvmPointer_t
user_arg );
Library
EVM Support Library (libevm.so).
Parameters
connection The EVM connection established to listen for events. See the EvmConnCreate(3) manpage.
unused This parameter must be specified as NULL.
filter_string A string specifying the events of interest. For a formal description of the syntax of the
filter_string. See the EvmFilter(5) manpage.
event_class An event name string having at least one component of the event name. An event class can-
not contain wildcard characters. For example, in the EVM event name of
sys.unix.colad, sys,
unix, and colad are components of the event name.
user_arg The value supplied in this parameter is returned in the callback function’s extended callback
structure. The value can be used by the calling code to match the callback with the originat-
ing request.
DESCRIPTION
To receive notification of events as they happen, a program must establish a listening connection to the
EVM daemon, using the
EvmConnCreate()
routine. The program must then call EvmConnSub -
scribe()
to associate a filter with the connection. Whenever the daemon receives an event matching the
filter, it delivers the event to the subscriber. The subscriber must handle incoming events using the API
routines described in the EvmConnWait(3) manpage.
The
EvmConnSubscribe()
routine passes the supplied filter_string to the EVM daemon to select a set
of events for subscription. The routine returns immediately if preliminary validation fails. Otherwise, the
routine passes the request to the daemon. The daemon’s response is returned through the connection’s call-
back function, with a reason code of
EvmREASON_SUBSCRIBE_COMPLETE
. The caller must watch for
the response using
EvmConnWait() or a related function, and then invoke EvmConnDispatch()
to
handle it.
The
EvmConnRegistrationGet() routine asks the daemon to return the event template correspond-
ing to the supplied event_class, if the event is registered. The daemon responds by returning the event
template, in the form of an EVM event, through the connection’s callback function, with a reason code of
EvmREASON_TEMPLATE_INFO_DELIVERED.
If the event class is registered, the event field in the extended callback data structure holds an event
corresponding to the template. The caller must handle it as if it were an incoming event.
If the event class is not registered, the callback status code is set to
EvmERROR_NOT_PRESENT, and the
event handle in the structure is set to NULL.
The EvmConnTemplateScan() routine asks the daemon to return a series of event templates that
match the supplied filter_string. The daemon responds by returning event templates, in the form of EVM
HP-UX 11i Version 3: February 2007 − 1 − Hewlett-Packard Company 381