Commit Graph

486 Commits

Author SHA1 Message Date
Andrew Thompson
131c55bc5b Add support for the optional key in the GRE header.
PR:		kern/114714
Submitted by:	Cristian KLEIN
2008-06-20 17:26:34 +00:00
Coleman Kane
c4ca06b9b3 Update the lib/expat tree for the new v2.0.1 expat import. The bsdxml.h
header is now in two parts: bsdxml.h and bsdxml_external.h, representing
the expat.h and expat_external.h headers. Updated the info on the man
page as well. Also, fixed a type-error in a printf in
sbin/ifconfig/regdomain.c that would cause a compiler warning.

Approved by:	sam, phk
2008-05-08 14:01:42 +00:00
Sam Leffler
b032f27c36 Multi-bss (aka vap) support for 802.11 devices.
Note this includes changes to all drivers and moves some device firmware
loading to use firmware(9) and a separate module (e.g. ral).  Also there
no longer are separate wlan_scan* modules; this functionality is now
bundled into the wlan module.

Supported by:	Hobnob and Marvell
Reviewed by:	many
Obtained from:	Atheros (some bits)
2008-04-20 20:35:46 +00:00
Sam Leffler
2fa02c5fb7 Fix handling of create operation together with setting other parameters:
o mark cmds/parameters to indicate they are potential arguments to a clone
  operation (e.g. vlantag)
o when handling a create/clone operation do the callback on seeing the first
  non-clone cmd line argument so the new device is created and can be used;
  and re-setup operating state to reflect the newly created device

Reviewed by:	Eugene Grosbein
MFC after:	2 weeks
2008-03-31 15:38:07 +00:00
Sam Leffler
5ce09a9e9c explain that you must set a default transmit key for WEP
Submitted by:	Jeremie Le Hen <jeremie@le-hen.org>
MFC after:	1 week
2008-02-29 20:42:17 +00:00
Sam Leffler
5ad26a3de5 correct tx rate displayed by list sta: the reported legacy tx rate
is still an index into the rate set and not (yet) the rate code

Noticed by:	JoaoBR
2008-02-03 18:29:58 +00:00
Sam Leffler
055d464b33 fix list mac; broken in delta 1.48
Noticed by:	JoaoBR
2008-02-03 18:21:13 +00:00
Sam Leffler
de0abf19ba Wake On Lan (WOL) infrastructure
Submitted by:	Stefan Sperling <stsp@stsp.name>
Reviewed by:	brooks
2007-12-10 02:31:00 +00:00
Andrew Thompson
5f33ec7ba2 Add an option to limit the number of source MACs that can be behind a bridge
interface.  Once the limit is reached packets with unknown source addresses are
dropped until an existing host cache entry expires or is removed.  Useful to
use with the STICKY cache option.

Sponsored by:	miniSuperHappyDevHouse NZ
2007-11-04 08:32:27 +00:00
Sam Leffler
237183f212 sync with vap code base; updates for 11n support and some
general code cleanups

Reviewed by:	thompsa, avatar
MFC after:	1 week
2007-11-02 05:24:57 +00:00
Sam Leffler
d592cd38bc minor wireless-related corrections
MFC after:	1 week
2007-11-02 05:23:22 +00:00
Andrew Thompson
265e8a9acc Fix the module name matching to the drivers present in the kernel. Previously
it would return true on a partial match where it would think the edsc module
was already present by having a positive match on 'ed'.  This changes it so
that it compares the full string including the nul terminators.

This also fixes a buffer overflow in the ifkind variable where the length of
the interface name in *argv wasnt checked for size.

Reviewed by:	brooks
Approved by:	re (gnn)
2007-10-04 09:45:41 +00:00
Andrew Thompson
85ce729794 Add a bridge interface flag called PRIVATE where any private port can not
communicate with another private port.

All unicast/broadcast/multicast layer2 traffic is blocked so it works much the
same way as using firewall rules but scales better and is generally easier as
firewall packages usually do not allow ARP blocking.

An example usage would be having a number of customers on separate vlans
bridged with a server network. All the vlans are marked private, they can all
communicate with the server network unhindered, but can not exchange any
traffic whatsoever with each other.

Approved by:	re (rwatson)
2007-08-01 00:33:52 +00:00
Sam Leffler
fdef6acc3d updates for 802.11-related parameters
Reviewed by:	thompsa
Approved by:	re (hrs)
2007-07-09 15:39:58 +00:00
Andrew Thompson
b3d37ca5f8 Allow the LACP state to be queried from userland which at the moment is the
actor and partner peer info. Print out the active aggregator and per port data
in verbose mode from ifconfig.

Approved by:	re (mux)
2007-07-05 09:18:57 +00:00
Andrew Thompson
22dcc3c17b Add the vlan tag to the bridge route table. This allows a vlan trunk to be
bridged, previously legitimate traffic was not passed as the bridge could not
tell that it was on a different Ethernet segment.

All non-tagged traffic is treated as vlan1 as per IEEE 802.1Q-2003
2007-06-13 18:58:04 +00:00
Robert Watson
0cae11b9cc Remove IPX over IP tunneling pieces from ifconfig(8), omitted portion of
previous commit:

  Remove IPX over IP tunneling support, which allows IPX routing over IP
  tunnels, and was not MPSAFE.  The code can be easily restored in the
  event that someone with an IPX over IP tunnel configuration can work
  with me to test patches.

  This removes one of five remaining consumers of NET_NEEDS_GIANT.

  Approved by:    re (kensmith)

Spotted by:	Artem Naluzhny <tutat nhamon dot com dot ua>
2007-06-13 18:07:59 +00:00
Andrew Thompson
6b3375abfa Catch up with variable name changes in struct lagg_protos. 2007-06-12 10:07:57 +00:00
Andrew Thompson
927a1b4120 Reset the pointer to the ioctl buffer after it gets changed. 2007-06-12 00:52:40 +00:00
Andre Oppermann
a6575bfc2d Add reporting and toggling of TCP LRO (large receive offload) support to
ifconfig(8).
2007-06-11 20:15:20 +00:00
Sam Leffler
8f3591a5bb Update for revised 802.11 support:
o revised channel handling support; ifconfig now queries the kernel to
  find the list of available channels and handles channel promotion;
  channel attributes can be specified as part of the channel; e.g. 36:a
  for channel 36 in 11a (as opposed to turbo A or HT A)
