30 #define CONFIG_TYPE "store" 32 #define VARIABLE_SUBSTITUTE "${CERTIFICATE}" 90 e->
command =
"stir_shaken show store";
92 "Usage: stir_shaken show store <id>\n" 93 " Show the store stir/shaken settings for a given id\n";
123 if (stat(var->
value, &statbuf)) {
128 if (!S_ISDIR(statbuf.st_mode)) {
150 ast_log(
LOG_ERROR,
"stir/shaken - public_cert_url scheme must be 'http[s]'\n");
155 ast_log(
LOG_ERROR,
"stir/shaken - public_cert_url must contain variable '%s' " #define AST_CLI_DEFINE(fn, txt,...)
Asterisk main include file. File version handling, generic pbx functions.
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
static int public_cert_url_to_str(const void *obj, const intptr_t *args, char **buf)
descriptor for a cli entry.
static struct ast_cli_entry stir_shaken_store_cli[]
Structure for variables, used for configurations and for channel variables.
static void * stir_shaken_store_alloc(const char *name)
Perform no matching, return all objects.
Full structure for sorcery.
Type for a default handler that should do nothing.
#define ast_cli_register_multiple(e, len)
Register multiple commands.
static int on_load_public_cert_url(const struct aco_option *opt, struct ast_variable *var, void *obj)
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
Return all matching objects.
#define ast_strdup(str)
A wrapper for strdup()
static int stir_shaken_store_apply(const struct ast_sorcery *sorcery, void *obj)
char * stir_shaken_tab_complete_name(const char *word, struct ao2_container *container)
Tab completion for name matching with STIR/SHAKEN CLI commands.
static int on_load_path(const struct aco_option *opt, struct ast_variable *var, void *obj)
void * ast_sorcery_retrieve_by_id(const struct ast_sorcery *sorcery, const char *type, const char *id)
Retrieve an object using its unique identifier.
#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.
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
#define AST_STRING_FIELD(name)
Declare a string field.
#define ao2_ref(o, delta)
static char * stir_shaken_store_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
int stir_shaken_cli_show(void *obj, void *arg, int flags)
Output configuration settings to the Asterisk CLI.
#define ast_sorcery_object_register(sorcery, type, alloc, transform, apply)
Register an object type.
#define VARIABLE_SUBSTITUTE
#define ast_sorcery_apply_default(sorcery, type, name, data)
const ast_string_field public_cert_url
const ast_string_field path
struct ast_sorcery * ast_stir_shaken_sorcery(void)
Retrieve the stir/shaken sorcery context.
void * ast_sorcery_retrieve_by_fields(const struct ast_sorcery *sorcery, const char *type, unsigned int flags, struct ast_variable *fields)
Retrieve an object or multiple objects using specific fields.
#define ast_sorcery_object_field_register(sorcery, type, name, default_val, opt_type, flags,...)
Register a field within an object.
static void stir_shaken_store_destructor(void *obj)
static struct ast_sorcery * sorcery
Standard Command Line Interface.
int stir_shaken_store_unload(void)
Unload time cleanup for the stir/shaken 'store' configuration.
static struct ao2_container * stir_shaken_store_get_all(void)
static struct stir_shaken_store * stir_shaken_store_get(const char *id)
static int path_to_str(const void *obj, const intptr_t *args, char **buf)
static int force_inline attribute_pure ast_begins_with(const char *str, const char *prefix)
void * ast_sorcery_generic_alloc(size_t size, ao2_destructor_fn destructor)
Allocate a generic sorcery capable object.
int stir_shaken_store_load(void)
Load time initialization for the stir/shaken 'store' configuration.
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
Sorcery Data Access Layer API.
#define ast_string_field_set(x, field, data)
Set a field to a simple string value.