[asterisk-commits] russell: branch group/security_events r201185 - in /team/group/security_event...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 16 16:48:07 CDT 2009


Author: russell
Date: Tue Jun 16 16:48:03 2009
New Revision: 201185

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=201185
Log:
Move account ID 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/manager.c
    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=201185&r1=201184&r2=201185
==============================================================================
--- team/group/security_events/channels/chan_sip.c (original)
+++ team/group/security_events/channels/chan_sip.c Tue Jun 16 16:48:03 2009
@@ -12031,8 +12031,8 @@
 		.common.version    = AST_SECURITY_EVENT_FAILED_ACL_VERSION,
 		.common.service    = "SIP",
 		.common.module     = AST_MODULE,
-
-		.account_id = peer->name,
+		.common.account_id = peer->name,
+
 		.session_id = pvt->callid,
 		.acl_name   = acl_name,
 		.session_tv = &pvt->session_tv,
@@ -12058,8 +12058,8 @@
 		.common.version    = AST_SECURITY_EVENT_INVAL_ACCT_ID_VERSION,
 		.common.service    = "SIP",
 		.common.module     = AST_MODULE,
-
-		.account_id = peer_name,
+		.common.account_id = peer_name,
+
 		.session_id = pvt->callid,
 		.session_tv = &pvt->session_tv,
 		.local_addr = {

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=201185&r1=201184&r2=201185
==============================================================================
--- 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:48:03 2009
@@ -163,16 +163,21 @@
 	uint32_t version;
 	/*!
 	 * \brief Service that generated the event
-	 * \note Required
+	 * \note Always required
 	 *
 	 * Examples: "SIP", "AMI"
 	 */
 	const char *service;
 	/*!
 	 * \brief Module, Normally the AST_MODULE define
-	 * \note optional
+	 * \note Always optional
 	 */
 	const char *module;
+	/*!
+	 * \brief Account ID, specific to the service type
+	 * \note optional/required, depending on event type
+	 */
+	const char *account_id;
 };
 
 /*!
@@ -184,7 +189,282 @@
 	 * \note This _must_ be changed if this event descriptor is changed.
 	 */
 	#define AST_SECURITY_EVENT_FAILED_ACL_VERSION 1
