107 append_ie(str, event, ies[i].ie_type, required);
151 ast_verb(3,
"Security Logging Enabled\n");
158 if (security_event_sub) {
164 ast_verb(3,
"Security Logging Disabled\n");
#define AST_THREADSTORAGE(name)
Define a thread storage variable.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Security Event Reporting API.
Asterisk main include file. File version handling, generic pbx functions.
ast_security_event_type
Security event types.
static int ie_is_present(const struct ast_event *event, const enum ast_event_ie_type ie_type)
uint32_t ast_event_get_ie_bitflags(const struct ast_event *event, enum ast_event_ie_type ie_type)
Get the value of an information element that has a bitflags payload.
String manipulation functions.
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.
static struct ast_event_sub * security_event_sub
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
#define ast_log_dynamic_level(level,...)
Send a log message to a dynamically registered log level.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
enum ast_event_ie_pltype ast_event_get_ie_pltype(enum ast_event_ie_type ie_type)
Get the payload type for a given information element type.
Definitions to aid in the use of thread local storage.
#define ast_verb(level,...)
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.
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
void ast_logger_unregister_level(const char *name)
Unregister a previously registered logger level.
static const char LOG_SECURITY_NAME[]
ast_event_ie_type
Event Information Element types.
int ast_logger_register_level(const char *name)
Register a new logger level.
const void * ast_event_get_ie_raw(const struct ast_event *event, enum ast_event_ie_type ie_type)
Get the value of an information element that has a raw payload.
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
enum ast_event_ie_type ie_type
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
static const size_t SECURITY_EVENT_BUF_INIT_LEN
Support for logging to various files, console and syslog Configuration in file logger.conf.
uint32_t ast_event_get_ie_uint(const struct ast_event *event, enum ast_event_ie_type ie_type)
Get the value of an information element that has an integer payload.
static void security_event_cb(const struct ast_event *event, void *data)
struct ast_event_sub * ast_event_subscribe(enum ast_event_type event_type, ast_event_cb_t cb, const char *description, void *userdata,...)
Subscribe to events.
const char * ast_event_get_ie_type_name(enum ast_event_ie_type ie_type)
Get the string representation of an information element type.
static void append_ie(struct ast_str **str, const struct ast_event *event, const enum ast_event_ie_type ie_type, enum ie_required required)
static int load_module(void)
static int unload_module(void)
static void append_ies(struct ast_str **str, const struct ast_event *event, const struct ast_security_event_ie_type *ies, enum ie_required required)
struct ast_str * ast_str_thread_get(struct ast_threadstorage *ts, size_t init_len)
Retrieve a thread locally stored dynamic string.
const char * ast_event_get_ie_str(const struct ast_event *event, enum ast_event_ie_type ie_type)
Get the value of an information element that has a string payload.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
const char * ast_security_event_get_name(const enum ast_security_event_type event_type)
Get the name of a security event sub-type.
static struct ast_threadstorage security_event_buf
struct ast_event_sub * ast_event_unsubscribe(struct ast_event_sub *event_sub)
Un-subscribe from events.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.