Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 May 2008 13:16:47 GMT
From:      Diego Giagio <diego@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 141763 for review
Message-ID:  <200805171316.m4HDGluh071136@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=141763

Change 141763 by diego@diego_black on 2008/05/17 13:16:28

	Better naming conventions

Affected files ...

.. //depot/projects/soc2008/diego-audit/src/sys/contrib/pf/net/pf_ioctl.c#4 edit
.. //depot/projects/soc2008/diego-audit/src/sys/netinet/ip_fw2.c#4 edit
.. //depot/projects/soc2008/diego-audit/src/sys/netinet/ip_fw_pfil.c#3 edit
.. //depot/projects/soc2008/diego-audit/src/sys/security/audit/audit.h#7 edit
.. //depot/projects/soc2008/diego-audit/src/sys/security/audit/audit_pfil.c#3 edit

Differences ...

==== //depot/projects/soc2008/diego-audit/src/sys/contrib/pf/net/pf_ioctl.c#4 (text+ko) ====

@@ -3875,12 +3875,12 @@
 	switch(type) {
 	case MOD_LOAD:
 		error = pf_load();
-		AUDIT_CALL(audit_pfil_enable_pf(error));
+		AUDIT_CALL(audit_pf_enable(error));
 		break;
 
 	case MOD_UNLOAD:
 		error = pf_unload();
-		AUDIT_CALL(audit_pfil_disable_pf(error));
+		AUDIT_CALL(audit_pf_disable(error));
 		break;
 	default:
 		error = EINVAL;

==== //depot/projects/soc2008/diego-audit/src/sys/netinet/ip_fw2.c#4 (text+ko) ====

@@ -4210,7 +4210,7 @@
 		IPFW_WUNLOCK(&layer3_chain);
 		if (rule != NULL)
 			reap_rules(rule);
-		AUDIT_CALL(audit_pfil_flush_ipfw(error));
+		AUDIT_CALL(audit_ipfw_flush(error));
 		break;
 
 	case IP_FW_ADD:
@@ -4225,7 +4225,7 @@
 			if (!error && sopt->sopt_dir == SOPT_GET)
 				error = sooptcopyout(sopt, rule, size);
 		}
-		AUDIT_CALL(audit_pfil_addrule_ipfw(rule, error));
+		AUDIT_CALL(audit_ipfw_addrule(rule, error));
 		free(rule, M_TEMP);
 		break;
 
@@ -4255,7 +4255,7 @@
 			    ~(1<<RESVD_SET); /* set RESVD_SET always enabled */
 		else
 			error = EINVAL;
-		AUDIT_CALL(audit_pfil_delrule_ipfw(NULL /* XXX */, error));
+		AUDIT_CALL(audit_ipfw_delrule(NULL /* XXXDG */, error));
 		break;
 
 	case IP_FW_ZERO:
@@ -4281,7 +4281,7 @@
 				break;
 			error = add_table_entry(&layer3_chain, ent.tbl,
 			    ent.addr, ent.masklen, ent.value);
-			AUDIT_CALL(audit_pfil_table_ipfw(ent.tbl, error));
+			AUDIT_CALL(audit_ipfw_table(ent.tbl, error));
 		}
 		break;
 
@@ -4295,7 +4295,7 @@
 				break;
 			error = del_table_entry(&layer3_chain, ent.tbl,
 			    ent.addr, ent.masklen);
-			AUDIT_CALL(audit_pfil_table_ipfw(ent.tbl, error));
+			AUDIT_CALL(audit_ipfw_table(ent.tbl, error));
 		}
 		break;
 
@@ -4310,7 +4310,7 @@
 			IPFW_WLOCK(&layer3_chain);
 			error = flush_table(&layer3_chain, tbl);
 			IPFW_WUNLOCK(&layer3_chain);
-			AUDIT_CALL(audit_pfil_table_ipfw(tbl, error));
+			AUDIT_CALL(audit_ipfw_table(tbl, error));
 		}
 		break;
 

==== //depot/projects/soc2008/diego-audit/src/sys/netinet/ip_fw_pfil.c#3 (text+ko) ====

@@ -544,7 +544,7 @@
 			break;
 		}
 #endif
