AT&T ECOMP Vendor Event Listener library  0.1
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
evel_internal.h File Reference

EVEL internal definitions. More...

#include "evel.h"
Include dependency graph for evel_internal.h:
This graph shows which files directly or indirectly include this file:

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_INTERNALevel_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...
 

Detailed Description

EVEL internal definitions.

These are internal definitions which need to be shared between modules within the library but are not intended for external consumption.

License

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:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the AT&T.
  4. Neither the name of AT&T nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

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.

Macro Definition Documentation

§ EVEL_CT_ASSERT

#define EVEL_CT_ASSERT (   X)    switch (0) {case 0: case (X):;}

Compile-time assertion.

Definition at line 62 of file evel_internal.h.

§ EVEL_RFC2822_STRFTIME_FORMAT

#define EVEL_RFC2822_STRFTIME_FORMAT   "%a, %d %b %Y %T %z"

Definition at line 174 of file evel_internal.h.

§ EVEL_THROTTLE_FIELD_DEPTH

#define EVEL_THROTTLE_FIELD_DEPTH   3

Definition at line 179 of file evel_internal.h.

§ max

#define max (   a,
 
)
Value:
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; })

Definition at line 48 of file evel_internal.h.

§ min

#define min (   a,
 
)
Value:
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a < _b ? _a : _b; })

Definition at line 53 of file evel_internal.h.

Typedef Documentation

§ EVEL_JSON_BUFFER

§ EVEL_SUPPRESSED_NV_PAIRS

Suppressed NV pairs list entry.

JSON equivalent field: suppressedNvPairs

§ EVEL_THROTTLE_SPEC

Event Throttling Specification for a domain which is in a throttled state.

JSON equivalent object: eventThrottlingState

§ EVENT_INTERNAL

Internal event.

Pseudo-event used for routing internal commands.

§ MEMORY_CHUNK

typedef struct memory_chunk MEMORY_CHUNK

A chunk of memory used in the cURL functions.

Enumeration Type Documentation

§ 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.

§ EVT_HANDLER_STATE

State of the Event Handler thread.

Enumerator
EVT_HANDLER_UNINITIALIZED 
EVT_HANDLER_INACTIVE 

The library cannot handle events.

EVT_HANDLER_ACTIVE 

The event handler thread not started.

EVT_HANDLER_REQUEST_TERMINATE 

The event handler thread is started.

EVT_HANDLER_TERMINATING 

Initial stages of shutdown.

EVT_HANDLER_TERMINATED 

The ring-buffer is being depleted.

EVT_HANDLER_MAX_STATES 

The library is exited.

Maximum number of valid states.

Definition at line 93 of file evel_internal.h.

Function Documentation

§ evel_alert_action()

char* evel_alert_action ( const EVEL_ALERT_ACTIONS  alert_action)

Map an EVEL_ALERT_ACTIONS enum value to the equivalent string.

Parameters
alert_actionThe alert_action to convert.
Returns
The equivalent string.

Definition at line 123 of file evel_strings.c.

§ evel_alert_type()

char* evel_alert_type ( const EVEL_ALERT_TYPES  alert_type)

Map an EVEL_ALERT_TYPES enum value to the equivalent string.

Parameters
alert_typeThe alert_type to convert.
Returns
The equivalent string.

Definition at line 159 of file evel_strings.c.

§ evel_criticality()

char* evel_criticality ( const EVEL_COUNTER_CRITICALITIES  criticality)

Map an EVEL_COUNTER_CRITICALITIES enum value to the equivalent string.

Parameters
criticalityThe criticality to convert.
Returns
The equivalent string.

Definition at line 47 of file evel_strings.c.

§ evel_enc_kv_double()

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.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.
keyPointer to the key to encode.
valueThe corresponding value to encode.

Definition at line 323 of file evel_json_buffer.c.

§ evel_enc_kv_int()

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.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.
keyPointer to the key to encode.
valueThe corresponding value to encode.

Definition at line 252 of file evel_json_buffer.c.

§ evel_enc_kv_opt_double()

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.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.
keyPointer to the key to encode.
optionPointer to holder of the corresponding value to encode.
Returns
true if the key, value was added, false if it was suppressed.

Definition at line 282 of file evel_json_buffer.c.

§ evel_enc_kv_opt_int()

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.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.
keyPointer to the key to encode.
optionPointer to holder of the corresponding value to encode.
Returns
true if the key, value was added, false if it was suppressed.

