svn commit: r197913 - user/eri/pf45/head/contrib/pf/pfctl

Ermal Luçi eri at FreeBSD.org
Fri Oct 9 19:23:13 UTC 2009


Author: eri
Date: Fri Oct  9 19:23:12 2009
New Revision: 197913
URL: http://svn.freebsd.org/changeset/base/197913

Log:
  Actually make pfctl compile.

Modified:
  user/eri/pf45/head/contrib/pf/pfctl/parse.y
  user/eri/pf45/head/contrib/pf/pfctl/pf_print_state.c
  user/eri/pf45/head/contrib/pf/pfctl/pfctl.c
  user/eri/pf45/head/contrib/pf/pfctl/pfctl.h
  user/eri/pf45/head/contrib/pf/pfctl/pfctl_altq.c

Modified: user/eri/pf45/head/contrib/pf/pfctl/parse.y
==============================================================================
--- user/eri/pf45/head/contrib/pf/pfctl/parse.y	Fri Oct  9 19:01:26 2009	(r197912)
+++ user/eri/pf45/head/contrib/pf/pfctl/parse.y	Fri Oct  9 19:23:12 2009	(r197913)
@@ -1171,7 +1171,7 @@ scrub_opt	: NODF	{
 			scrub_opts.randomid = 1;
 		}
 		| RTABLE NUMBER				{
-			if ($2 < 0 || $2 > RT_TABLEID_MAX) {
+			if ($2 < 0 /* || $2 > RT_TABLEID_MAX */) {
 				yyerror("invalid rtable id");
 				YYERROR;
 			}
@@ -1319,7 +1319,7 @@ antispoof_opt	: label	{
 			antispoof_opts.label = $1;
 		}
 		| RTABLE NUMBER				{
-			if ($2 < 0 || $2 > RT_TABLEID_MAX) {
+			if ($2 < 0 /* || $2 > RT_TABLEID_MAX */ ) {
 				yyerror("invalid rtable id");
 				YYERROR;
 			}
@@ -2354,7 +2354,7 @@ filter_opt	: USER uids {
 				filter_opts.prob = 1;
 		}
 		| RTABLE NUMBER				{
-			if ($2 < 0 || $2 > RT_TABLEID_MAX) {
+			if ($2 < 0 /* || $2 > RT_TABLEID_MAX */ ) {
 				yyerror("invalid rtable id");
 				YYERROR;
 			}
@@ -4161,7 +4161,7 @@ tagged		: /* empty */		{ $$.neg = 0; $$.
 
 rtable		: /* empty */		{ $$ = -1; }
 		| RTABLE NUMBER		{
-			if ($2 < 0 || $2 > RT_TABLEID_MAX) {
+			if ($2 < 0 /* || $2 > RT_TABLEID_MAX */ ) {
 				yyerror("invalid rtable id");
 				YYERROR;
 			}

Modified: user/eri/pf45/head/contrib/pf/pfctl/pf_print_state.c
==============================================================================
--- user/eri/pf45/head/contrib/pf/pfctl/pf_print_state.c	Fri Oct  9 19:01:26 2009	(r197912)
+++ user/eri/pf45/head/contrib/pf/pfctl/pf_print_state.c	Fri Oct  9 19:23:12 2009	(r197913)
@@ -35,6 +35,10 @@ __FBSDID("$FreeBSD$");
 
 #include <sys/types.h>
 #include <sys/socket.h>
+#ifdef __FreeBSD__
+#include <sys/endian.h>
+#define	betoh64	be64toh
+#endif
 #include <net/if.h>
 #define TCPSTATES
 #include <netinet/tcp_fsm.h>

Modified: user/eri/pf45/head/contrib/pf/pfctl/pfctl.c
==============================================================================
--- user/eri/pf45/head/contrib/pf/pfctl/pfctl.c	Fri Oct  9 19:01:26 2009	(r197912)
+++ user/eri/pf45/head/contrib/pf/pfctl/pfctl.c	Fri Oct  9 19:23:12 2009	(r197913)
@@ -39,6 +39,10 @@ __FBSDID("$FreeBSD$");
 #include <sys/socket.h>
 #include <sys/stat.h>
 
+#ifdef __FreeBSD__
+#include <sys/endian.h>
+#endif
+
 #include <net/if.h>
 #include <netinet/in.h>
 #include <net/pfvar.h>
@@ -59,10 +63,6 @@ __FBSDID("$FreeBSD$");
 #include "pfctl_parser.h"
 #include "pfctl.h"
 
- #ifdef __FreeBSD__
- #define HTONL(x)       (x) = htonl((__uint32_t)(x))
- #endif
-
 void	 usage(void);
 int	 pfctl_enable(int, int);
 int	 pfctl_disable(int, int);
@@ -1583,7 +1583,11 @@ pfctl_init_options(struct pfctl *pf)
 	pf->limit[PF_LIMIT_TABLE_ENTRIES] = PFR_KENTRY_HIWAT;
 
 	mib[0] = CTL_HW;
+#ifdef __FreeBSD__
+	mib[1] = HW_PHYSMEM;
+#else
 	mib[1] = HW_PHYSMEM64;
+#endif
 	size = sizeof(mem);
 	if (sysctl(mib, 2, &mem, &size, NULL, 0) == -1)
 		err(1, "sysctl");

Modified: user/eri/pf45/head/contrib/pf/pfctl/pfctl.h
==============================================================================
--- user/eri/pf45/head/contrib/pf/pfctl/pfctl.h	Fri Oct  9 19:01:26 2009	(r197912)
+++ user/eri/pf45/head/contrib/pf/pfctl/pfctl.h	Fri Oct  9 19:23:12 2009	(r197913)
@@ -88,6 +88,7 @@ FILE	*pfctl_fopen(const char *, const ch
 #ifdef __FreeBSD__
 extern int altqsupport;
 extern int dummynetsupport;
+ #define HTONL(x)       (x) = htonl((__uint32_t)(x))
 #endif
 
 #ifndef DEFAULT_PRIORITY

Modified: user/eri/pf45/head/contrib/pf/pfctl/pfctl_altq.c
==============================================================================
--- user/eri/pf45/head/contrib/pf/pfctl/pfctl_altq.c	Fri Oct  9 19:01:26 2009	(r197912)
+++ user/eri/pf45/head/contrib/pf/pfctl/pfctl_altq.c	Fri Oct  9 19:23:12 2009	(r197913)
@@ -1095,12 +1095,12 @@ rate2str(double rate)
 	return (buf);
 }
 
--#ifdef __FreeBSD__
--/*
-- * XXX
-- * FreeBSD does not have SIOCGIFDATA.
-- * To emulate this, DIOCGIFSPEED ioctl added to pf.
-- */
+#ifdef __FreeBSD__
+/*
+ * XXX
+ * FreeBSD does not have SIOCGIFDATA.
+ * To emulate this, DIOCGIFSPEED ioctl added to pf.
+ */
 u_int32_t
 getifspeed(int pfdev, char *ifname)
 {


More information about the svn-src-user mailing list