[svn-commits] russell: branch group/security_events r201184 - in /team/group/security_event...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jun 16 16:34:02 CDT 2009


Author: russell
Date: Tue Jun 16 16:33:55 2009
New Revision: 201184

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=201184
Log:
Move module field into the common struct

Modified:
    team/group/security_events/channels/chan_sip.c
    team/group/security_events/include/asterisk/security_events_defs.h
    team/group/security_events/main/security_events.c
    team/group/security_events/tests/test_security_events.c

Modified: team/group/security_events/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/security_events/channels/chan_sip.c?view=diff&rev=201184&r1=201183&r2=201184
==============================================================================
--- team/group/security_events/channels/chan_sip.c (original)
+++ team/group/security_events/channels/chan_sip.c Tue Jun 16 16:33:55 2009
@@ -12030,8 +12030,8 @@
 		.common.event_type = AST_SECURITY_EVENT_FAILED_ACL,
 		.common.version    = AST_SECURITY_EVENT_FAILED_ACL_VERSION,
 		.common.service    = "SIP",
-
-		.module     = AST_MODULE,
+		.common.module     = AST_MODULE,
+
 		.account_id = peer->name,
 		.session_id = pvt->callid,
 		.acl_name   = acl_name,
@@ -12057,8 +12057,8 @@
 		.common.event_type = AST_SECURITY_EVENT_INVAL_ACCT_ID,
 		.common.version    = AST_SECURITY_EVENT_INVAL_ACCT_ID_VERSION,
 		.common.service    = "SIP",
-
-		.module     = AST_MODULE,
+		.common.module     = AST_MODULE,
+
 		.account_id = peer_name,
 		.session_id = pvt->callid,
 		.session_tv = &pvt->session_tv,

Modified: team/group/security_events/include/asterisk/security_events_defs.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/security_events/include/asterisk/security_events_defs.h?view=diff&rev=201184&r1=201183&r2=201184
==============================================================================
--- team/group/security_events/include/asterisk/security_events_defs.h (original)
+++ team/group/security_events/include/asterisk/security_events_defs.h Tue Jun 16 16:33:55 2009
@@ -163,10 +163,16 @@
 	uint32_t version;
 	/*!
 	 * \brief Service that generated the event
+	 * \note Required
 	 *
-	 * Examples: "SIP"
+	 * Examples: "SIP", "AMI"
 	 */
 	const char *service;
+	/*!
+	 * \brief Module, Normally the AST_MODULE define
+	 * \note optional
+	 */
+	const char *module;
 };
 
 /*!
@@ -181,11 +187,6 @@
 	/*! \brief Common security event descriptor elements */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Module, Normally the AST_MODULE define
-	 * \note optional
-	 */
-	const char *module;
-	/*!
 	 * \brief Account ID, specific to the service type
 	 * \note required
 	 */
@@ -229,11 +230,6 @@
 	/*! \brief Common security event descriptor elements */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Module, Normally the AST_MODULE define
-	 * \note optional
-	 */
-	const char *module;
-	/*!
 	 * \brief Account ID, specific to the service type
 	 * \note required
 	 */
@@ -272,11 +268,6 @@
 	/*! \brief Common security event descriptor elements */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Module, Normally the AST_MODULE define
-	 * \note optional
-	 */
-	const char *module;
-	/*!
 	 * \brief Account ID, specific to the service type
 	 * \note required
 	 */
@@ -315,11 +306,6 @@
 	/*! \brief Common security event descriptor elements */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Module, Normally the AST_MODULE define
-	 * \note optional
-	 */
-	const char *module;
-	/*!
 	 * \brief Account ID, specific to the service type
 	 * \note required
 	 */
@@ -358,11 +344,6 @@
 	/*! \brief Common security event descriptor elements */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Module, Normally the AST_MODULE define
-	 * \note optional
-	 */
-	const char *module;
-	/*!
 	 * \brief Account ID, specific to the service type
 	 * \note required
 	 */
@@ -401,11 +382,6 @@
 	/*! \brief Common security event descriptor elements */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Module, Normally the AST_MODULE define
-	 * \note optional
-	 */
-	const char *module;
-	/*!
 	 * \brief Account ID, specific to the service type
 	 * \note required
 	 */
@@ -449,11 +425,6 @@
 	/*! \brief Common security event descriptor elements */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Module, Normally the AST_MODULE define
-	 * \note optional
-	 */
-	const char *module;
-	/*!
 	 * \brief Account ID, specific to the service type
 	 * \note required
 	 */
@@ -502,11 +473,6 @@
 	/*! \brief Common security event descriptor elements */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Module, Normally the AST_MODULE define
-	 * \note optional
-	 */
-	const char *module;
-	/*!
 	 * \brief Account ID, specific to the service type
 	 * \note required
 	 */
@@ -550,11 +516,6 @@
 	/*! \brief Common security event descriptor elements */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Module, Normally the AST_MODULE define
-	 * \note optional
-	 */
-	const char *module;
-	/*!
 	 * \brief Account ID, specific to the service type
 	 * \note optional
 	 */