Definition at line 211 of file evel_json_buffer.c.

§ evel_enc_kv_opt_string()

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.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.
keyPointer to the key to encode.
optionPointer to holder of the corresponding value to encode.
Returns
true if the key, value was added, false if it was suppressed.

Definition at line 105 of file evel_json_buffer.c.

§ evel_enc_kv_opt_time()

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.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.
keyPointer to the key to encode.
optionPointer to holder of the corresponding value to encode.
Returns
true if the key, value was added, false if it was suppressed.

Definition at line 424 of file evel_json_buffer.c.

§ evel_enc_kv_opt_ull()

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.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.
keyPointer to the key to encode.
optionPointer to holder of the corresponding value to encode.
Returns
true if the key, value was added, false if it was suppressed.

Definition at line 353 of file evel_json_buffer.c.

§ evel_enc_kv_string()

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.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.
keyPointer to the key to encode.
valuePointer to the corresponding value to encode.

Definition at line 146 of file evel_json_buffer.c.

§ evel_enc_kv_time()

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.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.
keyPointer to the key to encode.
timePointer to the time to encode.

Definition at line 465 of file evel_json_buffer.c.

§ evel_enc_kv_ull()

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.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.
keyPointer to the key to encode.
valueThe corresponding value to encode.

Definition at line 394 of file evel_json_buffer.c.

§ evel_enc_list_item()

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.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.
formatFormat string in standard printf format.
...Variable parameters for format string.

Definition at line 620 of file evel_json_buffer.c.

§ evel_enc_version()

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.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.
keyPointer to the key to encode.
major_versionThe major version to encode.
minor_versionThe minor version to encode.

Definition at line 501 of file evel_json_buffer.c.

§ evel_entity_state()

char* evel_entity_state ( const EVEL_ENTITY_STATE  state)

Convert a EVEL_ENTITY_STATE to it's string form for JSON encoding.

Parameters
stateThe entity state to encode.
Returns
the corresponding string

Definition at line 416 of file evel_strings.c.

§ evel_event_domain()

char* evel_event_domain ( const EVEL_EVENT_DOMAINS  domain)

Map an EVEL_EVENT_DOMAINS enum value to the equivalent string.

Parameters
domainThe domain to convert.
Returns
The equivalent string.

Definition at line 199 of file evel_strings.c.

§ evel_event_priority()

char* evel_event_priority ( const EVEL_EVENT_PRIORITIES  priority)

Map an EVEL_EVENT_PRIORITIES enum value to the equivalent string.

Parameters
priorityThe priority to convert.
Returns
The equivalent string.

Definition at line 264 of file evel_strings.c.

§ evel_force_option_double()

void evel_force_option_double ( EVEL_OPTION_DOUBLE *const  option,
const double  value 
)

Force the value of an EVEL_OPTION_DOUBLE.

Parameters
optionPointer to the EVEL_OPTION_DOUBLE.
valueThe value to set.

Definition at line 248 of file evel_option.c.

§ evel_force_option_int()

void evel_force_option_int ( EVEL_OPTION_INT *const  option,
const int  value 
)

Force the value of an EVEL_OPTION_INT.

Parameters
optionPointer to the EVEL_OPTION_INT.
valueThe value to set.

Definition at line 172 of file evel_option.c.

§ evel_force_option_string()

void evel_force_option_string ( EVEL_OPTION_STRING *const  option,
const char *const  value 
)

Force the value of an EVEL_OPTION_STRING.

Parameters
optionPointer to the EVEL_OPTION_STRING.
valueThe value to set.

Definition at line 128 of file evel_option.c.

§ evel_force_option_time()

void evel_force_option_time ( EVEL_OPTION_TIME *const  option,
const time_t  value 
)

Force the value of an EVEL_OPTION_TIME.

Parameters
optionPointer to the EVEL_OPTION_TIME.
valueThe value to set.

Definition at line 395 of file evel_option.c.

§ evel_force_option_ull()

void evel_force_option_ull ( EVEL_OPTION_ULL *const  option,
const unsigned long long  value 
)

Force the value of an EVEL_OPTION_ULL.

Parameters
optionPointer to the EVEL_OPTION_ULL.
valueThe value to set.

Definition at line 322 of file evel_option.c.

§ evel_free_event_instance_id()

void evel_free_event_instance_id ( EVEL_EVENT_INSTANCE_ID *const  instance_id)

Free an event instance id.