o use channel list to map between freq and IEEE channel #; this eliminates
  all knowledge of how the mapping is done and fixes handling of cases
  where channels overlap in the IEEE channel # space but are distinct in
  the frequency+attributes space (e.g. PSB)
o add new knobs: bgscan, ff (Atheors fast frames), dturbo (Atheros
  Dynamic Turbo mode), bgscanidle, bgscanintvl, scanvalid, roam:rssi11a,
  roam:rssi11b, roam:rssi11g, roam:rate11a, roam:rate11b, roam:rate11g
  (roaming parameters), burst, doth (forthcoming 11h support)
o print contents of WME, ATH, WPA, RSN, information elements with -v option
o print signal strength in dBm
o print noise floor in dBm
o add list txpow to print tx power caps/channel
o change default channel display in status to be more informative
2007-06-11 03:56:33 +00:00
Andrew Thompson
a389ab003f Add the -n flag for disabling automatic module loading, this will be used by
rc.d to stop it reloading the network module on unload.
2007-05-22 17:41:09 +00:00
Andrew Thompson
18242d3b09 Rename the trunk(4) driver to lagg(4) as it is too similar to vlan trunking.
The name trunk is misused as the networking term trunk means carrying multiple
VLANs over a single connection. The IEEE standard for link aggregation (802.3
section 3) does not talk about 'trunk' at all while it is used throughout IEEE
802.1Q in describing vlans.

The lagg(4) driver provides link aggregation, failover and fault tolerance.

Discussed on:	current@
2007-04-17 00:35:11 +00:00
Andrew Thompson
68bca8a5e3 Bump document date for new trunk commands. 2007-04-10 03:35:42 +00:00
Andrew Thompson
7b62d98bf8 Hook trunk(4) up to the build. 2007-04-10 00:35:31 +00:00
Andrew Thompson
b47888ceba Add the trunk(4) driver for providing link aggregation, failover and fault
tolerance.  This driver allows aggregation of multiple network interfaces as
one virtual interface using a number of different protocols/algorithms.

failover    - Sends traffic through the secondary port if the master becomes
              inactive.
fec         - Supports Cisco Fast EtherChannel.
lacp        - Supports the IEEE 802.3ad Link Aggregation Control Protocol
              (LACP) and the Marker Protocol.
loadbalance - Static loadbalancing using an outgoing hash.
roundrobin  - Distributes outgoing traffic using a round-robin scheduler
              through all active ports.

This code was obtained from OpenBSD and this also includes 802.3ad LACP support
from agr(4) in NetBSD.
2007-04-10 00:27:25 +00:00
Sam Leffler
3b4f84880e don't display ssid cloaking status as "ssid HIDE", use the cmd line
parameter like everything else

MFC after:	2 weeks
2007-03-30 18:14:04 +00:00
Andrew Thompson
99469fe270 Correct the name of the 'proto' command.
MFC after:	3 days
2007-03-29 21:30:26 +00:00
Yaroslav Tykhiy
f013cfc544 Back out rev. 1.129 because it breaks the practice of auto-loading
hardware drivers.  Unlike pseudo-device drivers, which just attach
to the cloning framework and wait for "ifconfig create", h/w drivers
create interfaces for installed cards as soon as loaded.  The issue
of devd(8) involuntarily reloading modules should be dealt with in a
different way.
2007-03-24 20:26:54 +00:00
Yaroslav Tykhiy
a40fb996ae Attempt to load the kernel module only if we are going to create a
new interface.  In other cases loading the module is unwanted and
can lead to ill side effects.  One such effect found is as follows:
"kldunload if_foo" tells the module to kill all its interfaces,
which results in messages sent to devd; the module unloads.  Then
devd starts processing the messages, which ends up in a etc script
running ifconfig fooX, which reloads the module.
2007-03-12 13:08:56 +00:00
Sam Leffler
7c25c5c447 point-to-point address should come from ifa_dstaddr 2007-03-09 23:28:40 +00:00
Sam Leffler
e5f015499d o consistently check strlcpy result
o warn when we skip an interface because it's name is too long
2007-02-27 17:11:18 +00:00
Sam Leffler
0b28f08125 correct type to silence const complaint 2007-02-27 17:03:22 +00:00
Sam Leffler
30705853b0 unbreak create operation, must copy argument to global name
Spotted by:	des
2007-02-27 17:00:59 +00:00
Sam Leffler
cb8c905ae9 use getifaddrs from libc instead of private code
Reviewed by:	bms
MFC after:	1 month
2007-02-24 23:55:46 +00:00
Sam Leffler
aa388b9d49 correct type definition of option routine callback 2007-02-17 18:22:20 +00:00
Sam Leffler
a74d2fb50e remove (now) duplicate definition of IEEE80211_IS_CHAN_PASSIVE 2007-02-17 18:21:52 +00:00
Bruce M Simpson
9bb9973c66 Be explicit in examples about the correct grammar for 'alias' and
'-alias', and that 'add' and 'delete are in fact synonyms for these
in the ifconfig(8) grammar.

Use network prefixes explicitly specified in IETF RFCs for
documentation purposes. (bz)

PR:		102701
MFC after:	1 day
See also:	RFC 3330, RFC 3849
Submitted by:	bz
2007-02-04 16:48:56 +00:00
Bruce M Simpson
1b153c9278 Backout revision 1.4; it is not verified as the correct fix for the PR.
A more correct fix has been committed to ifconfig(8).

Submitted by:	bz
PR:		102701
2007-02-03 03:40:33 +00:00
Bruce M Simpson
9bad5f3777 Add an EXAMPLES section to ifconfig(8), clearly showing how to configure
IPv6 addresses in FreeBSD.

See also: http://www.telscom.ch/index.php/downloads/configure_ipv6_features

MFC after:	1 week
PR:		102701
Obtained from:	OpenBSD (partly, with edits)
2007-02-03 03:37:37 +00:00
Marius Strobl
98b0eedaf5 Actually fully emulate NetBSD and print the media instance number
only for non-zero instances so the typical output for IFM_IEEE80211
type media doesn't overflow 80 columns.

