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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 9 07:35:04 CDT 2009


Author: russell
Date: Tue Jun  9 07:35:01 2009
New Revision: 199735

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=199735
Log:
Rename "call limit" security event to more generic "session limit"

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

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=199735&r1=199734&r2=199735
==============================================================================
--- team/group/security_events/include/asterisk/security_events_defs.h (original)
+++ team/group/security_events/include/asterisk/security_events_defs.h Tue Jun  9 07:35:01 2009
@@ -59,12 +59,12 @@
 	 */
 	AST_SECURITY_EVENT_INVAL_ACCT_ID,
 	/*!
-	 * \brief Call limit reached
+	 * \brief Session limit reached
 	 *
-	 * A request has been denied because a configured call limit has been
-	 * reached.
-	 */
-	AST_SECURITY_EVENT_CALL_LIMIT,
+	 * A request has been denied because a configured session limit has been
+	 * reached, such as a call limit.
+	 */
+	AST_SECURITY_EVENT_SESSION_LIMIT,
 	/*!
 	 * \brief Memory limit reached
 	 *
@@ -261,14 +261,14 @@
 };
 
 /*!
- * \brief Request denied because of a call limit
- */
-struct ast_security_event_call_limit {
-	/*!
-	 * \brief Event descriptor version
-	 * \note This _must_ be changed if this event descriptor is changed.
-	 */
-	#define AST_SECURITY_EVENT_CALL_LIMIT_VERSION 1
+ * \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;
 	/*!

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=199735&r1=199734&r2=199735
==============================================================================
--- team/group/security_events/main/security_events.c (original)
+++ team/group/security_events/main/security_events.c Tue Jun  9 07:35:01 2009
@@ -92,24 +92,24 @@
 	},
 },
 
-[AST_SECURITY_EVENT_CALL_LIMIT] = {
-	.name     = "CallLimit",
-	.version  = AST_SECURITY_EVENT_CALL_LIMIT_VERSION,
-	.severity = AST_SECURITY_EVENT_SEVERITY_ERROR,
-	.required_ies = {
-		{ AST_EVENT_IE_EVENT_TV, 0 },
-		{ 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(call_limit, account_id) },
-		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(call_limit, session_id) },
-		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(call_limit, local_addr) },
-		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(call_limit, remote_addr) },
-		{ AST_EVENT_IE_END, 0 }
-	},
-	.optional_ies = {
-		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(call_limit, module) },
-		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(call_limit, session_tv) },
+[AST_SECURITY_EVENT_SESSION_LIMIT] = {
+	.name     = "SessionLimit",
+	.version  = AST_SECURITY_EVENT_SESSION_LIMIT_VERSION,
+	.severity = AST_SECURITY_EVENT_SEVERITY_ERROR,
+	.required_ies = {
+		{ AST_EVENT_IE_EVENT_TV, 0 },
+		{ 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_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) },
+		{ AST_EVENT_IE_END, 0 }
+	},
+	.optional_ies = {
+		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(session_limit, module) },
+		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(session_limit, session_tv) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 },

Modified: team/group/security_events/security_events.txt
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/security_events/security_events.txt?view=diff&rev=199735&r1=199734&r2=199735
==============================================================================
--- team/group/security_events/security_events.txt (original)
+++ team/group/security_events/security_events.txt Tue Jun  9 07:35:01 2009
@@ -147,7 +147,7 @@
   (+) Request parameters
   DevNotes: defined, has test code
 
-Call Limit Reached
+Session Limit Reached (such as a call limit)
   -> everything from inval account ID
   DevNotes: defined, has test code
 
@@ -210,7 +210,7 @@
 
 IE: SecurityEvent
 Content: This is the security event sub-type.
-Values: FailedACL, InvalidAccountID, CallLimit, MemoryLimit, LoadAverageLimit,
+Values: FailedACL, InvalidAccountID, SessionLimit, MemoryLimit, LoadAverageLimit,
         RequestNotSupported, RequestNotAllowed, AuthMethodNotAllowed,
         ReqBadFormat, UnexpectedAddress, ChallengeResponseFailed,
         InvalidPassword

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=199735&r1=199734&r2=199735
==============================================================================
--- team/group/security_events/tests/test_security_events.c (original)
+++ team/group/security_events/tests/test_security_events.c Tue Jun  9 07:35:01 2009
@@ -38,7 +38,7 @@
 
 static void evt_gen_failed_acl(void);
 static void evt_gen_inval_acct_id(void);
-static void evt_gen_call_limit(void);
+static void evt_gen_session_limit(void);
 static void evt_gen_mem_limit(void);
 static void evt_gen_load_avg(void);
 static void evt_gen_req_no_support(void);
@@ -54,7 +54,7 @@
 static const evt_generator evt_generators[AST_SECURITY_EVENT_NUM_TYPES] = {
 	[AST_SECURITY_EVENT_FAILED_ACL]              = evt_gen_failed_acl,
 	[AST_SECURITY_EVENT_INVAL_ACCT_ID]           = evt_gen_inval_acct_id,
-	[AST_SECURITY_EVENT_CALL_LIMIT]              = evt_gen_call_limit,
+	[AST_SECURITY_EVENT_SESSION_LIMIT]           = evt_gen_session_limit,
 	[AST_SECURITY_EVENT_MEM_LIMIT]               = evt_gen_mem_limit,
 	[AST_SECURITY_EVENT_LOAD_AVG]                = evt_gen_load_avg,
 	[AST_SECURITY_EVENT_REQ_NO_SUPPORT]          = evt_gen_req_no_support,
@@ -142,18 +142,18 @@
 	ast_security_event_report(AST_SEC_EVT(&inval_acct_id));
 }
 
-static void evt_gen_call_limit(void)
-{
-	struct sockaddr_in sin_local = {
-		.sin_family = AF_INET
-	};
-	struct sockaddr_in sin_remote = {
-		.sin_family = AF_INET
-	};
-	struct timeval session_tv = ast_tvnow();
-	struct ast_security_event_call_limit call_limit = {
-		.common.event_type = AST_SECURITY_EVENT_CALL_LIMIT,
-		.common.version    = AST_SECURITY_EVENT_CALL_LIMIT_VERSION,
+static void evt_gen_session_limit(void)
+{
+	struct sockaddr_in sin_local = {
+		.sin_family = AF_INET
+	};
+	struct sockaddr_in sin_remote = {
+		.sin_family = AF_INET
+	};
+	struct timeval session_tv = ast_tvnow();
+	struct ast_security_event_session_limit session_limit = {
+		.common.event_type = AST_SECURITY_EVENT_SESSION_LIMIT,
+		.common.version    = AST_SECURITY_EVENT_SESSION_LIMIT_VERSION,
 		.common.service    = "TEST",
 
 		.module     = AST_MODULE,
@@ -176,8 +176,7 @@
 	inet_aton("10.5.4.2", &sin_remote.sin_addr);
 	sin_remote.sin_port = htons(3333);
 
-	ast_security_event_report(AST_SEC_EVT(&call_limit));
-
+	ast_security_event_report(AST_SEC_EVT(&session_limit));
 }
 
 static void evt_gen_mem_limit(void)




More information about the asterisk-commits mailing list