Parameters
instance_idPointer to the event instance id being initialized.

Definition at line 505 of file evel_event.c.

§ evel_free_internal_event()

void evel_free_internal_event ( EVENT_INTERNAL event)

Free an internal event.

Free off the event supplied. Will free all the contained* allocated memory.

Note
It does not free the internal event itself, since that may be part of a larger structure.

Free off the event supplied. Will free all the contained allocated memory.

Note
It does not free the internal event itself, since that may be part of a larger structure.

Definition at line 106 of file evel_internal_event.c.

§ evel_free_option_string()

void evel_free_option_string ( EVEL_OPTION_STRING *const  option)

Free the underlying resources of an EVEL_OPTION_STRING.

Parameters
optionPointer to the EVEL_OPTION_STRING.

Definition at line 48 of file evel_option.c.

§ evel_handle_event_response()

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.

Parameters
chunkThe memory chunk containing the response.
postThe memory chunk in which to place any resulting POST.

Definition at line 904 of file evel_event_mgr.c.

§ evel_init_event_instance_id()

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.

Parameters
instance_idPointer to the event instance id being initialized.
vendor_idThe vendor id to encode in the event instance id.
event_idThe event id to encode in the event instance id.

Initialize an event instance id, typically embedded in an event.

Parameters
instance_idPointer to the event instance id being initialized.
vendor_idThe vendor id to encode in the event instance id.
event_idThe event id to encode in the event instance id.

Definition at line 471 of file evel_event.c.

§ evel_init_option_double()

void evel_init_option_double ( EVEL_OPTION_DOUBLE *const  option)

Initialize an EVEL_OPTION_DOUBLE to a not-set state.

Parameters
optionPointer to the EVEL_OPTION_DOUBLE.

Definition at line 227 of file evel_option.c.

§ evel_init_option_int()

void evel_init_option_int ( EVEL_OPTION_INT *const  option)

Initialize an EVEL_OPTION_INT to a not-set state.

Parameters
optionPointer to the EVEL_OPTION_INT.

Definition at line 151 of file evel_option.c.

§ evel_init_option_string()

void evel_init_option_string ( EVEL_OPTION_STRING *const  option)

Initialize an EVEL_OPTION_STRING to a not-set state.

Parameters
optionPointer to the EVEL_OPTION_STRING.

Definition at line 72 of file evel_option.c.

§ evel_init_option_time()

void evel_init_option_time ( EVEL_OPTION_TIME *const  option)

Initialize an EVEL_OPTION_TIME to a not-set state.

Parameters
optionPointer to the EVEL_OPTION_TIME.

Definition at line 376 of file evel_option.c.

§ evel_init_option_ull()

void evel_init_option_ull ( EVEL_OPTION_ULL *const  option)

Initialize an EVEL_OPTION_ULL to a not-set state.

Parameters
optionPointer to the EVEL_OPTION_ULL.

Definition at line 303 of file evel_option.c.

§ evel_json_buffer_init()

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.

Parameters
jbufPointer to the EVEL_JSON_BUFFER to initialise.
jsonPointer to the underlying working buffer to use.
max_sizeSize of storage available in the JSON buffer.
throttle_specPointer to throttle specification. Can be NULL.

Definition at line 55 of file evel_json_buffer.c.

§ evel_json_checkpoint()

void evel_json_checkpoint ( EVEL_JSON_BUFFER jbuf)

Add a checkpoint - a stake in the ground to which we can rewind.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.

Definition at line 813 of file evel_json_buffer.c.

§ evel_json_close_list()

void evel_json_close_list ( EVEL_JSON_BUFFER jbuf)

Add the closing bracket of a list to a JSON buffer.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.

Definition at line 596 of file evel_json_buffer.c.

§ evel_json_close_object()

void evel_json_close_object ( EVEL_JSON_BUFFER jbuf)

Add the closing bracket of an object to a JSON buffer.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.

Definition at line 758 of file evel_json_buffer.c.

§ evel_json_encode_fault()

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.

Parameters
jbufPointer to the EVEL_JSON_BUFFER to encode into.
eventPointer to the EVENT_HEADER to encode.

Definition at line 214 of file evel_fault.c.

§ evel_json_encode_header()

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.

Parameters
jbufPointer to the EVEL_JSON_BUFFER to encode into.
eventPointer to the EVENT_HEADER to encode.

Definition at line 291 of file evel_event.c.

