Wed Jan 8 2020 09:49:51

Asterisk developer's documentation


security_events.h
Go to the documentation of this file.
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 2009, Digium, Inc.
5  *
6  * Russell Bryant <russell@digium.com>
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 
19 /*!
20  * \file
21  *
22  * \brief Security Event Reporting API
23  *
24  * \author Russell Bryant <russell@digium.com>
25  */
26 
27 #ifndef __AST_SECURITY_EVENTS_H__
28 #define __AST_SECURITY_EVENTS_H__
29 
30 #include "asterisk/event.h"
31 
32 /* Data structure definitions */
34 
35 #if defined(__cplusplus) || defined(c_plusplus)
36 extern "C" {
37 #endif
38 
39 /*!
40  * \brief Report a security event
41  *
42  * \param[in] sec security event data. Callers of this function should never
43  * declare an instance of ast_security_event_common directly. The
44  * argument should be an instance of a specific security event
45  * descriptor which has ast_security_event_common at the very
46  * beginning.
47  *
48  * \retval 0 success
49  * \retval non-zero failure
50  */
52 
55  /*! \brief For internal usage */
56  size_t offset;
57 };
58 
59 /*!
60  * \brief Get the list of required IEs for a given security event sub-type
61  *
62  * \param[in] event_type security event sub-type
63  *
64  * \retval NULL invalid event_type
65  * \retval non-NULL An array terminated with the value AST_EVENT_IE_END
66  *
67  * \since 1.8
68  */
70  const enum ast_security_event_type event_type);
71 
72 /*!
73  * \brief Get the list of optional IEs for a given security event sub-type
74  *
75  * \param[in] event_type security event sub-type
76  *
77  * \retval NULL invalid event_type
78  * \retval non-NULL An array terminated with the value AST_EVENT_IE_END
79  *
80  * \since 1.8
81  */
83  const enum ast_security_event_type event_type);
84 
85 /*!
86  * \brief Get the name of a security event sub-type
87  *
88  * \param[in] event_type security event sub-type
89  *
90  * \retval NULL if event_type is invalid
91  * \retval non-NULL the name of the security event type
92  *
93  * \since 1.8
94  */
95 const char *ast_security_event_get_name(const enum ast_security_event_type event_type);
96 
97 /*!
98  * \brief Get the name of a security event severity
99  *
100  * \param[in] severity security event severity
101  *
102  * \retval NULL if severity is invalid
103  * \retval non-NULL the name of the security event severity
104  *
105  * \since 1.8
106  */
109 
110 #if defined(__cplusplus) || defined(c_plusplus)
111 }
112 #endif
113 
114 #endif /* __AST_SECURITY_EVENTS_H__ */
ast_security_event_severity
the severity of a security event
int ast_security_event_report(const struct ast_security_event_common *sec)
Report a security event.
ast_security_event_type
Security event types.
struct ast_security_event_ie_type * ast_security_event_get_optional_ies(const enum ast_security_event_type event_type)
Get the list of optional IEs for a given security event sub-type.
const char * ast_security_event_severity_get_name(const enum ast_security_event_severity severity)
Get the name of a security event severity.
size_t offset
For internal usage.
Common structure elements.
struct ast_security_event_ie_type * ast_security_event_get_required_ies(const enum ast_security_event_type event_type)
Get the list of required IEs for a given security event sub-type.
ast_event_ie_type
Event Information Element types.
Definition: event_defs.h:62
enum ast_event_ie_type ie_type
Security Event Reporting Data Structures.
enum ast_security_event_severity severity
const char * ast_security_event_get_name(const enum ast_security_event_type event_type)
Get the name of a security event sub-type.