Commit Graph

613 Commits

Author SHA1 Message Date
Rui Paulo
f30f9d4006 Fix typos.
Obtained from:	DragonFlyBSD
2010-04-28 10:57:27 +00:00
Xin LI
57d848483e When an underlying ioctl(2) handler returns an error, our ioctl(2)
interface considers that it hits a fatal error, and will not copyout
the request structure back for _IOW and _IOWR ioctls, keeping them
untouched.

The previous implementation of the SIOCGIFDESCR ioctl intends to
feed the buffer length back to userland.  However, if we return
an error, the feedback would be defeated and ifconfig(8) would
trap into an infinite loop.

This commit changes SIOCGIFDESCR to set buffer field to NULL to
indicate the previous ENAMETOOLONG case.

Reported by:	bschmidt
MFC after:	2 weeks
2010-04-14 22:02:19 +00:00
Rui Paulo
59f6c520f0 Add a missing LINE_BREAK() after printing the roaming parameters in
verbose mode.

Sponsored by:	iXsystems, inc.
MFC after:	2 weeks
2010-03-23 12:05:25 +00:00
Qing Li
6b533b5ddb Verify interface up status using its link state only
if the interface has such capability. The interface
capability flag indicates whether such capability
exists. This approach is much more backward compatible.
Physical device driver changes will be part of another
commit.

Also updated the ifconfig utility to show the LINKSTATE
capability if present.

Reviewed by:	rwatson, imp, juli
MFC after:	3 days
2010-03-16 17:59:12 +00:00
Ruslan Ermilov
bee10047c0 Fixed dependencies (make checkdpadd). 2010-02-25 20:24:19 +00:00
Pyun YongHyeon
0f686c0fc9 Add TSO support on VLAN in fconfig(8).
Reviewed by:	thompsa
2010-02-20 23:01:09 +00:00
Warner Losh
a8c422af92 The NetBSD Foundation has granted permission for people to remove
clause 3 and 4 from their software.
2010-02-16 21:39:20 +00:00
Ruslan Ermilov
440ff1b90d Shortening a passphrase caused wrong authentication key to be used.
Fix this in a FreeBSD and OpenBSD compatible way.

MFC after:	3 days
2010-02-04 11:43:22 +00:00
Xin LI
215940b3fa Revised revision 199201 (add interface description capability as inspired
by OpenBSD), based on comments from many, including rwatson, jhb, brooks
and others.

Sponsored by:	iXsystems, Inc.
MFC after:	1 month
2010-01-27 00:30:07 +00:00
Ed Schouten
f6d189a9e4 Raise WARNS for various tools where possible.
Submitted by:	Marius Nünnerich <marius@nuenneri.ch>
2010-01-17 21:56:27 +00:00
Ed Maste
40efe37e07 Reject invalid CIDR widths rather than silently stopping at the first
non-digit character.

Due to an issue with rc(8) in a test configuration, ifconfig was being
invoked with the address used again as the width - for example,

  ifconfig vlan0 10.0.0.1/10.0.0.1

Prior to this change, that address/width would be interpreted as
10.0.0.1/10.
2010-01-14 15:27:18 +00:00
Gavin Atkinson
7964930201 Spell "Hz" correctly wherever it is user-visible.
PR:		bin/142566
Submitted by:	N.J. Mann   njm njm.me.uk
Approved by:	ed (mentor)
MFC after:	2 weeks
2010-01-12 17:59:58 +00:00
Gavin Atkinson
a7874572c7 ifconfig(8) is documented to take a ISO 3166-1 country code to set the
regulatory domain with the "country" parameter, but will also take a full
country name.  The man page warns that only the ISO code is unambiguous.
In reality, however, the first match on either would be accepted, leading
to "DE" being interpreted as the "DEBUG" country rather than Germany, and
"MO" selecting Morocco rather than the correct country, Macau.

Fix this by always checking for an ISO CC match first, and only search on
the full country name if that fails.

