[asterisk-commits] russell: branch group/security_events r192381 - /team/group/security_events/res/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue May 5 09:21:21 CDT 2009
Author: russell
Date: Tue May 5 09:21:16 2009
New Revision: 192381
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=192381
Log:
Add a security logger module ... it just loads and subscribes to security events right now
Added:
team/group/security_events/res/res_security_log.c (with props)
Added: team/group/security_events/res/res_security_log.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/security_events/res/res_security_log.c?view=auto&rev=192381
==============================================================================
--- team/group/security_events/res/res_security_log.c (added)
+++ team/group/security_events/res/res_security_log.c Tue May 5 09:21:16 2009
@@ -1,0 +1,85 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2009, Digium, Inc.
+ *
+ * Russell Bryant <russell at digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*!
+ * \file
+ *
+ * \author Russell Bryant <russell at digium.com>
+ *
+ * \brief Security Logging
+ */
+
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$");
+
+#include "asterisk/module.h"
+#include "asterisk/logger.h"
+#include "asterisk/event.h"
+#include "asterisk/security_events.h"
+
+static struct ast_event_sub *security_event_sub;
+
+static void failed_acl_handler(const struct ast_event *event);
+
+static struct {
+ uint32_t version;
+ void (*handler)(const struct ast_event *event);
+} event_handlers[AST_SECURITY_EVENT_NUM_TYPES] attribute_unused = {
+ [AST_SECURITY_EVENT_FAILED_ACL] = {
+ .version = AST_SECURITY_EVENT_FAILED_ACL_VERSION,
+ .handler = failed_acl_handler,
+ },
+};
+
+static void failed_acl_handler(const struct ast_event *event)
+{
+ /* XXX */
+}
+
+static void security_event_cb(const struct ast_event *event, void *data)
+{
+ /* XXX */
+}
+
+static int load_module(void)
+{
+ security_event_sub = ast_event_subscribe(AST_EVENT_SECURITY,
+ security_event_cb, NULL, AST_EVENT_IE_END);
+
+ if (!security_event_sub) {
+ return AST_MODULE_LOAD_DECLINE;
+ }
+
+ ast_verb(3, "Security Logging Enabled\n");
+
+ return AST_MODULE_LOAD_SUCCESS;
+}
+
+static int unload_module(void)
+{
+ if (security_event_sub) {
+ security_event_sub = ast_event_unsubscribe(security_event_sub);
+ }
+
+ ast_verb(3, "Security Logging Disabled\n");
+
+ return 0;
+}
+
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Security Logging");
Propchange: team/group/security_events/res/res_security_log.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/group/security_events/res/res_security_log.c
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/group/security_events/res/res_security_log.c
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the asterisk-commits
mailing list