-	/*! \brief Common security event descriptor elements */
+	/*!
+	 * \brief Common security event descriptor elements
+	 * \note Account ID required
+	 */
+	struct ast_security_event_common common;
+	/*!
+	 * \brief Session ID, specific to the service type
+	 * \note required
+	 */
+	const char *session_id;
+	/*!
+	 * \brief ACL name, identifies which ACL was hit
+	 * \note optional
+	 */
+	const char *acl_name;
+	/*!
+	 * \brief Session timeval, when the session started
+	 * \note optional
+	 */
+	const struct timeval *session_tv;
+	/*!
+	 * \brief Local address the request came in on
+	 * \note required
+	 */
+	struct ast_security_event_ipv4_addr local_addr;
+	/*!
+	 * \brief Remote address the request came from
+	 * \note required
+	 */
+	struct ast_security_event_ipv4_addr remote_addr;
+};
+
+/*!
+ * \brief Invalid account ID specified (invalid username, for example)
+ */
+struct ast_security_event_inval_acct_id {
+	/*!
+	 * \brief Event descriptor version
+	 * \note This _must_ be changed if this event descriptor is changed.
+	 */
+	#define AST_SECURITY_EVENT_INVAL_ACCT_ID_VERSION 1
+	/*!
+	 * \brief Common security event descriptor elements
+	 * \note Account ID required
+	 */
+	struct ast_security_event_common common;
+	/*!
+	 * \brief Session ID, specific to the service type
+	 * \note required
+	 */
+	const char *session_id;
+	/*!
+	 * \brief Session timeval, when the session started
+	 * \note optional
+	 */
+	const struct timeval *session_tv;
+	/*!
+	 * \brief Local address the request came in on
+	 * \note required
+	 */
+	struct ast_security_event_ipv4_addr local_addr;
+	/*!
+	 * \brief Remote address the request came from
+	 * \note required
+	 */
+	struct ast_security_event_ipv4_addr remote_addr;
+};
+
+/*!
+ * \brief Request denied because of a session limit
+ */
+struct ast_security_event_session_limit {
+	/*!
+	 * \brief Event descriptor version
+	 * \note This _must_ be changed if this event descriptor is changed.
+	 */
+	#define AST_SECURITY_EVENT_SESSION_LIMIT_VERSION 1
+	/*!
+	 * \brief Common security event descriptor elements
+	 * \note Account ID required
+	 */
+	struct ast_security_event_common common;
+	/*!
+	 * \brief Session ID, specific to the service type
+	 * \note required
+	 */
+	const char *session_id;
+	/*!
+	 * \brief Session timeval, when the session started
+	 * \note optional
+	 */
+	const struct timeval *session_tv;
+	/*!
+	 * \brief Local address the request came in on
+	 * \note required
+	 */
+	struct ast_security_event_ipv4_addr local_addr;
+	/*!
+	 * \brief Remote address the request came from
+	 * \note required
+	 */
+	struct ast_security_event_ipv4_addr remote_addr;
+};
+
+/*!
+ * \brief Request denied because of a memory limit
+ */
+struct ast_security_event_mem_limit {
+	/*!
+	 * \brief Event descriptor version
+	 * \note This _must_ be changed if this event descriptor is changed.
+	 */
+	#define AST_SECURITY_EVENT_MEM_LIMIT_VERSION 1
+	/*!
+	 * \brief Common security event descriptor elements
+	 * \note Account ID required
+	 */
+	struct ast_security_event_common common;
+	/*!
+	 * \brief Session ID, specific to the service type
+	 * \note required
+	 */
+	const char *session_id;
+	/*!
+	 * \brief Session timeval, when the session started
+	 * \note optional
+	 */
+	const struct timeval *session_tv;
+	/*!
+	 * \brief Local address the request came in on
+	 * \note required
+	 */
+	struct ast_security_event_ipv4_addr local_addr;
+	/*!
+	 * \brief Remote address the request came from
+	 * \note required
+	 */
+	struct ast_security_event_ipv4_addr remote_addr;
+};
+
+/*!
+ * \brief Request denied because of a load average limit
+ */
+struct ast_security_event_load_avg {
+	/*!
+	 * \brief Event descriptor version
+	 * \note This _must_ be changed if this event descriptor is changed.
+	 */
+	#define AST_SECURITY_EVENT_LOAD_AVG_VERSION 1
+	/*!
+	 * \brief Common security event descriptor elements
+	 * \note Account ID required
+	 */
+	struct ast_security_event_common common;
+	/*!
+	 * \brief Session ID, specific to the service type
+	 * \note required
+	 */
+	const char *session_id;
+	/*!
+	 * \brief Session timeval, when the session started
+	 * \note optional
+	 */
+	const struct timeval *session_tv;
+	/*!
+	 * \brief Local address the request came in on
+	 * \note required
+	 */
+	struct ast_security_event_ipv4_addr local_addr;
+	/*!
+	 * \brief Remote address the request came from
+	 * \note required
+	 */
+	struct ast_security_event_ipv4_addr remote_addr;
+};
+
+/*!
+ * \brief Request denied because we don't support it
+ */
+struct ast_security_event_req_no_support {
+	/*!
+	 * \brief Event descriptor version
+	 * \note This _must_ be changed if this event descriptor is changed.
+	 */
+	#define AST_SECURITY_EVENT_REQ_NO_SUPPORT_VERSION 1
+	/*!
+	 * \brief Common security event descriptor elements
+	 * \note Account ID required
+	 */
+	struct ast_security_event_common common;
+	/*!
+	 * \brief Session ID, specific to the service type
+	 * \note required
+	 */
+	const char *session_id;
+	/*!
+	 * \brief Session timeval, when the session started
+	 * \note optional
+	 */
+	const struct timeval *session_tv;
+	/*!
+	 * \brief Local address the request came in on
+	 * \note required
+	 */
+	struct ast_security_event_ipv4_addr local_addr;
+	/*!
+	 * \brief Remote address the request came from
+	 * \note required
+	 */
+	struct ast_security_event_ipv4_addr remote_addr;
+	/*!
+	 * \brief Request type that was made
+	 * \note required
+	 */
+	const char *request_type;
+};
+
+/*!
+ * \brief Request denied because it's not allowed
+ */
+struct ast_security_event_req_not_allowed {
+	/*!
+	 * \brief Event descriptor version
+	 * \note This _must_ be changed if this event descriptor is changed.
+	 */
+	#define AST_SECURITY_EVENT_REQ_NOT_ALLOWED_VERSION 1
+	/*!
+	 * \brief Common security event descriptor elements
+	 * \note Account ID required
+	 */
+	struct ast_security_event_common common;
+	/*!
+	 * \brief Session ID, specific to the service type
+	 * \note required
+	 */
+	const char *session_id;
+	/*!
+	 * \brief Session timeval, when the session started
+	 * \note optional
+	 */
+	const struct timeval *session_tv;
+	/*!
+	 * \brief Local address the request came in on
+	 * \note required
+	 */
+	struct ast_security_event_ipv4_addr local_addr;
+	/*!
+	 * \brief Remote address the request came from
+	 * \note required
+	 */
+	struct ast_security_event_ipv4_addr remote_addr;
+	/*!
+	 * \brief Request type that was made
+	 * \note required
+	 */
+	const char *request_type;
+	/*!
+	 * \brief Request type that was made
+	 * \note optional
+	 */
+	const char *request_params;
+};
+
+/*!
+ * \brief Auth method used not allowed
+ */
+struct ast_security_event_auth_method_not_allowed {
+	/*!
+	 * \brief Event descriptor version
+	 * \note This _must_ be changed if this event descriptor is changed.
+	 */
+	#define AST_SECURITY_EVENT_AUTH_METHOD_NOT_ALLOWED_VERSION 1
+	/*!
+	 * \brief Common security event descriptor elements
+	 * \note Account ID required
+	 */
 	struct ast_security_event_common common;
 	/*!
 	 * \brief Account ID, specific to the service type
@@ -197,195 +477,41 @@
 	 */
 	const char *session_id;
 	/*!
-	 * \brief ACL name, identifies which ACL was hit
-	 * \note optional
-	 */
-	const char *acl_name;
-	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
-	/*!
-	 * \brief Local address the request came in on
-	 * \note required
-	 */
-	struct ast_security_event_ipv4_addr local_addr;
-	/*!
-	 * \brief Remote address the request came from
-	 * \note required
-	 */
-	struct ast_security_event_ipv4_addr remote_addr;
-};
-
-/*!
- * \brief Invalid account ID specified (invalid username, for example)
- */
-struct ast_security_event_inval_acct_id {
-	/*!
-	 * \brief Event descriptor version
-	 * \note This _must_ be changed if this event descriptor is changed.
-	 */
-	#define AST_SECURITY_EVENT_INVAL_ACCT_ID_VERSION 1
-	/*! \brief Common security event descriptor elements */
-	struct ast_security_event_common common;
-	/*!
-	 * \brief Account ID, specific to the service type
-	 * \note required
-	 */
-	const char *account_id;
-	/*!
-	 * \brief Session ID, specific to the service type
-	 * \note required
-	 */
-	const char *session_id;
-	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
-	/*!
-	 * \brief Local address the request came in on
-	 * \note required
-	 */
-	struct ast_security_event_ipv4_addr local_addr;
-	/*!
-	 * \brief Remote address the request came from
-	 * \note required
-	 */
-	struct ast_security_event_ipv4_addr remote_addr;
-};
-
-/*!
- * \brief Request denied because of a session limit
- */
-struct ast_security_event_session_limit {
-	/*!
-	 * \brief Event descriptor version
-	 * \note This _must_ be changed if this event descriptor is changed.
-	 */
-	#define AST_SECURITY_EVENT_SESSION_LIMIT_VERSION 1
-	/*! \brief Common security event descriptor elements */
-	struct ast_security_event_common common;
-	/*!
-	 * \brief Account ID, specific to the service type
-	 * \note required
-	 */
-	const char *account_id;
-	/*!
-	 * \brief Session ID, specific to the service type
-	 * \note required
-	 */
-	const char *session_id;
-	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
-	/*!
-	 * \brief Local address the request came in on
-	 * \note required
-	 */
-	struct ast_security_event_ipv4_addr local_addr;
-	/*!
-	 * \brief Remote address the request came from
-	 * \note required
-	 */
-	struct ast_security_event_ipv4_addr remote_addr;
-};
-
-/*!
- * \brief Request denied because of a memory limit
- */
-struct ast_security_event_mem_limit {
-	/*!
-	 * \brief Event descriptor version
-	 * \note This _must_ be changed if this event descriptor is changed.
-	 */
-	#define AST_SECURITY_EVENT_MEM_LIMIT_VERSION 1
-	/*! \brief Common security event descriptor elements */
-	struct ast_security_event_common common;
-	/*!
-	 * \brief Account ID, specific to the service type
-	 * \note required
-	 */
-	const char *account_id;
-	/*!
-	 * \brief Session ID, specific to the service type
-	 * \note required
-	 */
-	const char *session_id;
-	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
-	/*!
-	 * \brief Local address the request came in on
-	 * \note required
-	 */
-	struct ast_security_event_ipv4_addr local_addr;
-	/*!
-	 * \brief Remote address the request came from
-	 * \note required
-	 */
-	struct ast_security_event_ipv4_addr remote_addr;
-};
-
-/*!
- * \brief Request denied because of a load average limit
- */
-struct ast_security_event_load_avg {
-	/*!
-	 * \brief Event descriptor version
-	 * \note This _must_ be changed if this event descriptor is changed.
-	 */
-	#define AST_SECURITY_EVENT_LOAD_AVG_VERSION 1
-	/*! \brief Common security event descriptor elements */
-	struct ast_security_event_common common;
-	/*!
-	 * \brief Account ID, specific to the service type
-	 * \note required
-	 */
-	const char *account_id;
-	/*!
-	 * \brief Session ID, specific to the service type
-	 * \note required
-	 */
-	const char *session_id;
-	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
-	/*!
-	 * \brief Local address the request came in on
-	 * \note required
-	 */
-	struct ast_security_event_ipv4_addr local_addr;
-	/*!
-	 * \brief Remote address the request came from
-	 * \note required
-	 */
-	struct ast_security_event_ipv4_addr remote_addr;
-};
-
-/*!
- * \brief Request denied because we don't support it
- */
-struct ast_security_event_req_no_support {
-	/*!
-	 * \brief Event descriptor version
-	 * \note This _must_ be changed if this event descriptor is changed.
-	 */
-	#define AST_SECURITY_EVENT_REQ_NO_SUPPORT_VERSION 1
-	/*! \brief Common security event descriptor elements */
-	struct ast_security_event_common common;
-	/*!
-	 * \brief Account ID, specific to the service type
-	 * \note required
-	 */
-	const char *account_id;
+	 * \brief Session timeval, when the session started
+	 * \note optional
+	 */
+	const struct timeval *session_tv;
+	/*!
+	 * \brief Local address the request came in on
+	 * \note required
+	 */
+	struct ast_security_event_ipv4_addr local_addr;
+	/*!
+	 * \brief Remote address the request came from
+	 * \note required
+	 */
+	struct ast_security_event_ipv4_addr remote_addr;
+	/*!
+	 * \brief Auth method attempted
+	 * \note required
+	 */
+	const char *auth_method;
+};
+
+/*!
+ * \brief Invalid formatting of request
+ */
+struct ast_security_event_req_bad_format {
+	/*!
+	 * \brief Event descriptor version
+	 * \note This _must_ be changed if this event descriptor is changed.
+	 */
+	#define AST_SECURITY_EVENT_REQ_BAD_FORMAT_VERSION 1
+	/*!
+	 * \brief Common security event descriptor elements
+	 * \note Account ID optional
+	 */
+	struct ast_security_event_common common;
 	/*!
 	 * \brief Session ID, specific to the service type
 	 * \note required
@@ -411,148 +537,14 @@
 	 * \note required
 	 */
 	const char *request_type;
-};
-
-/*!
- * \brief Request denied because it's not allowed
- */
-struct ast_security_event_req_not_allowed {
-	/*!
-	 * \brief Event descriptor version
-	 * \note This _must_ be changed if this event descriptor is changed.
-	 */
-	#define AST_SECURITY_EVENT_REQ_NOT_ALLOWED_VERSION 1
-	/*! \brief Common security event descriptor elements */
-	struct ast_security_event_common common;
-	/*!
-	 * \brief Account ID, specific to the service type
-	 * \note required
-	 */
-	const char *account_id;
-	/*!
-	 * \brief Session ID, specific to the service type
-	 * \note required
-	 */
-	const char *session_id;
-	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
-	/*!
-	 * \brief Local address the request came in on
-	 * \note required
-	 */
-	struct ast_security_event_ipv4_addr local_addr;
-	/*!
-	 * \brief Remote address the request came from
-	 * \note required
-	 */
-	struct ast_security_event_ipv4_addr remote_addr;
 	/*!
 	 * \brief Request type that was made
-	 * \note required
-	 */
-	const char *request_type;
-	/*!
-	 * \brief Request type that was made
 	 * \note optional
 	 */
 	const char *request_params;
 };
 
 /*!
- * \brief Auth method used not allowed
- */
-struct ast_security_event_auth_method_not_allowed {
-	/*!
-	 * \brief Event descriptor version
-	 * \note This _must_ be changed if this event descriptor is changed.
-	 */
-	#define AST_SECURITY_EVENT_AUTH_METHOD_NOT_ALLOWED_VERSION 1
-	/*! \brief Common security event descriptor elements */
-	struct ast_security_event_common common;
-	/*!
-	 * \brief Account ID, specific to the service type
-	 * \note required
-	 */
-	const char *account_id;
-	/*!
-	 * \brief Session ID, specific to the service type
-	 * \note required
-	 */
-	const char *session_id;
-	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
-	/*!
-	 * \brief Local address the request came in on
-	 * \note required
-	 */
-	struct ast_security_event_ipv4_addr local_addr;
-	/*!
-	 * \brief Remote address the request came from
-	 * \note required
-	 */
-	struct ast_security_event_ipv4_addr remote_addr;
-	/*!
-	 * \brief Auth method attempted
-	 * \note required
-	 */
-	const char *auth_method;
-};
-
-/*!
- * \brief Invalid formatting of request
- */
-struct ast_security_event_req_bad_format {
-	/*!
-	 * \brief Event descriptor version
-	 * \note This _must_ be changed if this event descriptor is changed.
-	 */
-	#define AST_SECURITY_EVENT_REQ_BAD_FORMAT_VERSION 1
-	/*! \brief Common security event descriptor elements */
-	struct ast_security_event_common common;
-	/*!
-	 * \brief Account ID, specific to the service type
-	 * \note optional
-	 */
-	const char *account_id;
-	/*!
-	 * \brief Session ID, specific to the service type
-	 * \note required
-	 */
-	const char *session_id;
-	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
-	/*!
-	 * \brief Local address the request came in on
-	 * \note required
-	 */
-	struct ast_security_event_ipv4_addr local_addr;
-	/*!
-	 * \brief Remote address the request came from
-	 * \note required
-	 */
-	struct ast_security_event_ipv4_addr remote_addr;
-	/*!
-	 * \brief Request type that was made
-	 * \note required
-	 */
-	const char *request_type;
-	/*!
-	 * \brief Request type that was made
-	 * \note optional
-	 */
-	const char *request_params;
-};
-
-/*!
  * \brief Successful authentication
  */
 struct ast_security_event_successful_auth {
@@ -561,13 +553,11 @@
 	 * \note This _must_ be changed if this event descriptor is changed.
 	 */
 	#define AST_SECURITY_EVENT_SUCCESSFUL_AUTH_VERSION 1
-	/*! \brief Common security event descriptor elements */
-	struct ast_security_event_common common;
-	/*!
-	 * \brief Account ID, specific to the service type
-	 * \note required
-	 */
-	const char *account_id;
+	/*!
+	 * \brief Common security event descriptor elements
+	 * \note Account ID required
+	 */
+	struct ast_security_event_common common;
 	/*!
 	 * \brief Session ID, specific to the service type
 	 * \note required
@@ -599,13 +589,11 @@
 	 * \note This _must_ be changed if this event descriptor is changed.
 	 */
 	#define AST_SECURITY_EVENT_UNEXPECTED_ADDR_VERSION 1
-	/*! \brief Common security event descriptor elements */
-	struct ast_security_event_common common;
-	/*!
-	 * \brief Account ID, specific to the service type
-	 * \note required
-	 */
-	const char *account_id;
+	/*!
+	 * \brief Common security event descriptor elements
+	 * \note Account ID required
+	 */
+	struct ast_security_event_common common;
 	/*!
 	 * \brief Session ID, specific to the service type
 	 * \note required
@@ -642,13 +630,11 @@
 	 * \note This _must_ be changed if this event descriptor is changed.
 	 */
 	#define AST_SECURITY_EVENT_CHAL_RESP_FAILED_VERSION 1
-	/*! \brief Common security event descriptor elements */
-	struct ast_security_event_common common;
-	/*!
-	 * \brief Account ID, specific to the service type
-	 * \note required
-	 */
-	const char *account_id;
+	/*!
+	 * \brief Common security event descriptor elements
+	 * \note Account ID required
+	 */
+	struct ast_security_event_common common;
 	/*!
 	 * \brief Session ID, specific to the service type
 	 * \note required
@@ -695,13 +681,11 @@
 	 * \note This _must_ be changed if this event descriptor is changed.
 	 */
 	#define AST_SECURITY_EVENT_INVAL_PASSWORD_VERSION 1
-	/*! \brief Common security event descriptor elements */
-	struct ast_security_event_common common;
-	/*!
-	 * \brief Account ID, specific to the service type
-	 * \note required
-	 */
-	const char *account_id;
+	/*!
+	 * \brief Common security event descriptor elements
+	 * \note Account ID required
+	 */
+	struct ast_security_event_common common;
 	/*!
 	 * \brief Session ID, specific to the service type
 	 * \note required

Modified: team/group/security_events/main/manager.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/security_events/main/manager.c?view=diff&rev=201185&r1=201184&r2=201185
==============================================================================
--- team/group/security_events/main/manager.c (original)
+++ team/group/security_events/main/manager.c Tue Jun 16 16:48:03 2009
@@ -1760,8 +1760,8 @@
 		.common.event_type = AST_SECURITY_EVENT_INVAL_ACCT_ID,
 		.common.version    = AST_SECURITY_EVENT_INVAL_ACCT_ID_VERSION,
 		.common.service    = "AMI",
-
-		.account_id = username,
+		.common.account_id = username,
+
 		.session_tv = &s->session->sessionstart_tv,
 		.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
@@ -1787,8 +1787,8 @@
 		.common.event_type = AST_SECURITY_EVENT_FAILED_ACL,
 		.common.version    = AST_SECURITY_EVENT_FAILED_ACL_VERSION,
 		.common.service    = "AMI",
-
-		.account_id = username,
+		.common.account_id = username,
+
 		.session_tv = &s->session->sessionstart_tv,
 		.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
@@ -1814,8 +1814,8 @@
 		.common.event_type = AST_SECURITY_EVENT_INVAL_PASSWORD,
 		.common.version    = AST_SECURITY_EVENT_INVAL_PASSWORD_VERSION,
 		.common.service    = "AMI",
-
-		.account_id = username,
+		.common.account_id = username,
+
 		.session_tv = &s->session->sessionstart_tv,
 		.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
@@ -1841,8 +1841,8 @@
 		.common.event_type = AST_SECURITY_EVENT_SUCCESSFUL_AUTH,
 		.common.version    = AST_SECURITY_EVENT_SUCCESSFUL_AUTH_VERSION,
 		.common.service    = "AMI",
-
-		.account_id = s->session->username,
+		.common.account_id = s->session->username,
+
 		.session_tv = &s->session->sessionstart_tv,
 		.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
@@ -1869,8 +1869,8 @@
 		.common.event_type = AST_SECURITY_EVENT_REQ_NOT_ALLOWED,
 		.common.version    = AST_SECURITY_EVENT_REQ_NOT_ALLOWED_VERSION,
 		.common.service    = "AMI",
-
-		.account_id = s->session->username,
+		.common.account_id = s->session->username,
+
 		.session_tv = &s->session->sessionstart_tv,
 		.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
@@ -1900,8 +1900,8 @@
 		.common.event_type = AST_SECURITY_EVENT_REQ_BAD_FORMAT,
 		.common.version    = AST_SECURITY_EVENT_REQ_BAD_FORMAT_VERSION,
 		.common.service    = "AMI",
-
-		.account_id = s->session->username,
+		.common.account_id = s->session->username,
+
 		.session_tv = &s->session->sessionstart_tv,
 		.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
@@ -1931,8 +1931,8 @@
 		.common.event_type = AST_SECURITY_EVENT_CHAL_RESP_FAILED,
 		.common.version    = AST_SECURITY_EVENT_CHAL_RESP_FAILED_VERSION,
 		.common.service    = "AMI",
-
-		.account_id = s->session->username,
+		.common.account_id = s->session->username,
+
 		.session_tv = &s->session->sessionstart_tv,
 		.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
@@ -1961,8 +1961,8 @@
 		.common.event_type = AST_SECURITY_EVENT_SESSION_LIMIT,
 		.common.version    = AST_SECURITY_EVENT_SESSION_LIMIT_VERSION,
 		.common.service    = "AMI",
-
-		.account_id = s->session->username,
+		.common.account_id = s->session->username,
+
 		.session_tv = &s->session->sessionstart_tv,
 		.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),

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=201185&r1=201184&r2=201185
==============================================================================
--- team/group/security_events/main/security_events.c (original)
+++ team/group/security_events/main/security_events.c Tue Jun 16 16:48:03 2009
@@ -56,7 +56,7 @@
 		{ AST_EVENT_IE_SEVERITY, 0 },
 		{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
-		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(failed_acl, account_id) },
+		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(failed_acl, session_id) },
 		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(failed_acl, local_addr) },
 		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(failed_acl, remote_addr) },
@@ -79,7 +79,7 @@
 		{ AST_EVENT_IE_SEVERITY, 0 },
 		{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
-		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(inval_acct_id, account_id) },
+		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(inval_acct_id, session_id) },
 		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(inval_acct_id, local_addr) },
 		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(inval_acct_id, remote_addr) },
@@ -101,7 +101,7 @@
 		{ AST_EVENT_IE_SEVERITY, 0 },
 		{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
-		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(session_limit, account_id) },
+		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(session_limit, session_id) },
 		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(session_limit, local_addr) },
 		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(session_limit, remote_addr) },
@@ -123,7 +123,7 @@
 		{ AST_EVENT_IE_SEVERITY, 0 },
 		{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
-		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(mem_limit, account_id) },
+		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(mem_limit, session_id) },
 		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(mem_limit, local_addr) },
 		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(mem_limit, remote_addr) },
@@ -145,7 +145,7 @@
 		{ AST_EVENT_IE_SEVERITY, 0 },
 		{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
-		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(load_avg, account_id) },
+		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(load_avg, session_id) },
 		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(load_avg, local_addr) },
 		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(load_avg, remote_addr) },
@@ -167,7 +167,7 @@
 		{ AST_EVENT_IE_SEVERITY, 0 },
 		{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
-		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(req_no_support, account_id) },
+		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(req_no_support, session_id) },
 		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(req_no_support, local_addr) },
 		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(req_no_support, remote_addr) },
@@ -190,7 +190,7 @@
 		{ AST_EVENT_IE_SEVERITY, 0 },
 		{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
-		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(req_not_allowed, account_id) },
+		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(req_not_allowed, session_id) },
 		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(req_not_allowed, local_addr) },
 		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(req_not_allowed, remote_addr) },
@@ -214,7 +214,7 @@
 		{ AST_EVENT_IE_SEVERITY, 0 },
 		{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
-		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(auth_method_not_allowed, account_id) },
+		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(auth_method_not_allowed, session_id) },
 		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(auth_method_not_allowed, local_addr) },
 		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(auth_method_not_allowed, remote_addr) },
@@ -246,7 +246,7 @@
 	.optional_ies = {
 		{ 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_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_REQUEST_PARAMS, SEC_EVT_FIELD(req_bad_format, request_params) },
 		{ AST_EVENT_IE_END, 0 }
 	},
@@ -261,7 +261,7 @@
 		{ AST_EVENT_IE_SEVERITY, 0 },
 		{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
-		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(successful_auth, account_id) },
+		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(successful_auth, session_id) },
 		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(successful_auth, local_addr) },
 		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(successful_auth, remote_addr) },
@@ -283,7 +283,7 @@
 		{ AST_EVENT_IE_SEVERITY, 0 },
 		{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
-		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(unexpected_addr, account_id) },
+		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(unexpected_addr, session_id) },
 		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(unexpected_addr, local_addr) },
 		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(unexpected_addr, remote_addr) },
@@ -306,7 +306,7 @@
 		{ AST_EVENT_IE_SEVERITY, 0 },
 		{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
-		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(chal_resp_failed, account_id) },
+		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(chal_resp_failed, session_id) },
 		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(chal_resp_failed, local_addr) },
 		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(chal_resp_failed, remote_addr) },
@@ -331,7 +331,7 @@
 		{ AST_EVENT_IE_SEVERITY, 0 },
 		{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
-		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(inval_password, account_id) },
+		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(inval_password, session_id) },
 		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(inval_password, local_addr) },
 		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(inval_password, remote_addr) },

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=201185&r1=201184&r2=201185
==============================================================================
--- team/group/security_events/tests/test_security_events.c (original)
+++ team/group/security_events/tests/test_security_events.c Tue Jun 16 16:48:03 2009
@@ -81,8 +81,8 @@
 		.common.version    = AST_SECURITY_EVENT_FAILED_ACL_VERSION,
 		.common.service    = "TEST",
 		.common.module     = AST_MODULE,
-
-		.account_id = "Username",
+		.common.account_id = "Username",
+
 		.session_id = "Session123",
 		.acl_name   = "TEST_ACL",
 		.session_tv = &session_tv,
@@ -119,8 +119,8 @@
 		.common.version    = AST_SECURITY_EVENT_INVAL_ACCT_ID_VERSION,
 		.common.service    = "TEST",
 		.common.module     = AST_MODULE,
-
-		.account_id = "FakeUser",
+		.common.account_id = "FakeUser",
+
 		.session_id = "Session456",
 		.session_tv = &session_tv,
 		.local_addr = {
@@ -156,8 +156,8 @@
 		.common.version    = AST_SECURITY_EVENT_SESSION_LIMIT_VERSION,
 		.common.service    = "TEST",
 		.common.module     = AST_MODULE,
-
-		.account_id = "Jenny",
+		.common.account_id = "Jenny",
+
 		.session_id = "8675309",
 		.session_tv = &session_tv,
 		.local_addr = {
@@ -193,8 +193,8 @@
 		.common.version    = AST_SECURITY_EVENT_MEM_LIMIT_VERSION,
 		.common.service    = "TEST",
 		.common.module     = AST_MODULE,
-
-		.account_id = "Felix",
+		.common.account_id = "Felix",
+
 		.session_id = "Session2604",
 		.session_tv = &session_tv,
 		.local_addr = {
@@ -230,8 +230,8 @@
 		.common.version    = AST_SECURITY_EVENT_LOAD_AVG_VERSION,
 		.common.service    = "TEST",
 		.common.module     = AST_MODULE,
-
-		.account_id = "GuestAccount",
+		.common.account_id = "GuestAccount",
+
 		.session_id = "XYZ123",
 		.session_tv = &session_tv,
 		.local_addr = {
@@ -267,8 +267,8 @@
 		.common.version    = AST_SECURITY_EVENT_REQ_NO_SUPPORT_VERSION,
 		.common.service    = "TEST",
 		.common.module     = AST_MODULE,
-
-		.account_id = "George",
+		.common.account_id = "George",
+
 		.session_id = "alksdjf023423h4lka0df",
 		.session_tv = &session_tv,
 		.local_addr = {
@@ -305,8 +305,8 @@
 		.common.version    = AST_SECURITY_EVENT_REQ_NOT_ALLOWED_VERSION,
 		.common.service    = "TEST",
 		.common.module     = AST_MODULE,
-
-		.account_id = "George",
+		.common.account_id = "George",
+
 		.session_id = "alksdjf023423h4lka0df",
 		.session_tv = &session_tv,
 		.local_addr = {
@@ -344,8 +344,8 @@
 		.common.version    = AST_SECURITY_EVENT_AUTH_METHOD_NOT_ALLOWED_VERSION,
 		.common.service    = "TEST",
 		.common.module     = AST_MODULE,
-
-		.account_id = "Bob",
+		.common.account_id = "Bob",
+
 		.session_id = "010101010101",
 		.session_tv = &session_tv,
 		.local_addr = {
@@ -382,8 +382,8 @@
 		.common.version    = AST_SECURITY_EVENT_REQ_BAD_FORMAT_VERSION,
 		.common.service    = "TEST",
 		.common.module     = AST_MODULE,
-
-		.account_id = "Larry",
+		.common.account_id = "Larry",
+
 		.session_id = "838383fhfhf83hf8h3f8h",
 		.session_tv = &session_tv,
 		.local_addr = {
@@ -421,8 +421,8 @@
 		.common.version    = AST_SECURITY_EVENT_SUCCESSFUL_AUTH_VERSION,
 		.common.service    = "TEST",
 		.common.module     = AST_MODULE,
-
-		.account_id = "ValidUser",
+		.common.account_id = "ValidUser",
+
 		.session_id = "Session456",
 		.session_tv = &session_tv,
 		.local_addr = {
@@ -461,8 +461,8 @@
 		.common.version    = AST_SECURITY_EVENT_UNEXPECTED_ADDR_VERSION,
 		.common.service    = "TEST",
 		.common.module     = AST_MODULE,
-
-		.account_id = "CoolUser",
+		.common.account_id = "CoolUser",
+
 		.session_id = "Session789",
 		.session_tv = &session_tv,
 		.local_addr = {
@@ -505,8 +505,8 @@
 		.common.version    = AST_SECURITY_EVENT_CHAL_RESP_FAILED_VERSION,
 		.common.service    = "TEST",
 		.common.module     = AST_MODULE,
-
-		.account_id = "SuperDuperUser",
+		.common.account_id = "SuperDuperUser",
+
 		.session_id = "Session1231231231",
 		.session_tv = &session_tv,
 		.local_addr = {
@@ -545,8 +545,8 @@
 		.common.version    = AST_SECURITY_EVENT_INVAL_PASSWORD_VERSION,
 		.common.service    = "TEST",
 		.common.module     = AST_MODULE,
-
-		.account_id = "AccountIDGoesHere",
+		.common.account_id = "AccountIDGoesHere",
+
 		.session_id = "SessionIDGoesHere",
 		.session_tv = &session_tv,
 		.local_addr = {




More information about the asterisk-commits mailing list