PR:		bin/140571
Tested by:	Dirk Meyer dirk.meyer dinoex.sub.org
Reviewed by:	sam
Approved by:	ed (mentor)
MFC after:	1 month
2009-12-15 20:44:12 +00:00
Will Andrews
c3582a1967 Make ``ifconfig -l ether'' only list interfaces that speak Ethernet.
PR:		118987
Approved by:	ken (mentor)
2009-11-25 00:00:57 +00:00
Xin LI
1a9d4dda9b Revert revision 199201 for now as it has introduced a kernel vulnerability
and requires more polishing.
2009-11-12 19:02:10 +00:00
Xin LI
41c8c6e876 Add interface description capability as inspired by OpenBSD.
MFC after:	3 months
2009-11-11 21:30:58 +00:00
Hiroki Sato
7590eb54ce Use printb() to display the "nd6 options=" line. 2009-10-12 21:11:50 +00:00
Rui Paulo
57c81ff830 Update for latest 802.11s changes in meshconf format.
MFC after:	3 days
2009-10-12 14:51:19 +00:00
Hiroki Sato
2e77c5abfb Fix several logic bugs in the previous IPv6 variable change and
re-add $ipv6_enable support for backward compatibility.  From
UPDATING:

 1. To use IPv6, simply define $ifconfig_IF_ipv6 like $ifconfig_IF
    for IPv4.  For aliases, $ifconfig_IF_aliasN should be used.
    Note that both variables need the "inet6" keyword at the head.

    Do not set $ipv6_network_interfaces manually if you do not
    understand what you are doing.  It is not needed in most cases.

    $ipv6_ifconfig_IF and $ipv6_ifconfig_IF_aliasN still work, but
    they are obsolete.

 2. $ipv6_enable is obsolete.  Use $ipv6_prefer and/or
    "inet6 accept_rtadv" keyword in ifconfig(8) instead.

    If you define $ipv6_enable=YES, it means $ipv6_prefer=YES and
    all configured interfaces have "inet6 accept_rtadv" in the
    $ifconfig_IF_ipv6.  These are for backward compatibility.

 3. A new variable $ipv6_prefer has been added.  If NO, IPv6
    functionality of interfaces with no corresponding
    $ifconfig_IF_ipv6 is disabled by using "inet6 ifdisabled" flag,
    and the default address selection policy of ip6addrctl(8)
    is the IPv4-preferred one (see rc.d/ip6addrctl for more details).
    Note that if you want to configure IPv6 functionality on the
    disabled interfaces after boot, first you need to clear the flag by
    using ifconfig(8) like:

         ifconfig em0 inet6 -ifdisabled

    If YES, the default address selection policy is set as
    IPv6-preferred.

    The default value of $ipv6_prefer is NO.

 4. If your system need to receive Router Advertisement messages,
    define "inet6 accept_rtadv" in $ifconfig_IF_ipv6.  The rc(8)
    scripts automatically invoke rtsol(8) when the interface becomes
    UP.  The Router Advertisement messages are used for SLAAC
    (State-Less Address AutoConfiguration).
2009-09-26 18:59:00 +00:00
Hiroki Sato
6dcd0ad85d Document accept_rev_ethip_ver and send_rev_ethip_ver flags of
EtherIP (gif(4) + if_bridge(8)).

MFC after:	3 days
2009-09-12 22:17:13 +00:00
Hiroki Sato
a283298ce3 Improve flexibility of receiving Router Advertisement and
automatic link-local address configuration:

- Convert a sysctl net.inet6.ip6.accept_rtadv to one for the
  default value of a per-IF flag ND6_IFF_ACCEPT_RTADV, not a
  global knob.  The default value of the sysctl is 0.

- Add a new per-IF flag ND6_IFF_AUTO_LINKLOCAL and convert a
  sysctl net.inet6.ip6.auto_linklocal to one for its default
  value.  The default value of the sysctl is 1.

- Make ND6_IFF_IFDISABLED more robust.  It can be used to disable
  IPv6 functionality of an interface now.

- Receiving RA is allowed if ip6_forwarding==0 *and*
  ND6_IFF_ACCEPT_RTADV is set on that interface.  The former
  condition will be revisited later to support a "host + router" box
  like IPv6 CPE router.  The current behavior is compatible with
  the older releases of FreeBSD.

- The ifconfig(8) now supports these ND6 flags as well as "nud",
  "prefer_source", and "disabled" in ndp(8).  The ndp(8) now
  supports "auto_linklocal".

