60 const char *
const interface)
70 assert(interface != NULL);
76 if (state_change == NULL)
82 EVEL_DEBUG(
"New State Change is at %lp", state_change);
121 assert(state_change != NULL);
128 while (addl_field != NULL)
130 EVEL_DEBUG(
"Freeing Additional Field (%s, %s)",
133 free(addl_field->
name);
134 free(addl_field->
value);
157 const char *
const type)
164 assert(state_change != NULL);
187 const char *
const name,
188 const char *
const value)
196 assert(state_change != NULL);
198 assert(name != NULL);
199 assert(value != NULL);
201 EVEL_DEBUG(
"Adding name=%s value=%s", name, value);
203 assert(addl_field != NULL);
205 addl_field->
name = strdup(name);
206 addl_field->
value = strdup(value);
207 assert(addl_field->
name != NULL);
208 assert(addl_field->
value != NULL);
234 assert(state_change != NULL);
256 bool item_added =
false;
259 while (addl_field_item != NULL)
262 assert(addl_field != NULL);
288 "stateChangeFieldsVersion",
#define EVEL_DEBUG(FMT,...)
void evel_state_change_type_set(EVENT_STATE_CHANGE *const state_change, const char *const type)
Set the Event Type property of the State Change.
DLIST_ITEM * dlist_get_first(DLIST *list)
void dlist_initialize(DLIST *list)
List initialization.
void evel_free_state_change(EVENT_STATE_CHANGE *const state_change)
Free a State Change.
EVEL_THROTTLE_SPEC * throttle_spec
void evel_json_encode_state_change(EVEL_JSON_BUFFER *jbuf, EVENT_STATE_CHANGE *state_change)
Encode the state change as a JSON state change.
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_close_list(EVEL_JSON_BUFFER *jbuf)
Add the closing bracket of a list to a JSON buffer.
EVEL_ENTITY_STATE old_state
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.
void evel_json_close_object(EVEL_JSON_BUFFER *jbuf)
Add the closing bracket of an object to a JSON buffer.
#define EVEL_STATE_CHANGE_MAJOR_VERSION
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_open_object(EVEL_JSON_BUFFER *jbuf)
Add the opening bracket of an object to a JSON buffer.
void evel_json_checkpoint(EVEL_JSON_BUFFER *jbuf)
Add a checkpoint - a stake in the ground to which we can rewind.
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_free_header(EVENT_HEADER *const event)
Free an event header.
void * dlist_pop_last(DLIST *list)
void dlist_push_last(DLIST *list, void *item)
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.
void log_error_state(char *format,...)
#define EVEL_STATE_CHANGE_MINOR_VERSION
State Change Additional Field.
DLIST_ITEM * dlist_get_next(DLIST_ITEM *item)
void evel_json_rewind(EVEL_JSON_BUFFER *jbuf)
Rewind to the latest checkoint.
void evel_header_type_set(EVENT_HEADER *const header, const char *const type)
Set the Event Type property of the event header.
EVEL throttle definitions.
EVEL_ENTITY_STATE new_state
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_init_header(EVENT_HEADER *const header)
Initialize a newly created event header.
bool evel_throttle_suppress_nv_pair(EVEL_THROTTLE_SPEC *throttle_spec, const char *const field_name, const char *const name)
Determine whether a name-value pair should be allowed (not suppressed).
EVENT_STATE_CHANGE * evel_new_state_change(const EVEL_ENTITY_STATE new_state, const EVEL_ENTITY_STATE old_state, const char *const interface)
Create a new State Change event.
EVEL_ENTITY_STATE
Alert types.
void evel_state_change_addl_field_add(EVENT_STATE_CHANGE *const state_change, const char *const name, const char *const value)
Add an additional field name/value pair to the State Change.