|
Asterisk - The Open Source Telephony Project GIT-master-4f2b068
|
#include "asterisk.h"#include "asterisk/config.h"#include "asterisk/cli.h"#include "asterisk/res_geolocation.h"#include "geoloc_private.h"
Go to the source code of this file.
Data Structures | |
| struct | geoloc_gml_attr |
| struct | geoloc_gml_shape_def |
Macros | |
| #define | _SENTRY {NULL, -1, -1, NULL} |
| #define | CRS_OPT {"crs", 0, 1, crs_validator} |
| #define | CRS_REQ {"crs", 1, 1, crs_validator} |
| #define | MAX_SHAPE_ATTRIBUTES 9 |
| #define | SET_RESULT(__result, ...) |
Functions | |
| static enum angle_parse_result | angle_parser (const char *name, const char *value, char **angle, char **uom, char **result) |
| static int | angle_validator (const char *name, const char *value, const struct ast_variable *varlist, char **result) |
| enum ast_geoloc_validate_result | ast_geoloc_gml_validate_varlist (struct ast_variable *varlist, char **result) |
| Validate that the variables in the list represent a valid GML shape. | |
| static int | crs_validator (const char *name, const char *value, const struct ast_variable *varlist, char **result) |
| static int | find_attribute_index (int shape_index, const char *name) |
| static int | find_shape_index (const char *shape) |
| static int | float_validator (const char *name, const char *value, const struct ast_variable *varlist, char **result) |
| struct ast_xml_node * | geoloc_gml_list_to_xml (struct ast_variable *resolved_location, const char *ref_string) |
| int | geoloc_gml_load (void) |
| int | geoloc_gml_reload (void) |
| int | geoloc_gml_unload (void) |
| static char * | handle_gml_show (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
| static int | pos_validator (const char *name, const char *value, const struct ast_variable *varlist, char **result) |
| static enum ast_geoloc_validate_result | validate_def_varlist (int shape_index, const struct ast_variable *varlist, char **result) |
Variables | |
| static struct ast_cli_entry | geoloc_gml_cli [] |
| static struct geoloc_gml_shape_def | gml_shape_defs [] |
Definition at line 156 of file geoloc_gml.c.
| #define CRS_OPT {"crs", 0, 1, crs_validator} |
Definition at line 158 of file geoloc_gml.c.
| #define CRS_REQ {"crs", 1, 1, crs_validator} |
Definition at line 159 of file geoloc_gml.c.
| #define MAX_SHAPE_ATTRIBUTES 9 |
Definition at line 31 of file geoloc_gml.c.
| #define SET_RESULT | ( | __result, | |
| ... | |||
| ) |
Definition at line 38 of file geoloc_gml.c.
| enum angle_parse_result |
| Enumerator | |
|---|---|
| ANGLE_PARSE_RESULT_SUCCESS | |
| ANGLE_PARSE_ERROR_NO_ANGLE | |
| ANGLE_PARSE_ERROR_INVALID_ANGLE | |
| ANGLE_PARSE_ERROR_ANGLE_OUT_OF_RANGE | |
| ANGLE_PARSE_ERROR_INVALID_UOM | |
Definition at line 87 of file geoloc_gml.c.
|
static |
Definition at line 95 of file geoloc_gml.c.
References ANGLE_PARSE_ERROR_ANGLE_OUT_OF_RANGE, ANGLE_PARSE_ERROR_INVALID_ANGLE, ANGLE_PARSE_ERROR_INVALID_UOM, ANGLE_PARSE_ERROR_NO_ANGLE, ANGLE_PARSE_RESULT_SUCCESS, ast_begins_with(), ast_strdup, ast_strdupa, ast_strings_equal(), ast_strlen_zero(), ast_strsep(), AST_STRSEP_ALL, name, NULL, result, SET_RESULT, and value.
Referenced by angle_validator(), and geoloc_gml_list_to_xml().
|
static |
Definition at line 148 of file geoloc_gml.c.
References ANGLE_PARSE_RESULT_SUCCESS, angle_parser(), name, NULL, result, and value.
| enum ast_geoloc_validate_result ast_geoloc_gml_validate_varlist | ( | struct ast_variable * | varlist, |
| char ** | result | ||
| ) |
Validate that the variables in the list represent a valid GML shape.
| varlist | Variable list to check. | |
| [out] | result | Pointer to char * to receive failing item. |
Definition at line 260 of file geoloc_gml.c.
References AST_GEOLOC_VALIDATE_INVALID_CRS, AST_GEOLOC_VALIDATE_INVALID_CRS_FOR_SHAPE, AST_GEOLOC_VALIDATE_INVALID_SHAPE, AST_GEOLOC_VALIDATE_MISSING_SHAPE, ast_strings_equal(), ast_strlen_zero(), ast_variable_find_in_list(), ast_variable_list_append, ast_variable_new, geoloc_gml_shape_def::crs, crs_validator(), find_shape_index(), gml_shape_defs, NULL, result, SET_RESULT, and validate_def_varlist().
Referenced by geoloc_gml_list_to_xml(), and validate_location_info().
|
static |
Definition at line 45 of file geoloc_gml.c.
References ast_strings_equal(), result, SET_RESULT, and value.
Referenced by ast_geoloc_gml_validate_varlist().
|
static |
Definition at line 191 of file geoloc_gml.c.
References ast_strings_equal(), gml_shape_defs, MAX_SHAPE_ATTRIBUTES, name, NULL, and geoloc_gml_shape_def::required_attributes.
Referenced by validate_def_varlist().
|
static |
Definition at line 178 of file geoloc_gml.c.
References ARRAY_LEN, ast_strings_equal(), gml_shape_defs, and geoloc_gml_shape_def::shape_type.
Referenced by ast_geoloc_gml_validate_varlist().
|
static |
Definition at line 76 of file geoloc_gml.c.
References name, result, SET_RESULT, and value.
| struct ast_xml_node * geoloc_gml_list_to_xml | ( | struct ast_variable * | resolved_location, |
| const char * | ref_string | ||
| ) |
Definition at line 349 of file geoloc_gml.c.
References ANGLE_PARSE_RESULT_SUCCESS, angle_parser(), ast_free, ast_geoloc_gml_validate_varlist(), AST_GEOLOC_VALIDATE_SUCCESS, ast_strings_equal(), ast_strlen_zero(), ast_variable_find_in_list(), ast_variable_list_append, ast_variable_new, ast_xml_free_node(), ast_xml_new_child(), ast_xml_new_node(), ast_xml_set_attribute(), ast_xml_set_text(), LOG_ERROR, ast_variable::next, NULL, RAII_VAR, result, SCOPE_ENTER, SCOPE_EXIT_LOG_RTN_VALUE, SCOPE_EXIT_RTN_VALUE, and var.
Referenced by geoloc_eprofile_to_intermediate().
| int geoloc_gml_load | ( | void | ) |
Definition at line 442 of file geoloc_gml.c.
References ARRAY_LEN, ast_cli_register_multiple, AST_MODULE_LOAD_SUCCESS, and geoloc_gml_cli.
Referenced by load_module().
| int geoloc_gml_reload | ( | void | ) |
Definition at line 449 of file geoloc_gml.c.
References AST_MODULE_LOAD_SUCCESS.
Referenced by reload_module().
| int geoloc_gml_unload | ( | void | ) |
Definition at line 435 of file geoloc_gml.c.
References ARRAY_LEN, ast_cli_unregister_multiple(), AST_MODULE_LOAD_SUCCESS, and geoloc_gml_cli.
Referenced by unload_module().
|
static |
Definition at line 304 of file geoloc_gml.c.
References a, ARRAY_LEN, ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, geoloc_gml_shape_def::crs, gml_shape_defs, geoloc_gml_attr::max_allowed, geoloc_gml_attr::min_required, name, geoloc_gml_attr::name, NULL, geoloc_gml_shape_def::required_attributes, geoloc_gml_shape_def::shape_type, and ast_cli_entry::usage.
|
static |
Definition at line 55 of file geoloc_gml.c.
References ast_strings_equal(), ast_variable_find_in_list(), result, S_OR, SET_RESULT, and value.
|
static |
Definition at line 206 of file geoloc_gml.c.
References ARRAY_LEN, AST_GEOLOC_VALIDATE_INVALID_VALUE, AST_GEOLOC_VALIDATE_INVALID_VARNAME, AST_GEOLOC_VALIDATE_NOT_ENOUGH_VARNAMES, AST_GEOLOC_VALIDATE_SUCCESS, AST_GEOLOC_VALIDATE_TOO_MANY_VARNAMES, ast_strings_equal(), find_attribute_index(), gml_shape_defs, name, ast_variable::next, NULL, result, SET_RESULT, and var.
Referenced by ast_geoloc_gml_validate_varlist().
|
static |
Definition at line 345 of file geoloc_gml.c.
Referenced by geoloc_gml_load(), and geoloc_gml_unload().
|
static |
Definition at line 161 of file geoloc_gml.c.
Referenced by ast_geoloc_gml_validate_varlist(), find_attribute_index(), find_shape_index(), handle_gml_show(), and validate_def_varlist().