Discussed with:	bz and jinmei
Reviewed by:	bz
MFC after:	3 days
2009-09-12 22:08:20 +00:00
Hiroki Sato
53ac3451a7 Use printb() instead of rolling its own routine to display
bits in options=<>.

Pointed out by:	ume
MFC after:	3 days
2009-09-07 15:52:15 +00:00
Hajimu UMEMOTO
ad334ef082 Suppress an options line when no bit is on.
Reviewed by:	hrs
MFC after:	3 days
2009-09-07 15:22:54 +00:00
Rui Paulo
3ca80f0dbc Mesh fixes, namely:
* don't clobber proxy entries
* HWMP seq number processing, including discard of old frames
* flush routing table entries based on nexthop
* print route flags in ifconfig
* more debugging messages and comments

Proxy changes submitted by sam.

Approved by:	re (kib)
2009-07-27 14:22:09 +00:00
Bjoern A. Zeeb
00dc5f8e66 Make ifconfig ifN -vnet <jname|jid> actually work:
- fix ifconfig to ignore the non-existent interface in the current
  network stack in case of '-vnet'.
- in ifconfig: actually use the local variables defined for the
  vnet functions rather than modifying the global.

Reviewed by:	rwatson
Approved by:	re (kib)
2009-07-26 11:25:57 +00:00
Rui Paulo
c104cff26e More mesh bits, namely:
* bridge support (sam)
* handling of errors (sam)
* deletion of inactive routing entries
* more debug msgs (sam)
* fixed some inconsistencies with the spec.
* decap is now specific to mesh (sam)
* print mesh seq. no. on ifconfig list mesh
* small perf. improvements

Reviewed by:	sam
Approved by:	re (kib)
2009-07-20 19:12:08 +00:00
Rui Paulo
59aa14a91d Implementation of the upcoming Wireless Mesh standard, 802.11s, on the
net80211 wireless stack. This work is based on the March 2009 D3.0 draft
standard. This standard is expected to become final next year.
This includes two main net80211 modules, ieee80211_mesh.c
which deals with peer link management, link metric calculation,
routing table control and mesh configuration and ieee80211_hwmp.c
which deals with the actually routing process on the mesh network.
HWMP is the mandatory routing protocol on by the mesh standard, but
others, such as RA-OLSR, can be implemented.

Authentication and encryption are not implemented.

There are several scripts under tools/tools/net80211/scripts that can be
used to test different mesh network topologies and they also teach you
how to setup a mesh vap (for the impatient: ifconfig wlan0 create
wlandev ... wlanmode mesh).

A new build option is available: IEEE80211_SUPPORT_MESH and it's enabled
by default on GENERIC kernels for i386, amd64, sparc64 and pc98.

Drivers that support mesh networks right now are: ath, ral and mwl.

More information at: http://wiki.freebsd.org/WifiMesh

Please note that this work is experimental. Also, please note that
bridging a mesh vap with another network interface is not yet supported.

Many thanks to the FreeBSD Foundation for sponsoring this project and to
Sam Leffler for his support.
Also, I would like to thank Gateworks Corporation for sending me a
Cambria board which was used during the development of this project.

Reviewed by:	sam
Approved by:	re (kensmith)
Obtained from:	projects/mesh11s
2009-07-11 15:02:45 +00:00
Jamie Gritton
5061de23fa Add the "vnet" and "-vnet" options, to allow moving interfaces between
jails with VIMAGE.

Approved by:	bz (mentor)
2009-06-24 18:21:37 +00:00
Xin LI
b59dcaeeb3 - Use size_t instead of int when appropriate;
- Use C99 sparse initialization.

With these changes ifconfig(8) is WARNS=2 clean.
2009-06-23 23:49:52 +00:00
Sam Leffler
4fbdba9588 Rev IEEE80211_IOC_STA_INFO abi: ni_flags grew from 16 bits to 32
bits but isi_state did not follow; expand it to 32 bits and pad to
maintain alignment.  Note this is an incompatible change that
requires rebuilding of user applications.

