summaryrefslogtreecommitdiff
path: root/sys/net/pfvar.h
diff options
context:
space:
mode:
authorMichele Marchetto <michele@cvs.openbsd.org>2009-10-04 16:08:38 +0000
committerMichele Marchetto <michele@cvs.openbsd.org>2009-10-04 16:08:38 +0000
commit82b30916c9515794d7aca77e8c937fc5e0455586 (patch)
treece06c3cb91a134e4d7d4cb69f04155cf3c8ba2dc /sys/net/pfvar.h
parentdd5c2f75fe5e092eb892c438f7f87faa2e57fcb6 (diff)
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 'sys/net/pfvar.h')
-rw-r--r--sys/net/pfvar.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h
index d0328ba566a..9559bec1fa8 100644
--- a/sys/net/pfvar.h
+++ b/sys/net/pfvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfvar.h,v 1.293 2009/09/08 17:52:17 michele Exp $ */
+/* $OpenBSD: pfvar.h,v 1.294 2009/10/04 16:08:37 michele Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -60,7 +60,7 @@ struct ip6_hdr;
enum { PF_INOUT, PF_IN, PF_OUT };
enum { PF_PASS, PF_DROP, PF_SCRUB, PF_NOSCRUB, PF_NAT, PF_NONAT,
PF_BINAT, PF_NOBINAT, PF_RDR, PF_NORDR, PF_SYNPROXY_DROP, PF_DEFER,
- PF_MATCH };
+ PF_MATCH, PF_DIVERT };
enum { PF_RULESET_FILTER, PF_RULESET_NAT, PF_RULESET_BINAT,
PF_RULESET_RDR, PF_RULESET_MAX };
enum { PF_OP_NONE, PF_OP_IRG, PF_OP_EQ, PF_OP_NE, PF_OP_LT,
@@ -622,7 +622,7 @@ struct pf_rule {
struct {
struct pf_addr addr;
u_int16_t port;
- } divert;
+ } divert, divert_packet;
};
/* rule flags */