Asterisk - The Open Source Telephony Project GIT-master-f36a736
Data Structures | Functions
verification.h File Reference
#include "common_config.h"
Include dependency graph for verification.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ast_stir_shaken_vs_ctx
 

Functions

int vs_load (void)
 Load the stir/shaken verification service. More...
 
int vs_reload (void)
 Reload the stir/shaken verification service. More...
 
int vs_unload (void)
 Unload the stir/shaken verification service. More...
 

Function Documentation

◆ vs_load()

int vs_load ( void  )

Load the stir/shaken verification service.

Return values
0on success
-1on error

Definition at line 1099 of file verification.c.

1100{
1101 int rc = 0;
1102
1103 if (vs_config_load()) {
1105 }
1106
1107 rc = regcomp(&url_match_regex, FULL_URL_REGEX, REG_EXTENDED);
1108 if (rc) {
1109 char regex_error[512];
1110 regerror(rc, &url_match_regex, regex_error, sizeof(regex_error));
1111 ast_log(LOG_ERROR, "Verification service URL regex failed to compile: %s\n", regex_error);
1112 vs_unload();
1114 }
1115 if (url_match_regex.re_nsub != FULL_URL_REGEX_GROUPS) {
1116 ast_log(LOG_ERROR, "The verification service URL regex was updated without updating FULL_URL_REGEX_GROUPS\n");
1117 vs_unload();
1119 }
1120
1122}
#define ast_log
Definition: astobj2.c:42
int vs_config_load(void)
#define LOG_ERROR
@ AST_MODULE_LOAD_SUCCESS
Definition: module.h:70
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
Definition: module.h:78
static regex_t url_match_regex
Definition: verification.c:48
#define FULL_URL_REGEX_GROUPS
Definition: verification.c:772
#define FULL_URL_REGEX
Definition: verification.c:771
int vs_unload()
Unload the stir/shaken verification service.

References ast_log, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, FULL_URL_REGEX, FULL_URL_REGEX_GROUPS, LOG_ERROR, url_match_regex, vs_config_load(), and vs_unload().

Referenced by common_config_load().

◆ vs_reload()

int vs_reload ( void  )

Reload the stir/shaken verification service.

Return values
0on success
-1on error

Definition at line 1082 of file verification.c.

1083{
1085
1086 return 0;
1087}
int vs_config_reload(void)

References vs_config_reload().

Referenced by common_config_reload().

◆ vs_unload()

int vs_unload ( void  )

Unload the stir/shaken verification service.

Return values
0on success
-1on error

Definition at line 1089 of file verification.c.

1090{
1092 if (url_match_regex.re_nsub > 0) {
1093 regfree(&url_match_regex);
1094 }
1095
1096 return 0;
1097}
int vs_config_unload(void)

References url_match_regex, and vs_config_unload().

Referenced by common_config_unload(), and vs_load().