Requested by:	sam
2007-01-22 13:42:07 +00:00
Marius Strobl
1113949379 - Display the media instance numbers and allow the user to set the active
one. This is based on NetBSD but unlike NetBSD this implementation prints
  the instance number for all media instances and doesn't skip it for the
  first one as I don't see a reason to suppress it except for the vague
  reason to preserve the output for single-instance configurations.
- Fix some whitespace nits.
2007-01-20 00:56:49 +00:00
Sam Leffler
9a71a3d565 Add initial support for 900MHz channels; still has some rough
edges but ifconfig ath0 list chan works and you can use ieee
channel #'s to lock/select a channel.

MFC after:	1 month
2007-01-15 01:20:28 +00:00
Bjoern A. Zeeb
3ca72aeb09 Fix an off-by-one which could mean writing beyond the end of the array
when copying the interface name.
This code part should probably be rewritten.
2006-12-29 18:44:04 +00:00
Sam Leffler
b0eb2f6935 Add half/quarter rate 11a channel support:
o add hack/nonstandard channel mapping for public safety band channels to
  mirror kernel (temporary until we have proper 802.11 state)
o change ieee80211_mhz2ieee to take channel flags (unused right now)

While here do some minor fixups like using IEEE80211_IS_CHAN_ANYG.
2006-12-27 18:48:50 +00:00
Jung-uk Kim
f7c6b0a8c6 Clear full-duplex when half-duplex flag is set. This actually makes
'mediaopt half-duplex' working as it should.  It is now equivalent of
'-mediaopt full-duplex'.
2006-12-19 22:50:49 +00:00
Andrew Thompson
787096051b These days P2P means peer-2-peer (also well known from serveral filesharing
protocols) while PointToPoint has been PtP links. Change the variables
accordingly while the code is still fresh and undocumented.

Requested by:	bz
2006-12-11 23:46:40 +00:00
Sam Leffler
0972edc076 fix handling of ssid "-" etc; we're writing 1 byte past the
end of the result buffer

Noticed by:	Sepherosa Zieha
Reviewed by:	cperciva
MFC after:	2 weeks
2006-12-09 20:11:55 +00:00
Andrew Thompson
153f9b00f3 Add descriptions for p2p and autop2p. 2006-11-27 21:59:04 +00:00
Ceri Davies
85606c18b8 Bump .Dd for r1.127. 2006-11-27 21:54:46 +00:00
Andrew Thompson
75ba43386e Show the MAC address cache size and timeout. 2006-11-27 20:52:57 +00:00
Andrew Thompson
1dfd31abfb Keep the command name the same as the values display name in ifconfig. 2006-11-27 20:18:43 +00:00
Andrew Thompson
6c32e05ca3 Sync with the OpenBSD port of RSTP
- use flags rather than sperate ioctls for edge, p2p
 - implement p2p and autop2p flags
 - define large pathcost constant as ULL
 - show bridgeid and rootid in ifconfig

Obtained from:	Reyk Floeter <reyk@openbsd.org>
2006-11-27 00:35:40 +00:00
Andrew Thompson
3df7fad0cf Add a new address cache type called sticky. On an interface marked sticky any
address learned by the bridge is made permanent, the address will not age out
and most importantly will not migrate to another interface.

This can be used to stop mac address poisoning or clients roaming in much the
same way as static entries without the hassle of preloading the table.
2006-11-09 06:32:38 +00:00
Andrew Thompson
3fab76690c Bring in support for the Rapid Spanning Tree Protocol (802.1w).
RSTP provides faster spanning tree convergence, the protocol will exchange
information with neighboring switches to quickly transition to forwarding
without creating loops. The code will default to RSTP mode but will downgrade
any port connected to a legacy STP network so is fully backward compatible.

Reviewed by:	syrinx
Tested by:	syrinx
2006-11-01 09:07:47 +00:00
Ruslan Ermilov
dadff48394 Fix markup botched in previous commit. 2006-10-10 09:44:08 +00:00
Tom Rhodes
7a6f335e14 Note that the -v option may be used to expand long SSIDs.
PR:		102118
Reviewed by:	sam
2006-10-10 02:20:12 +00:00
Jens Schweikhardt
09a66bda90 Correct some grammos. 2006-10-02 08:55:54 +00:00
Bruce M Simpson
7d9079197c Fix a typo in af_inet6.c such that IPv6 addresses may be deleted
from interfaces.

PR:		bin/102701
Submitted by:	George Mitchell
MFC after:	3 days
2006-09-25 18:20:56 +00:00
Andre Oppermann
6b92a00668 In setifcap() only set/unset those capabilities the interface actually
supports.
2006-09-20 15:38:37 +00:00
Ruslan Ermilov
8266d47670 Markup fixes. 2006-09-18 11:55:10 +00:00
Andre Oppermann
581d6e4ca7 Fix octal representation of TSO4 and TSO6 bits in interface capabilities
description.
2006-09-08 13:29:38 +00:00
Andre Oppermann
d7097da403 Make TSO (TCP segmentation offload) capabilities visible and accessible with
'ifconfig em0 tso' and 'ifconfig em0 -tso'.  TSO for IPv4 and IPv6 is always
enabled or disabled together.  The driver may enable only one if it doesn't
support both.

Document 'tso' and '-tso' in the ifconfig(8) man pages.

Sponsored by:	TCP/IP Optimization Fundraise 2005
2006-09-06 22:07:14 +00:00
Thomas Quinot
68e160886a (media_status): Factor common code between IFM_ETHER and IFM_ATM cases.
(print_media_word, print_media_word_ifconfig): Remove unnecessary
goto following test for null desc.

PR:		bin/102354
Submitted by:	Ricardo Nabinger Sanchez <rnsanchez@gmail.com>
MFC after:	1 week
2006-08-22 23:49:36 +00:00
Yaroslav Tykhiy
fdaff6559d Restore the "plumb" compatibility command, which was lost
due to the recent change by sam@ to clone operations in ifconfig(8).
2006-08-12 18:07:17 +00:00
Sam Leffler
76f6413d65 fixup list station support:
o add sanity check to avoid possible looping
o use intended api for IEEE80211_IOC_STA_INFO
o when operating in sta mode get the sta info for the ap
2006-08-10 06:06:13 +00:00
Sam Leffler
d7ccef331a add beacon miss threshold control
Submitted by:	Henrik Brix Andersen <henrik@brixandersen.dk>
MFC after:	2 weeks
2006-07-26 03:08:45 +00:00
Sam Leffler
db82353d87 o replace special handling of clone operations by a clone callback
mechanism
o change vlan cloning to use callback and pass all vlan parameters
  on create using the new SIOCREATE2 ioctl