Submitted by:	rpaulo, cbzimmer, avatar
2009-06-13 23:43:00 +00:00
Hiroki Sato
dbe5926046 Fix and add a workaround on an issue of EtherIP packet with reversed
version field sent via gif(4)+if_bridge(4).  The EtherIP
implementation found on FreeBSD 6.1, 6.2, 6.3, 7.0, 7.1, and 7.2 had
an interoperability issue because it sent the incorrect EtherIP
packets and discarded the correct ones.

This change introduces the following two flags to gif(4):

 accept_rev_ethip_ver: accepts both correct EtherIP packets and ones
    with reversed version field, if enabled.  If disabled, the gif
    accepts the correct packets only.  This flag is enabled by
    default.

 send_rev_ethip_ver: sends EtherIP packets with reversed version field
    intentionally, if enabled.  If disabled, the gif sends the correct
    packets only.  This flag is disabled by default.

These flags are stored in struct gif_softc and can be set by
ifconfig(8) on per-interface basis.

Note that this is an incompatible change of EtherIP with the older
FreeBSD releases.  If you need to interoperate older FreeBSD boxes and
new versions after this commit, setting "send_rev_ethip_ver" is
needed.

Reviewed by:	thompsa and rwatson
Spotted by:	Shunsuke SHINOMIYA
PR:		kern/125003
MFC after:	2 weeks
2009-06-07 23:00:40 +00:00
Sam Leffler
5d644c39b5 track rename of CSA ie
Submitted by:	wxs
2009-06-04 18:22:21 +00:00
Andrew Thompson
934434b510 Do no spam the ifconfig output for the aggregated interface with 'laggdev laggX'. 2009-04-30 14:31:52 +00:00
Robert Watson
31b2ac28c9 ifconfig(8) no longer needs to know how to print the IFF_NEEDSGIANT flag,
since it shortly won't be defined at all.
2009-04-18 20:10:39 +00:00
Brooks Davis
7e82008762 The structs ifaliasreq and in_aliasreq have exactly the same layout and
member names, but we really do mean to use in_aliasreq here.

MFC after:	1 week
2009-04-15 20:53:34 +00:00
Sam Leffler
46b7ac7ad8 add superg+tdma include files for protocol defs needed to do ie parsing 2009-03-26 21:29:38 +00:00
Jamie Gritton
a9948a71cf Default to AF_LOCAL instead of AF_INET sockets for non-family-specific
operations.  This allows the query operations to work in non-IPv4 jails,
and will be necessary in a future of possible non-INET networking.

Approved by:	bz (mentor)
2009-03-15 22:33:18 +00:00
Rui Paulo
9c1fd0b05f Replace clone_setcallback() with a new function clone_setdefcallback()
that selects a callback from an interface prefix name. This allows us to
report a meaningful error when the user types 'ifconfig wlan0 create',
for example, and also kills some redundant code.

Reviewed by:    sam (earlier version)
2009-02-27 00:31:34 +00:00
Sam Leffler
7a8ca89318 Fixup handling of roaming and xmit parameters to support 1/2 and 1/4-width
channel modes:
o usurp 'h' mode flag for half-width channels
o add 'q' mode flag for quarter-width channels
o rewrite rate parameter parsing to handle fractional values
o merge mode loops to eliminate ordering assumptions
o replace 0x80 with IEEE80211_RATE_MCS
2009-02-19 05:28:03 +00:00
Sam Leffler
47ee60ebbe Regulatory fixups:
o add missing channel flags for ECM, indoor, and outdoor constraints
o use HT capabilities to short-circuit HT20/HT40 channel construction
o rewrite 1/2 and 1/4 width channel handling yet again; previously
  we assumed there was a full-width version of the channel in the
  calibration table but that's not always true (e.g. for the Public
  Safety Band), now we first check the calibration table for the
  exact channel we want then fall back to the heuristics we used before
o fix HT channel construction; wasn't adjusting band edges for HT40
  channel bandwidth requirements
