Asterisk - The Open Source Telephony Project  18.5.0
Functions
store.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int stir_shaken_store_load (void)
 Load time initialization for the stir/shaken 'store' configuration. More...
 
int stir_shaken_store_unload (void)
 Unload time cleanup for the stir/shaken 'store' configuration. More...
 

Function Documentation

◆ stir_shaken_store_load()

int stir_shaken_store_load ( void  )

Load time initialization for the stir/shaken 'store' configuration.

Return values
0on success, -1 on error

Definition at line 180 of file store.c.

References ARRAY_LEN, ast_cli_register_multiple, ast_log, ast_sorcery_apply_default, ast_sorcery_object_field_register, ast_sorcery_object_field_register_custom, ast_sorcery_object_register, ast_stir_shaken_sorcery(), CONFIG_TYPE, LOG_ERROR, NULL, on_load_path(), on_load_public_cert_url(), OPT_NOOP_T, path_to_str(), public_cert_url_to_str(), sorcery, stir_shaken_store_alloc(), and stir_shaken_store_apply().

Referenced by load_module().

181 {
183 
184  ast_sorcery_apply_default(sorcery, CONFIG_TYPE, "config", "stir_shaken.conf,criteria=type=store");
185 
188  ast_log(LOG_ERROR, "stir/shaken - failed to register '%s' sorcery object\n", CONFIG_TYPE);
189  return -1;
190  }
191 
192  ast_sorcery_object_field_register(sorcery, CONFIG_TYPE, "type", "", OPT_NOOP_T, 0, 0);
194  on_load_path, path_to_str, NULL, 0, 0);
195  ast_sorcery_object_field_register_custom(sorcery, CONFIG_TYPE, "public_cert_url", "",
197 
200 
201  return 0;
202 }
#define ARRAY_LEN(a)
Definition: isdn_lib.c:42
static int public_cert_url_to_str(const void *obj, const intptr_t *args, char **buf)
Definition: store.c:163
static struct ast_cli_entry stir_shaken_store_cli[]
Definition: store.c:114
static void * stir_shaken_store_alloc(const char *name)
Definition: store.c:62
Full structure for sorcery.
Definition: sorcery.c:230
Type for a default handler that should do nothing.
#define ast_cli_register_multiple(e, len)
Register multiple commands.
Definition: cli.h:265
static int on_load_public_cert_url(const struct aco_option *opt, struct ast_variable *var, void *obj)
Definition: store.c:145
#define NULL
Definition: resample.c:96
#define CONFIG_TYPE
Definition: store.c:30
static int stir_shaken_store_apply(const struct ast_sorcery *sorcery, void *obj)
Definition: store.c:79
static int on_load_path(const struct aco_option *opt, struct ast_variable *var, void *obj)
Definition: store.c:118
#define ast_log
Definition: astobj2.c:42
#define ast_sorcery_object_field_register_custom(sorcery, type, name, default_val, config_handler, sorcery_handler, multiple_handler, flags,...)
Register a field within an object with custom handlers.
Definition: sorcery.h:1005
#define ast_sorcery_object_register(sorcery, type, alloc, transform, apply)
Register an object type.
Definition: sorcery.h:838
#define LOG_ERROR
Definition: logger.h:285
#define ast_sorcery_apply_default(sorcery, type, name, data)
Definition: sorcery.h:477
struct ast_sorcery * ast_stir_shaken_sorcery(void)
Retrieve the stir/shaken sorcery context.
#define ast_sorcery_object_field_register(sorcery, type, name, default_val, opt_type, flags,...)
Register a field within an object.
Definition: sorcery.h:955
static struct ast_sorcery * sorcery
static int path_to_str(const void *obj, const intptr_t *args, char **buf)
Definition: store.c:136

◆ stir_shaken_store_unload()

int stir_shaken_store_unload ( void  )

Unload time cleanup for the stir/shaken 'store' configuration.

Return values
0on success, -1 on error

Definition at line 172 of file store.c.

References ARRAY_LEN, and ast_cli_unregister_multiple().

Referenced by unload_module().

173 {
176 
177  return 0;
178 }
#define ARRAY_LEN(a)
Definition: isdn_lib.c:42
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
Definition: clicompat.c:30
static struct ast_cli_entry stir_shaken_store_cli[]
Definition: store.c:114