The data structure section first defines some generic types that will be used throughout the definition of XEMS. Some of these types define standard C data types and some machine dependant types so that implementations of XEMS can define them to be machine dependent. There are also some other non-scalar types that are use to standardize use of items such as timestamp, and character strings.
Event attributes are used in several other data structures in XEMS, such as the event data structure as well as the event type schema data structure, and the attribute list data structure. Event attributes contain an attribute name as well as a self defining value which has a format and a value.
The XEMS Event structure contains a fixed header, and a variable size array of event attributes.
The header contains fields that identify the event and its type, the event origin, what severity the event is, as well as a place for the Event Service to put the received time as well as the time the event was delivered to an interested consumer.
An additional field has been added to mark the priority of an event.
The event type data structures allow the construction of event type schemas.
Event filters are constitute in XEMS using the event filter data structures. These structures allow building filters by first constructing event expressions that contain attribute names, operators, and attribute values. Expressions are then collected into expression lists which then become event filters. There is also a structure for event filter name lists which are used to define consumer filter groups and to return lists of filters from the event filter database.
The consumer and supplier data structures are used to return information about consumers and suppliers from XEMS.
There is also an attribute list data structure which allows getting and setting attributes in XEMS. The actual values of the attributes are not defined in the specification.
The event list data structure allows management of undelivered events. A list of undelivered events can be returned in an event list.
The
ems_handle
is an opaque data type which is used in calls to XEMS routines. An
ems_handle
represents a connection to an Event Service on a particular host.
When calling XEMS routines, one of the XEMS registration routines is called to unitize the handle,
and it is used in all subsequent calls to XEMS routines that want to affect the Event Service on that host.
-
-
typedef unsigned_char ems_boolean; // 1 byte
#define ems_false false
#define ems_true true
typedef unsigned char ems_byte; // 1 byte
typedef unsigned char ems_char; // 1 byte
typedef signed char ems_small_int; // 1 byte
typedef unsigned char ems_usmall_int; // 1 byte
typedef short int ems_short_int; // 2 bytes
typedef unsigned short int ems_ushort_int; // 2 bytes
typedef long int ems_long_int; // 4 bytes
typedef unsigned long int ems_ulong_int; // 4 bytes
struct ems_hyper_int_rep_s_t {
ems_long_int high;
ems_ulong_int low;
} ems_hyper_int;
struct ems_uhyper_int_rep_s_t {
ems_ulong_int high;
ems_ulong_int low;
} ems_uhyper_int;
typedef float ems_short_float; // 4 bytes
typedef double ems_long_float; // 8 bytes
-
-
typedef char * ems_string_t;
-
-
typedef struct uuid_t {
ems_ulong_int time_low;
ems_ushort_int time_mid;
ems_ushort_int time_hi_and_version;
ems_usmall_int clock_seq_hi_and_reserved;
ems_usmall_int clock_seq_low;
ems_byte node[6];
} ems_uuid_t;
-
-
typedef struct utc {
ems_byte char_array[16];
} ems_utc_t;
-
-
typedef ems_ulong_int ems_error_t;
-
-
typedef ems_uuid_t ems_event_type_t;
-
-
typedef enum {
ems_delivery_push = 0,
ems_delivery_pull
} ems_delivery_t;
-
-
typedef enum {
ems_secobj_server = 0,
ems_secobj_eventtypes,
ems_secobj_filters,
ems_secobj_consumers,
ems_secobj_suppliers,
ems_secobj_eventtype,
ems_secobj_filter
} ems_secobjtype_t;
typedef struct {
ems_secobjtype_t secobjtype;
ems_string_t name;
ems_uuid_t uuid;
} ems_secobj_t;
-
-
typedef struct {
ems_usmall_int control;
ems_usmall_int delete;
ems_usmall_int insert;
ems_usmall_int read;
ems_usmall_int write;
ems_usmall_int execute;
} ems_secperm_t;
-
-
typedef struct {
ems_string_t name;
ems_uuid_t uuid;
} ems_secsubj_t;
-
-
typedef struct {
ems_ushort_int len;
ems_byte * principal;
} ems_secprin_t;
-
-
typedef ems_ushort_int ems_attr_type_t;
An event attribute type can be one of the following:
Attribute Type | Data Type |
---|---|
ems_c_attr_small_int | ems_small_int |
ems_c_attr_short_int | ems_short_int |
ems_c_attr_long_int | ems_long_int |
ems_c_attr_hyper_int | ems_hyper_int |
ems_c_attr_usmall_int | ems_usmall_int |
ems_c_attr_ushort_int | ems_ushort_int |
ems_c_attr_ulong_int | ems_ulong_int |
ems_c_attr_uhyper_int | ems_uhyper_int |
ems_c_attr_short_float | ems_short_float |
ems_c_attr_long_float | ems_long_float |
ems_c_attr_boolean | ems_boolean |
ems_c_attr_uuid | ems_uuid_t |
ems_c_attr_utc | ems_utc_t |
ems_c_attr_severity | ems_severity_t |
ems_c_attr_byte_string | ems_byte * |
ems_c_attr_char_string | ems_char * |
ems_c_attr_bytes | see structure |
The actual attribute format type values are:
-
-
typedef struct ems_bytes_s_t {
ems_ulong_int size;
ems_byte *data;
} ems_bytes_t;
typedef struct {
ems_attr_type_t format;
union {
/* case(s): ems_c_attr_small_int */
ems_small_int small_int;
/* case(s): ems_c_attr_short_int */
ems_short_int short_int;
/* case(s): ems_c_attr_long_int */
ems_long_int long_int;
/* case(s): ems_c_attr_hyper_int */
ems_hyper_int hyper_int;
/* case(s): ems_c_attr_usmall_int */
ems_usmall_int usmall_int;
/* case(s): ems_c_attr_ushort_int */
ems_ushort_int ushort_int;
/* case(s): ems_c_attr_ulong_int */
ems_ulong_int ulong_int;
/* case(s): ems_c_attr_uhyper_int */
ems_uhyper_int uhyper_int;
/* case(s): ems_c_attr_short_float */
ems_short_float short_float;
/* case(s): ems_c_attr_long_float */
ems_long_float long_float;
/* case(s): ems_c_attr_boolean */
ems_boolean bool;
/* case(s): ems_c_attr_uuid */
ems_uuid_t uuid;
/* case(s): ems_c_attr_utc */
ems_utc_t *utc;
/* case(s): ems_c_attr_severity */
ems_severity_t severity;
/* case(s): ems_c_attr_byte_string */
ems_byte *byte_string;
/* case(s): ems_c_attr_char_string */
char *char_string;
/* case(s): ems_c_attr_bytes */
ems_bytes_t bytes;
} tagged_union;
} ems_attr_value_t;
-
-
typedef struct ems_attribute_s_t {
ems_string_t name;
ems_attr_value_t value;
} ems_attribute_t;
-
-
typedef struct ems_eventid_s_t {
ems_event_type_t type;
ems_uuid_t id;
} ems_eventid_t;
Event Type | Event Type Name |
---|---|
ems_c_generic_type | Generic |
Events of type Generic, do not have event type schemas associated with them,
and can only be filtered by expressions with header attributes
in them (see
-
-
typedef enum {
ems_ns_other,
ems_ns_dns,
ems_ns_dce,
ems_ns_x500,
ems_ns_nis,
ems_ns_sna
} ems_nameservice_t;
The
ems_netaddr_t
structure specifies the actual network name. It can be interpreted according to the name service specified.
Structure
ems_octet_t
defines an 8-bit field.
len
specifies how many 8-bit quantities there are in name.
The
ems_netname_t
consists of service which specifies which name service recognizes the name specified by netaddr.
For a DCE hostname, the following example will set the
ems_netname_t
structure:
-
-
typedef struct ems_origin_s_t {
ems_netname_t netname;
ems_string_t descname;
ems_ulong_int pid;
ems_ulong_int uid;
ems_ulong_int gid;
} ems_origin_t;
-
-
typedef enum {
ems_sev_info,
ems_sev_fatal,
ems_sev_error,
ems_sev_warning,
ems_sev_notice,
ems_sev_notice_verbose,
ems_sev_debug
} ems_severity_t;
-
-
typedef ems_ulong_int ems_priority_t;
-
-
typedef struct ems_hdr_s_t {
ems_eventid_t eventid;
ems_origin_t origin;
ems_severity_t severity;
ems_utc_t received;
ems_utc_t delivered;
ems_priority_t priority;
} ems_hdr_t;
A set of filter attributes are provided for event header filtering. The following names can be used for the filter attribute in an event filter expressions.
Attribute Name | Attribute Type |
---|---|
eventid.id | ems_c_attr_uuid |
eventid.type | ems_c_attr_uuid |
origin.netname.service | ems_c_attr_ulong |
origin.netname.netaddr | ems_c_attr_bytes |
origin.descname | ems_c_attr_char_string |
origin.pid | ems_c_attr_ulong |
origin.uid | ems_c_attr_ulong |
origin.gid | ems_c_attr_ulong |
severity | ems_c_attr_severity |
received | ems_c_attr_utc |
received.tod | ems_c_attr_char_string |
received.mday | ems_c_attr_ushort_int |
received.year | ems_c_attr_ushort_int |
received.wday | ems_c_attr_ushort_int |
received.yday | ems_c_attr_ushort_int |
-
-
typedef struct ems_event_s_t {
ems_hdr_t header;
ems_ulong_int count;
ems_attribute_t item[1];
} ems_event_t;
-
-
typedef struct ems_event_schema_s_t {
ems_event_type_t type;
ems_string_t name;
ems_long_int size;
ems_attribute_t attribute[1];
} ems_event_schema_t;
-
-
typedef ems_event_schema_t *ems_schema_ptr_t;
typedef struct ems_event_type_list_s_t {
ems_long_int size;
ems_schema_ptr_t schema[1];
} ems_event_type_list_t;
-
-
typedef ems_ushort_int ems_attr_op_t;
Attribute Operator | Description of Attribute Operator |
---|---|
ems_c_attr_op_eq | TRUE if attr_name equal (==) to attr_value |
ems_c_attr_op_gt | TRUE if attr_name greater than (> |
ems_c_attr_op_lt | TRUE if attr_name less than (< |
ems_c_attr_op_ge | TRUE if attr_name greater than or equal (> |
ems_c_attr_op_le | TRUE if attr_name greater than or equal (< |
ems_c_attr_op_ne | TRUE if attr_name not equal (< |
ems_c_attr_op_bitand | TRUE if attr_name bitwise anded with attr_value is greater than 0 |
ems_c_attr_op_substr | TRUE if attr_name contains the string value specified by attr_value |
The actual values of the operators are:
-
-
typedef unsigned16 ems_filter_grammar_t;
const ems_filter_grammar_t ems_c_fg_default = 0;
const ems_filter_grammar_t ems_c_fg_OQL = 1;
const ems_filter_grammar_t ems_c_fg_other = 2;
OQL stands for Object Query Language.
-
-
typedef struct ems_default_fg_s_t {
ems_string_t attr_name;
ems_attr_op_t attr_operator;
ems_attr_value_t attr_value;
} ems_default_fg_t;
-
-
typedef struct ems_filter_exp_s_t {
ems_filter_grammar_t grammar;
union {
/* case: ems_c_fg_default */
ems_default_fg_t def_filter;
/* case: ems_c_fg_OQL */
ems_string_t oql_filter;
/* case: ems_c_fg_other */
ems_string_t other_filter;
} tagged_union;
} ems_filter_exp_t;
-
-
typedef struct ems_filter_exp_list_s_t {
ems_long_int size;
ems_filter_exp_t filter_exps[1];
} ems_filter_exp_list_t;
Filters with event type of generic, can only have filter expressions with header attribute names in them (see
-
-
typedef struct ems_filtername_list_s_t {
ems_long_int size;
ems_string_t filter_names[1];
} ems_filtername_list_t;
-
-
typedef ems_filter_t *ems_filter_ptr_t;
typedef struct ems_filter_list_s_t {
ems_long_int size;
ems_filter_ptr_t filter[1];
} ems_filter_list_t;
-
-
typedef struct ems_consumer_s_t {
ems_string_t name;
ems_netname_t *hostname;
ems_uuid_t uuid;
ems_delivery_t type;
} ems_consumer_t;
-
-
typedef struct ems_consumer_list_s_t {
ems_long_list size;
ems_consumer_t consumer[1];
} ems_consumer_list_t;
-
-
typedef void (*ems_handler)(void * arg, ems_event_t * event,
ems_error_t * error);
-
-
typedef void (*ems_supplier_count_handler_t)(ems_event_type_t type,
ems_long_int count, ems_error_t * error);
-
-
typedef struct ems_supplier_s_t {
ems_string_t name;
ems_netname_t *hostname;
ems_uuid_t uuid;
ems_delivery_t type;
} ems_supplier_t;
-
-
typedef struct ems_supplier_list_s_t {
ems_long_int size;
ems_supplier_t supplier[1];
} ems_supplier_list_t;
-
-
typedef struct ems_attrlist_s_t {
ems_long_int size;
ems_attribute_t attr[1];
} ems_attrlist_t;
-
-
typedef ems_event_t *ems_event_ptr_t;
typedef struct ems_event_list_s_t {
ems_long_int size;
ems_event_ptr_t event[1];
} ems_event_list_t;
-
-
typedef void *ems_handle_t;
Rather than list the specific status codes for each routine, the following summary lists all the status codes and their meanings.
Contents | Next section | Index |