summaryrefslogtreecommitdiff
path: root/sys/net/route.h
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-01-28 12:34:10 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-01-28 12:34:10 +0000
commitc6f251c468201e9a9d210697044f12e5e64e4d6f (patch)
tree2c7111720c6fc449b2f384f5c113da67484f2f43 /sys/net/route.h
parentf799ce5ad12dc57f158c92360fd1fcb6e973017a (diff)
Implement basic routing socket filtering. It is possible to give a list --
actually a bitfield -- of routing messages a listener is interested in. This list can be changed with a setsockopt(s, AF_ROUTE, ROUTE_MSGFILTER, ...) call. OK henning@, dlg@
Diffstat (limited to 'sys/net/route.h')
-rw-r--r--sys/net/route.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/net/route.h b/sys/net/route.h
index 3ce2f803fba..45df3f207d2 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.h,v 1.56 2009/01/08 12:47:45 michele Exp $ */
+/* $OpenBSD: route.h,v 1.57 2009/01/28 12:34:09 claudio Exp $ */
/* $NetBSD: route.h,v 1.9 1996/02/13 22:00:49 christos Exp $ */
/*
@@ -297,6 +297,14 @@ struct rt_omsghdr {
#define RTAX_LABEL 10 /* route label present */
#define RTAX_MAX 11 /* size of array to allocate */
+/*
+ * setsockopt defines used for the filtering.
+ */
+#define ROUTE_MSGFILTER 1 /* bitmask to specifiy which types should be
+ sent to the client. */
+
+#define ROUTE_SETFILTER(x, m) (x) |= (1 << (m))
+
struct rt_addrinfo {
int rti_addrs;
struct sockaddr *rti_info[RTAX_MAX];