o update vlan set logic to match existing practice
2006-07-09 06:10:23 +00:00
Sam Leffler
97d7b28e83 remove display of the ERP ie from the list sta output (it's always
zero); replace it with station capabilities

MFC after:	1 month
2006-06-23 17:22:03 +00:00
Max Laier
0dad3f0e15 Import interface groups from OpenBSD. This allows to group interfaces in
order to - for example - apply firewall rules to a whole group of
interfaces.  This is required for importing pf from OpenBSD 3.9

Obtained from:	OpenBSD (with changes)
Discussed on:	-net (back in April)
2006-06-19 22:20:45 +00:00
Gleb Smirnoff
11c4984f64 Print pfsync interface status if either syncpeer or syncdev is configured. 2006-06-06 11:21:08 +00:00
Scott Long
df75593684 Document the rest of the 802.11 capability flags. 2006-04-08 21:38:09 +00:00
Ruslan Ermilov
cea557add0 Extend coverage of the MK_IPX build option to the following:
- <netipx> headers [1]
- IPX library (libipx)
- IPX support in ifconfig(8)
- IPXrouted(8)
- new MK_NCP option

New MK_NCP build option controls:

- <netncp> and <fs/nwfs> headers
- NCP library (libncp)
- ncplist(1) and ncplogin(1)
- mount_nwfs(8)
- ncp and nwfs kernel modules

User knobs: WITHOUT_IPX, WITHOUT_IPX_SUPPORT, WITHOUT_NCP.

[1] <netsmb/netbios.h> unconditionally uses <netipx> headers
so they are still installed.  This needs to be dealt with.
2006-03-20 14:24:58 +00:00
Gleb Smirnoff
193af8d25e There is no IFF_POLLING flag anymore. 2006-03-12 14:00:15 +00:00
Yaroslav Tykhiy
2fe9aa26c6 Revert to setting vlan and vlandev parametes synchronously, as soon
as both have been read from the command line.  Still use the callback,
but this time only to verify that both vlan and vlandev have been
found on the command line.

This should allow for control over the relative order of processing
parameters, which is needed to satisfy some caveats of the if_vlan
driver.  E.g., MTU cannot be changed on a vlan interface until it's
attached to its parent.

PR:             bin/94028
Reviewed by:    ru
MFC after:      3 days
2006-03-09 14:58:09 +00:00
Sam Leffler
451486b569 explain what list chan displays
MFC after:	1 week
2006-02-27 19:57:07 +00:00
Sam Leffler
3e0ded9327 cleanup line break formatting
MFC after:	1 week
2006-02-23 00:07:10 +00:00
Sam Leffler
e70fcb23b6 add miss args to mac:del and mac:kick
Submitted by:	Anders Hanssen
MFC after:	3 days
2006-02-15 23:16:03 +00:00
Sam Leffler
225b126b2d fix off by one malloc sizes
Submitted by:	Michal Mertl
MFC after:	1 week
2006-02-14 23:19:40 +00:00
Sam Leffler
daad4d04c5 really truncate long ssid's when !verbose
MFC after:	1 week
2006-02-08 19:24:55 +00:00
Jesus R. Camou
556c9a4ca3 Document carp(4) arguments.
PR:		docs/92653
Submitted by:	Jeremy C. Reed <reed@reedmedia.net>
Reviewed by:	ru
Approved by:	trhodes (mentor)
MFC after:	5 days
2006-02-03 14:41:41 +00:00
Gleb Smirnoff
5dc27bc63b Recognize new VLAN_HWCSUM flag. 2006-01-30 14:04:30 +00:00
Yaroslav Tykhiy
c21a88e7f8 Do address assignment/removal operations after callbacks.
Presently, ifconfig callbacks are used for L2 configuration, media
and vlan, so actions associated with address assignment, like sending
out a gratuitous ARP, should go when L2 is running already.

This also should fix the problem with setting up vlan interfaces
from rc.conf, when both IP and vlan+vlandev parameters are passed
to ifconfig at once.

Future work: Consider introducing several ifconfig callback lists
to invoke callbacks orderly.

MFC after:	1 week
2006-01-30 13:37:34 +00:00
Maxim Konovalov
8a4fabbd23 Fix an off-by-one error.
Reviewed by:	sam
2006-01-29 17:32:39 +00:00
Sam Leffler
949c433eab don't widen the ssid field by default, this screws up other formatting;
make it available with the -v option
2006-01-18 17:45:38 +00:00
Ruslan Ermilov
5fb6ae1091 Fix an off-by-one bug.
Submitted by:	Ulrich Spoerlein
2006-01-15 19:17:13 +00:00
Doug Ambrisko
1cc59a99c0 Grab the media from the passed in structure to put it into the
global structure.

PR:	bin/91399
Submitted by:	Spencer Minear
2006-01-11 22:37:59 +00:00
Robert Watson
7e1ff2ff14 When printing SSID's in ifconfig(8)'s scan mode, set the width of the
ssid field to 32 characters instead of 14, as long SSID's are quite
common and hard to type in if you can't read them.
2005-12-30 17:27:26 +00:00
Sam Leffler
4e0a8f0dc7 document deftxkey 2005-12-26 18:15:09 +00:00
Ceri Davies
ced42c6c54 Document the pfsync(4) specific maxupd parameter, with text mostly taken
from OpenBSD's manpage.

PR:		docs/89256
Submitted by:	Pim van Pelt <pim at ipng dot nl>
MFC after:	3 days
2005-12-16 11:38:18 +00:00
Sam Leffler
29d58c7173 add control for packet bursting 2005-12-14 19:44:39 +00:00
Andrew Thompson
91f6764e93 Add support for creating span ports so that one can snoop bridged traffic
from another interface/machine/network.

Obtained from:	OpenBSD
MFC after:	2 weeks
2005-12-14 02:52:13 +00:00
Sam Leffler
aa5eb8878e display a bssid that's zero with the -v option 2005-12-14 01:22:26 +00:00
Sam Leffler
439b4702f3 add mcastrate support
MFC after:	1 week
2005-12-12 19:23:55 +00:00
Ruslan Ermilov
4e9e907d63 -mdoc sweep. 2005-11-18 10:36:29 +00:00
Brooks Davis
bed230409f SSIDs are of length 32-bytes and not NUL terminated. Use the correct
length and bail immediatly if the returned length is wrong rather than
attempting to set an correct value.

