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

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


Author: russell
Date: Tue Jun 16 17:07:36 2009
New Revision: 201189

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=201189
Log:
Move local addr / remote addr into 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=201189&r1=201188&r2=201189
==============================================================================
--- team/group/security_events/channels/chan_sip.c (original)
+++ team/group/security_events/channels/chan_sip.c Tue Jun 16 17:07:36 2009
@@ -12034,16 +12034,16 @@
 		.common.account_id = peer->name,
 		.common.session_id = pvt->callid,
 		.common.session_tv = &pvt->session_tv,
-
-		.acl_name   = acl_name,
-		.local_addr = {
+		.common.local_addr = {
 			.sin       = encode_sin_local(&sin_local, pvt),
 			.transport = security_event_transport_type(pvt->socket.type),
 		},
-		.remote_addr = {
+		.common.remote_addr = {
 			.sin       = sin_remote,
 			.transport = security_event_transport_type(pvt->socket.type),
 		},
+
+		.acl_name   = acl_name,
 	};
 
 	ast_security_event_report(AST_SEC_EVT(&failed_acl_event));
@@ -12061,12 +12061,11 @@
 		.common.account_id = peer_name,
 		.common.session_id = pvt->callid,
 		.common.session_tv = &pvt->session_tv,
-
-		.local_addr = {
+		.common.local_addr = {
 			.sin       = encode_sin_local(&sin_local, pvt),
 			.transport = security_event_transport_type(pvt->socket.type),
 		},
-		.remote_addr = {
+		.common.remote_addr = {
 			.sin       = sin_remote,
 			.transport = security_event_transport_type(pvt->socket.type),
 		},

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=201189&r1=201188&r2=201189
==============================================================================
--- team/group/security_events/include/asterisk/security_events_defs.h (original)
+++ team/group/security_events/include/asterisk/security_events_defs.h Tue Jun 16 17:07:36 2009
@@ -188,6 +188,16 @@
 	 * \note Always optional
 	 */
 	const struct timeval *session_tv;
+	/*!
+	 * \brief Local address the request came in on
+	 * \note Always required
+	 */
+	struct ast_security_event_ipv4_addr local_addr;
+	/*!
+	 * \brief Remote address the request came from
+	 * \note Always required
+	 */
+	struct ast_security_event_ipv4_addr remote_addr;
 };
 
 /*!
@@ -209,16 +219,6 @@
 	 * \note optional
 	 */
 	const char *acl_name;
-	/*!
-	 * \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;
 };
 
 /*!
@@ -235,16 +235,6 @@
 	 * \note Account ID required
 	 */
 	struct ast_security_event_common common;
-	/*!
-	 * \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;
 };
 
 /*!
@@ -261,16 +251,6 @@
 	 * \note Account ID required
 	 */
 	struct ast_security_event_common common;
-	/*!
-	 * \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;
 };
 
 /*!
@@ -287,16 +267,6 @@
 	 * \note Account ID required
 	 */
 	struct ast_security_event_common common;
-	/*!
-	 * \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;
 };
 
 /*!
@@ -313,16 +283,6 @@
 	 * \note Account ID required
 	 */
 	struct ast_security_event_common common;
-	/*!
-	 * \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;
 };
 
 /*!
@@ -340,16 +300,6 @@
 	 */
 	struct ast_security_event_common common;
 	/*!
-	 * \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
 	 */
@@ -370,16 +320,6 @@
 	 * \note Account ID required
 	 */
 	struct ast_security_event_common common;
-	/*!
-	 * \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
@@ -407,16 +347,6 @@
 	 */
 	struct ast_security_event_common common;
 	/*!
-	 * \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
 	 */
@@ -437,16 +367,6 @@
 	 * \note Account ID optional
 	 */
 	struct ast_security_event_common common;
-	/*!
-	 * \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
@@ -473,16 +393,6 @@
 	 * \note Account ID required
 	 */
 	struct ast_security_event_common common;
-	/*!
-	 * \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;
 };
 
 /*!
@@ -500,16 +410,6 @@
 	 */
 	struct ast_security_event_common common;
 	/*!
-	 * \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 Expected remote address
 	 * \note required
 	 */
@@ -531,16 +431,6 @@
 	 */
 	struct ast_security_event_common common;
 	/*!
-	 * \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 Challenge provided
 	 * \note required
 	 */
@@ -571,16 +461,6 @@
 	 * \note Account ID required
 	 */
 	struct ast_security_event_common common;
-	/*!
-	 * \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;
 };
 
 #if defined(__cplusplus) || defined(c_plusplus)

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=201189&r1=201188&r2=201189
==============================================================================
--- team/group/security_events/main/manager.c (original)
+++ team/group/security_events/main/manager.c Tue Jun 16 17:07:36 2009
@@ -1762,12 +1762,11 @@
 		.common.service    = "AMI",
 		.common.account_id = username,
 		.common.session_tv = &s->session->sessionstart_tv,
-
-		.local_addr = {
+		.common.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
 			.transport = mansession_get_transport(s),
 		},
-		.remote_addr = {
+		.common.remote_addr = {
 			.sin       = &s->session->sin,
 			.transport = mansession_get_transport(s),
 		},
@@ -1789,12 +1788,11 @@
 		.common.service    = "AMI",
 		.common.account_id = username,
 		.common.session_tv = &s->session->sessionstart_tv,
-
-		.local_addr = {
+		.common.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
 			.transport = mansession_get_transport(s),
 		},
-		.remote_addr = {
+		.common.remote_addr = {
 			.sin       = &s->session->sin,
 			.transport = mansession_get_transport(s),
 		},
@@ -1816,12 +1814,11 @@
 		.common.service    = "AMI",
 		.common.account_id = username,
 		.common.session_tv = &s->session->sessionstart_tv,
-
-		.local_addr = {
+		.common.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
 			.transport = mansession_get_transport(s),
 		},
-		.remote_addr = {
+		.common.remote_addr = {
 			.sin       = &s->session->sin,
 			.transport = mansession_get_transport(s),
 		},
@@ -1843,12 +1840,11 @@
 		.common.service    = "AMI",
 		.common.account_id = s->session->username,
 		.common.session_tv = &s->session->sessionstart_tv,
-
-		.local_addr = {
+		.common.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
 			.transport = mansession_get_transport(s),
 		},
-		.remote_addr = {
+		.common.remote_addr = {
 			.sin       = &s->session->sin,
 			.transport = mansession_get_transport(s),
 		},
@@ -1871,12 +1867,11 @@
 		.common.service    = "AMI",
 		.common.account_id = s->session->username,
 		.common.session_tv = &s->session->sessionstart_tv,
-
-		.local_addr = {
+		.common.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
 			.transport = mansession_get_transport(s),
 		},
-		.remote_addr = {
+		.common.remote_addr = {
 			.sin       = &s->session->sin,
 			.transport = mansession_get_transport(s),
 		},
@@ -1902,12 +1897,11 @@
 		.common.service    = "AMI",
 		.common.account_id = s->session->username,
 		.common.session_tv = &s->session->sessionstart_tv,
-
-		.local_addr = {
+		.common.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
 			.transport = mansession_get_transport(s),
 		},
-		.remote_addr = {
+		.common.remote_addr = {
 			.sin       = &s->session->sin,
 			.transport = mansession_get_transport(s),
 		},
@@ -1933,12 +1927,11 @@
 		.common.service    = "AMI",
 		.common.account_id = s->session->username,
 		.common.session_tv = &s->session->sessionstart_tv,
-
-		.local_addr = {
+		.common.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
 			.transport = mansession_get_transport(s),
 		},
-		.remote_addr = {
+		.common.remote_addr = {
 			.sin       = &s->session->sin,
 			.transport = mansession_get_transport(s),
 		},
@@ -1963,12 +1956,11 @@
 		.common.service    = "AMI",
 		.common.account_id = s->session->username,
 		.common.session_tv = &s->session->sessionstart_tv,
-
-		.local_addr = {
+		.common.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
 			.transport = mansession_get_transport(s),
 		},
-		.remote_addr = {
+		.common.remote_addr = {
 			.sin       = &s->session->sin,
 			.transport = mansession_get_transport(s),
 		},

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=201189&r1=201188&r2=201189
==============================================================================
--- team/group/security_events/main/security_events.c (original)
+++ team/group/security_events/main/security_events.c Tue Jun 16 17:07:36 2009
@@ -58,8 +58,8 @@
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
 		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, 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) },
+		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
+		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
@@ -81,8 +81,8 @@
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
 		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, 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) },
+		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
+		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
@@ -103,8 +103,8 @@
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
 		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, 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) },
+		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
+		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
@@ -125,8 +125,8 @@
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
 		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, 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) },
+		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
+		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
@@ -147,8 +147,8 @@
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
 		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, 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) },
+		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
+		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
@@ -169,8 +169,8 @@
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
 		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, 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) },
+		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
+		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
 		{ AST_EVENT_IE_REQUEST_TYPE, SEC_EVT_FIELD(req_no_support, request_type) },
 		{ AST_EVENT_IE_END, 0 }
 	},
@@ -192,8 +192,8 @@
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
 		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, 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) },
+		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
+		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
 		{ AST_EVENT_IE_REQUEST_TYPE, SEC_EVT_FIELD(req_not_allowed, request_type) },
 		{ AST_EVENT_IE_END, 0 }
 	},
@@ -216,8 +216,8 @@
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
 		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, 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) },
+		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
+		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
 		{ AST_EVENT_IE_AUTH_METHOD, SEC_EVT_FIELD(auth_method_not_allowed, auth_method) },
 		{ AST_EVENT_IE_END, 0 }
 	},
@@ -238,8 +238,8 @@
 		{ AST_EVENT_IE_SERVICE, SEC_EVT_FIELD(common, service) },
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, session_id) },
-		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(req_bad_format, local_addr) },
-		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(req_bad_format, remote_addr) },
+		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
+		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
 		{ AST_EVENT_IE_REQUEST_TYPE, SEC_EVT_FIELD(req_bad_format, request_type) },
 		{ AST_EVENT_IE_END, 0 }
 	},
@@ -263,8 +263,8 @@
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
 		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, 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) },
+		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
+		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
@@ -285,8 +285,8 @@
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
 		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, 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) },
+		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
+		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
 		{ AST_EVENT_IE_EXPECTED_ADDR, SEC_EVT_FIELD(unexpected_addr, expected_addr) },
 		{ AST_EVENT_IE_END, 0 }
 	},
@@ -308,8 +308,8 @@
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
 		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, 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) },
+		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
+		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
 		{ AST_EVENT_IE_CHALLENGE, SEC_EVT_FIELD(chal_resp_failed, challenge) },
 		{ AST_EVENT_IE_RESPONSE, SEC_EVT_FIELD(chal_resp_failed, response) },
 		{ AST_EVENT_IE_EXPECTED_RESPONSE, SEC_EVT_FIELD(chal_resp_failed, expected_response) },
@@ -333,8 +333,8 @@
 		{ AST_EVENT_IE_EVENT_VERSION, SEC_EVT_FIELD(common, version) },
 		{ AST_EVENT_IE_ACCOUNT_ID, SEC_EVT_FIELD(common, account_id) },
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, 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) },
+		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
+		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {

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=201189&r1=201188&r2=201189
==============================================================================
--- team/group/security_events/tests/test_security_events.c (original)
+++ team/group/security_events/tests/test_security_events.c Tue Jun 16 17:07:36 2009
@@ -84,16 +84,16 @@
 		.common.account_id = "Username",
 		.common.session_id = "Session123",
 		.common.session_tv = &session_tv,
+		.common.local_addr = {
+			.sin  = &sin_local,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
+		},
+		.common.remote_addr = {
+			.sin = &sin_remote,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
+		},
 
 		.acl_name   = "TEST_ACL",
-		.local_addr = {
-			.sin  = &sin_local,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
-		},
-		.remote_addr = {
-			.sin = &sin_remote,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
-		},
 	};
 
 	inet_aton("192.168.1.1", &sin_local.sin_addr);
@@ -122,12 +122,11 @@
 		.common.account_id = "FakeUser",
 		.common.session_id = "Session456",
 		.common.session_tv = &session_tv,
-
-		.local_addr = {
-			.sin  = &sin_local,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
-		},
-		.remote_addr = {
+		.common.local_addr = {
+			.sin  = &sin_local,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
+		},
+		.common.remote_addr = {
 			.sin = &sin_remote,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
 		},
@@ -159,12 +158,11 @@
 		.common.account_id = "Jenny",
 		.common.session_id = "8675309",
 		.common.session_tv = &session_tv,
-
-		.local_addr = {
+		.common.local_addr = {
 			.sin  = &sin_local,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_TLS,
 		},
-		.remote_addr = {
+		.common.remote_addr = {
 			.sin = &sin_remote,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_TLS,
 		},
@@ -196,12 +194,11 @@
 		.common.account_id = "Felix",
 		.common.session_id = "Session2604",
 		.common.session_tv = &session_tv,
-
-		.local_addr = {
-			.sin  = &sin_local,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
-		},
-		.remote_addr = {
+		.common.local_addr = {
+			.sin  = &sin_local,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
+		},
+		.common.remote_addr = {
 			.sin = &sin_remote,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
 		},
@@ -233,12 +230,11 @@
 		.common.account_id = "GuestAccount",
 		.common.session_id = "XYZ123",
 		.common.session_tv = &session_tv,
-
-		.local_addr = {
-			.sin  = &sin_local,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
-		},
-		.remote_addr = {
+		.common.local_addr = {
+			.sin  = &sin_local,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
+		},
+		.common.remote_addr = {
 			.sin = &sin_remote,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
 		},
@@ -270,15 +266,15 @@
 		.common.account_id = "George",
 		.common.session_id = "alksdjf023423h4lka0df",
 		.common.session_tv = &session_tv,
-
-		.local_addr = {
-			.sin  = &sin_local,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
-		},
-		.remote_addr = {
-			.sin = &sin_remote,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
-		},
+		.common.local_addr = {
+			.sin  = &sin_local,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
+		},
+		.common.remote_addr = {
+			.sin = &sin_remote,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
+		},
+
 		.request_type = "MakeMeDinner",
 	};
 
@@ -308,15 +304,15 @@
 		.common.account_id = "George",
 		.common.session_id = "alksdjf023423h4lka0df",
 		.common.session_tv = &session_tv,
-
-		.local_addr = {
-			.sin  = &sin_local,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
-		},
-		.remote_addr = {
-			.sin = &sin_remote,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
-		},
+		.common.local_addr = {
+			.sin  = &sin_local,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
+		},
+		.common.remote_addr = {
+			.sin = &sin_remote,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
+		},
+
 		.request_type = "MakeMeBreakfast",
 		.request_params = "BACONNNN!",
 	};
@@ -347,15 +343,15 @@
 		.common.account_id = "Bob",
 		.common.session_id = "010101010101",
 		.common.session_tv = &session_tv,
-
-		.local_addr = {
-			.sin  = &sin_local,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
-		},
-		.remote_addr = {
-			.sin = &sin_remote,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
-		},
+		.common.local_addr = {
+			.sin  = &sin_local,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
+		},
+		.common.remote_addr = {
+			.sin = &sin_remote,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
+		},
+
 		.auth_method = "PlainText"
 	};
 
@@ -385,15 +381,15 @@
 		.common.account_id = "Larry",
 		.common.session_id = "838383fhfhf83hf8h3f8h",
 		.common.session_tv = &session_tv,
-
-		.local_addr = {
-			.sin  = &sin_local,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
-		},
-		.remote_addr = {
-			.sin = &sin_remote,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
-		},
+		.common.local_addr = {
+			.sin  = &sin_local,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
+		},
+		.common.remote_addr = {
+			.sin = &sin_remote,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
+		},
+
 		.request_type = "CheeseBurger",
 		.request_params = "Onions,Swiss,MotorOil",
 	};
@@ -424,12 +420,11 @@
 		.common.account_id = "ValidUser",
 		.common.session_id = "Session456",
 		.common.session_tv = &session_tv,
-
-		.local_addr = {
-			.sin  = &sin_local,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
-		},
-		.remote_addr = {
+		.common.local_addr = {
+			.sin  = &sin_local,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
+		},
+		.common.remote_addr = {
 			.sin = &sin_remote,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
 		},
@@ -464,15 +459,15 @@
 		.common.account_id = "CoolUser",
 		.common.session_id = "Session789",
 		.common.session_tv = &session_tv,
-
-		.local_addr = {
-			.sin  = &sin_local,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
-		},
-		.remote_addr = {
-			.sin = &sin_remote,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
-		},
+		.common.local_addr = {
+			.sin  = &sin_local,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
+		},
+		.common.remote_addr = {
+			.sin = &sin_remote,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
+		},
+
 		.expected_addr = {
 			.sin = &sin_expected,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
@@ -508,15 +503,15 @@
 		.common.account_id = "SuperDuperUser",
 		.common.session_id = "Session1231231231",
 		.common.session_tv = &session_tv,
-
-		.local_addr = {
-			.sin  = &sin_local,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
-		},
-		.remote_addr = {
-			.sin = &sin_remote,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
-		},
+		.common.local_addr = {
+			.sin  = &sin_local,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
+		},
+		.common.remote_addr = {
+			.sin = &sin_remote,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
+		},
+
 		.challenge         = "8adf8a9sd8fas9df23ljk4",
 		.response          = "9u3jlaksdjflakjsdfoi23",
 		.expected_response = "oiafaljhadf9834luahk3k",
@@ -548,12 +543,11 @@
 		.common.account_id = "AccountIDGoesHere",
 		.common.session_id = "SessionIDGoesHere",
 		.common.session_tv = &session_tv,
-
-		.local_addr = {
-			.sin  = &sin_local,
-			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
-		},
-		.remote_addr = {
+		.common.local_addr = {
+			.sin  = &sin_local,
+			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
+		},
+		.common.remote_addr = {
 			.sin = &sin_remote,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
 		},




More information about the asterisk-commits mailing list