Asterisk - The Open Source Telephony Project  18.5.0
general.h
Go to the documentation of this file.
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 2020, Sangoma Technologies Corporation
5  *
6  * Kevin Harwell <[email protected]>
7  *
8  * See http://www.asterisk.org for more information about
9  * the Asterisk project. Please do not directly contact
10  * any of the maintainers of this project for assistance;
11  * the project provides a web site, mailing lists and IRC
12  * channels for your use.
13  *
14  * This program is free software, distributed under the terms of
15  * the GNU General Public License Version 2. See the LICENSE file
16  * at the top of the source tree.
17  */
18 #ifndef _STIR_SHAKEN_GENERAL_H
19 #define _STIR_SHAKEN_GENERAL_H
20 
21 struct ast_sorcery;
22 
23 /*!
24  * \brief General configuration for stir/shaken
25  */
26 struct stir_shaken_general;
27 
28 /*!
29  * \brief Retrieve the stir/shaken 'general' configuration object
30  *
31  * A default configuration object is returned if no configuration was specified.
32  * As well, NULL can be returned if there is no configuration, and a problem
33  * occurred while loading the defaults.
34  *
35  * \note Object is returned with a reference that the caller is responsible
36  * for de-referencing.
37  *
38  * \retval A 'general' configuration object, or NULL
39  */
41 
42 /*!
43  * \brief Retrieve the 'ca_file' general configuration option value
44  *
45  * \note If a NULL configuration is given, then the default value is returned
46  *
47  * \param cfg A 'general' configuration object
48  *
49  * \retval The 'ca_file' value
50  */
51 const char *ast_stir_shaken_ca_file(const struct stir_shaken_general *cfg);
52 
53 /*!
54  * \brief Retrieve the 'ca_path' general configuration option value
55  *
56  * \note If a NULL configuration is given, then the default value is returned
57  *
58  * \param cfg A 'general' configuration object
59  *
60  * \retval The 'ca_path' value
61  */
62 const char *ast_stir_shaken_ca_path(const struct stir_shaken_general *cfg);
63 
64 /*!
65  * \brief Retrieve the 'cache_max_size' general configuration option value
66  *
67  * \note If a NULL configuration is given, then the default value is returned
68  *
69  * \param cfg A 'general' configuration object
70  *
71  * \retval The 'cache_max_size' value
72  */
73 unsigned int ast_stir_shaken_cache_max_size(const struct stir_shaken_general *cfg);
74 
75 /*!
76  * \brief Retrieve the 'curl_timeout' general configuration option value
77  *
78  * \note If a NULL configuration is given, then the default value is returned
79  *
80  * \param cfg A 'general' configuration object
81  *
82  * \retval The 'curl_timeout' value
83  */
84 unsigned int ast_stir_shaken_curl_timeout(const struct stir_shaken_general *cfg);
85 
86 /*!
87  * \brief Retrieve the 'signature_timeout' general configuration option value
88  *
89  * \note if a NULL configuration is given, then the default value is returned
90  *
91  * \param cfg A 'general' configuration object
92  *
93  * \retval The 'signature_timeout' value
94  */
95 unsigned int ast_stir_shaken_signature_timeout(const struct stir_shaken_general *cfg);
96 
97 /*!
98  * \brief Load time initialization for the stir/shaken 'general' configuration
99  *
100  * \retval 0 on success, -1 on error
101  */
102 int stir_shaken_general_load(void);
103 
104 /*!
105  * \brief Unload time cleanup for the stir/shaken 'general' configuration
106  *
107  * \retval 0 on success, -1 on error
108  */
110 
111 #endif /* _STIR_SHAKEN_GENERAL_H */
const char * ast_stir_shaken_ca_file(const struct stir_shaken_general *cfg)
Retrieve the &#39;ca_file&#39; general configuration option value.
Definition: general.c:72
unsigned int ast_stir_shaken_curl_timeout(const struct stir_shaken_general *cfg)
Retrieve the &#39;curl_timeout&#39; general configuration option value.
Definition: general.c:87
unsigned int ast_stir_shaken_signature_timeout(const struct stir_shaken_general *cfg)
Retrieve the &#39;signature_timeout&#39; general configuration option value.
Definition: general.c:92
Full structure for sorcery.
Definition: sorcery.c:230
unsigned int ast_stir_shaken_cache_max_size(const struct stir_shaken_general *cfg)
Retrieve the &#39;cache_max_size&#39; general configuration option value.
Definition: general.c:82
struct stir_shaken_general * stir_shaken_general_get(void)
Retrieve the stir/shaken &#39;general&#39; configuration object.
Definition: general.c:54
int stir_shaken_general_unload(void)
Unload time cleanup for the stir/shaken &#39;general&#39; configuration.
Definition: general.c:232
int stir_shaken_general_load(void)
Load time initialization for the stir/shaken &#39;general&#39; configuration.
Definition: general.c:248
const char * ast_stir_shaken_ca_path(const struct stir_shaken_general *cfg)
Retrieve the &#39;ca_path&#39; general configuration option value.
Definition: general.c:77