This commit differs from the patch in the PR in the use of exit instead
of return and the use of a defined value for the array.

Submitted by:	Daan Vreeken [PA4DAN] <Danovitsch at Vitsch dot net>
PR:		bin/74509
2005-10-30 16:31:05 +00:00
Brooks Davis
ab77cda1ad Don't crash when given an invalid nwkey string.
PR:	misc/88159
2005-10-28 21:57:04 +00:00
Andrew Thompson
a33a86ea1f Display the status of the spanning tree for each port.
member: xl0 flags=7<LEARNING,DISCOVER,STP>
        member: gem0 flags=7<LEARNING,DISCOVER,STP>
to:
        member: xl0 flags=7<LEARNING,DISCOVER,STP>
                port 3 priority 128 path cost 55 forwarding
        member: gem0 flags=7<LEARNING,DISCOVER,STP>
                port 1 priority 128 path cost 55 learning
2005-10-07 00:32:16 +00:00
Yaroslav Tykhiy
a2d3802cd8 Eliminate some unneeded code bits. 2005-10-06 15:05:55 +00:00
Yaroslav Tykhiy
7fc2ce8ae4 Use a callback to set up a vlan interface so that "vlan"
and "vlandev" commands can be specified in any order.
This makes the code more compact and clear as well.

Improve error check on vlan argument.

MFC after:	2 weeks
2005-10-04 11:48:03 +00:00
Gleb Smirnoff
1f8f09b081 Now ifconfig is the one right way to turn polling on. Thus, remove
the "if" clauses.
2005-10-01 19:14:34 +00:00
Yaroslav Tykhiy
9e241c5ef2 For the sake of consistency and easier typing,
introduce "-tunnel" as an alias for "deletetunnel".
The latter is overly long and prone to typos,  but
keep it for POLA since it costs nothing.

MFC after:	5 days
2005-09-29 23:53:29 +00:00
Yaroslav Tykhiy
7259f7c495 Forgot to touch .Dd in the previous commit. 2005-09-29 23:39:37 +00:00
Yaroslav Tykhiy
b0dcc11c43 Deprecate the useless argument to -vlandev.
Submitted by:	Fredrik Lindberg <fli+freebsd-current at shapeshifter.se> (implementation)
Reviewed by:	brooks
MFC after:	5 days
2005-09-29 23:38:24 +00:00
Ruslan Ermilov
e6f7c17ebd err() -> errx() where appropriate. 2005-09-29 13:09:04 +00:00
Yaroslav Tykhiy
163653e84b Since special interface types get their own subsections
(not in mdoc(7) sense yet) in ifconfig(8) manpage, create such
subsections for gif(4) and vlan(4) so that their specific
options are not mixed up with general options.
2005-09-22 11:49:52 +00:00
Andrew Thompson
db7d6dc145 Document two missed if_bridge commands 'addr' and 'static'.
Noticed by:	Michal Mertl
Approved by:	mlaier (mentor)
MFC after:	3 days
2005-08-14 03:28:08 +00:00
Sam Leffler
29f0e92957 add list mac and mac:kick support
Submitted by:	Michal Mertl (original version)
MFC after:	2 weeks
2005-08-13 17:38:09 +00:00
Stefan Farfeleder
70382d5abe Fix commen typos. 2005-08-03 20:57:33 +00:00
Sam Leffler
aeffcba3c1 Wireless suport fixups: add a bunch of stuff that's been in the
code but not documented (e.g. wme, mac acl) and correct some
information, etc.

Reviewed by:	brueffer
2005-08-02 19:13:13 +00:00
Sam Leffler
7c0cbd3bfa acm and ack are specified per-ac
MFC after:	3 days
2005-08-01 16:34:41 +00:00
Sam Leffler
0c36e9bb67 oops, revert previous change 2005-07-30 03:30:29 +00:00
Sam Leffler
4e5771359e MFC: add fragthreshold parameter and accept - (or any) for rtsthreshold
Approved by:	re (kensmith)
2005-07-30 03:28:41 +00:00
Sam Leffler
ad60ee418a o add fragthreshold support now that the ioctl exists
o accept rtsthreshold - (or any) as a shorthand for rtsthreshold 2346

MFC after:	3 days
2005-07-26 06:00:33 +00:00
Robert Watson
b7eb47e290 Add a new flag '-k' to ifconfig(8), indicating that it is alright to
print potentially sensitive keying material to stdout.  With the new
802.11 support, ifconfig(8) is now capable of printing 802.11 keys,
and did by default for the root user, which is undesirable in some
environments.  Now it will not print keying material unless requested
(and available to the user).

MFC after:	1 week
2005-07-14 18:33:21 +00:00
Yaroslav Tykhiy
2eb9396fb7 Add symbolic names for the IFF_PPROMISC and IFF_NEEDSGIANT flags
so that ifconfig(8) can print them.

MFC after:	5 days
2005-07-13 21:23:40 +00:00
Christian Brueffer
ef95d02dd0 mdoc cleanup and whitespace removal after the last commit.
Submitted by:	ru
2005-07-13 09:35:35 +00:00
Christian Brueffer
1a44eb0750 Information about the capability flags in 'ifconfig foo0 scan' output.
Most content by:	avatar
Reviewed by:		sam
Approved by:		re (hrs)
MFC after:		3 days
2005-07-12 06:22:02 +00:00
Sam Leffler
fa56f74570 add pureg/-pureg parameter for controlling pureg ap mode support
Reviewed by:	avatar
Approved by:	re (scottl)
2005-07-06 15:39:11 +00:00
Tai-hwa Liang
ecc1960073 Appending "..." to a SSID which contains unprintable characters only when
necessary.

