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

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


Author: russell
Date: Tue Jun 16 16:59:03 2009
New Revision: 201188

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=201188
Log:
Move session timeval 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=201188&r1=201187&r2=201188
==============================================================================
--- team/group/security_events/channels/chan_sip.c (original)
+++ team/group/security_events/channels/chan_sip.c Tue Jun 16 16:59:03 2009
@@ -12033,9 +12033,9 @@
 		.common.module     = AST_MODULE,
 		.common.account_id = peer->name,
 		.common.session_id = pvt->callid,
+		.common.session_tv = &pvt->session_tv,
 
 		.acl_name   = acl_name,
-		.session_tv = &pvt->session_tv,
 		.local_addr = {
 			.sin       = encode_sin_local(&sin_local, pvt),
 			.transport = security_event_transport_type(pvt->socket.type),
@@ -12060,8 +12060,8 @@
 		.common.module     = AST_MODULE,
 		.common.account_id = peer_name,
 		.common.session_id = pvt->callid,
-
-		.session_tv = &pvt->session_tv,
+		.common.session_tv = &pvt->session_tv,
+
 		.local_addr = {
 			.sin       = encode_sin_local(&sin_local, pvt),
 			.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=201188&r1=201187&r2=201188
==============================================================================
--- 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:59:03 2009
@@ -183,6 +183,11 @@
 	 * \note Always required
 	 */
 	const char *session_id;
+	/*!
+	 * \brief Session timeval, when the session started
+	 * \note Always optional
+	 */
+	const struct timeval *session_tv;
 };
 
 /*!
@@ -205,11 +210,6 @@
 	 */
 	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
 	 */
@@ -236,11 +236,6 @@
 	 */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
-	/*!
 	 * \brief Local address the request came in on
 	 * \note required
 	 */
@@ -267,11 +262,6 @@
 	 */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
-	/*!
 	 * \brief Local address the request came in on
 	 * \note required
 	 */
@@ -298,11 +288,6 @@
 	 */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
-	/*!
 	 * \brief Local address the request came in on
 	 * \note required
 	 */
@@ -329,11 +314,6 @@
 	 */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
-	/*!
 	 * \brief Local address the request came in on
 	 * \note required
 	 */
@@ -360,11 +340,6 @@
 	 */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
-	/*!
 	 * \brief Local address the request came in on
 	 * \note required
 	 */
@@ -395,11 +370,6 @@
 	 * \note Account ID required
 	 */
 	struct ast_security_event_common common;
-	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
 	/*!
 	 * \brief Local address the request came in on
 	 * \note required
@@ -437,11 +407,6 @@
 	 */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
-	/*!
 	 * \brief Local address the request came in on
 	 * \note required
 	 */
@@ -472,11 +437,6 @@
 	 * \note Account ID optional
 	 */
 	struct ast_security_event_common common;
-	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
 	/*!
 	 * \brief Local address the request came in on
 	 * \note required
@@ -514,11 +474,6 @@
 	 */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
-	/*!
 	 * \brief Local address the request came in on
 	 * \note required
 	 */
@@ -545,11 +500,6 @@
 	 */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
-	/*!
 	 * \brief Local address the request came in on
 	 * \note required
 	 */
@@ -581,11 +531,6 @@
 	 */
 	struct ast_security_event_common common;
 	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
-	/*!
 	 * \brief Local address the request came in on
 	 * \note required
 	 */
@@ -626,11 +571,6 @@
 	 * \note Account ID required
 	 */
 	struct ast_security_event_common common;
-	/*!
-	 * \brief Session timeval, when the session started
-	 * \note optional
-	 */
-	const struct timeval *session_tv;
 	/*!
 	 * \brief Local address the request came in on
 	 * \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=201188&r1=201187&r2=201188
==============================================================================
--- team/group/security_events/main/manager.c (original)
+++ team/group/security_events/main/manager.c Tue Jun 16 16:59:03 2009
@@ -1761,8 +1761,8 @@
 		.common.version    = AST_SECURITY_EVENT_INVAL_ACCT_ID_VERSION,
 		.common.service    = "AMI",
 		.common.account_id = username,
-
-		.session_tv = &s->session->sessionstart_tv,
+		.common.session_tv = &s->session->sessionstart_tv,
+
 		.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
 			.transport = mansession_get_transport(s),
@@ -1788,8 +1788,8 @@
 		.common.version    = AST_SECURITY_EVENT_FAILED_ACL_VERSION,
 		.common.service    = "AMI",
 		.common.account_id = username,
-
-		.session_tv = &s->session->sessionstart_tv,
+		.common.session_tv = &s->session->sessionstart_tv,
+
 		.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
 			.transport = mansession_get_transport(s),
@@ -1815,8 +1815,8 @@
 		.common.version    = AST_SECURITY_EVENT_INVAL_PASSWORD_VERSION,
 		.common.service    = "AMI",
 		.common.account_id = username,
-
-		.session_tv = &s->session->sessionstart_tv,
+		.common.session_tv = &s->session->sessionstart_tv,
+
 		.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
 			.transport = mansession_get_transport(s),
@@ -1842,8 +1842,8 @@
 		.common.version    = AST_SECURITY_EVENT_SUCCESSFUL_AUTH_VERSION,
 		.common.service    = "AMI",
 		.common.account_id = s->session->username,
-
-		.session_tv = &s->session->sessionstart_tv,
+		.common.session_tv = &s->session->sessionstart_tv,
+
 		.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
 			.transport = mansession_get_transport(s),
@@ -1870,8 +1870,8 @@
 		.common.version    = AST_SECURITY_EVENT_REQ_NOT_ALLOWED_VERSION,
 		.common.service    = "AMI",
 		.common.account_id = s->session->username,
-
-		.session_tv = &s->session->sessionstart_tv,
+		.common.session_tv = &s->session->sessionstart_tv,
+
 		.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
 			.transport = mansession_get_transport(s),
@@ -1901,8 +1901,8 @@
 		.common.version    = AST_SECURITY_EVENT_REQ_BAD_FORMAT_VERSION,
 		.common.service    = "AMI",
 		.common.account_id = s->session->username,
-
-		.session_tv = &s->session->sessionstart_tv,
+		.common.session_tv = &s->session->sessionstart_tv,
+
 		.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
 			.transport = mansession_get_transport(s),
@@ -1932,8 +1932,8 @@
 		.common.version    = AST_SECURITY_EVENT_CHAL_RESP_FAILED_VERSION,
 		.common.service    = "AMI",
 		.common.account_id = s->session->username,
-
-		.session_tv = &s->session->sessionstart_tv,
+		.common.session_tv = &s->session->sessionstart_tv,
+
 		.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
 			.transport = mansession_get_transport(s),
@@ -1962,8 +1962,8 @@
 		.common.version    = AST_SECURITY_EVENT_SESSION_LIMIT_VERSION,
 		.common.service    = "AMI",
 		.common.account_id = s->session->username,
-
-		.session_tv = &s->session->sessionstart_tv,
+		.common.session_tv = &s->session->sessionstart_tv,
+
 		.local_addr = {
 			.sin       = mansession_encode_sin_local(s, &sin_local),
 			.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=201188&r1=201187&r2=201188
==============================================================================
--- team/group/security_events/main/security_events.c (original)
+++ team/group/security_events/main/security_events.c Tue Jun 16 16:59:03 2009
@@ -65,7 +65,7 @@
 	.optional_ies = {
 		{ 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_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 },
@@ -87,7 +87,7 @@
 	},
 	.optional_ies = {
 		{ 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_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 },
@@ -109,7 +109,7 @@
 	},
 	.optional_ies = {
 		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
-		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(session_limit, session_tv) },
+		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 },
@@ -131,7 +131,7 @@
 	},
 	.optional_ies = {
 		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
-		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(mem_limit, session_tv) },
+		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 },
@@ -153,7 +153,7 @@
 	},
 	.optional_ies = {
 		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
-		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(load_avg, session_tv) },
+		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 },
@@ -176,7 +176,7 @@
 	},
 	.optional_ies = {
 		{ 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_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 },
@@ -199,7 +199,7 @@
 	},
 	.optional_ies = {
 		{ 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_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
 		{ AST_EVENT_IE_REQUEST_PARAMS, SEC_EVT_FIELD(req_not_allowed, request_params) },
 		{ AST_EVENT_IE_END, 0 }
 	},
@@ -223,7 +223,7 @@
 	},
 	.optional_ies = {
 		{ 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_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 },
@@ -245,7 +245,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_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
 		{ 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 }
@@ -269,7 +269,7 @@
 	},
 	.optional_ies = {
 		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
-		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(successful_auth, session_tv) },
+		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 },
@@ -292,7 +292,7 @@
 	},
 	.optional_ies = {
 		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
-		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(unexpected_addr, session_tv) },
+		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 },
@@ -317,7 +317,7 @@
 	},
 	.optional_ies = {
 		{ 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_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 },
@@ -339,7 +339,7 @@
 	},
 	.optional_ies = {
 		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
-		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(inval_password, session_tv) },
+		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, 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=201188&r1=201187&r2=201188
==============================================================================
--- team/group/security_events/tests/test_security_events.c (original)
+++ team/group/security_events/tests/test_security_events.c Tue Jun 16 16:59:03 2009
@@ -83,9 +83,9 @@
 		.common.module     = AST_MODULE,
 		.common.account_id = "Username",
 		.common.session_id = "Session123",
+		.common.session_tv = &session_tv,
 
 		.acl_name   = "TEST_ACL",
-		.session_tv = &session_tv,
 		.local_addr = {
 			.sin  = &sin_local,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
@@ -121,8 +121,8 @@
 		.common.module     = AST_MODULE,
 		.common.account_id = "FakeUser",
 		.common.session_id = "Session456",
-
-		.session_tv = &session_tv,
+		.common.session_tv = &session_tv,
+
 		.local_addr = {
 			.sin  = &sin_local,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
@@ -158,8 +158,8 @@
 		.common.module     = AST_MODULE,
 		.common.account_id = "Jenny",
 		.common.session_id = "8675309",
-
-		.session_tv = &session_tv,
+		.common.session_tv = &session_tv,
+
 		.local_addr = {
 			.sin  = &sin_local,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_TLS,
@@ -195,8 +195,8 @@
 		.common.module     = AST_MODULE,
 		.common.account_id = "Felix",
 		.common.session_id = "Session2604",
-
-		.session_tv = &session_tv,
+		.common.session_tv = &session_tv,
+
 		.local_addr = {
 			.sin  = &sin_local,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
@@ -232,8 +232,8 @@
 		.common.module     = AST_MODULE,
 		.common.account_id = "GuestAccount",
 		.common.session_id = "XYZ123",
-
-		.session_tv = &session_tv,
+		.common.session_tv = &session_tv,
+
 		.local_addr = {
 			.sin  = &sin_local,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
@@ -269,8 +269,8 @@
 		.common.module     = AST_MODULE,
 		.common.account_id = "George",
 		.common.session_id = "alksdjf023423h4lka0df",
-
-		.session_tv = &session_tv,
+		.common.session_tv = &session_tv,
+
 		.local_addr = {
 			.sin  = &sin_local,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
@@ -307,8 +307,8 @@
 		.common.module     = AST_MODULE,
 		.common.account_id = "George",
 		.common.session_id = "alksdjf023423h4lka0df",
-
-		.session_tv = &session_tv,
+		.common.session_tv = &session_tv,
+
 		.local_addr = {
 			.sin  = &sin_local,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
@@ -346,8 +346,8 @@
 		.common.module     = AST_MODULE,
 		.common.account_id = "Bob",
 		.common.session_id = "010101010101",
-
-		.session_tv = &session_tv,
+		.common.session_tv = &session_tv,
+
 		.local_addr = {
 			.sin  = &sin_local,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
@@ -384,8 +384,8 @@
 		.common.module     = AST_MODULE,
 		.common.account_id = "Larry",
 		.common.session_id = "838383fhfhf83hf8h3f8h",
-
-		.session_tv = &session_tv,
+		.common.session_tv = &session_tv,
+
 		.local_addr = {
 			.sin  = &sin_local,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
@@ -423,8 +423,8 @@
 		.common.module     = AST_MODULE,
 		.common.account_id = "ValidUser",
 		.common.session_id = "Session456",
-
-		.session_tv = &session_tv,
+		.common.session_tv = &session_tv,
+
 		.local_addr = {
 			.sin  = &sin_local,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
@@ -463,8 +463,8 @@
 		.common.module     = AST_MODULE,
 		.common.account_id = "CoolUser",
 		.common.session_id = "Session789",
-
-		.session_tv = &session_tv,
+		.common.session_tv = &session_tv,
+
 		.local_addr = {
 			.sin  = &sin_local,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_UDP,
@@ -507,8 +507,8 @@
 		.common.module     = AST_MODULE,
 		.common.account_id = "SuperDuperUser",
 		.common.session_id = "Session1231231231",
-
-		.session_tv = &session_tv,
+		.common.session_tv = &session_tv,
+
 		.local_addr = {
 			.sin  = &sin_local,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,
@@ -547,8 +547,8 @@
 		.common.module     = AST_MODULE,
 		.common.account_id = "AccountIDGoesHere",
 		.common.session_id = "SessionIDGoesHere",
-
-		.session_tv = &session_tv,
+		.common.session_tv = &session_tv,
+
 		.local_addr = {
 			.sin  = &sin_local,
 			.transport  = AST_SECURITY_EVENT_TRANSPORT_TCP,




More information about the asterisk-commits mailing list