Asterisk - The Open Source Telephony Project GIT-master-0a46be9
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 1122 of file verification.c.

1123{
1124 int rc = 0;
1125
1126 if (vs_config_load()) {
1128 }
1129
1130 rc = regcomp(&url_match_regex, FULL_URL_REGEX, REG_EXTENDED);
1131 if (rc) {
1132 char regex_error[512];
1133 regerror(rc, &url_match_regex, regex_error, sizeof(regex_error));
1134 ast_log(LOG_ERROR, "Verification service URL regex failed to compile: %s\n", regex_error);
1135 vs_unload();
1137 }
1138 if (url_match_regex.re_nsub != FULL_URL_REGEX_GROUPS) {
1139 ast_log(LOG_ERROR, "The verification service URL regex was updated without updating FULL_URL_REGEX_GROUPS\n");
1140 vs_unload();
1142 }
1143
1145}
#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:785
#define FULL_URL_REGEX
Definition: verification.c:784
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 1105 of file verification.c.

1106{
1108
1109 return 0;
1110}
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 1112 of file verification.c.

1113{
1115 if (url_match_regex.re_nsub > 0) {
1116 regfree(&url_match_regex);
1117 }
1118
1119 return 0;
1120}
int vs_config_unload(void)

References url_match_regex, and vs_config_unload().

Referenced by common_config_unload(), and vs_load().