Submitted by:	sam
Approved by:	re (scottl)
2005-06-20 02:33:02 +00:00
Hajimu UMEMOTO
73bbc449db only show a tunnel information of an adequate address family.
Approved by:	re (dwhite)
2005-06-16 19:37:09 +00:00
Ruslan Ermilov
55c82bf0d4 Markup fixes.
Approved by:	re (blanket)
2005-06-14 11:24:56 +00:00
Christian Brueffer
e7951bdf02 It's spelled 'preceded' of course.
Submitted by:	David Adam <zanchey@ucc.gu.uwa.edu.au>
Pointy hat to:	brueffer
2005-06-13 15:49:59 +00:00
Christian Brueffer
3e3a17bb92 Hex strings are _pre_ceeded by 0x, not _pro_ceeded.
PR:		82187
Submitted by:	Anthony Rogers <anthony.j.rogers@gmail.com>
Approved by:	re (blanket)
MFC after:	3 days
2005-06-13 07:55:15 +00:00
Andrew Thompson
7afc53b8df Connect if_bridge to the build.
Approved by:	mlaier (mentor)
2005-06-05 03:32:53 +00:00
Andrew Thompson
31997bf223 Add if_bridge, which provides more advanced Ethernet bridging and 802.1d
spanning tree support.

Based on Jason Wright's bridge driver from OpenBSD, and modified by Jason R.
Thorpe in NetBSD.

Reviewed by:	mlaier, bms, green
Silence from:	-net
Approved by:	mlaier (mentor)
Obtained from:	NetBSD
2005-06-05 02:59:26 +00:00
John Baldwin
d14c0c076e Fix some warnings on 64-bit archs.
Reviewed by:	sam
2005-06-01 14:55:45 +00:00
Sam Leffler
eb2a391f14 guard against bogus address data
Submitted by:	Bakul Shah
2005-05-20 03:58:53 +00:00
Hajimu UMEMOTO
4f10131848 NI_WITHSCOPEID cleanup. Neither RFC 2553 nor RFC 3493 defines
NI_WITHSCOPEID, and our getaddrinfo(3) does nothing special
for it, now.
2005-05-13 16:31:11 +00:00
Max Laier
10a51bf5a1 Update ifconfig's pfsync module for 3.7 pfsync(4) 2005-05-03 16:59:14 +00:00
Stefan Farfeleder
c508bf7a54 ISO C does not allow unnamed union members. 2005-04-08 21:37:41 +00:00
Stefan Farfeleder
77a9f6dd96 Fix typo in comment. 2005-04-08 21:31:20 +00:00
Brooks Davis
6c6faad6dd Remove bogus (but harmless) -I.. from CFLAGS. It makes no difference to
.depends other then the commant line.

Also remove -g from CFLAGS.  The user should add it to CFLAGS if they
desire debug support.

Reviewed by:	ru (in concept)
MFC After:	7 days
2005-03-25 22:08:59 +00:00
Christian Brueffer
4029efa504 Xref carp(4) and polling(4).
MFC after:	3 days
2005-03-19 16:14:31 +00:00
Gleb Smirnoff
ef3abbe88a Use afswch->af_other_status for carp_status() and pfsync_status().
Sponsored by:	Rambler
2005-02-22 14:07:47 +00:00
Gleb Smirnoff
a97719482d Add CARP (Common Address Redundancy Protocol), which allows multiple
hosts to share an IP address, providing high availability and load
balancing.

Original work on CARP done by Michael Shalayeff, with many
additions by Marco Pfatschbacher and Ryan McBride.

FreeBSD port done solely by Max Laier.

Patch by:	mlaier
Obtained from:	OpenBSD (mickey, mcbride)
2005-02-22 13:04:05 +00:00
Doug Ambrisko
499e862cae Change the ifr_media operation to only get its value and only set
its value once per ifconfig run.  Use Sam's new callback
operation to set it when everything is done.

The purpose for this is that if you did something like
	ifconfig bge0 media 100baseTX mediaopt full-duplex
multiple times it would end up causing the PHY to re-sync
since it would send the IOCTLs:
	ifconfig bge0 media 100baseTX -mediaopt full-duplex
	ifconfig bge0 media 100baseTX mediaopt full-duplex
This would cause the PHY to be updated twice even though
there really wasn't any change since the check in
sys/net/if_media.c would always fail.

Caveat is that this doesn't fix the case of:
	ifconfig bge0 media autoselect
