Module Name: src Committed By: rmind Date: Thu Sep 19 12:05:11 UTC 2013
Modified Files: src/usr.sbin/npf/npfctl: npf.conf.5 npf_build.c npfctl.8 npfctl.c npfctl.h Log Message: npfctl: remove some n-code leftovers, fix the build, update the man pages. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/npf/npfctl/npf.conf.5 cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/npf/npfctl/npf_build.c cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/npf/npfctl/npfctl.8 cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/npf/npfctl/npfctl.c cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/npf/npfctl/npfctl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/npf/npfctl/npf.conf.5 diff -u src/usr.sbin/npf/npfctl/npf.conf.5:1.29 src/usr.sbin/npf/npfctl/npf.conf.5:1.30 --- src/usr.sbin/npf/npfctl/npf.conf.5:1.29 Sun Mar 10 21:55:40 2013 +++ src/usr.sbin/npf/npfctl/npf.conf.5 Thu Sep 19 12:05:11 2013 @@ -1,4 +1,4 @@ -.\" $NetBSD: npf.conf.5,v 1.29 2013/03/10 21:55:40 christos Exp $ +.\" $NetBSD: npf.conf.5,v 1.30 2013/09/19 12:05:11 rmind Exp $ .\" .\" Copyright (c) 2009-2013 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 10, 2013 +.Dd September 19, 2013 .Dt NPF.CONF 5 .Os .Sh NAME @@ -315,8 +315,8 @@ group (default) { .Ed .\" ----- .Sh SEE ALSO -.Xr npfctl 8 , -.Xr npf_ncode 9 +.Xr bpf 4 , +.Xr npfctl 8 .Sh HISTORY NPF first appeared in .Nx 6.0 . Index: src/usr.sbin/npf/npfctl/npf_build.c diff -u src/usr.sbin/npf/npfctl/npf_build.c:1.25 src/usr.sbin/npf/npfctl/npf_build.c:1.26 --- src/usr.sbin/npf/npfctl/npf_build.c:1.25 Thu Sep 19 01:04:45 2013 +++ src/usr.sbin/npf/npfctl/npf_build.c Thu Sep 19 12:05:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: npf_build.c,v 1.25 2013/09/19 01:04:45 rmind Exp $ */ +/* $NetBSD: npf_build.c,v 1.26 2013/09/19 12:05:11 rmind Exp $ */ /*- * Copyright (c) 2011-2013 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: npf_build.c,v 1.25 2013/09/19 01:04:45 rmind Exp $"); +__RCSID("$NetBSD: npf_build.c,v 1.26 2013/09/19 12:05:11 rmind Exp $"); #include <sys/types.h> #include <sys/ioctl.h> @@ -463,7 +463,7 @@ npfctl_build_group_end(void) } /* - * npfctl_build_rule: create a rule, build n-code from filter options, + * npfctl_build_rule: create a rule, build byte-code from filter options, * if any, and insert into the ruleset of current group, or set the rule. */ void Index: src/usr.sbin/npf/npfctl/npfctl.8 diff -u src/usr.sbin/npf/npfctl/npfctl.8:1.13 src/usr.sbin/npf/npfctl/npfctl.8:1.14 --- src/usr.sbin/npf/npfctl/npfctl.8:1.13 Sat Feb 16 21:11:15 2013 +++ src/usr.sbin/npf/npfctl/npfctl.8 Thu Sep 19 12:05:11 2013 @@ -1,4 +1,4 @@ -.\" $NetBSD: npfctl.8,v 1.13 2013/02/16 21:11:15 rmind Exp $ +.\" $NetBSD: npfctl.8,v 1.14 2013/09/19 12:05:11 rmind Exp $ .\" .\" Copyright (c) 2009-2013 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 16, 2013 +.Dd September 19, 2013 .Dt NPFCTL 8 .Os .Sh NAME @@ -154,7 +154,7 @@ Administrator may want to start packet i .It Ic stats Print various statistics. .It Ic debug -Process the configuration file, print the n-code of each rule +Process the configuration file, print the byte-code of each rule and dump the raw configuration. This is primarily for developer use. .El @@ -189,8 +189,8 @@ Addition and removal of entries in the t .Ed .\" ----- .Sh SEE ALSO -.Xr npf.conf 5 , -.Xr npf_ncode 9 +.Xr bpf 4 , +.Xr npf.conf 5 .Sh HISTORY NPF first appeared in .Nx 6.0 . Index: src/usr.sbin/npf/npfctl/npfctl.c diff -u src/usr.sbin/npf/npfctl/npfctl.c:1.38 src/usr.sbin/npf/npfctl/npfctl.c:1.39 --- src/usr.sbin/npf/npfctl/npfctl.c:1.38 Thu Sep 19 01:04:45 2013 +++ src/usr.sbin/npf/npfctl/npfctl.c Thu Sep 19 12:05:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: npfctl.c,v 1.38 2013/09/19 01:04:45 rmind Exp $ */ +/* $NetBSD: npfctl.c,v 1.39 2013/09/19 12:05:11 rmind Exp $ */ /*- * Copyright (c) 2009-2013 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: npfctl.c,v 1.38 2013/09/19 01:04:45 rmind Exp $"); +__RCSID("$NetBSD: npfctl.c,v 1.39 2013/09/19 12:05:11 rmind Exp $"); #include <sys/ioctl.h> #include <sys/stat.h> @@ -211,23 +211,11 @@ npfctl_print_stats(int fd) void npfctl_print_error(const nl_error_t *ne) { - static const char *ncode_errors[] = { - [-NPF_ERR_OPCODE] = "invalid instruction", - [-NPF_ERR_JUMP] = "invalid jump", - [-NPF_ERR_REG] = "invalid register", - [-NPF_ERR_INVAL] = "invalid argument value", - [-NPF_ERR_RANGE] = "processing out of range" - }; - const int nc_err = ne->ne_ncode_error; const char *srcfile = ne->ne_source_file; if (srcfile) { warnx("source %s line %d", srcfile, ne->ne_source_line); } - if (nc_err) { - warnx("n-code error (%d): %s at offset 0x%x", - nc_err, ncode_errors[-nc_err], ne->ne_ncode_errat); - } if (ne->ne_id) { warnx("object: %d", ne->ne_id); } Index: src/usr.sbin/npf/npfctl/npfctl.h diff -u src/usr.sbin/npf/npfctl/npfctl.h:1.31 src/usr.sbin/npf/npfctl/npfctl.h:1.32 --- src/usr.sbin/npf/npfctl/npfctl.h:1.31 Thu Sep 19 01:49:07 2013 +++ src/usr.sbin/npf/npfctl/npfctl.h Thu Sep 19 12:05:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: npfctl.h,v 1.31 2013/09/19 01:49:07 rmind Exp $ */ +/* $NetBSD: npfctl.h,v 1.32 2013/09/19 12:05:11 rmind Exp $ */ /*- * Copyright (c) 2009-2013 The NetBSD Foundation, Inc. @@ -39,7 +39,6 @@ #include <util.h> #define NPF_BPFCOP -#include <net/npf_ncode.h> #include <net/npf.h> #define _NPF_PRIVATE