-		AUDIT_CALL(audit_pfil_enable_ipfw(err));
+		AUDIT_CALL(audit_ipfw_enable(err));
 		break;
 
 	case MOD_UNLOAD:
@@ -555,7 +555,7 @@
 			break;
 #endif
 		ipfw_destroy();
-		AUDIT_CALL(audit_pfil_disable_ipfw(err));
+		AUDIT_CALL(audit_ipfw_disable(err));
 		break;
 
 	default:

==== //depot/projects/soc2008/diego-audit/src/sys/security/audit/audit.h#7 (text) ====

@@ -126,16 +126,17 @@
 /*
  * Functions for auditing packet filter events.
  */
-void	 audit_pfil_enable_ipfw(int error);
-void	 audit_pfil_disable_ipfw(int error);
-void	 audit_pfil_enable_pf(int error);
-void	 audit_pfil_disable_pf(int error);
+void	 audit_ipfw_enable(int error);
+void	 audit_ipfw_disable(int error);
 
 struct ip_fw;
-void	 audit_pfil_addrule_ipfw(struct ip_fw *rule, int error);
-void	 audit_pfil_delrule_ipfw(struct ip_fw *rule, int error);
-void	 audit_pfil_flush_ipfw(int error);
-void	 audit_pfil_table_ipfw(u_int table, int error);
+void	 audit_ipfw_addrule(struct ip_fw *rule, int error);
+void	 audit_ipfw_delrule(struct ip_fw *rule, int error);
+void	 audit_ipfw_flush(int error);
+void	 audit_ipfw_table(u_int table, int error);
+
+void	 audit_pf_enable(int error);
+void	 audit_pf_disable(int error);
 
 /*
  * The remaining kernel functions are conditionally compiled in as they are

==== //depot/projects/soc2008/diego-audit/src/sys/security/audit/audit_pfil.c#3 (text+ko) ====

@@ -41,7 +41,7 @@
 #include <security/audit/audit_private.h>
 
 static void
-audit_pfil_enable_common(char *name, int error)
+audit_enable_common(char *name, int error)
 {
 	struct kaudit_record *ar;
 
@@ -54,7 +54,7 @@
 }
 
 static void
-audit_pfil_disable_common(char *name, int error)
+audit_disable_common(char *name, int error)
 {
 	struct kaudit_record *ar;
 
@@ -67,31 +67,19 @@
 }
 
 void
-audit_pfil_enable_ipfw(int error)
+audit_ipfw_enable(int error)
 {
-	audit_pfil_enable_common("ipfw", error);
+	audit_enable_common("ipfw", error);
 }
 
 void
-audit_pfil_disable_ipfw(int error)
+audit_ipfw_disable(int error)
 {
-	audit_pfil_disable_common("ipfw", error);
+	audit_disable_common("ipfw", error);
 }
 
 void
-audit_pfil_enable_pf(int error)
-{
-	audit_pfil_enable_common("pf", error);
-}
-
-void
-audit_pfil_disable_pf(int error)
-{
-	audit_pfil_disable_common("pf", error);
-}
-
-void
-audit_pfil_addrule_ipfw(struct ip_fw *rule, int error)
+audit_ipfw_addrule(struct ip_fw *rule, int error)
 {
 	struct kaudit_record *ar;
 
@@ -105,7 +93,7 @@
 }
 
 void
-audit_pfil_delrule_ipfw(struct ip_fw *rule, int error)
+audit_ipfw_delrule(struct ip_fw *rule, int error)
 {
 	struct kaudit_record *ar;
 
@@ -119,7 +107,7 @@
 }
 
 void
-audit_pfil_flush_ipfw(int error)
+audit_ipfw_flush(int error)
 {
 	struct kaudit_record *ar;
 
@@ -133,7 +121,7 @@
 }
 
 void
-audit_pfil_table_ipfw(u_int32_t table, int error)
+audit_ipfw_table(u_int32_t table, int error)
 {
 	struct kaudit_record *ar;
 
@@ -146,3 +134,15 @@
 	audit_commit(ar, error, 0);
 }
 
+void
+audit_pf_enable(int error)
+{
+	audit_enable_common("pf", error);
+}
+
+void
+audit_pf_disable(int error)
+{
+	audit_disable_common("pf", error);
+}
+



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805171316.m4HDGluh071136>