AT&T ECOMP Vendor Event Listener library
0.1
|
Implementation of EVEL functions relating to Event Headers - since Heartbeats only contain the Event Header, the Heartbeat factory function is here too. More...
#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include <sys/time.h>
#include "evel.h"
#include "evel_internal.h"
#include "evel_throttle.h"
#include "metadata.h"
Go to the source code of this file.
Functions | |
void | evel_set_next_event_sequence (const int sequence) |
Set the next event_sequence to use. More... | |
EVENT_HEADER * | evel_new_heartbeat () |
Create a new heartbeat event. More... | |
void | evel_init_header (EVENT_HEADER *const header) |
Initialize a newly created event header. More... | |
void | evel_header_type_set (EVENT_HEADER *const header, const char *const type) |
Set the Event Type property of the event header. More... | |
void | evel_start_epoch_set (EVENT_HEADER *const header, const unsigned long long start_epoch_microsec) |
Set the Start Epoch property of the event header. More... | |
void | evel_last_epoch_set (EVENT_HEADER *const header, const unsigned long long last_epoch_microsec) |
Set the Last Epoch property of the event header. More... | |
void | evel_reporting_entity_name_set (EVENT_HEADER *const header, const char *const entity_name) |
Set the Reporting Entity Name property of the event header. More... | |
void | evel_reporting_entity_id_set (EVENT_HEADER *const header, const char *const entity_id) |
Set the Reporting Entity Id property of the event header. 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_free_header (EVENT_HEADER *const event) |
Free an event header. More... | |
int | evel_json_encode_event (char *json, int max_size, EVENT_HEADER *event) |
Encode the event as a JSON event object according to AT&T's schema. 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. More... | |
void | evel_free_event_instance_id (EVEL_EVENT_INSTANCE_ID *const instance_id) |
Free an event instance id. 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... | |
Implementation of EVEL functions relating to Event Headers - since Heartbeats only contain the Event Header, the Heartbeat factory function is here too.
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_event.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_header | ( | EVENT_HEADER *const | event | ) |
Free an event header.
Free off the event header supplied. Will free all the contained allocated memory.
Definition at line 349 of file evel_event.c.
void evel_header_type_set | ( | EVENT_HEADER *const | header, |
const char *const | type | ||
) |
Set the Event Type property of the event header.
header | Pointer to the EVENT_HEADER. |
type | The Event Type to be set. ASCIIZ string. The caller does not need to preserve the value once the function returns. |
Definition at line 164 of file evel_event.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.
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_header | ( | EVENT_HEADER *const | header | ) |
Initialize a newly created event header.
header | Pointer to the header being initialized. |
Definition at line 112 of file evel_event.c.
int evel_json_encode_event | ( | char * | json, |
int | max_size, | ||
EVENT_HEADER * | event | ||
) |
Encode the event as a JSON event object according to AT&T's schema.
json | Pointer to where to store the JSON encoded data. |
max_size | Size of storage available in json_body. |
event | Pointer to the EVENT_HEADER to encode. |
Definition at line 381 of file evel_event.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_last_epoch_set | ( | EVENT_HEADER *const | header, |
const unsigned long long | last_epoch_microsec | ||
) |
Set the Last Epoch property of the event header.
header | Pointer to the EVENT_HEADER. |
last_epoch_microsec | The last epoch to set, in microseconds. |
Definition at line 212 of file evel_event.c.
EVENT_HEADER* evel_new_heartbeat | ( | void | ) |
Create a new heartbeat event.
NULL | Failed to create the event. |
Definition at line 78 of file evel_event.c.
void evel_reporting_entity_id_set | ( | EVENT_HEADER *const | header, |
const char *const | entity_id | ||
) |
Set the Reporting Entity Id property of the event header.
header | Pointer to the EVENT_HEADER. |
entity_id | The entity id to set. |
Definition at line 264 of file evel_event.c.
void evel_reporting_entity_name_set | ( | EVENT_HEADER *const | header, |
const char *const | entity_name | ||
) |
Set the Reporting Entity Name property of the event header.
header | Pointer to the EVENT_HEADER. |
entity_name | The entity name to set. |
Definition at line 234 of file evel_event.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_start_epoch_set | ( | EVENT_HEADER *const | header, |
const unsigned long long | start_epoch_microsec | ||
) |
Set the Start Epoch property of the event header.
header | Pointer to the EVENT_HEADER. |
start_epoch_microsec | The start epoch to set, in microseconds. |
Definition at line 189 of file evel_event.c.