@@ -603,11 +564,6 @@
 	/*! \brief Common security event descriptor elements */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Module, Normally the AST_MODULE define
-	 * \note optional
-	 */
-	const char *module;
-	/*!
 	 * \brief Account ID, specific to the service type
 	 * \note required
 	 */
@@ -646,11 +602,6 @@
 	/*! \brief Common security event descriptor elements */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Module, Normally the AST_MODULE define
-	 * \note optional
-	 */
-	const char *module;
-	/*!
 	 * \brief Account ID, specific to the service type
 	 * \note required
 	 */
@@ -694,11 +645,6 @@
 	/*! \brief Common security event descriptor elements */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Module, Normally the AST_MODULE define
-	 * \note optional
-	 */
-	const char *module;
-	/*!
 	 * \brief Account ID, specific to the service type
 	 * \note required
 	 */
@@ -751,11 +697,6 @@
 	#define AST_SECURITY_EVENT_INVAL_PASSWORD_VERSION 1
 	/*! \brief Common security event descriptor elements */
 	struct ast_security_event_common common;
-	/*!
-	 * \brief Module, Normally the AST_MODULE define
-	 * \note optional
-	 */
-	const char *module;
 	/*!
 	 * \brief Account ID, specific to the service type
 	 * \note required

Modified: team/group/security_events/main/security_events.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/security_events/main/security_events.c?view=diff&rev=201184&r1=201183&r2=201184
==============================================================================
--- team/group/security_events/main/security_events.c (original)
+++ team/group/security_events/main/security_events.c Tue Jun 16 16:33:55 2009
@@ -63,7 +63,7 @@
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
-		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(failed_acl, module) },
+		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
 		{ AST_EVENT_IE_ACL_NAME, SEC_EVT_FIELD(failed_acl, acl_name) },
 		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(failed_acl, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
@@ -86,7 +86,7 @@
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
-		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(inval_acct_id, module) },
+		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
 		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(inval_acct_id, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
@@ -108,7 +108,7 @@
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
-		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(session_limit, module) },
+		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
 		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(session_limit, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
@@ -130,7 +130,7 @@
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
-		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(mem_limit, module) },
+		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
 		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(mem_limit, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
@@ -152,7 +152,7 @@
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
-		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(load_avg, module) },
+		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
 		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(load_avg, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
@@ -175,7 +175,7 @@
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
-		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(req_no_support, module) },
+		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
 		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(req_no_support, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
@@ -198,7 +198,7 @@
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
-		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(req_not_allowed, module) },
+		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
 		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(req_not_allowed, session_tv) },
 		{ AST_EVENT_IE_REQUEST_PARAMS, SEC_EVT_FIELD(req_not_allowed, request_params) },
 		{ AST_EVENT_IE_END, 0 }
@@ -222,7 +222,7 @@
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
-		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(auth_method_not_allowed, module) },
+		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
 		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(auth_method_not_allowed, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
@@ -244,7 +244,7 @@
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
-		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(req_bad_format, module) },
+		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
 		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(req_bad_format, session_tv) },
 		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(req_bad_format, account_id) },
 		{ AST_EVENT_IE_REQUEST_PARAMS, SEC_EVT_FIELD(req_bad_format, request_params) },
@@ -268,7 +268,7 @@
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
-		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(successful_auth, module) },
+		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
 		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(successful_auth, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
@@ -291,7 +291,7 @@
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
-		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(unexpected_addr, module) },
+		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
 		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(unexpected_addr, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
@@ -316,7 +316,7 @@
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
-		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(chal_resp_failed, module) },
+		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
 		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(chal_resp_failed, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
@@ -338,7 +338,7 @@
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
-		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(inval_password, module) },
+		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
 		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(inval_password, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},

Modified: team/group/security_events/tests/test_security_events.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/security_events/tests/test_security_events.c?view=diff&rev=201184&r1=201183&r2=201184
==============================================================================
--- team/group/security_events/tests/test_security_events.c (original)
+++ team/group/security_events/tests/test_security_events.c Tue Jun 16 16:33:55 2009
@@ -80,8 +80,8 @@
 		.common.event_type = AST_SECURITY_EVENT_FAILED_ACL,
 		.common.version    = AST_SECURITY_EVENT_FAILED_ACL_VERSION,
 		.common.service    = "TEST",
-
-		.module     = AST_MODULE,
+		.common.module     = AST_MODULE,
+
 		.account_id = "Username",
 		.session_id = "Session123",
 		.acl_name   = "TEST_ACL",
@@ -118,8 +118,8 @@
 		.common.event_type = AST_SECURITY_EVENT_INVAL_ACCT_ID,
 		.common.version    = AST_SECURITY_EVENT_INVAL_ACCT_ID_VERSION,
 		.common.service    = "TEST",
-
-		.module     = AST_MODULE,
+		.common.module     = AST_MODULE,
+
 		.account_id = "FakeUser",
 		.session_id = "Session456",
 		.session_tv = &session_tv,
@@ -155,8 +155,8 @@
 		.common.event_type = AST_SECURITY_EVENT_SESSION_LIMIT,
 		.common.version    = AST_SECURITY_EVENT_SESSION_LIMIT_VERSION,
 		.common.service    = "TEST",
-
-		.module     = AST_MODULE,
+		.common.module     = AST_MODULE,
+
 		.account_id = "Jenny",
 		.session_id = "8675309",
 		.session_tv = &session_tv,
@@ -192,8 +192,8 @@
 		.common.event_type = AST_SECURITY_EVENT_MEM_LIMIT,
 		.common.version    = AST_SECURITY_EVENT_MEM_LIMIT_VERSION,
 		.common.service    = "TEST",
-
-		.module     = AST_MODULE,
+		.common.module     = AST_MODULE,
+
 		.account_id = "Felix",
 		.session_id = "Session2604",
 		.session_tv = &session_tv,
@@ -229,8 +229,8 @@
 		.common.event_type = AST_SECURITY_EVENT_LOAD_AVG,
 		.common.version    = AST_SECURITY_EVENT_LOAD_AVG_VERSION,
 		.common.service    = "TEST",
-
-		.module     = AST_MODULE,
+		.common.module     = AST_MODULE,
+
 		.account_id = "GuestAccount",
 		.session_id = "XYZ123",
 		.session_tv = &session_tv,
@@ -266,8 +266,8 @@
 		.common.event_type = AST_SECURITY_EVENT_REQ_NO_SUPPORT,
 		.common.version    = AST_SECURITY_EVENT_REQ_NO_SUPPORT_VERSION,
 		.common.service    = "TEST",
-
-		.module     = AST_MODULE,
+		.common.module     = AST_MODULE,
+
 		.account_id = "George",
 		.session_id = "alksdjf023423h4lka0df",
 		.session_tv = &session_tv,
@@ -304,8 +304,8 @@
 		.common.event_type = AST_SECURITY_EVENT_REQ_NOT_ALLOWED,
 		.common.version    = AST_SECURITY_EVENT_REQ_NOT_ALLOWED_VERSION,
 		.common.service    = "TEST",
-
-		.module     = AST_MODULE,
+		.common.module     = AST_MODULE,
+
 		.account_id = "George",
 		.session_id = "alksdjf023423h4lka0df",
 		.session_tv = &session_tv,
@@ -343,8 +343,8 @@
 		.common.event_type = AST_SECURITY_EVENT_AUTH_METHOD_NOT_ALLOWED,
 		.common.version    = AST_SECURITY_EVENT_AUTH_METHOD_NOT_ALLOWED_VERSION,
 		.common.service    = "TEST",
-
-		.module     = AST_MODULE,
+		.common.module     = AST_MODULE,
+
 		.account_id = "Bob",
 		.session_id = "010101010101",
 		.session_tv = &session_tv,
@@ -381,8 +381,8 @@
 		.common.event_type = AST_SECURITY_EVENT_REQ_BAD_FORMAT,
 		.common.version    = AST_SECURITY_EVENT_REQ_BAD_FORMAT_VERSION,
 		.common.service    = "TEST",
-
-		.module     = AST_MODULE,
+		.common.module     = AST_MODULE,
+
 		.account_id = "Larry",
 		.session_id = "838383fhfhf83hf8h3f8h",
 		.session_tv = &session_tv,
@@ -420,8 +420,8 @@
 		.common.event_type = AST_SECURITY_EVENT_SUCCESSFUL_AUTH,
 		.common.version    = AST_SECURITY_EVENT_SUCCESSFUL_AUTH_VERSION,
 		.common.service    = "TEST",
-
-		.module     = AST_MODULE,
+		.common.module     = AST_MODULE,
+
 		.account_id = "ValidUser",
 		.session_id = "Session456",
 		.session_tv = &session_tv,
@@ -460,8 +460,8 @@
 		.common.event_type = AST_SECURITY_EVENT_UNEXPECTED_ADDR,
 		.common.version    = AST_SECURITY_EVENT_UNEXPECTED_ADDR_VERSION,
 		.common.service    = "TEST",
-
-		.module     = AST_MODULE,
+		.common.module     = AST_MODULE,
+
 		.account_id = "CoolUser",
 		.session_id = "Session789",
 		.session_tv = &session_tv,
@@ -504,8 +504,8 @@
 		.common.event_type = AST_SECURITY_EVENT_CHAL_RESP_FAILED,
 		.common.version    = AST_SECURITY_EVENT_CHAL_RESP_FAILED_VERSION,
 		.common.service    = "TEST",
-
-		.module     = AST_MODULE,
+		.common.module     = AST_MODULE,
+
 		.account_id = "SuperDuperUser",
 		.session_id = "Session1231231231",
 		.session_tv = &session_tv,
@@ -544,8 +544,8 @@
 		.common.event_type = AST_SECURITY_EVENT_INVAL_PASSWORD,
 		.common.version    = AST_SECURITY_EVENT_INVAL_PASSWORD_VERSION,
 		.common.service    = "TEST",
-
-		.module     = AST_MODULE,
+		.common.module     = AST_MODULE,
+
 		.account_id = "AccountIDGoesHere",
 		.session_id = "SessionIDGoesHere",
 		.session_tv = &session_tv,




More information about the svn-commits mailing list