summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/main.c
diff options
context:
space:
mode:
authormichele <michele@openbsd.org>2009-10-04 16:08:37 +0000
committermichele <michele@openbsd.org>2009-10-04 16:08:37 +0000
commitd85f7bc16ff4db5aedffd92a6397af819385204f (patch)
tree598f4848e32d35b40351aebd52fcfc6ee34fbd98 /usr.bin/netstat/main.c
parentWhen IKE is operating in dynamic mode and no srcid is given, the hostname (diff)
downloadwireguard-openbsd-d85f7bc16ff4db5aedffd92a6397af819385204f.tar.xz
wireguard-openbsd-d85f7bc16ff4db5aedffd92a6397af819385204f.zip
Add (again) support for divert sockets. They allow you to:
- queue packets from pf(4) to a userspace application - reinject packets from the application into the kernel stack. The divert socket can be bound to a special "divert port" and will receive every packet diverted to that port by pf(4). The pf syntax is pretty simple, e.g.: pass on em0 inet proto tcp from any to any port 80 divert-packet port 1 A lot of discussion have happened since my last commit that resulted in many changes and improvements. I would *really* like to thank everyone who took part in the discussion especially canacar@ who spotted out which are the limitations of this approach. OpenBSD divert(4) is meant to be compatible with software running on top of FreeBSD's divert sockets even though they are pretty different and will become even more with time. discusses with many, but mainly reyk@ canacar@ deraadt@ dlg@ claudio@ beck@ tested by reyk@ and myself ok reyk@ claudio@ beck@ manpage help and ok by jmc@
Diffstat (limited to 'usr.bin/netstat/main.c')
-rw-r--r--usr.bin/netstat/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 8662a82be53..4fe7e9c64c6 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.79 2009/05/07 15:51:53 claudio Exp $ */
+/* $OpenBSD: main.c,v 1.80 2009/10/04 16:08:37 michele Exp $ */
/* $NetBSD: main.c,v 1.9 1996/05/07 02:55:02 thorpej Exp $ */
/*
@@ -87,6 +87,8 @@ struct nlist nl[] = {
{ "_rawcbtable" },
#define N_RAWIP6TABLE 14
{ "_rawin6pcbtable" },
+#define N_DIVBTABLE 15
+ { "_divbtable" },
{ ""}
};
@@ -101,6 +103,7 @@ struct protox {
{ N_TCBTABLE, protopr, tcp_stats, tcp_dump, "tcp" },
{ N_UDBTABLE, protopr, udp_stats, NULL, "udp" },
{ N_RAWIPTABLE, protopr, ip_stats, NULL, "ip" },
+ { N_DIVBTABLE, protopr, div_stats, NULL, "divert" },
{ -1, NULL, icmp_stats, NULL, "icmp" },
{ -1, NULL, igmp_stats, NULL, "igmp" },
{ -1, NULL, ah_stats, NULL, "ah" },