etc. since in sys/net/if_media.c it forces an autoselect to go through
the entire process in ifmedia_ioctl :-( :
          /*
           * If no change, we're done.
           * XXX Automedia may invole software intervention.
           *     Keep going in case the the connected media changed.
           *     Similarly, if best match changed (kernel debugger?).
           */
           if ((IFM_SUBTYPE(newmedia) != IFM_AUTO) &&
                (newmedia == ifm->ifm_media) &&
                (match == ifm->ifm_cur))
                     return 0;

Briefly looked at by:	sam
2005-01-27 16:40:12 +00:00
Ruslan Ermilov
6087df9e8b Sort sections. 2005-01-18 10:09:38 +00:00
Ruslan Ermilov
214144704b Scheduled mdoc(7) sweep. 2005-01-10 16:17:34 +00:00
Sam Leffler
90c4b74cbe Fix special status reporting. Prior to the reorg there was
special-purpose code to display status for an interface for
state that was not address-oriented.  This status reporting
was merged in to the address-oriented status reporting but
did not work for link address reporting (as discovered with
fwip interfaces).  Correct this mis-merge and eliminate the
bogus kludge that was used for link-level address reporting.

o add an af_other_status method for an address family for
  reporting status of things like media, vlan, etc.
o call the af_other_status methods after reporting address
  status for an interface
o special-case link address status; when reporting all
  status for an interface invoke it specially prior to
  reporting af_other_status methods (since it requires the
  sockaddr_dl that is passed in to status separately from
  the rtmsg address state)
o correct the calling convention for link address status;
  don't cast types, construct the proper parameter

This fixes ifconfig on fwip interfaces.
2004-12-31 19:46:27 +00:00
Sam Leffler
5040559548 o accept deftxkey as a synonym for weptxkey since that is what is
printed for status (allows cut&paste)
o accept undef for the deftxkey/weptxkey so you can reset state

Requested by:	phk
2004-12-31 19:39:25 +00:00
Sam Leffler
881cb7c4d1 recognize atheros information elements 2004-12-31 19:37:02 +00:00
Sam Leffler
3ce8a7b4fc always display the deftxkey for an 802.11 device if privacy is enabled 2004-12-12 04:32:44 +00:00
Sam Leffler
58ac5e5b7a add a callback mechanism for code that wants to defer committing changes
until all the command line args have been processed

Reviewed by:	ambrisko
2004-12-11 02:33:33 +00:00
Sam Leffler
5faf8dcb55 Overhaul to cleanup some of the tangled logic that's grown over the years.
o break per-address family support out into separate files
o modularize per-address family and functional operations using
  a registration mechanism; this permits configuration according
  to which files you include (but beware that order of the files
  is important to insure backwards compatibility)
o many cleanups to eliminate incestuous behaviour, global variables,
  and poor coding practices (still much more to fix)

The original motivation of this work was to support dynamic addition
of functionality based on the interface so we can eliminate the various
little control programs and so that vendors can distribute ifconfig
plugins that support their in-kernel code.  That work is still to be
completed.

o Update 802.11 support for all the new net80211 functionality; some
  of these operations (e.g. list *) may be better suited in a different
  program
2004-12-08 19:18:07 +00:00
Ruslan Ermilov
1313b9ea59 First there was an -m option.
Then Peter killed it and made it the default.
Then Brooks and Poul-Henning added it again.
Then Ruslan fixed the manpage...
2004-11-06 13:38:45 +00:00
Brooks Davis
9e734b4468 Use a spare byte in struct if_data to store the structure size without
increasing it.  Add code to ifconfig to use this size to find the
sockaddr_dl after the struct if_data in the routing message.  This
allows struct if_data to grow (up to 255 bytes) without breaking
ifconfig.

Submitted by:	peter
2004-09-01 18:22:14 +00:00
Pyun YongHyeon
a740f6ee14 Fix long standing mediaopt setting bugs seen on sparc64. Though
the bug exists in little-endian machine, it was not triggered due
to the difference of memory ordering between little/big endian
machines. Instead of relying on possibly modified value during
function invokcations, use saved copy of ifr.ifr_addr.sa_family.
Also add a comment at the top of ifconfig.c clarifying the issue
so the bug won't re-appear.

Approved by:	jake
Reviewed by:	yar
2004-08-09 03:13:57 +00:00
Yaroslav Tykhiy
46912de489 Bump the date, .Dd, since the document content has been changed
in the previous commit.

Pointed out by:	ru
2004-07-27 09:51:49 +00:00
Yaroslav Tykhiy
e82866fea6 Add two knobs to ifconfig(8), vlanmtu' and vlanhwtag',
that provide control over the respective capabilities
of an interface, reception of extended frames and hardware
VLAN multiplexor.
2004-07-26 13:25:45 +00:00
Ruslan Ermilov
9806e23132 Mechanically kill hard sentence breaks. 2004-07-02 21:45:06 +00:00
Bruce M Simpson
4b32efacf3 mdoc(7) police
Submitted by:	ru
2004-06-14 19:31:10 +00:00
Bruce M Simpson
c4d297d20d Wordsmith the BUGS section re: IPv6 link-local addresses.
PR:		docs/66541
Submitted by:	Michel Lavondes (with some cleanups/additions)
2004-06-14 16:04:59 +00:00
Ruslan Ermilov
d04b5dfe6c Assorted markup, grammar, and spelling fixes. 2004-05-17 08:35:43 +00:00
Doug Ambrisko
41b0ee744a For both ifconfig and route if we didn't get enough memory from the
prior sysctl due to the structure growing between calls try again.

Also try again for deleting routes if things fail.  We've seen
route -f fail this way which does not actually flush all routes.
This fixes it.  It will whine but it will do the work.

PR:		56732
Obtained from:	IronPort
2004-04-30 22:34:12 +00:00
Luigi Rizzo
0b46c08590 Replace ROUNDUP/ADVANCE with SA_SIZE 2004-04-13 11:24:43 +00:00
Ruslan Ermilov
fc2814036c Document that -m also causes the capability list to be displayed. 2004-04-11 13:44:57 +00:00
Ruslan Ermilov
3a3b019aeb Added the new interface capability option for drivers that implement
user-configurable polling(4) support.  Make ifconfig(8) aware of it.

Suggested by:	luigi
2004-04-11 13:36:52 +00:00
Mark Murray
4c723140a4 Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core, imp
2004-04-09 19:58:40 +00:00
Poul-Henning Kamp
d2aeb9ccaa Fix an off-by-one error in the function used to input the ascii/hex strings.
Be a little bit more helpful in error messages.
2004-04-04 07:28:58 +00:00
Sam Leffler
a6b03f428a add support for setting 802.11 rtsthreshold, transmit power,
and 11g protection mode

Reviewed by:	imp (just code)
2004-03-30 22:59:22 +00:00
Ruslan Ermilov
08b82c6b74 The print mask's first part is the base, not the total number of bit
identifiers.
2004-03-12 23:52:32 +00:00
Ruslan Ermilov
aec32663a4 Show the polling(4) flag on the interface. 2004-03-12 23:43:40 +00:00
Bruce Evans
c88f8102e3 Fixed a misspelling of 0 as NULL. 2004-03-10 08:46:39 +00:00
Alexander Kabaev
652d6e18bf Look for both name and if_<name> strings in module metadata. Pseudo-devices
like tun are naming their modules using the 'if_; prefix and previous version of
the code failed to detect their presence in the kernel, resulting in the same
module being loaded twice.
2004-02-27 06:43:14 +00:00
Johan Karlsson
604d24db95 style.Makefile(5):
Use WARNS?= instead of WARNS=.
2004-02-23 20:25:27 +00:00
Yaroslav Tykhiy
588e78c575 We can cross-reference to vlan(4) as long as
the corresponding manpage has been committed.
The rest of "vlan" words, which are refering
to the technology itself, should be capitalized.

MFC after:	1 week
2004-02-21 14:21:18 +00:00
Yaroslav Tykhiy
4742fd9891 The hardware tagging capability is set on the physical
interface that is parent to a vlan(4) interface,
not on the vlan(4) interface itself.
2004-02-21 14:11:57 +00:00
Brooks Davis
97bebf0a28 Add ifconfig support for network interface renaming. In the process,
reorganize the printing of the interface name when using wildcard
cloning so it is not printed if it we either immediately rename or
destroy the interface.

Reviewed by:	ru
2004-02-04 02:55:46 +00:00
Brooks Davis
bbe513dbf8 Use memcpy plus a manual NUL termination when copying the interface name
from the sdl because strlcpy requires that the source string be
NUL-terminated unlike strncpy.

Submitted by:	Peter Jeremy <PeterJeremy at optushome dot com dot au>
2004-01-31 22:59:03 +00:00
Brooks Davis
a4fa9864bf Use IFNAMSIZ instead of a magic value for the length of an interface
name.

Prevent the kernel from potentially overflowing the interface name
variable.  The size argument of strlcpy is complex because the name is
not null-terminated in sdl_data.
2004-01-27 01:43:14 +00:00
Sam Leffler
fbc5a4076e 802.11 mode bits are now masks; convert to suit 2004-01-15 15:19:19 +00:00
Brooks Davis
405077fd53 We want the length of the string, not the size of its pointer. 2003-11-01 00:03:20 +00:00
Peter Wemm
566214a32a Give wider types to sscanf to fix two warnings (u_short cannot be > 0xffff)
and to make sure that we catch oversized arguments rather than silently
truncate them.  I dont know if sscanf will reject an integer if it will
not fit in the short return variable or not, but this way it should be
detected.
2003-10-26 04:36:47 +00:00
Ruslan Ermilov
deb62e2887 By popular demand, added the "static ARP" per-interface option. 2003-10-01 08:32:37 +00:00
Sam Leffler
60ef637e8d o add support for setting 128-bit WEP keys
o use IEEE80211_KEYBUF_SIZE instead of magic numbers
o distinguish between 40-, 104-, and 128-bit WEP keys when printing status
2003-09-17 19:27:43 +00:00
Sam Leffler
cf260fe35a o update for new 802.11 support
o fix channel command so channel - does what the man page says
2003-06-28 06:23:40 +00:00
Sam Leffler
2559c28876 o correct mode request handling
o add 802.11 alias support
o suppress display of the default "mode autoselect" when showing the "phy mode"
2003-06-25 15:05:17 +00:00
Ruslan Ermilov
eb9a85cabd mdoc(7) police: fix more breakages from rev. 1.69. 2003-05-14 16:22:16 +00:00
Sheldon Hearn
49830e2a2c Fix broken comment line introduced in rev 1.69.
Found with:	nroff -mandoc ifconfig.8 > /dev/null
2003-05-13 08:29:49 +00:00
Hartmut Brandt
2b75e097f1 Add media types and options for ATM. While on most ATM cards media cannot
be changed, it is very convenient to be able to toggle SDH/Sonet,
idle/unassigned cells and scrambled mode and to see the carrier
state.

Reviewed by:	-arch (if_media.h definitions)
2003-04-29 17:23:23 +00:00
Sam Leffler
e519b1a5ee document mode directive 2003-04-28 16:47:40 +00:00
Sam Leffler
4e61f6f1f6 add a "mode" directive to specify the operating mode for multi-mode devices;
this is mostly intended for use with multi-mode 802.11 devices that support
some combination of 11a, 11b, and 11g
2003-04-28 16:37:38 +00:00
Matthew N. Dodd
71d66ceb2c Don't abuse module names to facilitate ifconfig module loading;
such abuse isn't really needed.  (And if we do need type information
associated with a module then we should make it explicit and not
use hacks.)
2003-04-15 06:25:58 +00:00
Tim J. Robbins
8151186746 Uncomment the description of the ipdst parameter, but refer to IPX
instead of NS.
2003-03-08 13:42:42 +00:00
Peter Wemm
059c32d2eb Kill #ifdef NS code 2003-03-05 19:18:05 +00:00
Ruslan Ermilov
8fbad60d0a Document the rxcsum and txcsum commands.
Submitted by:	jlemon
2003-02-27 22:59:13 +00:00
Matthew N. Dodd
83d5e173ac Add missing #if USE_IF_MEDIA/#endif. 2003-01-23 18:31:56 +00:00
Max Khon
b8701b5430 fix link_status() in non-Ethernet case
MFC after:	1 week
2003-01-22 00:14:34 +00:00
Ruslan Ermilov
3706a3a87f mdoc(7) police: markup, spelling.
Also fixed a critical bug made in revision 1.62 by phk@.
2002-11-25 16:01:28 +00:00
Sam Leffler
ac244ef31f update vlandev description; vlan code now auto-recognizes devices that
support h/w tagging
2002-11-15 00:31:49 +00:00
Sam Leffler
94da260035 o display new interface capability bits
o capitilize capability bit strings for consistency

