1 #ifndef EVEL_INTERNAL_INCLUDED 2 #define EVEL_INTERNAL_INCLUDED 49 ({ __typeof__ (a) _a = (a); \ 50 __typeof__ (b) _b = (b); \ 54 ({ __typeof__ (a) _a = (a); \ 55 __typeof__ (b) _b = (b); \ 62 #define EVEL_CT_ASSERT(X) switch (0) {case 0: case (X):;} 174 #define EVEL_RFC2822_STRFTIME_FORMAT "%a, %d %b %Y %T %z" 179 #define EVEL_THROTTLE_FIELD_DEPTH 3 197 const char *
const throt_api_url,
198 const char *
const username,
199 const char *
const password,
263 const char *
const vendor_id,
264 const char *
const event_id);
440 const char *
const key,
451 const char *
const key,
452 const char *
const value);
463 const char *
const key,
474 const char *
const key,
486 const char *
const key,
497 const char *
const key,
509 const char *
const key,
520 const char *
const key,
521 const unsigned long long value);
532 const char *
const key,
543 const char *
const key,
544 const time_t * time);
555 const char *
const key,
556 const int major_version,
557 const int minor_version);
567 const char *
const key);
576 const char *
const key);
593 const char *
const format,
603 const char *
const key);
613 const char *
const key);
665 const char *
const value,
666 const char *
const description);
675 const char *
const value);
702 const char *
const description);
729 const char *
const description);
745 const unsigned long long value);
755 const unsigned long long value,
756 const char *
const description);
783 const char *
const description);
EVEL_ERR_CODES event_handler_terminate()
Terminate the event handler.
DLIST suppressed_field_names
EVEL_EVENT_DOMAINS
Event domains for the various events we support.
struct memory_chunk MEMORY_CHUNK
A chunk of memory used in the cURL functions.
char * evel_event_domain(const EVEL_EVENT_DOMAINS domain)
Map an EVEL_EVENT_DOMAINS enum value to the equivalent string.
void evel_init_option_int(EVEL_OPTION_INT *const option)
Initialize an EVEL_OPTION_INT to a not-set state.
void evel_set_next_event_sequence(const int sequence)
Set the next event_sequence to use.
void evel_set_option_string(EVEL_OPTION_STRING *const option, const char *const value, const char *const description)
Set the value of an EVEL_OPTION_STRING.
void evel_json_buffer_init(EVEL_JSON_BUFFER *jbuf, char *const json, const int max_size, EVEL_THROTTLE_SPEC *throttle_spec)
Initialize a EVEL_JSON_BUFFER.
Suppressed NV pairs list entry.
char * evel_service_endpoint_desc(const EVEL_ENTITY_STATE endpoint_desc)
Convert a EVEL_SERVICE_ENDPOINT_DESC to string form for JSON encoding.
void evel_enc_list_item(EVEL_JSON_BUFFER *jbuf, const char *const format,...)
Encode a list item with format and param list to a EVEL_JSON_BUFFER.
Event Instance Identifier JSON equivalent field: eventInstanceIdentifier.
void evel_set_option_int(EVEL_OPTION_INT *const option, const int value, const char *const description)
Set the value of an EVEL_OPTION_INT.
char * evel_alert_action(const EVEL_ALERT_ACTIONS alert_action)
Map an EVEL_ALERT_ACTIONS enum value to the equivalent string.
void evel_json_open_named_list(EVEL_JSON_BUFFER *jbuf, const char *const key)
Add the key and opening bracket of a named list to a JSON buffer.
Optional parameter holder for unsigned long long.
Optional parameter holder for double.
bool evel_json_open_opt_named_object(EVEL_JSON_BUFFER *jbuf, const char *const key)
Add the opening bracket of an optional named object to a JSON buffer.
Optional parameter holder for string.
EVT_HANDLER_COMMAND command
A chunk of memory used in the cURL functions.
struct evel_throttle_spec EVEL_THROTTLE_SPEC
Event Throttling Specification for a domain which is in a throttled state.
EVEL_THROTTLE_SPEC * throttle_spec
The event handler thread not started.
bool evel_enc_kv_opt_double(EVEL_JSON_BUFFER *jbuf, const char *const key, const EVEL_OPTION_DOUBLE *const option)
Encode a string key and double value to a EVEL_JSON_BUFFER.
void evel_json_encode_mobile_flow(EVEL_JSON_BUFFER *jbuf, EVENT_MOBILE_FLOW *event)
Encode the Mobile Flow in JSON according to AT&T's schema for the event type.
char * evel_entity_state(const EVEL_ENTITY_STATE state)
Convert a EVEL_ENTITY_STATE to it's string form for JSON encoding.
void evel_json_encode_service(EVEL_JSON_BUFFER *const jbuf, EVENT_SERVICE *const event)
Encode the Service Event in JSON according to AT&T's schema for the event type.
void evel_force_option_ull(EVEL_OPTION_ULL *const option, const unsigned long long value)
Force the value of an EVEL_OPTION_ULL.
void evel_init_event_instance_id(EVEL_EVENT_INSTANCE_ID *const instance_id, const char *const vendor_id, const char *const event_id)
Initialize an event instance id, typically embedded in an event.
char * evel_alert_type(const EVEL_ALERT_TYPES alert_type)
Map an EVEL_ALERT_TYPES enum value to the equivalent string.
void evel_json_encode_state_change(EVEL_JSON_BUFFER *jbuf, EVENT_STATE_CHANGE *state_change)
Encode the state change as a JSON state change.
The event handler thread is started.
DLIST suppressed_nv_pairs_list
Initial stages of shutdown.
void evel_json_close_list(EVEL_JSON_BUFFER *jbuf)
Add the closing bracket of a list to a JSON buffer.
void evel_init_option_string(EVEL_OPTION_STRING *const option)
Initialize an EVEL_OPTION_STRING to a not-set state.
void evel_set_option_double(EVEL_OPTION_DOUBLE *const option, const double value, const char *const description)
Set the value of an EVEL_OPTION_DOUBLE.
char * evel_event_priority(const EVEL_EVENT_PRIORITIES priority)
Map an EVEL_EVENT_PRIORITIES enum value to the equivalent string.
char * nv_pair_field_name
void evel_json_encode_instance_id(EVEL_JSON_BUFFER *jbuf, EVEL_EVENT_INSTANCE_ID *instance_id)
Encode the instance id as a JSON object according to AT&T's schema.
void evel_json_encode_fault(EVEL_JSON_BUFFER *jbuf, EVENT_FAULT *event)
Encode the fault in JSON according to AT&T's schema for the fault type.
void evel_init_option_time(EVEL_OPTION_TIME *const option)
Initialize an EVEL_OPTION_TIME to a not-set state.
EVENT_INTERNAL * evel_new_internal_event(EVT_HANDLER_COMMAND command)
Create a new internal event.
char * evel_source_type(const EVEL_SOURCE_TYPES source_type)
Map an EVEL_SOURCE_TYPES enum value to the equivalent string.
void evel_force_option_string(EVEL_OPTION_STRING *const option, const char *const value)
Force the value of an EVEL_OPTION_STRING.
struct event_internal EVENT_INTERNAL
Internal event.
void evel_enc_kv_string(EVEL_JSON_BUFFER *jbuf, const char *const key, const char *const value)
Encode a string key and string value to a EVEL_JSON_BUFFER.
char * evel_vf_status(const EVEL_VF_STATUSES vf_status)
Map an EVEL_VF_STATUSES enum value to the equivalent string.
void evel_json_encode_header(EVEL_JSON_BUFFER *jbuf, EVENT_HEADER *event)
Encode the event as a JSON event object according to AT&T's schema.
void evel_json_close_object(EVEL_JSON_BUFFER *jbuf)
Add the closing bracket of an object to a JSON buffer.
Event Throttling Specification for a domain which is in a throttled state.
void evel_init_option_double(EVEL_OPTION_DOUBLE *const option)
Initialize an EVEL_OPTION_DOUBLE to a not-set state.
void evel_enc_kv_ull(EVEL_JSON_BUFFER *jbuf, const char *const key, const unsigned long long value)
Encode a string key and unsigned long long value to a EVEL_JSON_BUFFER.
void evel_enc_kv_int(EVEL_JSON_BUFFER *jbuf, const char *const key, const int value)
Encode a string key and integer value to a EVEL_JSON_BUFFER.
Optional parameter holder for int.
void evel_force_option_time(EVEL_OPTION_TIME *const option, const time_t value)
Force the value of an EVEL_OPTION_TIME.
EVEL_SOURCE_TYPES
Fault source types.
EVEL_ALERT_TYPES
Alert types.
void evel_handle_event_response(const MEMORY_CHUNK *const chunk, MEMORY_CHUNK *const post)
Handle a JSON response from the listener, contained in a MEMORY_CHUNK.
DLIST suppressed_nv_pair_names
char * functional_role
The Functional Role of the equipment represented by this VNF.
void evel_json_open_named_object(EVEL_JSON_BUFFER *jbuf, const char *const key)
Add the opening bracket of an object to a JSON buffer.
void evel_json_encode_signaling(EVEL_JSON_BUFFER *const jbuf, EVENT_SIGNALING *const event)
Encode the Signaling in JSON according to AT&T's schema for the event type.
void evel_set_option_time(EVEL_OPTION_TIME *const option, const time_t value, const char *const description)
Set the value of an EVEL_OPTION_TIME.
struct evel_json_buffer EVEL_JSON_BUFFER
void evel_json_open_object(EVEL_JSON_BUFFER *jbuf)
Add the opening bracket of an object to a JSON buffer.
EVEL_ERR_CODES
Error codes.
bool evel_enc_kv_opt_ull(EVEL_JSON_BUFFER *jbuf, const char *const key, const EVEL_OPTION_ULL *const option)
Encode a string key and unsigned long long value to a EVEL_JSON_BUFFER.
void evel_free_internal_event(EVENT_INTERNAL *event)
Free an internal event.
void evel_json_checkpoint(EVEL_JSON_BUFFER *jbuf)
Add a checkpoint - a stake in the ground to which we can rewind.
void evel_enc_kv_double(EVEL_JSON_BUFFER *jbuf, const char *const key, const double value)
Encode a string key and double value to a EVEL_JSON_BUFFER.
void evel_json_encode_report(EVEL_JSON_BUFFER *jbuf, EVENT_REPORT *event)
Encode the report as a JSON report.
EVEL_VF_STATUSES
Fault VNF Status.
The library cannot handle events.
EVEL_SEVERITIES
Fault / Threshold severities.
void evel_force_option_int(EVEL_OPTION_INT *const option, const int value)
Force the value of an EVEL_OPTION_INT.
void evel_enc_kv_time(EVEL_JSON_BUFFER *jbuf, const char *const key, const time_t *time)
Encode a string key and time value to a EVEL_JSON_BUFFER.
char * evel_criticality(const EVEL_COUNTER_CRITICALITIES criticality)
Map an EVEL_COUNTER_CRITICALITIES enum value to the equivalent string.
void evel_json_encode_measurement(EVEL_JSON_BUFFER *jbuf, EVENT_MEASUREMENT *event)
Encode the measurement as a JSON measurement.
bool evel_json_open_opt_named_list(EVEL_JSON_BUFFER *jbuf, const char *const key)
Add the key and opening bracket of an optional named list to a JSON buffer.
struct evel_suppressed_nv_pairs EVEL_SUPPRESSED_NV_PAIRS
Suppressed NV pairs list entry.
void evel_free_option_string(EVEL_OPTION_STRING *const option)
Free the underlying resources of an EVEL_OPTION_STRING.
struct hsearch_data * hash_nv_pairs_list
EVT_HANDLER_STATE
State of the Event Handler thread.
bool evel_enc_kv_opt_string(EVEL_JSON_BUFFER *jbuf, const char *const key, const EVEL_OPTION_STRING *const option)
Encode a string key and string value to a EVEL_JSON_BUFFER.
EVT_HANDLER_COMMAND
Global commands that may be sent to the Event Handler thread.
void evel_set_option_ull(EVEL_OPTION_ULL *const option, const unsigned long long value, const char *const description)
Set the value of an EVEL_OPTION_ULL.
struct hsearch_data * hash_field_names
bool evel_enc_kv_opt_int(EVEL_JSON_BUFFER *jbuf, const char *const key, const EVEL_OPTION_INT *const option)
Encode a string key and integer value to a EVEL_JSON_BUFFER.
void evel_json_rewind(EVEL_JSON_BUFFER *jbuf)
Rewind to the latest checkoint.
EVEL_ALERT_ACTIONS
Alert actions.
void evel_init_option_ull(EVEL_OPTION_ULL *const option)
Initialize an EVEL_OPTION_ULL to a not-set state.
EVEL_EVENT_PRIORITIES
Event priorities.
Double-linked list structure.
void evel_json_encode_syslog(EVEL_JSON_BUFFER *jbuf, EVENT_SYSLOG *event)
Encode the Syslog in JSON according to AT&T's schema for the event type.
The ring-buffer is being depleted.
bool evel_enc_kv_opt_time(EVEL_JSON_BUFFER *jbuf, const char *const key, const EVEL_OPTION_TIME *const option)
Encode a string key and time value to a EVEL_JSON_BUFFER.
void evel_enc_version(EVEL_JSON_BUFFER *jbuf, const char *const key, const int major_version, const int minor_version)
Encode a key and version.
void evel_json_encode_other(EVEL_JSON_BUFFER *jbuf, EVENT_OTHER *event)
Encode the Other in JSON according to AT&T's schema for the event type.
void evel_free_event_instance_id(EVEL_EVENT_INSTANCE_ID *const instance_id)
Free an event instance id.
EVEL_ERR_CODES event_handler_initialize(const char *const event_api_url, const char *const throt_api_url, const char *const username, const char *const password, int verbosity)
Initialize the event handler.
Optional parameter holder for time_t.
char * evel_severity(const EVEL_SEVERITIES severity)
Map an EVEL_SEVERITIES enum value to the equivalent string.
EVEL_ENTITY_STATE
Alert types.
EVEL_ERR_CODES event_handler_run()
Run the event handler.
void evel_force_option_double(EVEL_OPTION_DOUBLE *const option, const double value)
Force the value of an EVEL_OPTION_DOUBLE.
struct hsearch_data * hash_nv_pair_names
EVEL_SOURCE_TYPES event_source_type
The type of equipment represented by this VNF.
EVEL_COUNTER_CRITICALITIES
Counter criticalities.