§ evel_json_encode_instance_id()

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.

Parameters
jbufPointer to the EVEL_JSON_BUFFER to encode into.
instance_idPointer to the EVEL_EVENT_INSTANCE_ID to encode.

Definition at line 534 of file evel_event.c.

§ evel_json_encode_measurement()

void evel_json_encode_measurement ( EVEL_JSON_BUFFER jbuf,
EVENT_MEASUREMENT event 
)

Encode the measurement as a JSON measurement.

Parameters
jbufPointer to the EVEL_JSON_BUFFER to encode into.
eventPointer to the EVENT_HEADER to encode.

Definition at line 1225 of file evel_scaling_measurement.c.

§ evel_json_encode_mobile_flow()

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.

Parameters
jbufPointer to the EVEL_JSON_BUFFER to encode into.
eventPointer to the EVENT_HEADER to encode.

Definition at line 898 of file evel_mobile_flow.c.

§ evel_json_encode_other()

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.

Parameters
jbufPointer to the EVEL_JSON_BUFFER to encode into.
eventPointer to the EVENT_HEADER to encode.

Definition at line 160 of file evel_other.c.

§ evel_json_encode_report()

void evel_json_encode_report ( EVEL_JSON_BUFFER jbuf,
EVENT_REPORT event 
)

Encode the report as a JSON report.

Parameters
jbufPointer to the EVEL_JSON_BUFFER to encode into.
eventPointer to the EVENT_HEADER to encode.

Definition at line 266 of file evel_reporting_measurement.c.

§ evel_json_encode_service()

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.

Parameters
jbufPointer to the EVEL_JSON_BUFFER to encode into.
eventPointer to the EVENT_HEADER to encode.

Encode the Service Event in JSON according to AT&T's schema for the event type.

Parameters
jbufPointer to the EVEL_JSON_BUFFER to encode into.
eventPointer to the EVENT_HEADER to encode.

Definition at line 1030 of file evel_service.c.

§ evel_json_encode_signaling()

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.

Parameters
jbufPointer to the EVEL_JSON_BUFFER to encode into.
eventPointer to the EVENT_HEADER to encode.

Definition at line 441 of file evel_signaling.c.

§ evel_json_encode_state_change()

void evel_json_encode_state_change ( EVEL_JSON_BUFFER jbuf,
EVENT_STATE_CHANGE state_change 
)

Encode the state change as a JSON state change.

Parameters
jbufPointer to the EVEL_JSON_BUFFER to encode into.
state_changePointer to the EVENT_STATE_CHANGE to encode.

Definition at line 221 of file evel_state_change.c.

§ evel_json_encode_syslog()

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.

Parameters
jbufPointer to the EVEL_JSON_BUFFER to encode into.
eventPointer to the EVENT_HEADER to encode.

Definition at line 354 of file evel_syslog.c.

§ evel_json_open_named_list()

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.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.
keyPointer to the key to encode.

Definition at line 570 of file evel_json_buffer.c.

§ evel_json_open_named_object()

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.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.
keyPointer to the key to encode.
Returns
true if the object was opened, false if it was suppressed.

Definition at line 698 of file evel_json_buffer.c.

§ evel_json_open_object()

void evel_json_open_object ( EVEL_JSON_BUFFER jbuf)

Add the opening bracket of an object to a JSON buffer.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.

Definition at line 724 of file evel_json_buffer.c.

§ evel_json_open_opt_named_list()

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.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.
keyPointer to the key to encode.
Returns
true if the list was opened, false if it was suppressed.

Definition at line 533 of file evel_json_buffer.c.

§ evel_json_open_opt_named_object()

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.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.
keyPointer to the key to encode.

Definition at line 660 of file evel_json_buffer.c.

§ evel_json_rewind()

void evel_json_rewind ( EVEL_JSON_BUFFER jbuf)

Rewind to the latest checkoint.

Parameters
jbufPointer to working EVEL_JSON_BUFFER.

Definition at line 835 of file evel_json_buffer.c.

§ evel_new_internal_event()

EVENT_INTERNAL* evel_new_internal_event ( EVT_HANDLER_COMMAND  command)

Create a new internal event.

Note
The mandatory fields on the Fault must be supplied to this factory function and are immutable once set. Optional fields have explicit setter functions, but again values may only be set once so that the Fault has immutable properties.
Parameters
commandThe condition indicated by the event.
Returns
pointer to the newly manufactured EVENT_INTERNAL. If the event is not used (i.e. posted) it must be released using evel_free_event.
Return values
NULLFailed to create the event.