Approved by:	re
2002-11-15 00:02:21 +00:00
Chris Costello
d25beabfca Remove a line that reflected behavior that does not actually exist.
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-10-28 03:46:32 +00:00
Chris Costello
76b4b15fcf Document the `maclabel' command.
Obtained from:	TrustedBSD Project
Sponsored by:	Network Associates Laboratories
2002-10-25 22:40:37 +00:00
Poul-Henning Kamp
fb3133242f Report the MONITOR bit. 2002-10-24 17:23:52 +00:00
Robert Watson
97490f4b3c Rename ifconfig's "mac" argument to "maclabel" to prevent confusion
regarding 802.1 MAC and Mandatory Access Control (MAC).  Some
potential for confusion remains further in other areas of the
system regarding Message Authentication Codes (MAC).

Requested by:	wollman
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-23 22:50:04 +00:00
Robert Watson
2d58d642d2 Teach ifconfig(8) how to print and set the MAC labels on network
interfaces using the 'mac' argument.  Without MAC support in the
kernel, this does not change the behavior of ifconfig.

Approved by:	re
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-23 03:40:47 +00:00
Dima Dorfman
b6fcb4fec3 Don't crash when the user feeds us nonesense in the form:
ifconfig IF ether WHATEVER -alias

PR:		42544
Submitted by:	Mike Makonnen <makonnen@pacbell.net>
2002-10-02 02:17:59 +00:00
Poul-Henning Kamp
afbe3a0f81 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
2002-09-27 18:57:47 +00:00
Maxim Sobolev
ffb079be0c Implement user-setable promiscuous mode (a new `promisc' flag for ifconfig(8)).
Also, for all interfaces in this mode pass all ethernet frames to upper layer,
even those not addressed to our own MAC, which allows packets encapsulated
in those frames be processed with packet filters (ipfw(8) et al).

Emphatically requested by:	Anton Turygin <pa3op@ukr-link.net>
Valuable suggestions by:	fenner
2002-08-19 15:16:38 +00:00