Source-Changes-HG archive

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

[src/netbsd-10]: src/share/man/man4 Pull up following revision(s) (requested ...



details:   https://anonhg.NetBSD.org/src/rev/e4b55293c05b
branches:  netbsd-10
changeset: 377480:e4b55293c05b
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Jul 13 09:07:37 2023 +0000

description:
Pull up following revision(s) (requested by gutteridge in ticket #230):

        share/man/man4/npflog.4: revision 1.1
        share/man/man4/npflog.4: revision 1.2
        share/man/man4/Makefile: revision 1.732
        distrib/sets/lists/man/mi: revision 1.1762

npflog.4: add a man page for the npflog device

Addresses PR misc/57441 from Taylor R Campbell. (Not yet hooked into
source sets, will be done separately.)
(Borrows heavily from the equivalent pflog.4 man page already in tree,
and so retains the original copyright attribution as well.)

npflog.4: add and adjust some details

Add details about the header structure (though the if_npflog.h file is
not presently installed and has a _KERNEL guard). Also adjust some
sentences (requested by riastradh@), and include the original OpenBSD
RCS ID, since much of this content shares that origin.

Add npflog.4 to sets

diffstat:

 distrib/sets/lists/man/mi |    5 +-
 share/man/man4/Makefile   |    4 +-
 share/man/man4/npflog.4   |  102 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 108 insertions(+), 3 deletions(-)

diffs (157 lines):

diff -r 60598007d56c -r e4b55293c05b distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Sun Jul 09 13:40:15 2023 +0000
+++ b/distrib/sets/lists/man/mi Thu Jul 13 09:07:37 2023 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1757 2022/11/21 22:01:32 christos Exp $
+# $NetBSD: mi,v 1.1757.2.1 2023/07/13 09:07:37 martin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1548,6 +1548,7 @@
 ./usr/share/man/cat4/nfsmbc.0                  man-sys-catman          .cat
 ./usr/share/man/cat4/njata.0                   man-sys-catman          .cat
 ./usr/share/man/cat4/njs.0                     man-sys-catman          .cat
+./usr/share/man/cat4/npflog.0                  man-sys-catman          .cat
 ./usr/share/man/cat4/ns.0                      man-obsolete            obsolete
 ./usr/share/man/cat4/nsclpcsio.0               man-sys-catman          .cat
 ./usr/share/man/cat4/nside.0                   man-sys-catman          .cat
@@ -4778,6 +4779,7 @@
 ./usr/share/man/html4/nfsmbc.html              man-sys-htmlman         html
 ./usr/share/man/html4/njata.html               man-sys-htmlman         html
 ./usr/share/man/html4/njs.html                 man-sys-htmlman         html
+./usr/share/man/html4/npflog.html              man-sys-htmlman         html
 ./usr/share/man/html4/nsclpcsio.html           man-sys-htmlman         html
 ./usr/share/man/html4/nside.html               man-sys-htmlman         html
 ./usr/share/man/html4/nsmb.html                        man-obsolete            obsolete
@@ -7862,6 +7864,7 @@
 ./usr/share/man/man4/nfsmbc.4                  man-sys-man             .man
 ./usr/share/man/man4/njata.4                   man-sys-man             .man
 ./usr/share/man/man4/njs.4                     man-sys-man             .man
+./usr/share/man/man4/npflog.4                  man-sys-man             .man
 ./usr/share/man/man4/ns.4                      man-obsolete            obsolete
 ./usr/share/man/man4/nsclpcsio.4               man-sys-man             .man
 ./usr/share/man/man4/nside.4                   man-sys-man             .man
diff -r 60598007d56c -r e4b55293c05b share/man/man4/Makefile
--- a/share/man/man4/Makefile   Sun Jul 09 13:40:15 2023 +0000
+++ b/share/man/man4/Makefile   Thu Jul 13 09:07:37 2023 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.730 2022/11/21 21:24:00 brad Exp $
+#      $NetBSD: Makefile,v 1.730.2.1 2023/07/13 09:07:37 martin Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/18/93
 
 MAN=   aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -42,7 +42,7 @@ MAN=  aac.4 ac97.4 acardide.4 aceride.4 a
        mcx.4 md.4 mfb.4 mfi.4 mfii.4 mhzc.4 \
        micphy.4 midi.4 mii.4 mk48txx.4 mlx.4 mly.4 mpls.4 mpii.4 mpt.4 \
        mpu.4 mtd.4 mtio.4 msm6242b.4 multicast.4 mvsata.4 \
-       nadb.4 ne.4 neo.4 netintro.4 nfe.4 nfsmb.4 njata.4 njs.4 \
+       nadb.4 ne.4 neo.4 netintro.4 nfe.4 nfsmb.4 njata.4 njs.4 npflog.4 \
        nsclpcsio.4 nside.4 nsphy.4 nsphyter.4 ntwoc.4 null.4 \
        nvme.4 nvmm.4 \
        oak.4 oosiop.4 opl.4 options.4 optiide.4 osiop.4 otus.4 \
diff -r 60598007d56c -r e4b55293c05b share/man/man4/npflog.4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man4/npflog.4   Thu Jul 13 09:07:37 2023 +0000
@@ -0,0 +1,102 @@
+.\" $NetBSD: npflog.4,v 1.2.2.2 2023/07/13 09:07:37 martin Exp $
+.\" $OpenBSD: pflog.4,v 1.10 2007/05/31 19:19:51 jmc Exp $
+.\"
+.\" Copyright (c) 2001 Tobias Weingartner
+.\" All rights reserved.
+.\"
+.\" Copyright (c) 2023 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" Portions of this documentation are derived from text contributed by
+.\" David H. Gutteridge.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd June 29, 2023
+.Dt NPFLOG 4
+.Os
+.Sh NAME
+.Nm npflog
+.Nd packet filter logging interface
+.Sh SYNOPSIS
+.Cd "pseudo-device npflog"
+.Sh DESCRIPTION
+The
+.Nm 
+interface is a pseudo-device which makes visible all packets logged by
+the
+.Xr npf 7
+packet filter.
+Logged packets can be monitored in real time by invoking
+.Xr tcpdump 8
+on the
+.Nm
+interface, or stored to disk using
+.Xr npfd 8 .
+.Pp
+The npflog0 interface is created automatically at boot if
+.Xr npf 7
+is enabled;
+further instances can be created using
+.Xr ifconfig 8 .
+.Pp
+Each packet retrieved on this interface has a header associated
+that presently matches the format used by
+.Xr pf 4 .
+This header documents the address family, interface name, rule
+number, reason, action, and direction of the packet that was logged.
+This structure looks like:
+.Bd -literal -offset indent
+struct npfloghdr {
+       uint8_t         length;
+       sa_family_t     af;
+       uint8_t         action;
+       uint8_t         reason;
+       char            ifname[IFNAMSIZ];
+       char            ruleset[NPFLOG_RULESET_NAME_SIZE];
+       uint32_t        rulenr;
+       uint32_t        subrulenr;
+       uint32_t        uid;
+       uint32_t        pid;
+       uint32_t        rule_uid;
+       uint32_t        rule_pid;
+       uint8_t         dir;
+       uint8_t         pad[3];
+};
+.Ed
+.Sh EXAMPLES
+Monitor all packets logged on the default interface:
+.Bd -literal -offset indent
+# tcpdump -n -e -tttt -i npflog0
+.Ed
+.Sh SEE ALSO
+.Xr inet 4 ,
+.Xr inet6 4 ,
+.Xr netintro 4 ,
+.Xr npf 7 ,
+.Xr ifconfig 8 ,
+.Xr npfd 8 ,
+.Xr tcpdump 8
+.Sh HISTORY
+The
+.Nm
+device first appeared in
+.Nx 6.0 .



Home | Main Index | Thread Index | Old Index