summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2020-08-21 13:20:15 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2020-08-21 13:20:15 +0000
commitf964e0d6a21f092a18a29d28e39e2879b9618236 (patch)
tree71d437fe5ad853a64de2fe533fbba15373eae454 /share
parent5d3a8e0c3d2ea50b552a420b15e15b890f735a06 (diff)
Document the ROUTE_FLAGFILTER socket option.
ok jmatthew@
Diffstat (limited to 'share')
-rw-r--r--share/man/man4/route.426
1 files changed, 24 insertions, 2 deletions
diff --git a/share/man/man4/route.4 b/share/man/man4/route.4
index 03a47a7c289..5085487a1fb 100644
--- a/share/man/man4/route.4
+++ b/share/man/man4/route.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: route.4,v 1.54 2019/11/22 06:26:00 claudio Exp $
+.\" $OpenBSD: route.4,v 1.55 2020/08/21 13:20:14 benno Exp $
.\" $NetBSD: route.4,v 1.3 1994/11/30 16:22:31 jtc Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)route.4 8.6 (Berkeley) 4/19/94
.\"
-.Dd $Mdocdate: November 22 2019 $
+.Dd $Mdocdate: August 21 2020 $
.Dt ROUTE 4
.Os
.Sh NAME
@@ -195,6 +195,15 @@ by doing a
.Xr shutdown 2
system call for further input.
.Pp
+There are three filter options that can be used to restrict the received route messages
+to a subset of all the route messages processed by the kernel:
+.Pp
+.Bl -tag -width xxxxxxxx -compact
+.It ROUTE_TABLEFILTER
+.It ROUTE_MSGFILTER
+.It ROUTE_FLAGFILTER
+.El
+.Pp
A process can specify an alternate routing table by using the
.Dv ROUTE_TABLEFILTER
.Xr setsockopt 2 .
@@ -244,6 +253,19 @@ if (setsockopt(routefd, AF_ROUTE, ROUTE_PRIOFILTER,
err(1, "setsockopt(ROUTE_PRIOFILTER)");
.Ed
.Pp
+The
+.Dv ROUTE_FLAGFILTER
+socket option can be used to exclude a subset of
+.Vt rtm_flags
+flags from the received route messages:
+.Bd -literal -offset indent
+int rtfilter = RTF_LLINFO | RTF_BROADCAST;
+
+if (setsockopt(routefd, AF_ROUTE, ROUTE_FLAGFILTER, &rtfilter,
+ sizeof(rtfilter)) == -1)
+ err(1, "setsockopt(ROUTE_FLAGFILTER)");
+.Ed
+.Pp
The predefined constants for the routing priorities are:
.Bd -literal
#define RTP_NONE 0 /* unset priority use sane default */