libamxo
4.3.4
Object Definition Language (ODL) parsing
|
#include <sys/resource.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <limits.h>
#include <libgen.h>
#include <ctype.h>
#include <dlfcn.h>
#include <unistd.h>
#include <dirent.h>
#include <syslog.h>
#include <amxc/amxc_macros.h>
#include <amxc/amxc.h>
#include <amxp/amxp.h>
#include <amxd/amxd_common.h>
#include <amxd/amxd_dm.h>
#include <amxd/amxd_object.h>
#include <amxd/amxd_object_expression.h>
#include <amxd/amxd_object_event.h>
#include <amxd/amxd_parameter.h>
#include <amxd/amxd_action.h>
#include <amxd/amxd_path.h>
#include <amxo/amxo.h>
#include <amxs/amxs.h>
Go to the source code of this file.
Data Structures | |
struct | _event |
struct | _amxo_txt |
struct | _amxo_txt_regexp |
struct | _amxo_res_data |
Typedefs | |
typedef enum _amxo_parser_attr | amxo_parser_attr_t |
typedef enum _amxo_action | amxo_action_t |
typedef enum _event_id | event_id_t |
typedef struct _event | event_t |
typedef struct _amxo_txt | amxo_txt_t |
typedef struct _amxo_txt_regexp | amxo_txt_regexp_t |
typedef struct _amxo_res_data | amxo_res_data_t |
Enumerations | |
enum | amxo_parser_tokens_t { token_include , token_optional_include , token_conditional_include , token_post_include , token_import , token_config , token_define , token_populate , token_object , token_mib , token_keyword , token_eof , token_requires } |
enum | _amxo_parser_attr { attr_readonly , attr_persistent , attr_private , attr_template , attr_instance , attr_variable , attr_in , attr_out , attr_mandatory , attr_strict , attr_key , attr_unique , attr_protected , attr_mutable , attr_asynchronous } |
enum | _amxo_action { amxo_action_invalid = -1 , action_all = 0 , action_read , action_write , action_validate , action_list , action_describe , action_add_inst , action_del_inst , action_destroy , action_translate , action_apply , action_max = action_apply } |
enum | _event_id { event_none , event_instance_add , event_object_change } |
Functions | |
PRIVATE void | amxo_parser_free_event (amxc_llist_it_t *it) |
PRIVATE void | amxo_ftab_fn_free (const char *key, amxc_htable_it_t *it) |
PRIVATE void | amxo_parser_del_mib_info (const char *key, amxc_htable_it_t *it) |
PRIVATE ssize_t | amxo_parser_fd_reader (amxo_parser_t *parser, char *buf, size_t max_size) |
PRIVATE int | amxo_parser_parse_file_impl (amxo_parser_t *parser, const char *file_path, amxd_object_t *object) |
PRIVATE void | amxo_parser_child_init (amxo_parser_t *parser) |
PRIVATE void | amxo_parser_create_lex (amxo_parser_t *parser) |
PRIVATE void | amxo_parser_destroy_lex (amxo_parser_t *parser) |
PRIVATE void | amxo_parser_msg (amxo_parser_t *parser, const char *format,...) __attribute__((format(printf |
PRIVATE void PRIVATE int | amxo_parser_printf (amxo_parser_t *parser, const char *format,...) __attribute__((format(printf |
PRIVATE void PRIVATE int PRIVATE bool | amxo_parser_find (amxo_parser_t *parser, const amxc_llist_t *dirs, const char *file_path, char **full_path) |
PRIVATE bool | amxo_parser_check_attr (amxo_parser_t *pctx, int64_t attributes, int64_t bitmask) |
PRIVATE bool | amxo_parser_set_param_attrs (amxo_parser_t *pctx, uint64_t attr, bool enable) |
PRIVATE bool | amxo_parser_set_param_flags (amxo_parser_t *pctx, amxc_var_t *flags) |
PRIVATE bool | amxo_parser_set_object_attrs (amxo_parser_t *pctx, uint64_t attr, bool enable) |
PRIVATE int | amxo_parser_create_object (amxo_parser_t *pctx, const char *name, int64_t attr_bitmask, amxd_object_type_t type) |
PRIVATE bool | amxo_parser_add_instance (amxo_parser_t *pctx, uint32_t index, const char *name, amxc_var_t *params) |
PRIVATE bool | amxo_parser_push_object (amxo_parser_t *pctx, const char *name) |
PRIVATE bool | amxo_parser_pop_object (amxo_parser_t *pctx) |
PRIVATE bool | amxo_parser_push_param (amxo_parser_t *pctx, const char *name, int64_t attr_bitmask, uint32_t type) |
PRIVATE int | amxo_parser_set_param (amxo_parser_t *pctx, const char *name, amxc_var_t *value) |
PRIVATE bool | amxo_parser_pop_param (amxo_parser_t *pctx) |
PRIVATE int | amxo_parser_push_func (amxo_parser_t *pctx, const char *name, int64_t attr_bitmask, uint32_t type) |
PRIVATE bool | amxo_parser_set_function_flags (amxo_parser_t *pctx, amxc_var_t *flags) |
PRIVATE void | amxo_parser_pop_func (amxo_parser_t *pctx) |
PRIVATE bool | amxo_parser_add_arg (amxo_parser_t *pctx, const char *name, int64_t attr_bitmask, uint32_t type, amxc_var_t *def_value) |
PRIVATE bool | amxo_parser_set_counter (amxo_parser_t *pctx, const char *param_name) |
PRIVATE int | amxo_parser_subscribe_path (amxo_parser_t *pctx, const char *event, bool event_is_regexp, const char *path, bool path_is_regexp) |
PRIVATE int | amxo_parser_subscribe (amxo_parser_t *pctx, const char *event, bool event_is_regexp, const char *full_expr) |
PRIVATE int | amxo_parser_subscribe_object (amxo_parser_t *pctx, const char *event, bool event_is_regexp, const char *full_expr) |
PRIVATE int | amxo_parser_add_post_include (amxo_parser_t *pctx, const char *file_path) |
PRIVATE int | amxo_parser_include (amxo_parser_t *pctx, const char *file_path) |
PRIVATE amxc_htable_t * | amxo_parser_get_resolvers (void) |
PRIVATE int | amxo_parser_resolve_internal (amxo_parser_t *parser, const char *fn_name, amxo_fn_type_t type, const char *data) |
PRIVATE void | amxo_resolver_import_clean (amxo_parser_t *parser, void *priv) |
PRIVATE int | amxo_parser_resolve (amxo_parser_t *parser, const char *resolver_name, const char *func_name, amxo_fn_type_t type, const char *data) |
PRIVATE void | amxo_parser_clean_resolvers (amxo_parser_t *parser) |
PRIVATE void | amxo_parser_init_resolvers (amxo_parser_t *parser) |
PRIVATE int | amxo_parser_call_entry_point (amxo_parser_t *pctx, const char *lib_name, const char *fn_name) |
PRIVATE int | amxo_parser_set_action (amxo_parser_t *pctx, amxo_action_t action, const char *name, amxc_var_t *data) |
PRIVATE amxo_action_t | amxo_parser_get_action_id (amxo_parser_t *pctx, const char *action_name) |
PRIVATE void | amxo_parser_print (amxo_parser_t *pctx, const char *text) |
PRIVATE bool | amxo_parser_add_mib (amxo_parser_t *pctx, const char *mib_name) |
PRIVATE bool | amxo_parser_no_resolve (amxo_parser_t *parser) |
PRIVATE bool | amxo_parser_check_config (amxo_parser_t *pctx, const char *path, const char *check) |
PRIVATE void | amxo_parser_resolve_value (amxo_parser_t *pctx, amxc_string_t *value) |
PRIVATE void | amxo_parser_del_sync_data (amxc_llist_it_t *it) |
PRIVATE void | amxo_parser_pop_sync_item (amxo_parser_t *pctx) |
PRIVATE int | amxo_parser_push_sync_ctx (amxo_parser_t *pctx, const char *path_a, const char *path_b, int direction) |
PRIVATE int | amxo_parser_push_sync_template (amxo_parser_t *pctx, const char *path_a, const char *path_b, int direction, const char *name) |
PRIVATE int | amxo_parser_push_sync_object (amxo_parser_t *pctx, const char *path_a, const char *path_b, int direction) |
PRIVATE int | amxo_parser_push_sync_parameter (amxo_parser_t *pctx, const char *param_a, const char *param_b, int direction) |
PRIVATE int | amxo_parser_start_sync (amxc_llist_it_t *it) |
PRIVATE void | amxo_parser_stop_sync (amxc_llist_it_t *it) |
PRIVATE amxs_sync_entry_type_t | amxo_parser_get_sync_type (amxo_parser_t *pctx) |
PRIVATE bool | amxo_parser_is_sync_item (amxo_parser_t *pctx) |
PRIVATE amxd_status_t | amxo_parser_sync_set_translator (amxo_parser_t *pctx, amxs_translation_cb_t cb) |
PRIVATE amxd_status_t | amxo_parser_sync_set_action (amxo_parser_t *pctx, amxs_action_cb_t cb) |
PRIVATE bool | amxo_parser_sync_item_contains_entries (amxo_parser_t *pctx) |
PRIVATE void | amxo_parser_sync_remove_invalid (amxo_parser_t *pctx) |
PRIVATE int | amxo_parser_sync_update_flags (int direction) |
PRIVATE amxs_sync_ctx_t * | amxo_parser_sync_get (const char *sync_template) |
typedef enum _amxo_action amxo_action_t |
typedef enum _amxo_parser_attr amxo_parser_attr_t |
typedef struct _amxo_res_data amxo_res_data_t |
typedef struct _amxo_txt_regexp amxo_txt_regexp_t |
typedef struct _amxo_txt amxo_txt_t |
typedef enum _event_id event_id_t |
enum _amxo_action |
Enumerator | |
---|---|
amxo_action_invalid | |
action_all | |
action_read | |
action_write | |
action_validate | |
action_list | |
action_describe | |
action_add_inst | |
action_del_inst | |
action_destroy | |
action_translate | |
action_apply | |
action_max |
Definition at line 128 of file amxo_parser_priv.h.
enum _amxo_parser_attr |
Definition at line 110 of file amxo_parser_priv.h.
enum _event_id |
Enumerator | |
---|---|
event_none | |
event_instance_add | |
event_object_change |
Definition at line 144 of file amxo_parser_priv.h.
enum amxo_parser_tokens_t |
Definition at line 93 of file amxo_parser_priv.h.
PRIVATE void amxo_ftab_fn_free | ( | const char * | key, |
amxc_htable_it_t * | it | ||
) |
PRIVATE bool amxo_parser_add_arg | ( | amxo_parser_t * | pctx, |
const char * | name, | ||
int64_t | attr_bitmask, | ||
uint32_t | type, | ||
amxc_var_t * | def_value | ||
) |
Definition at line 182 of file amxo_parser_dm_func_utils.c.
PRIVATE bool amxo_parser_add_instance | ( | amxo_parser_t * | pctx, |
uint32_t | index, | ||
const char * | name, | ||
amxc_var_t * | params | ||
) |
Definition at line 563 of file amxo_parser_dm_utils.c.
PRIVATE bool amxo_parser_add_mib | ( | amxo_parser_t * | pctx, |
const char * | mib_name | ||
) |
Definition at line 843 of file amxo_parser_dm_utils.c.
PRIVATE int amxo_parser_add_post_include | ( | amxo_parser_t * | pctx, |
const char * | file_path | ||
) |
Definition at line 290 of file amxo_parser_include.c.
PRIVATE int amxo_parser_call_entry_point | ( | amxo_parser_t * | pctx, |
const char * | lib_name, | ||
const char * | fn_name | ||
) |
Definition at line 172 of file amxo_parser_utils.c.
PRIVATE bool amxo_parser_check_attr | ( | amxo_parser_t * | pctx, |
int64_t | attributes, | ||
int64_t | bitmask | ||
) |
Definition at line 499 of file amxo_parser_dm_utils.c.
PRIVATE bool amxo_parser_check_config | ( | amxo_parser_t * | pctx, |
const char * | path, | ||
const char * | check | ||
) |
Definition at line 477 of file amxo_parser_dm_utils.c.
PRIVATE void amxo_parser_child_init | ( | amxo_parser_t * | parser | ) |
Definition at line 181 of file amxo_parser_main.c.
PRIVATE void amxo_parser_clean_resolvers | ( | amxo_parser_t * | parser | ) |
Definition at line 103 of file amxo_resolver_mngr.c.
PRIVATE void amxo_parser_create_lex | ( | amxo_parser_t * | parser | ) |
PRIVATE int amxo_parser_create_object | ( | amxo_parser_t * | pctx, |
const char * | name, | ||
int64_t | attr_bitmask, | ||
amxd_object_type_t | type | ||
) |
Definition at line 520 of file amxo_parser_dm_utils.c.
PRIVATE void amxo_parser_del_mib_info | ( | const char * | key, |
amxc_htable_it_t * | it | ||
) |
PRIVATE void amxo_parser_del_sync_data | ( | amxc_llist_it_t * | it | ) |
Definition at line 183 of file amxo_parser_dm_sync_utils.c.
PRIVATE void amxo_parser_destroy_lex | ( | amxo_parser_t * | parser | ) |
PRIVATE ssize_t amxo_parser_fd_reader | ( | amxo_parser_t * | parser, |
char * | buf, | ||
size_t | max_size | ||
) |
Definition at line 104 of file amxo_parser_main.c.
PRIVATE void PRIVATE int PRIVATE bool amxo_parser_find | ( | amxo_parser_t * | parser, |
const amxc_llist_t * | dirs, | ||
const char * | file_path, | ||
char ** | full_path | ||
) |
Definition at line 256 of file amxo_parser_include.c.
PRIVATE void amxo_parser_free_event | ( | amxc_llist_it_t * | it | ) |
Definition at line 493 of file amxo_parser_dm_utils.c.
PRIVATE amxo_action_t amxo_parser_get_action_id | ( | amxo_parser_t * | pctx, |
const char * | action_name | ||
) |
Definition at line 203 of file amxo_parser_utils.c.
PRIVATE amxc_htable_t* amxo_parser_get_resolvers | ( | void | ) |
Definition at line 99 of file amxo_resolver_mngr.c.
PRIVATE amxs_sync_entry_type_t amxo_parser_get_sync_type | ( | amxo_parser_t * | pctx | ) |
Definition at line 158 of file amxo_parser_dm_sync_utils.c.
PRIVATE int amxo_parser_include | ( | amxo_parser_t * | pctx, |
const char * | file_path | ||
) |
Definition at line 311 of file amxo_parser_include.c.
PRIVATE void amxo_parser_init_resolvers | ( | amxo_parser_t * | parser | ) |
Definition at line 125 of file amxo_resolver_mngr.c.
PRIVATE bool amxo_parser_is_sync_item | ( | amxo_parser_t * | pctx | ) |
Definition at line 170 of file amxo_parser_dm_sync_utils.c.
PRIVATE void amxo_parser_msg | ( | amxo_parser_t * | parser, |
const char * | format, | ||
... | |||
) |
PRIVATE bool amxo_parser_no_resolve | ( | amxo_parser_t * | parser | ) |
Definition at line 87 of file amxo_parser_utils.c.
PRIVATE int amxo_parser_parse_file_impl | ( | amxo_parser_t * | parser, |
const char * | file_path, | ||
amxd_object_t * | object | ||
) |
Definition at line 156 of file amxo_parser_main.c.
PRIVATE void amxo_parser_pop_func | ( | amxo_parser_t * | pctx | ) |
Definition at line 172 of file amxo_parser_dm_func_utils.c.
PRIVATE bool amxo_parser_pop_object | ( | amxo_parser_t * | pctx | ) |
Definition at line 634 of file amxo_parser_dm_utils.c.
PRIVATE bool amxo_parser_pop_param | ( | amxo_parser_t * | pctx | ) |
Definition at line 348 of file amxo_parser_dm_param_utils.c.
PRIVATE void amxo_parser_pop_sync_item | ( | amxo_parser_t * | pctx | ) |
Definition at line 210 of file amxo_parser_dm_sync_utils.c.
PRIVATE void amxo_parser_print | ( | amxo_parser_t * | pctx, |
const char * | text | ||
) |
Definition at line 244 of file amxo_parser_utils.c.
PRIVATE void PRIVATE int amxo_parser_printf | ( | amxo_parser_t * | parser, |
const char * | format, | ||
... | |||
) |
PRIVATE int amxo_parser_push_func | ( | amxo_parser_t * | pctx, |
const char * | name, | ||
int64_t | attr_bitmask, | ||
uint32_t | type | ||
) |
Definition at line 99 of file amxo_parser_dm_func_utils.c.
PRIVATE bool amxo_parser_push_object | ( | amxo_parser_t * | pctx, |
const char * | name | ||
) |
Definition at line 598 of file amxo_parser_dm_utils.c.
PRIVATE bool amxo_parser_push_param | ( | amxo_parser_t * | pctx, |
const char * | name, | ||
int64_t | attr_bitmask, | ||
uint32_t | type | ||
) |
Definition at line 292 of file amxo_parser_dm_param_utils.c.
PRIVATE int amxo_parser_push_sync_ctx | ( | amxo_parser_t * | pctx, |
const char * | path_a, | ||
const char * | path_b, | ||
int | direction | ||
) |
Definition at line 222 of file amxo_parser_dm_sync_utils.c.
PRIVATE int amxo_parser_push_sync_object | ( | amxo_parser_t * | pctx, |
const char * | path_a, | ||
const char * | path_b, | ||
int | direction | ||
) |
Definition at line 320 of file amxo_parser_dm_sync_utils.c.
PRIVATE int amxo_parser_push_sync_parameter | ( | amxo_parser_t * | pctx, |
const char * | param_a, | ||
const char * | param_b, | ||
int | direction | ||
) |
Definition at line 364 of file amxo_parser_dm_sync_utils.c.
PRIVATE int amxo_parser_push_sync_template | ( | amxo_parser_t * | pctx, |
const char * | path_a, | ||
const char * | path_b, | ||
int | direction, | ||
const char * | name | ||
) |
Definition at line 285 of file amxo_parser_dm_sync_utils.c.
PRIVATE int amxo_parser_resolve | ( | amxo_parser_t * | parser, |
const char * | resolver_name, | ||
const char * | func_name, | ||
amxo_fn_type_t | type, | ||
const char * | data | ||
) |
Definition at line 63 of file amxo_resolver_mngr.c.
PRIVATE int amxo_parser_resolve_internal | ( | amxo_parser_t * | parser, |
const char * | fn_name, | ||
amxo_fn_type_t | type, | ||
const char * | data | ||
) |
Definition at line 124 of file amxo_parser_utils.c.
PRIVATE void amxo_parser_resolve_value | ( | amxo_parser_t * | pctx, |
amxc_string_t * | value | ||
) |
Definition at line 258 of file amxo_parser_utils.c.
PRIVATE int amxo_parser_set_action | ( | amxo_parser_t * | pctx, |
amxo_action_t | action, | ||
const char * | name, | ||
amxc_var_t * | data | ||
) |
Definition at line 813 of file amxo_parser_dm_utils.c.
PRIVATE bool amxo_parser_set_counter | ( | amxo_parser_t * | pctx, |
const char * | param_name | ||
) |
Definition at line 664 of file amxo_parser_dm_utils.c.
PRIVATE bool amxo_parser_set_function_flags | ( | amxo_parser_t * | pctx, |
amxc_var_t * | flags | ||
) |
Definition at line 149 of file amxo_parser_dm_func_utils.c.
PRIVATE bool amxo_parser_set_object_attrs | ( | amxo_parser_t * | pctx, |
uint64_t | attr, | ||
bool | enable | ||
) |
Definition at line 514 of file amxo_parser_dm_utils.c.
PRIVATE int amxo_parser_set_param | ( | amxo_parser_t * | pctx, |
const char * | name, | ||
amxc_var_t * | value | ||
) |
Definition at line 320 of file amxo_parser_dm_param_utils.c.
PRIVATE bool amxo_parser_set_param_attrs | ( | amxo_parser_t * | pctx, |
uint64_t | attr, | ||
bool | enable | ||
) |
Definition at line 263 of file amxo_parser_dm_param_utils.c.
PRIVATE bool amxo_parser_set_param_flags | ( | amxo_parser_t * | pctx, |
amxc_var_t * | flags | ||
) |
Definition at line 269 of file amxo_parser_dm_param_utils.c.
PRIVATE int amxo_parser_start_sync | ( | amxc_llist_it_t * | it | ) |
Definition at line 464 of file amxo_parser_dm_sync_utils.c.
PRIVATE void amxo_parser_stop_sync | ( | amxc_llist_it_t * | it | ) |
Definition at line 483 of file amxo_parser_dm_sync_utils.c.
PRIVATE int amxo_parser_subscribe | ( | amxo_parser_t * | pctx, |
const char * | event, | ||
bool | event_is_regexp, | ||
const char * | full_expr | ||
) |
Definition at line 738 of file amxo_parser_dm_utils.c.
PRIVATE int amxo_parser_subscribe_object | ( | amxo_parser_t * | pctx, |
const char * | event, | ||
bool | event_is_regexp, | ||
const char * | full_expr | ||
) |
Definition at line 772 of file amxo_parser_dm_utils.c.
PRIVATE int amxo_parser_subscribe_path | ( | amxo_parser_t * | pctx, |
const char * | event, | ||
bool | event_is_regexp, | ||
const char * | path, | ||
bool | path_is_regexp | ||
) |
Definition at line 695 of file amxo_parser_dm_utils.c.
PRIVATE amxs_sync_ctx_t* amxo_parser_sync_get | ( | const char * | sync_template | ) |
Definition at line 526 of file amxo_parser_dm_sync_utils.c.
PRIVATE bool amxo_parser_sync_item_contains_entries | ( | amxo_parser_t * | pctx | ) |
Definition at line 447 of file amxo_parser_dm_sync_utils.c.
PRIVATE void amxo_parser_sync_remove_invalid | ( | amxo_parser_t * | pctx | ) |
Definition at line 497 of file amxo_parser_dm_sync_utils.c.
PRIVATE amxd_status_t amxo_parser_sync_set_action | ( | amxo_parser_t * | pctx, |
amxs_action_cb_t | cb | ||
) |
Definition at line 428 of file amxo_parser_dm_sync_utils.c.
PRIVATE amxd_status_t amxo_parser_sync_set_translator | ( | amxo_parser_t * | pctx, |
amxs_translation_cb_t | cb | ||
) |
Definition at line 409 of file amxo_parser_dm_sync_utils.c.
PRIVATE int amxo_parser_sync_update_flags | ( | int | direction | ) |
Definition at line 175 of file amxo_parser_dm_sync_utils.c.
PRIVATE void amxo_resolver_import_clean | ( | amxo_parser_t * | parser, |
void * | priv | ||
) |