Definition at line 64 of file evel_internal_event.c.

§ evel_service_endpoint_desc()

char* evel_service_endpoint_desc ( const EVEL_ENTITY_STATE  endpoint_desc)

Convert a EVEL_SERVICE_ENDPOINT_DESC to string form for JSON encoding.

Parameters
endpoint_descendpoint description to encode.
Returns
the corresponding string

Definition at line 453 of file evel_strings.c.

§ evel_set_next_event_sequence()

void evel_set_next_event_sequence ( const int  sequence)

Set the next event_sequence to use.

Parameters
sequenceThe next sequence number to use.

Definition at line 59 of file evel_event.c.

§ evel_set_option_double()

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.

Parameters
optionPointer to the EVEL_OPTION_DOUBLE.
valueThe value to set.
descriptionDescription to be used in logging.

Definition at line 271 of file evel_option.c.

§ evel_set_option_int()

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.

Parameters
optionPointer to the EVEL_OPTION_INT.
valueThe value to set.
descriptionDescription to be used in logging.

Definition at line 195 of file evel_option.c.

§ evel_set_option_string()

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.

Parameters
optionPointer to the EVEL_OPTION_STRING.
valueThe value to set.
descriptionDescription to be used in logging.

Definition at line 94 of file evel_option.c.

§ evel_set_option_time()

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.

Parameters
optionPointer to the EVEL_OPTION_TIME.
valueThe value to set.
descriptionDescription to be used in logging.

Definition at line 418 of file evel_option.c.

§ evel_set_option_ull()

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.

Parameters
optionPointer to the EVEL_OPTION_ULL.
valueThe value to set.
descriptionDescription to be used in logging.

Definition at line 345 of file evel_option.c.

§ evel_severity()

char* evel_severity ( const EVEL_SEVERITIES  severity)

Map an EVEL_SEVERITIES enum value to the equivalent string.

Parameters
severityThe severity to convert.
Returns
The equivalent string.

Definition at line 79 of file evel_strings.c.

§ evel_source_type()

char* evel_source_type ( const EVEL_SOURCE_TYPES  source_type)

Map an EVEL_SOURCE_TYPES enum value to the equivalent string.

Parameters
source_typeThe source type to convert.
Returns
The equivalent string.

Definition at line 305 of file evel_strings.c.

§ evel_vf_status()

char* evel_vf_status ( const EVEL_VF_STATUSES  vf_status)

Map an EVEL_VF_STATUSES enum value to the equivalent string.

Parameters
vf_statusThe vf_status to convert.
Returns
The equivalent string.

Definition at line 370 of file evel_strings.c.

§ event_handler_initialize()

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.

Parameters
[in]event_api_urlThe URL where the Vendor Event Listener API is expected to be.
[in]throt_api_urlThe URL where the Throttling API is expected to be.
[in]usernameThe username for the Basic Authentication of requests.
[in]passwordThe password for the Basic Authentication of requests.
verbosity0 for normal operation, positive values for chattier logs.

Primarily responsible for getting CURL ready for use.

Parameters
[in]event_api_urlThe URL where the Vendor Event Listener API is expected to be.
[in]throt_api_urlThe URL where the Throttling API is expected to be.
[in]usernameThe username for the Basic Authentication of requests.
[in]passwordThe password for the Basic Authentication of requests.
verbosity0 for normal operation, positive values for chattier logs.

Definition at line 133 of file evel_event_mgr.c.

§ event_handler_run()

EVEL_ERR_CODES event_handler_run ( )

Run the event handler.

Spawns the thread responsible for handling events and sending them to the API.

Returns
Status code.
Return values
EVEL_SUCCESSif everything OK.
Oneof EVEL_ERR_CODES if there was a problem.

Definition at line 371 of file evel_event_mgr.c.

§ event_handler_terminate()

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.

Returns
Status code.
Return values
EVEL_SUCCESSif everything OK.
Oneof EVEL_ERR_CODES if there was a problem.

Definition at line 408 of file evel_event_mgr.c.

Variable Documentation

§ event_source_type

EVEL_SOURCE_TYPES event_source_type

The type of equipment represented by this VNF.

Definition at line 58 of file evel.c.

§ functional_role

char* functional_role

The Functional Role of the equipment represented by this VNF.

Definition at line 63 of file evel.c.