From owner-svn-src-user@FreeBSD.ORG Fri Oct 9 19:23:13 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E9E5106568F; Fri, 9 Oct 2009 19:23:13 +0000 (UTC) (envelope-from eri@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E3758FC15; Fri, 9 Oct 2009 19:23:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n99JNDVe061720; Fri, 9 Oct 2009 19:23:13 GMT (envelope-from eri@svn.freebsd.org) Received: (from eri@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n99JNDmZ061714; Fri, 9 Oct 2009 19:23:13 GMT (envelope-from eri@svn.freebsd.org) Message-Id: <200910091923.n99JNDmZ061714@svn.freebsd.org> From: Ermal Luçi Date: Fri, 9 Oct 2009 19:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197913 - user/eri/pf45/head/contrib/pf/pfctl X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2009 19:23:13 -0000 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 #include +#ifdef __FreeBSD__ +#include +#define betoh64 be64toh +#endif #include #define TCPSTATES #include 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 #include +#ifdef __FreeBSD__ +#include +#endif + #include #include #include @@ -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) {