2009-02-07 01:12:51 +00:00
Sam Leffler
b8bd4a9751 add support for max antenna gain (not used at the moment) 2009-02-05 17:51:46 +00:00
Xin LI
f9b2e762e8 Use %u instead of %zu when we intend to print integer constant. 2009-02-03 00:15:19 +00:00
Sam Leffler
1dfdb874b6 include the channel list in list caps when -v is set; ieee channel
#'s are not available and we have to hack around the mapchan routine
but it lets us see the calibration table w/o forcing the debug regdomain
2009-01-28 19:24:29 +00:00
Sam Leffler
fa46e75db6 pritize the channel we display with list chans so that, among other
things, 1/2 and 1/4 width channels are hidden behind the full width
channel; this is needed because they are ordered such that they
appear after in the channel table
2009-01-28 19:23:12 +00:00
Sam Leffler
2da7e03a99 simplify display of 1/2 and 1/4 width channels 2009-01-28 19:20:12 +00:00
Sam Leffler
2f686fcee3 improve debug msgs for regdomain operations; print channel flags
symbolically so it's easier to identify channels and why they
are added (or not)
2009-01-28 19:18:58 +00:00
Sam Leffler
d6bf86af1e Fix 1/2 and 1/4 width channel handling:
o only include 1/2 and 1/4 width channels when they are specified in the
  regulatory database description; previously we treated them as if they
  were part of the band and blindly added them for 11a/g
