aboutsummaryrefslogtreecommitdiff
path: root/sbin/ifconfig
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2002-09-27 18:57:47 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2002-09-27 18:57:47 +0000
commitafbe3a0f81bd2487579ccd3529de693841ded287 (patch)
tree2e0b7f0095d2053a63219572fbeafde682841ff6 /sbin/ifconfig
parentca916247cdab4aa84a7f00de7c39b9e8c933e581 (diff)
downloadsrc-afbe3a0f81bd2487579ccd3529de693841ded287.tar.gz
src-afbe3a0f81bd2487579ccd3529de693841ded287.zip
Add the "Monitor" interface flag.
Setting this flag on an ethernet interface blocks transmission of packets and discards incoming packets after BPF processing. This is useful if you want to monitor network trafic but not interact with the network in question. Sponsored by: http://www.babeltech.dk
Notes
Notes: svn path=/head/; revision=104044
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r--sbin/ifconfig/ifconfig.811
-rw-r--r--sbin/ifconfig/ifconfig.c2
2 files changed, 13 insertions, 0 deletions
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8
index 39761fbe5803..57468e974b34 100644
--- a/sbin/ifconfig/ifconfig.8
+++ b/sbin/ifconfig/ifconfig.8
@@ -504,6 +504,17 @@ for more information.
.It Fl link Op Cm 0 No - Cm 2
.Sm on
Disable special processing at the link level with the specified interface.
+.It Cm monitor
+.Sm on
+Put the interface in monitor mode.
+No packets are transmitted and received packets are discarded after
+.Xr bpf 4
+processing.
+.Sm off
+.It Fl monitor
+.Sm on
+Take the interface out of monitor mode.
+.Sm off
.It Cm up
Mark an interface
.Dq up .
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index c9ab382b42f5..35ac555e4f67 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -241,6 +241,8 @@ struct cmd {
{ "-link1", -IFF_LINK1, setifflags },
{ "link2", IFF_LINK2, setifflags },
{ "-link2", -IFF_LINK2, setifflags },
+ { "monitor", IFF_MONITOR, setifflags },
+ { "-monitor", -IFF_MONITOR, setifflags },
#ifdef USE_IF_MEDIA
{ "media", NEXTARG, setmedia },
{ "mediaopt", NEXTARG, setmediaopt },