Asterisk - The Open Source Telephony Project GIT-master-1f1c5bb
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 1100 of file verification.c.

1101{
1102 int rc = 0;
1103
1104 if (vs_config_load()) {
1106 }
1107
1108 rc = regcomp(&url_match_regex, FULL_URL_REGEX, REG_EXTENDED);
1109 if (rc) {
1110 char regex_error[512];
1111 regerror(rc, &url_match_regex, regex_error, sizeof(regex_error));
1112 ast_log(LOG_ERROR, "Verification service URL regex failed to compile: %s\n", regex_error);
1113 vs_unload();
1115 }
1116 if (url_match_regex.re_nsub != FULL_URL_REGEX_GROUPS) {
1117 ast_log(LOG_ERROR, "The verification service URL regex was updated without updating FULL_URL_REGEX_GROUPS\n");
1118 vs_unload();
1120 }
1121
1123}
#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:49
#define FULL_URL_REGEX_GROUPS
Definition: verification.c:773
#define FULL_URL_REGEX
Definition: verification.c:772
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 1083 of file verification.c.

1084{
1086
1087 return 0;
1088}
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 1090 of file verification.c.

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

References url_match_regex, and vs_config_unload().

Referenced by common_config_unload(), and vs_load().