Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/npf/npfctl npfctl: remove some n-code leftovers, fi...



details:   https://anonhg.NetBSD.org/src/rev/d520297287c0
branches:  trunk
changeset: 790108:d520297287c0
user:      rmind <rmind%NetBSD.org@localhost>
date:      Thu Sep 19 12:05:11 2013 +0000

description:
npfctl: remove some n-code leftovers, fix the build, update the man pages.

diffstat:

 usr.sbin/npf/npfctl/npf.conf.5  |   8 ++++----
 usr.sbin/npf/npfctl/npf_build.c |   6 +++---
 usr.sbin/npf/npfctl/npfctl.8    |  10 +++++-----
 usr.sbin/npf/npfctl/npfctl.c    |  16 ++--------------
 usr.sbin/npf/npfctl/npfctl.h    |   3 +--
 5 files changed, 15 insertions(+), 28 deletions(-)

diffs (153 lines):

diff -r d44fbcacb1a6 -r d520297287c0 usr.sbin/npf/npfctl/npf.conf.5
--- a/usr.sbin/npf/npfctl/npf.conf.5    Thu Sep 19 12:04:36 2013 +0000
+++ b/usr.sbin/npf/npfctl/npf.conf.5    Thu Sep 19 12:05:11 2013 +0000
@@ -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 @@
 .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 .
diff -r d44fbcacb1a6 -r d520297287c0 usr.sbin/npf/npfctl/npf_build.c
--- a/usr.sbin/npf/npfctl/npf_build.c   Thu Sep 19 12:04:36 2013 +0000
+++ b/usr.sbin/npf/npfctl/npf_build.c   Thu Sep 19 12:05:11 2013 +0000
@@ -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_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
diff -r d44fbcacb1a6 -r d520297287c0 usr.sbin/npf/npfctl/npfctl.8
--- a/usr.sbin/npf/npfctl/npfctl.8      Thu Sep 19 12:04:36 2013 +0000
+++ b/usr.sbin/npf/npfctl/npfctl.8      Thu Sep 19 12:05:11 2013 +0000
@@ -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 @@
 .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 @@
 .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 .
diff -r d44fbcacb1a6 -r d520297287c0 usr.sbin/npf/npfctl/npfctl.c
--- a/usr.sbin/npf/npfctl/npfctl.c      Thu Sep 19 12:04:36 2013 +0000
+++ b/usr.sbin/npf/npfctl/npfctl.c      Thu Sep 19 12:05:11 2013 +0000
@@ -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 @@
 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);
        }
diff -r d44fbcacb1a6 -r d520297287c0 usr.sbin/npf/npfctl/npfctl.h
--- a/usr.sbin/npf/npfctl/npfctl.h      Thu Sep 19 12:04:36 2013 +0000
+++ b/usr.sbin/npf/npfctl/npfctl.h      Thu Sep 19 12:05:11 2013 +0000
@@ -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



Home | Main Index | Thread Index | Old Index