AT&T ECOMP Vendor Event Listener library
0.1
|
EVEL throttle definitions. More...
Go to the source code of this file.
Data Structures | |
struct | evel_json_stack_entry |
An entry in the JSON stack. More... | |
struct | evel_json_stack |
The JSON stack. More... | |
Macros | |
#define | EVEL_JSON_STACK_DEPTH 10 |
#define | EVEL_MAX_RESPONSE_TOKENS 1024 |
Maximum number of tokens that we allow for in a JSON response. More... | |
Typedefs | |
typedef struct evel_json_stack_entry | EVEL_JSON_STACK_ENTRY |
An entry in the JSON stack. More... | |
typedef struct evel_json_stack | EVEL_JSON_STACK |
The JSON stack. More... | |
Enumerations | |
enum | EVEL_JSON_STATE { EVEL_JSON_KEY, EVEL_JSON_VALUE, EVEL_JSON_ITEM } |
The nature of the next token that we are iterating through. More... | |
enum | EVEL_JSON_COMMAND_STATE { EVEL_JCS_START, EVEL_JCS_COMMAND_LIST, EVEL_JCS_COMMAND_LIST_ENTRY, EVEL_JCS_COMMAND, EVEL_JCS_SPEC, EVEL_JCS_FIELD_NAMES, EVEL_JCS_PAIRS_LIST, EVEL_JCS_PAIRS_LIST_ENTRY, EVEL_JCS_NV_PAIR_NAMES, EVEL_JCS_MAX } |
States which we move through during JSON processing, tracking our way through the supported JSON structure. More... | |
Functions | |
void | evel_throttle_initialize () |
Initialize event throttling to the default state. More... | |
void | evel_throttle_terminate () |
Clean up event throttling. More... | |
bool | evel_handle_command_list (const MEMORY_CHUNK *const chunk, const jsmntok_t *const json_tokens, const int num_tokens, MEMORY_CHUNK *const post) |
Handle a JSON response from the listener, as a list of tokens from JSMN. More... | |
EVEL_THROTTLE_SPEC * | evel_get_throttle_spec (EVEL_EVENT_DOMAINS domain) |
Return the EVEL_THROTTLE_SPEC for a given domain. More... | |
bool | evel_throttle_suppress_field (EVEL_THROTTLE_SPEC *throttle_spec, const char *const field_name) |
Determine whether a field_name should be suppressed. More... | |
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). More... | |
EVEL throttle definitions.
These are internal definitions related to throttling specicications, which are required 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_throttle.h.
#define EVEL_JSON_STACK_DEPTH 10 |
Definition at line 50 of file evel_throttle.h.
#define EVEL_MAX_RESPONSE_TOKENS 1024 |
Maximum number of tokens that we allow for in a JSON response.
Definition at line 55 of file evel_throttle.h.
typedef struct evel_json_stack EVEL_JSON_STACK |
The JSON stack.
typedef struct evel_json_stack_entry EVEL_JSON_STACK_ENTRY |
An entry in the JSON stack.
States which we move through during JSON processing, tracking our way through the supported JSON structure.
Definition at line 72 of file evel_throttle.h.
enum EVEL_JSON_STATE |
The nature of the next token that we are iterating through.
Within an object, we alternate between collecting keys and values. Within an array, we only collect items.
Enumerator | |
---|---|
EVEL_JSON_KEY | |
EVEL_JSON_VALUE | |
EVEL_JSON_ITEM |
Definition at line 62 of file evel_throttle.h.
EVEL_THROTTLE_SPEC* evel_get_throttle_spec | ( | EVEL_EVENT_DOMAINS | domain | ) |
Return the EVEL_THROTTLE_SPEC for a given domain.
domain | The domain for which to return state. |
Definition at line 229 of file evel_throttle.c.
bool evel_handle_command_list | ( | const MEMORY_CHUNK *const | chunk, |
const jsmntok_t *const | json_tokens, | ||
const int | num_tokens, | ||
MEMORY_CHUNK *const | post | ||
) |
Handle a JSON response from the listener, as a list of tokens from JSMN.
chunk | Memory chunk containing the JSON buffer. |
json_tokens | Array of tokens to handle. |
num_tokens | The number of tokens to handle. |
post | The memory chunk in which to place any resulting POST. |
Definition at line 648 of file evel_throttle.c.
void evel_throttle_initialize | ( | ) |
Initialize event throttling to the default state.
Called from evel_initialize.
Definition at line 352 of file evel_throttle.c.
bool evel_throttle_suppress_field | ( | EVEL_THROTTLE_SPEC * | throttle_spec, |
const char *const | field_name | ||
) |
Determine whether a field_name should be suppressed.
throttle_spec | Throttle specification for the domain being encoded. |
field_name | The field name to encoded or suppress. |
Definition at line 254 of file evel_throttle.c.
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).
throttle_spec | Throttle specification for the domain being encoded. |
field_name | The field name holding the name-value pairs. |
name | The name of the name-value pair to encoded or suppress. |
Definition at line 293 of file evel_throttle.c.
void evel_throttle_terminate | ( | ) |
Clean up event throttling.
Called from evel_terminate.
Definition at line 377 of file evel_throttle.c.