AT&T ECOMP Vendor Event Listener library
0.1
|
EVEL internal definitions. More...
#include "evel.h"
Go to the source code of this file.
Data Structures | |
struct | memory_chunk |
A chunk of memory used in the cURL functions. More... | |
struct | event_internal |
Internal event. More... | |
struct | evel_suppressed_nv_pairs |
Suppressed NV pairs list entry. More... | |
struct | evel_throttle_spec |
Event Throttling Specification for a domain which is in a throttled state. More... | |
struct | evel_json_buffer |
Macros | |
#define | max(a, b) |
#define | min(a, b) |
#define | EVEL_CT_ASSERT(X) switch (0) {case 0: case (X):;} |
Compile-time assertion. More... | |
#define | EVEL_RFC2822_STRFTIME_FORMAT "%a, %d %b %Y %T %z" |
#define | EVEL_THROTTLE_FIELD_DEPTH 3 |
Typedefs | |
typedef struct memory_chunk | MEMORY_CHUNK |
A chunk of memory used in the cURL functions. More... | |
typedef struct event_internal | EVENT_INTERNAL |
Internal event. More... | |
typedef struct evel_suppressed_nv_pairs | EVEL_SUPPRESSED_NV_PAIRS |
Suppressed NV pairs list entry. More... | |
typedef struct evel_throttle_spec | EVEL_THROTTLE_SPEC |
Event Throttling Specification for a domain which is in a throttled state. More... | |
typedef struct evel_json_buffer | EVEL_JSON_BUFFER |
Enumerations | |
enum | EVT_HANDLER_COMMAND { EVT_CMD_TERMINATE, EVT_CMD_MAX_COMMANDS } |
Global commands that may be sent to the Event Handler thread. More... | |
enum | EVT_HANDLER_STATE { EVT_HANDLER_UNINITIALIZED, EVT_HANDLER_INACTIVE, EVT_HANDLER_ACTIVE, EVT_HANDLER_REQUEST_TERMINATE, EVT_HANDLER_TERMINATING, EVT_HANDLER_TERMINATED, EVT_HANDLER_MAX_STATES } |
State of the Event Handler thread. More... | |
Functions | |
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. More... | |
EVEL_ERR_CODES | event_handler_terminate () |
Terminate the event handler. More... | |
EVEL_ERR_CODES | event_handler_run () |
Run the event handler. More... | |
EVENT_INTERNAL * | evel_new_internal_event (EVT_HANDLER_COMMAND command) |
Create a new internal event. More... | |
void | evel_free_internal_event (EVENT_INTERNAL *event) |
Free an internal event. More... | |
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. More... | |
void | evel_free_event_instance_id (EVEL_EVENT_INSTANCE_ID *const instance_id) |
Free an event instance id. More... | |
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. More... | |
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. More... | |
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. More... | |
void | evel_json_encode_measurement (EVEL_JSON_BUFFER *jbuf, EVENT_MEASUREMENT *event) |
Encode the measurement as a JSON measurement. More... | |
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. More... | |
void | evel_json_encode_report (EVEL_JSON_BUFFER *jbuf, EVENT_REPORT *event) |
Encode the report as a JSON report. More... | |
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. More... | |
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. More... | |
void | evel_json_encode_state_change (EVEL_JSON_BUFFER *jbuf, EVENT_STATE_CHANGE *state_change) |
Encode the state change as a JSON state change. More... | |
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. More... | |
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. More... | |
void | evel_set_next_event_sequence (const int sequence) |
Set the next event_sequence to use. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
void | evel_json_close_list (EVEL_JSON_BUFFER *jbuf) |
Add the closing bracket of a list to a JSON buffer. More... | |
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. More... | |
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. More... | |
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. More... | |
void | evel_json_open_object (EVEL_JSON_BUFFER *jbuf) |
Add the opening bracket of an object to a JSON buffer. More... | |
void | evel_json_close_object (EVEL_JSON_BUFFER *jbuf) |
Add the closing bracket of an object to a JSON buffer. More... | |
void | evel_json_checkpoint (EVEL_JSON_BUFFER *jbuf) |
Add a checkpoint - a stake in the ground to which we can rewind. More... | |
void | evel_json_rewind (EVEL_JSON_BUFFER *jbuf) |
Rewind to the latest checkoint. More... | |
void | evel_free_option_string (EVEL_OPTION_STRING *const option) |
Free the underlying resources of an EVEL_OPTION_STRING. More... | |
void | evel_init_option_string (EVEL_OPTION_STRING *const option) |
Initialize an EVEL_OPTION_STRING to a not-set state. More... | |
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. More... | |
void | evel_force_option_string (EVEL_OPTION_STRING *const option, const char *const value) |
Force the value of an EVEL_OPTION_STRING. More... | |
void | evel_init_option_int (EVEL_OPTION_INT *const option) |
Initialize an EVEL_OPTION_INT to a not-set state. More... | |
void | evel_force_option_int (EVEL_OPTION_INT *const option, const int value) |
Force the value of an EVEL_OPTION_INT. More... | |
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. More... | |
void | evel_init_option_double (EVEL_OPTION_DOUBLE *const option) |
Initialize an EVEL_OPTION_DOUBLE to a not-set state. More... | |
void | evel_force_option_double (EVEL_OPTION_DOUBLE *const option, const double value) |
Force the value of an EVEL_OPTION_DOUBLE. More... | |
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. More... | |
void | evel_init_option_ull (EVEL_OPTION_ULL *const option) |
Initialize an EVEL_OPTION_ULL to a not-set state. More... | |
void | evel_force_option_ull (EVEL_OPTION_ULL *const option, const unsigned long long value) |
Force the value of an EVEL_OPTION_ULL. More... | |
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. More... | |
void | evel_init_option_time (EVEL_OPTION_TIME *const option) |
Initialize an EVEL_OPTION_TIME to a not-set state. More... | |
void | evel_force_option_time (EVEL_OPTION_TIME *const option, const time_t value) |
Force the value of an EVEL_OPTION_TIME. More... | |
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. More... | |
char * | evel_criticality (const EVEL_COUNTER_CRITICALITIES criticality) |
Map an EVEL_COUNTER_CRITICALITIES enum value to the equivalent string. More... | |
char * | evel_severity (const EVEL_SEVERITIES severity) |
Map an EVEL_SEVERITIES enum value to the equivalent string. More... | |
char * | evel_alert_action (const EVEL_ALERT_ACTIONS alert_action) |
Map an EVEL_ALERT_ACTIONS enum value to the equivalent string. More... | |
char * | evel_alert_type (const EVEL_ALERT_TYPES alert_type) |
Map an EVEL_ALERT_TYPES enum value to the equivalent string. More... | |
char * | evel_event_domain (const EVEL_EVENT_DOMAINS domain) |
Map an EVEL_EVENT_DOMAINS enum value to the equivalent string. More... | |
char * | evel_event_priority (const EVEL_EVENT_PRIORITIES priority) |
Map an EVEL_EVENT_PRIORITIES enum value to the equivalent string. More... | |
char * | evel_source_type (const EVEL_SOURCE_TYPES source_type) |
Map an EVEL_SOURCE_TYPES enum value to the equivalent string. More... | |
char * | evel_vf_status (const EVEL_VF_STATUSES vf_status) |
Map an EVEL_VF_STATUSES enum value to the equivalent string. More... | |
char * | evel_entity_state (const EVEL_ENTITY_STATE state) |
Convert a EVEL_ENTITY_STATE to it's string form for JSON encoding. More... | |
char * | evel_service_endpoint_desc (const EVEL_ENTITY_STATE endpoint_desc) |
Convert a EVEL_SERVICE_ENDPOINT_DESC to string form for JSON encoding. More... | |
Variables | |
char * | functional_role |
The Functional Role of the equipment represented by this VNF. More... | |
EVEL_SOURCE_TYPES | event_source_type |
The type of equipment represented by this VNF. More... | |
EVEL internal definitions.
These are internal definitions which need to be shared between modules within the library but are not intended for external consumption.
Copyright(c) <2016>, AT&T Intellectual Property. All other rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY AT&T INTELLECTUAL PROPERTY ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AT&T INTELLECTUAL PROPERTY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file evel_internal.h.
#define EVEL_CT_ASSERT | ( | X | ) | switch (0) {case 0: case (X):;} |
Compile-time assertion.
Definition at line 62 of file evel_internal.h.
#define EVEL_RFC2822_STRFTIME_FORMAT "%a, %d %b %Y %T %z" |
Definition at line 174 of file evel_internal.h.
#define EVEL_THROTTLE_FIELD_DEPTH 3 |
Definition at line 179 of file evel_internal.h.
#define max | ( | a, | |
b | |||
) |
Definition at line 48 of file evel_internal.h.
#define min | ( | a, | |
b | |||
) |
Definition at line 53 of file evel_internal.h.
typedef struct evel_json_buffer EVEL_JSON_BUFFER |
typedef struct evel_suppressed_nv_pairs EVEL_SUPPRESSED_NV_PAIRS |
Suppressed NV pairs list entry.
JSON equivalent field: suppressedNvPairs
typedef struct evel_throttle_spec EVEL_THROTTLE_SPEC |
Event Throttling Specification for a domain which is in a throttled state.
JSON equivalent object: eventThrottlingState
typedef struct event_internal EVENT_INTERNAL |
Internal event.
Pseudo-event used for routing internal commands.
typedef struct memory_chunk MEMORY_CHUNK |
A chunk of memory used in the cURL functions.
enum EVT_HANDLER_COMMAND |
Global commands that may be sent to the Event Handler thread.
Enumerator | |
---|---|
EVT_CMD_TERMINATE | |
EVT_CMD_MAX_COMMANDS |
Definition at line 85 of file evel_internal.h.
enum EVT_HANDLER_STATE |
State of the Event Handler thread.
Definition at line 93 of file evel_internal.h.
char* evel_alert_action | ( | const EVEL_ALERT_ACTIONS | alert_action | ) |
Map an EVEL_ALERT_ACTIONS enum value to the equivalent string.
alert_action | The alert_action to convert. |
Definition at line 123 of file evel_strings.c.
char* evel_alert_type | ( | const EVEL_ALERT_TYPES | alert_type | ) |
Map an EVEL_ALERT_TYPES enum value to the equivalent string.
alert_type | The alert_type to convert. |
Definition at line 159 of file evel_strings.c.
char* evel_criticality | ( | const EVEL_COUNTER_CRITICALITIES | criticality | ) |
Map an EVEL_COUNTER_CRITICALITIES enum value to the equivalent string.
criticality | The criticality to convert. |
Definition at line 47 of file evel_strings.c.
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.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
key | Pointer to the key to encode. |
value | The corresponding value to encode. |
Definition at line 323 of file evel_json_buffer.c.
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.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
key | Pointer to the key to encode. |
value | The corresponding value to encode. |
Definition at line 252 of file evel_json_buffer.c.
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.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
key | Pointer to the key to encode. |
option | Pointer to holder of the corresponding value to encode. |
Definition at line 282 of file evel_json_buffer.c.
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.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
key | Pointer to the key to encode. |
option | Pointer to holder of the corresponding value to encode. |
Definition at line 211 of file evel_json_buffer.c.
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.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
key | Pointer to the key to encode. |
option | Pointer to holder of the corresponding value to encode. |
Definition at line 105 of file evel_json_buffer.c.
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.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
key | Pointer to the key to encode. |
option | Pointer to holder of the corresponding value to encode. |
Definition at line 424 of file evel_json_buffer.c.
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.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
key | Pointer to the key to encode. |
option | Pointer to holder of the corresponding value to encode. |
Definition at line 353 of file evel_json_buffer.c.
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.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
key | Pointer to the key to encode. |
value | Pointer to the corresponding value to encode. |
Definition at line 146 of file evel_json_buffer.c.
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.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
key | Pointer to the key to encode. |
time | Pointer to the time to encode. |
Definition at line 465 of file evel_json_buffer.c.
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.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
key | Pointer to the key to encode. |
value | The corresponding value to encode. |
Definition at line 394 of file evel_json_buffer.c.
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.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
format | Format string in standard printf format. |
... | Variable parameters for format string. |
Definition at line 620 of file evel_json_buffer.c.
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.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
key | Pointer to the key to encode. |
major_version | The major version to encode. |
minor_version | The minor version to encode. |
Definition at line 501 of file evel_json_buffer.c.
char* evel_entity_state | ( | const EVEL_ENTITY_STATE | state | ) |
Convert a EVEL_ENTITY_STATE to it's string form for JSON encoding.
state | The entity state to encode. |
Definition at line 416 of file evel_strings.c.
char* evel_event_domain | ( | const EVEL_EVENT_DOMAINS | domain | ) |
Map an EVEL_EVENT_DOMAINS enum value to the equivalent string.
domain | The domain to convert. |
Definition at line 199 of file evel_strings.c.
char* evel_event_priority | ( | const EVEL_EVENT_PRIORITIES | priority | ) |
Map an EVEL_EVENT_PRIORITIES enum value to the equivalent string.
priority | The priority to convert. |
Definition at line 264 of file evel_strings.c.
void evel_force_option_double | ( | EVEL_OPTION_DOUBLE *const | option, |
const double | value | ||
) |
Force the value of an EVEL_OPTION_DOUBLE.
option | Pointer to the EVEL_OPTION_DOUBLE. |
value | The value to set. |
Definition at line 248 of file evel_option.c.
void evel_force_option_int | ( | EVEL_OPTION_INT *const | option, |
const int | value | ||
) |
Force the value of an EVEL_OPTION_INT.
option | Pointer to the EVEL_OPTION_INT. |
value | The value to set. |
Definition at line 172 of file evel_option.c.
void evel_force_option_string | ( | EVEL_OPTION_STRING *const | option, |
const char *const | value | ||
) |
Force the value of an EVEL_OPTION_STRING.
option | Pointer to the EVEL_OPTION_STRING. |
value | The value to set. |
Definition at line 128 of file evel_option.c.
void evel_force_option_time | ( | EVEL_OPTION_TIME *const | option, |
const time_t | value | ||
) |
Force the value of an EVEL_OPTION_TIME.
option | Pointer to the EVEL_OPTION_TIME. |
value | The value to set. |
Definition at line 395 of file evel_option.c.
void evel_force_option_ull | ( | EVEL_OPTION_ULL *const | option, |
const unsigned long long | value | ||
) |
Force the value of an EVEL_OPTION_ULL.
option | Pointer to the EVEL_OPTION_ULL. |
value | The value to set. |
Definition at line 322 of file evel_option.c.
void evel_free_event_instance_id | ( | EVEL_EVENT_INSTANCE_ID *const | instance_id | ) |
Free an event instance id.
instance_id | Pointer to the event instance id being initialized. |
Definition at line 505 of file evel_event.c.
void evel_free_internal_event | ( | EVENT_INTERNAL * | event | ) |
Free an internal event.
Free off the event supplied. Will free all the contained* allocated memory.
Free off the event supplied. Will free all the contained allocated memory.
Definition at line 106 of file evel_internal_event.c.
void evel_free_option_string | ( | EVEL_OPTION_STRING *const | option | ) |
Free the underlying resources of an EVEL_OPTION_STRING.
option | Pointer to the EVEL_OPTION_STRING. |
Definition at line 48 of file evel_option.c.
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.
Tokenize the response, and decode any tokens found.
chunk | The memory chunk containing the response. |
post | The memory chunk in which to place any resulting POST. |
Definition at line 904 of file evel_event_mgr.c.
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.
instance_id | Pointer to the event instance id being initialized. |
vendor_id | The vendor id to encode in the event instance id. |
event_id | The event id to encode in the event instance id. |
Initialize an event instance id, typically embedded in an event.
instance_id | Pointer to the event instance id being initialized. |
vendor_id | The vendor id to encode in the event instance id. |
event_id | The event id to encode in the event instance id. |
Definition at line 471 of file evel_event.c.
void evel_init_option_double | ( | EVEL_OPTION_DOUBLE *const | option | ) |
Initialize an EVEL_OPTION_DOUBLE to a not-set state.
option | Pointer to the EVEL_OPTION_DOUBLE. |
Definition at line 227 of file evel_option.c.
void evel_init_option_int | ( | EVEL_OPTION_INT *const | option | ) |
Initialize an EVEL_OPTION_INT to a not-set state.
option | Pointer to the EVEL_OPTION_INT. |
Definition at line 151 of file evel_option.c.
void evel_init_option_string | ( | EVEL_OPTION_STRING *const | option | ) |
Initialize an EVEL_OPTION_STRING to a not-set state.
option | Pointer to the EVEL_OPTION_STRING. |
Definition at line 72 of file evel_option.c.
void evel_init_option_time | ( | EVEL_OPTION_TIME *const | option | ) |
Initialize an EVEL_OPTION_TIME to a not-set state.
option | Pointer to the EVEL_OPTION_TIME. |
Definition at line 376 of file evel_option.c.
void evel_init_option_ull | ( | EVEL_OPTION_ULL *const | option | ) |
Initialize an EVEL_OPTION_ULL to a not-set state.
option | Pointer to the EVEL_OPTION_ULL. |
Definition at line 303 of file evel_option.c.
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.
jbuf | Pointer to the EVEL_JSON_BUFFER to initialise. |
json | Pointer to the underlying working buffer to use. |
max_size | Size of storage available in the JSON buffer. |
throttle_spec | Pointer to throttle specification. Can be NULL. |
Definition at line 55 of file evel_json_buffer.c.
void evel_json_checkpoint | ( | EVEL_JSON_BUFFER * | jbuf | ) |
Add a checkpoint - a stake in the ground to which we can rewind.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
Definition at line 813 of file evel_json_buffer.c.
void evel_json_close_list | ( | EVEL_JSON_BUFFER * | jbuf | ) |
Add the closing bracket of a list to a JSON buffer.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
Definition at line 596 of file evel_json_buffer.c.
void evel_json_close_object | ( | EVEL_JSON_BUFFER * | jbuf | ) |
Add the closing bracket of an object to a JSON buffer.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
Definition at line 758 of file evel_json_buffer.c.
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.
jbuf | Pointer to the EVEL_JSON_BUFFER to encode into. |
event | Pointer to the EVENT_HEADER to encode. |
Definition at line 214 of file evel_fault.c.
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.
jbuf | Pointer to the EVEL_JSON_BUFFER to encode into. |
event | Pointer to the EVENT_HEADER to encode. |
Definition at line 291 of file evel_event.c.
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.
jbuf | Pointer to the EVEL_JSON_BUFFER to encode into. |
instance_id | Pointer to the EVEL_EVENT_INSTANCE_ID to encode. |
Definition at line 534 of file evel_event.c.
void evel_json_encode_measurement | ( | EVEL_JSON_BUFFER * | jbuf, |
EVENT_MEASUREMENT * | event | ||
) |
Encode the measurement as a JSON measurement.
jbuf | Pointer to the EVEL_JSON_BUFFER to encode into. |
event | Pointer to the EVENT_HEADER to encode. |
Definition at line 1225 of file evel_scaling_measurement.c.
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.
jbuf | Pointer to the EVEL_JSON_BUFFER to encode into. |
event | Pointer to the EVENT_HEADER to encode. |
Definition at line 898 of file evel_mobile_flow.c.
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.
jbuf | Pointer to the EVEL_JSON_BUFFER to encode into. |
event | Pointer to the EVENT_HEADER to encode. |
Definition at line 160 of file evel_other.c.
void evel_json_encode_report | ( | EVEL_JSON_BUFFER * | jbuf, |
EVENT_REPORT * | event | ||
) |
Encode the report as a JSON report.
jbuf | Pointer to the EVEL_JSON_BUFFER to encode into. |
event | Pointer to the EVENT_HEADER to encode. |
Definition at line 266 of file evel_reporting_measurement.c.
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.
jbuf | Pointer to the EVEL_JSON_BUFFER to encode into. |
event | Pointer to the EVENT_HEADER to encode. |
Encode the Service Event in JSON according to AT&T's schema for the event type.
jbuf | Pointer to the EVEL_JSON_BUFFER to encode into. |
event | Pointer to the EVENT_HEADER to encode. |
Definition at line 1030 of file evel_service.c.
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.
jbuf | Pointer to the EVEL_JSON_BUFFER to encode into. |
event | Pointer to the EVENT_HEADER to encode. |
Definition at line 441 of file evel_signaling.c.
void evel_json_encode_state_change | ( | EVEL_JSON_BUFFER * | jbuf, |
EVENT_STATE_CHANGE * | state_change | ||
) |
Encode the state change as a JSON state change.
jbuf | Pointer to the EVEL_JSON_BUFFER to encode into. |
state_change | Pointer to the EVENT_STATE_CHANGE to encode. |
Definition at line 221 of file evel_state_change.c.
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.
jbuf | Pointer to the EVEL_JSON_BUFFER to encode into. |
event | Pointer to the EVENT_HEADER to encode. |
Definition at line 354 of file evel_syslog.c.
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.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
key | Pointer to the key to encode. |
Definition at line 570 of file evel_json_buffer.c.
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.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
key | Pointer to the key to encode. |
Definition at line 698 of file evel_json_buffer.c.
void evel_json_open_object | ( | EVEL_JSON_BUFFER * | jbuf | ) |
Add the opening bracket of an object to a JSON buffer.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
Definition at line 724 of file evel_json_buffer.c.
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.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
key | Pointer to the key to encode. |
Definition at line 533 of file evel_json_buffer.c.
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.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
key | Pointer to the key to encode. |
Definition at line 660 of file evel_json_buffer.c.
void evel_json_rewind | ( | EVEL_JSON_BUFFER * | jbuf | ) |
Rewind to the latest checkoint.
jbuf | Pointer to working EVEL_JSON_BUFFER. |
Definition at line 835 of file evel_json_buffer.c.
EVENT_INTERNAL* evel_new_internal_event | ( | EVT_HANDLER_COMMAND | command | ) |
Create a new internal event.
command | The condition indicated by the event. |
NULL | Failed to create the event. |
Definition at line 64 of file evel_internal_event.c.
char* evel_service_endpoint_desc | ( | const EVEL_ENTITY_STATE | endpoint_desc | ) |
Convert a EVEL_SERVICE_ENDPOINT_DESC to string form for JSON encoding.
endpoint_desc | endpoint description to encode. |
Definition at line 453 of file evel_strings.c.
void evel_set_next_event_sequence | ( | const int | sequence | ) |
Set the next event_sequence to use.
sequence | The next sequence number to use. |
Definition at line 59 of file evel_event.c.
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.
option | Pointer to the EVEL_OPTION_DOUBLE. |
value | The value to set. |
description | Description to be used in logging. |
Definition at line 271 of file evel_option.c.
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.
option | Pointer to the EVEL_OPTION_INT. |
value | The value to set. |
description | Description to be used in logging. |
Definition at line 195 of file evel_option.c.
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.
option | Pointer to the EVEL_OPTION_STRING. |
value | The value to set. |
description | Description to be used in logging. |
Definition at line 94 of file evel_option.c.
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.
option | Pointer to the EVEL_OPTION_TIME. |
value | The value to set. |
description | Description to be used in logging. |
Definition at line 418 of file evel_option.c.
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.
option | Pointer to the EVEL_OPTION_ULL. |
value | The value to set. |
description | Description to be used in logging. |
Definition at line 345 of file evel_option.c.
char* evel_severity | ( | const EVEL_SEVERITIES | severity | ) |
Map an EVEL_SEVERITIES enum value to the equivalent string.
severity | The severity to convert. |
Definition at line 79 of file evel_strings.c.
char* evel_source_type | ( | const EVEL_SOURCE_TYPES | source_type | ) |
Map an EVEL_SOURCE_TYPES enum value to the equivalent string.
source_type | The source type to convert. |
Definition at line 305 of file evel_strings.c.
char* evel_vf_status | ( | const EVEL_VF_STATUSES | vf_status | ) |
Map an EVEL_VF_STATUSES enum value to the equivalent string.
vf_status | The vf_status to convert. |
Definition at line 370 of file evel_strings.c.
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.
Primarily responsible for getting cURL ready for use.
[in] | event_api_url | The URL where the Vendor Event Listener API is expected to be. |
[in] | throt_api_url | The URL where the Throttling API is expected to be. |
[in] | username | The username for the Basic Authentication of requests. |
[in] | password | The password for the Basic Authentication of requests. |
verbosity | 0 for normal operation, positive values for chattier logs. |
Primarily responsible for getting CURL ready for use.
[in] | event_api_url | The URL where the Vendor Event Listener API is expected to be. |
[in] | throt_api_url | The URL where the Throttling API is expected to be. |
[in] | username | The username for the Basic Authentication of requests. |
[in] | password | The password for the Basic Authentication of requests. |
verbosity | 0 for normal operation, positive values for chattier logs. |
Definition at line 133 of file evel_event_mgr.c.
EVEL_ERR_CODES event_handler_run | ( | ) |
Run the event handler.
Spawns the thread responsible for handling events and sending them to the API.
EVEL_SUCCESS | if everything OK. |
One | of EVEL_ERR_CODES if there was a problem. |
Definition at line 371 of file evel_event_mgr.c.
EVEL_ERR_CODES event_handler_terminate | ( | ) |
Terminate the event handler.
Shuts down the event handler thread in as clean a way as possible. Sets the global exit flag and then signals the thread to interrupt it since it's most likely waiting on the ring-buffer.
Having achieved an orderly shutdown of the event handler thread, clean up the cURL library's resources cleanly.
EVEL_SUCCESS | if everything OK. |
One | of EVEL_ERR_CODES if there was a problem. |
Definition at line 408 of file evel_event_mgr.c.
EVEL_SOURCE_TYPES event_source_type |