o check the channel list returned in the devcaps to identify whether a
  device supports 1/2 or 1/4 width channels on a band; this might be
  better brought out as a capability bit to avoid filling the channel
  list w/ 1/2 and 1/4 width channels but then cards that only support
  these channels in a range of frequencies could not be described (though
  right now we don't check frequency range only band)
2009-01-28 19:15:52 +00:00
Sam Leffler
8658b18b82 Remove assumptions about the max # channels in ioctl's:
o change ioctl's that pass channel lists in/out to handle variable-size
  arrays instead of a fixed (compile-time) value; we do this in a way
  that maintains binary compatibility
o change ifconfig so all channel list data structures are now allocated
  to hold MAXCHAN entries (1536); this, for example, allows the kernel
  to return > IEEE80211_CHAN_MAX entries for calls like IEEE80211_IOC_DEVCAPS
2009-01-27 23:42:14 +00:00
Sam Leffler
63ad8170dd remove %b msg bit defines now public 2009-01-27 23:01:14 +00:00
Sam Leffler
5814deb84d Fix 1/2 and 1/4 width channel handling for non-GSM operation:
o correct typo that caused random channel selection
o explicitly add 1/2 and 1/4 width channels because channel lookups match
  flags that include IEEE80211_CHANNEL_HALF and IEEE80211_CHANNEL_QUARTER
2009-01-16 20:38:42 +00:00
Sam Leffler
fab0828067 use correct interface name when setting flags; fixes ifconfig ... create ... up
Noticed by:	Chris Anderson
2009-01-14 22:55:49 +00:00
Sam Leffler
10ad9a77f3 TDMA support for long distance point-to-point links using ath devices:
o add net80211 support for a tdma vap that is built on top of the
  existing adhoc-demo support
o add tdma scheduling of frame transmission to the ath driver; it's
  conceivable other devices might be capable of this too in which case
  they can make use of the 802.11 protocol additions etc.
o add minor bits to user tools that need to know: ifconfig to setup and
  configure, new statistics in athstats, and new debug mask bits

While the architecture can support >2 slots in a TDMA BSS the current
design is intended (and tested) for only 2 slots.

Sponsored by:	Intel
2009-01-08 17:12:47 +00:00
Sam Leffler
67207b6994 back out unintended change 2008-12-15 01:44:23 +00:00
Sam Leffler
ddd244ecff move channel parsing to a getchannel routine so it can be reused to check
the channel argument supplied to chanswitch
2008-12-15 01:15:15 +00:00
Sam Leffler
746b34ace7 fix handling of sku codes like country codes 2008-12-15 01:10:52 +00:00
Sam Leffler
76f0b9bff1 fix handling of unknown country codes; atoi doesn't return -1
for an invalid string as I thought; so use strtol instead
2008-12-15 01:10:08 +00:00
Sam Leffler
b6130d380f 0 is a potential ISO CC; use new NO_COUNTRY #define to identify
when the CC is not set.  Note NO_COUNTRY is set to 0xffff for now
(must be 16 bits as ieee80211_regdomain struct defines sku's and
cc's as uint16_t which may need fixing).
2008-12-15 01:09:01 +00:00
Sam Leffler
27c1a6f490 o distinguish between adhoc and ahdemo modes
o do not require 1/2 and 1/4 rate channels be present in the
  calibration list when doing a gsm regulatory change; the
  existing 900MHz cards are not self-identifying so there is
  no way (using the calibration channel list) to check
2008-12-15 01:06:49 +00:00
Sam Leffler
cf0d500765 Improve regdomain.xml parser:
o store XML_Parser in the state block so we can report line numbers for errors
o complain about netband w/o mode
o complain about unknown modes
o complain about band w/o enclosing netband
o complain about duplicate freqband
o complain about unknown channel flags
o complain about band w/o freqband's
o complain about band w/o maxpower
o complain about country w/o ISO cc
o complain about country w/o regdomain reference
2008-12-15 01:00:18 +00:00
Giorgos Keramidas
4f1fb109f9 Tiny wording nits.
MFC after:	1 week
2008-10-19 09:45:29 +00:00
Maxim Konovalov
116c00fb0b o Typo fixes.
PR:		docs/127866
Submitted by:	Marius Korsmo
2008-10-05 05:12:48 +00:00
Sam Leffler
24994b364c add duplicate cmd entries for vlan and vlandev that are marked !clone
so they can be used when not doing a create operation

Reviewed by:	ed
2008-10-02 20:03:41 +00:00
Sam Leffler
39669258d7 Distinguish between cmd/parameters used for clone operations and
all others.  Use this to disambiguate cmd line arguments that can
be either clone params or regular parameters so, in particular,
"bssid" again works as a regular parameter.

While here leverage the above to improve the logic for flushing
clone operations on the first !clone cmd line parameter.

Reviewed by:	jhay
2008-09-29 16:27:32 +00:00
Sam Leffler
51947cb625 MIMO power save and RIFS; while here also update per-node state/flags for ampdu 2008-09-22 00:30:26 +00:00
Sam Leffler
8db67fd293 "ampdudensity -" is too subtle; use "NA" for any and accept it as a parameter 2008-09-22 00:24:47 +00:00
Sam Leffler
40808af3aa check for undefined identifiers 2008-09-21 22:16:03 +00:00
Jack F Vogel
eafbb00d24 Add support in ifconfig to control the vlan hardware filter feature.
Reviewed by: EvilSam and moi
MFC after:1 week
2008-08-28 22:13:44 +00:00
Rui Paulo
b3c9746474 Fix typo. 2008-08-27 12:54:29 +00:00
Andrew Thompson
5c43e5f42d Fix channel parsing which was broken in r179958, the channel number may be
suffixed with :flag and /width.
2008-08-14 03:49:14 +00:00
Dag-Erling Smørgrav
2616144e43 Add sbuf_new_auto as a shortcut for the very common case of creating a
completely dynamic sbuf.

Obtained from:	Varnish
MFC after:	2 weeks
2008-08-09 11:14:05 +00:00
Sam Leffler
ed8b5a9370 recognize WPS ie's
Submitted by:	"Chuck Tuffli" <chuck@tuffli.net>
MFC after:	1 week
2008-08-09 05:37:22 +00:00
Andrew Thompson
3b0edf7dd0 Move the grekey to its own file, ifconfig.c does not have interface specific
code.

Submitted by:	sam
2008-08-03 03:36:12 +00:00
Sam Leffler
87a8e294f5 change list wme to only print the channel parameters; to
get channel+bss use -v
2008-08-02 18:10:14 +00:00
Sam Leffler
7842b6be31 don't silently exit if the regdomain.xml file is missing 2008-08-02 18:06:27 +00:00
Sam Leffler
c0f198ca9b add missing capability bits 2008-08-01 01:27:52 +00:00
Sam Leffler
4a5184dc80 correct description of how to clear a desired channel
Pointed out by:	Chris Buechler
MFC after:	1 week
2008-07-30 16:22:52 +00:00
Andrew Thompson
cd610d1cb9 Ensure the channel is a number and not a range, the 'channel' command can be
easily mixed up with 'chanlist' and would give unexpected results by fixing the
channel on the first number in the range.
2008-06-23 16:08:40 +00:00
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