Commit Graph

613 Commits

Author SHA1 Message Date
Eitan Adler
50d675f7a9 Remove trailing whitespace per mdoc lint warning
Disussed with:	gavin
No objection from:	doc
Approved by:	joel
MFC after:	3 days
2012-03-29 05:02:12 +00:00
Bernhard Schmidt
4b25863e5c Also fix the parameter usage in set80211meshpeering().
Submitted by:	Monthadar Al Jaberi
MFC after:	1 week
X-MFC after:	r233328
2012-03-23 18:12:25 +00:00
Adrian Chadd
bde65615f6 Fix an incorrect parameter usage here.
Submitted by:	monthadar@gmail.com
2012-03-22 21:22:58 +00:00
Andrew Thompson
a0778b71ad Fix typo and bump the document date which I also forgot.
Spotted by:	Andrey Zonov
2012-03-07 06:25:17 +00:00
Andrew Thompson
86f67641a9 Add the ability to set which packet layers are used for the load balance hash
calculation.
2012-03-06 22:58:13 +00:00
Christian Brueffer
5640c37256 Update bridge(4) default values.
PR:		164564
Submitted by:	"Rudy (bulk)" <crapsh@monkeybrains.net>
MFC after:	2 weeks
2012-02-29 21:11:02 +00:00
Gavin Atkinson
1748d1e513 Correct capitalization of "Hz" in user-visible text (manpages, printf(),
etc).

MFC after:	3 days
2012-02-28 13:19:34 +00:00
Robert Millan
9697f9f801 Disable jail support in ifconfig when either building a rescue
image or MK_JAIL knob has been set to "no".

Reviewed by:	bz
Approved by:	adrian (mentor)
2012-02-14 07:14:42 +00:00
Eitan Adler
83d26a13ba Fix warning when compiling with gcc46:
error: variable 'firstkey' set but not used

Approved by:	dim
MFC after:	3 days
2012-01-10 02:59:18 +00:00
Ulrich Spörlein
4b85a12f71 Spelling fixes for sbin/ 2012-01-07 16:09:33 +00:00
Robert Watson
f3f28e69a7 Adjust the VLAN section of the ifconfig(8) man page to better reflect
reality:

1. Only 12-bit VLAN Identifiers, not full 16-bit VLAN tags can be set using
   ifconfig vlan.

2. When we mean VLAN Identifiers, spell it that way, rather than as VLAN tag.

MFC after:	3 days
Sponsored by:	Adara Networks, Inc.
2012-01-04 21:04:57 +00:00
Bjoern A. Zeeb
9b776960c3 Allow toggling of IFCAP_VLAN_HWCSUM for hardware that supports checksum
offloading on vlans and document the new option.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2011-12-17 15:44:34 +00:00
Gleb Smirnoff
5f02482794 Rename ifcarp.c to carp.c 2011-12-16 14:30:58 +00:00
Gleb Smirnoff
92ed4e1a24 Since size of struct in_aliasreq has just been changed in r228571,
and thus ifconfig(8) needs recompile, it is a good chance to make
parameter checks on SIOCAIFADDR arguments more strict.
2011-12-16 13:30:17 +00:00
Gleb Smirnoff
08b68b0e4c A major overhaul of the CARP implementation. The ip_carp.c was started
from scratch, copying needed functionality from the old implemenation
on demand, with a thorough review of all code. The main change is that
interface layer has been removed from the CARP. Now redundant addresses
are configured exactly on the interfaces, they run on.

The CARP configuration itself is, as before, configured and read via
SIOCSVH/SIOCGVH ioctls. A new prefix created with SIOCAIFADDR or
SIOCAIFADDR_IN6 may now be configured to a particular virtual host id,
which makes the prefix redundant.

ifconfig(8) semantics has been changed too: now one doesn't need
to clone carpXX interface, he/she should directly configure a vhid
on a Ethernet interface.

To supply vhid data from the kernel to an application the getifaddrs(8)
function had been changed to pass ifam_data with each address. [1]

The new implementation definitely closes all PRs related to carp(4)
being an interface, and may close several others. It also allows
to run a single redundant IP per interface.

Big thanks to Bjoern Zeeb for his help with inet6 part of patch, for
idea on using ifam_data and for several rounds of reviewing!

PR:		kern/117000, kern/126945, kern/126714, kern/120130, kern/117448
Reviewed by:	bz
Submitted by:	bz [1]
2011-12-16 12:16:56 +00:00
Gleb Smirnoff
8d7813e7e9 For unknown reason, since rev 1.1 of ifconfig.c, sin_family isn't
set properly for the mask argument.

Since I'd like to improve argument sanity checking in kernel
side, in in_control(), fix this.
2011-11-19 19:06:08 +00:00
Adrian Chadd
fab8a49218 Bump date. 2011-11-12 23:30:57 +00:00
Adrian Chadd
6edc611e9d Add documentation for the new quiet time IE options.
Submitted by:	Himali Patel <himali.patel@sibridgetech.com>
Sponsored by:	Sibridge Technologies
2011-11-12 23:17:01 +00:00
Adrian Chadd
dd21aaf873 Add quiet time element configuration support to ifconfig.
This allows a hostap to specify to a set of stations that they
should not transmit for a certain period of time after each
beacon interval has expired. This is used when searching for
radar pulses or general interference.

Submitted by:	Himali Patel <himali.patel@sibridgetech.com>
Sponsored by:	Sibridge Technologies
2011-11-08 14:22:40 +00:00
Hiroki Sato
5ed6597742 - Document inet6 no_radr flag.
- Add descriptions of sysctl(8) variables which can control the default
  configuration of the inet6 flags.

Approved by:	re (kib)
2011-09-19 16:01:53 +00:00
Adrian Chadd
2168aaa506 This patch removes a check in ifconfig which disables HT/40 channels
on frequency bands with DFS. All Atheros chipsets >= AR9001 support
radar event detection on HT40 extension channels.

This should be a chipset specific item rather than enforced in the
regulatory domain database.

In addition, it's irrelevant for STA mode, as the radar detection is
done by the access point, not the STA.

Approved by:	re (kib)
2011-07-20 05:59:28 +00:00
Adrian Chadd
2ad10b365c This patch enables listing DFS related flags when 'ifconfig -v wlanX
list channel' is run. The following new options are introduced:

* D: channel requires DFS
* R: channel has a radar event
* I: channel has detected inteference
* C: the CAC period has completed on a channel that requires it (ie,
  DFS + PASSIVE.)

It's relevant for developing, debugging and using the DFS and
interference options.

Approved by:	re (bz)
2011-07-19 15:22:35 +00:00
Bjoern A. Zeeb
ad2571a225 If compiling RESCUE always ignore feature_present(3) calls so that
a /rescue/ifconfig more modern than the kernel could still configure
IPv4 or IPv6 addresses.

Reported by:	Andrzej Tobola (ato iem.pw.edu.pl)
Reported by:	gcooper
MFC after:	1 day
X-MFC:		will not MFC any time soon, just reminder for r222527
2011-07-18 10:29:16 +00:00
Bjoern A. Zeeb
35fd7bc020 Add infrastructure to allow all frames/packets received on an interface
to be assigned to a non-default FIB instance.

You may need to recompile world or ports due to the change of struct ifnet.

Submitted by:	cjsp
Submitted by:	Alexander V. Chernikov (melifaro ipfw.ru)
		(original versions)
Reviewed by:	julian
Reviewed by:	Alexander V. Chernikov (melifaro ipfw.ru)
MFC after:	2 weeks
X-MFC:		use spare in struct ifnet
2011-07-03 12:22:02 +00:00
Luigi Rizzo
c9d658e9f7 Grab one of the ifcap bits for netmap, and enable printing in ifconfig.
Document the fact that we might want an IFCAP_CANTCHANGE mask,
even though the value is not yet used in sys/net/if.c

(asked on -current a week ago, no feedback so i assume no objection).
2011-06-14 12:40:55 +00:00
Hiroki Sato
e7fa8d0ada - Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1.
- A new per-interface knob IFF_ND6_NO_RADR and sysctl IPV6CTL_NO_RADR.
  This controls if accepting a route in an RA message as the default route.
  The default value for each interface can be set by net.inet6.ip6.no_radr.
  The system wide default value is 0.

- A new sysctl: net.inet6.ip6.norbit_raif.  This controls if setting R-bit in
  NA on RA accepting interfaces.  The default is 0 (R-bit is set based on
  net.inet6.ip6.forwarding).

Background:

 IPv6 host/router model suggests a router sends an RA and a host accepts it for
 router discovery.  Because of that, KAME implementation does not allow
 accepting RAs when net.inet6.ip6.forwarding=1.  Accepting RAs on a router can
 make the routing table confused since it can change the default router
 unintentionally.

 However, in practice there are cases where we cannot distinguish a host from
 a router clearly.  For example, a customer edge router often works as a host
 against the ISP, and as a router against the LAN at the same time.  Another
 example is a complex network configurations like an L2TP tunnel for IPv6
 connection to Internet over an Ethernet link with another native IPv6 subnet.
 In this case, the physical interface for the native IPv6 subnet works as a
 host, and the pseudo-interface for L2TP works as the default IP forwarding
 route.

Problem:

 Disabling processing RA messages when net.inet6.ip6.forwarding=1 and
 accepting them when net.inet6.ip6.forward=0 cause the following practical
 issues:

 - A router cannot perform SLAAC.  It becomes a problem if a box has
   multiple interfaces and you want to use SLAAC on some of them, for
   example.  A customer edge router for IPv6 Internet access service
   using an IPv6-over-IPv6 tunnel sometimes needs SLAAC on the
   physical interface for administration purpose; updating firmware
   and so on (link-local addresses can be used there, but GUAs by
   SLAAC are often used for scalability).

 - When a host has multiple IPv6 interfaces and it receives multiple RAs on
   them, controlling the default route is difficult.  Router preferences
   defined in RFC 4191 works only when the routers on the links are
   under your control.

Details of Implementation Changes:

 Router Advertisement messages will be accepted even when
 net.inet6.ip6.forwarding=1.  More precisely, the conditions are as
 follow:

 (ACCEPT_RTADV && !NO_RADR && !ip6.forwarding)
	=> Normal RA processing on that interface. (as IPv6 host)

 (ACCEPT_RTADV && (NO_RADR || ip6.forwarding))
	=> Accept RA but add the router to the defroute list with
	   rtlifetime=0 unconditionally.  This effectively prevents
	   from setting the received router address as the box's
	   default route.

 (!ACCEPT_RTADV)
	=> No RA processing on that interface.

 ACCEPT_RTADV and NO_RADR are per-interface knob.  In short, all interface
 are classified as "RA-accepting" or not.  An RA-accepting interface always
 processes RA messages regardless of ip6.forwarding.  The difference caused by
 NO_RADR or ip6.forwarding is whether the RA source address is considered as
 the default router or not.

 R-bit in NA on the RA accepting interfaces is set based on
 net.inet6.ip6.forwarding.  While RFC 6204 W-1 rule (for CPE case) suggests
 a router should disable the R-bit completely even when the box has
 net.inet6.ip6.forwarding=1, I believe there is no technical reason with
 doing so.  This behavior can be set by a new sysctl net.inet6.ip6.norbit_raif
 (the default is 0).

Usage:

 # ifconfig fxp0 inet6 accept_rtadv
	=> accept RA on fxp0
 # ifconfig fxp0 inet6 accept_rtadv no_radr
	=> accept RA on fxp0 but ignore default route information in it.
 # sysctl net.inet6.ip6.norbit_no_radr=1
	=> R-bit in NAs on RA accepting interfaces will always be set to 0.
2011-06-06 02:14:23 +00:00
Hiroki Sato
c3cc3217bc Add the "nd6 options" line handler as af_other_status() of AF_INET6, not as an
own address family.

Reviewed by:	bz
2011-06-05 11:37:20 +00:00
Bjoern A. Zeeb
5af3fa9a5f Conditionally compile in the af_inet and af_inet6, af_nd6 modules.
If compiled in for dual-stack use, test with feature_present(3)
to see if we should register the IPv4/IPv6 address family related
options.

In case there is no "inet" support we would love to go with the
usage() and make the address family mandatory (as it is for anything
but inet in theory).  Unfortunately people are used to
  ifconfig IF up/down
etc. as well, so use a fallback of "link".  Adjust the man page
to reflect these minor details.

Improve error handling printing a warning in addition to the usage
telling that we do not know the given address family in two places.

Reviewed by:	hrs, rwatson
Sponsored by:	The FreeBSD Foundation
Sponsored by:	iXsystems
MFC after:	2 weeks
2011-05-31 14:40:21 +00:00
Marius Strobl
6f135a7584 When setting media always and not just in case of switching to IFM_AUTO
clear the options of the current media, i.e. only inherit the instance,
which matches what NetBSD does. Without this it's really non-intuitive
that the following sequence:
	ifconfig bge0 media 1000baseT mediaopt full-duplex
	ifconfig bge0 media 100baseTX
results in 100baseTX full-duplex to be set or that:
	ifconfig bge0 media autoselect mediaopt flowcontrol
	ifconfig bge0 media 1000baseT mediaopt full-duplex
tries to set 1000baseT full-duplex with flowcontrol, which isn't suported
und thus fails while the following:
	ifconfig re0 media 1000baseT mediaopt flowcontrol,full-duplex
	ifconfig re0 media autoselect
just switches to autoselection without flowcontrol.

MFC after:	2 weeks
2011-05-15 12:51:00 +00:00
Adrian Chadd
88e428c6bc Revert r220907 and r220915.
Changing the size of struct ieee80211_mimo_info changes
the STA info data, breaking ifconfig in general.
2011-04-22 00:44:27 +00:00
Adrian Chadd
bc4e0fe6d0 Change the MIMO userland export ABI to include flags, number of radio chains,
extended EVM statistics and EXT channel data.

ifconfig still displays 3 chains worth of ctl noise/rssi.
2011-04-21 03:47:40 +00:00
Glen Barber
66e0e139ee Correct 'list scan' description in the examples. The previous description
was incorrect - 'list scan' does not actually do a scan, but instead lists
the results of the background 'scan' cache.

Submitted by:	Fabian Keil (freebsd-listen of fabiankeil de) (via email)
Discussed with:	bschmidt
MFC after:	3 days
2011-04-06 11:20:54 +00:00
Glen Barber
8e99556f73 Bump date from previous commit. 2011-03-21 15:17:02 +00:00
Glen Barber
a34287fbad Use 'list scan' in favor of 'scan', as 'scan' has a different purpose.
Pointed out by:	bschmidt
MFC after:	1 day
2011-03-20 22:47:41 +00:00
Glen Barber
e387937975 Remove unneeded newline.
MFC after:	1 week
2011-03-12 19:07:19 +00:00
Glen Barber
48141d377d Add example of using 'scan' for wireless networks, similarly to
OpenBSD's ifconfig(8).

PR:		151952
Submitted by:	Jared (rhyous of yahoo com)
MFC after:	1 week
2011-03-12 19:05:39 +00:00
Bernhard Schmidt
90e0ec14c1 Fix the 'scan hang' issue.
When requesting a scan and one is already in progess, e.g. while in scan
state, we happily wait for a scan done notification. Though, this
notification might never be sent, e.g. if we are trying to find a network
to associate to and there is none. Instead of always waiting for a
notification just do so if a new scan has been started. For both cases the
scan cache is used to report available networks even if the content might
not be fresh.

MFC after:	1 month
2011-01-30 14:22:45 +00:00
Bernhard Schmidt
a272741053 When doing a scan while being associated it is possible that the scan
is deferred for the time it takes to flush the TX queue. This work being
done the scan then is continued, but only if it is marked to do so. As
the 'ifconfig scan' request is meant to be used after the interface is
brought up, request a background scan by default. This behaviour is
already documented in manual page.

This fixes on possible case where 'ifconfig scan' hangs infinitely.

MFC after:	1 month
2011-01-30 13:17:45 +00:00
Marius Strobl
a0fc3825c3 Teach ifconfig(8) the handy shared option shortcut aliases the NetBSD
counterpart also takes, i.e. "fdx" for "full-duplex", "flow" for
"flowcontrol", "hdx" for "half-duplex" as well as "loop" and "loopback"
for "hw-loopback".

MFC after:	1 week
2011-01-05 15:28:30 +00:00
Joel Dahl
f041f6a7b7 Remove the advertising clause from UCB copyrighted files in sbin. This
is in accordance with the information at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
2010-12-12 21:26:12 +00:00
Weongyo Jeong
6e3cb00068 Introduces IFF_CANTCONFIG interface flag to point that the interface
isn't configurable in a meaningful way.  This is for ifconfig(8) or
other tools not to change code whenever IFT_USB-like interfaces are
registered at the interface list.

Reviewed by:	brooks
No objections:	gavin, jkim
2010-12-07 20:23:47 +00:00
Weongyo Jeong
6d2f981e9b Don't print usbus[0-9] interfaces that it's not the interesting
interface type for ifconfig(8).
2010-12-01 03:24:38 +00:00
Marius Strobl
8d88402858 When setting a media with no sub-type specified also reset the type
specific options along with the global ones so these options don't
stick when f.e. switching to IFM_AUTO.

MFC after:	2 weeks
2010-11-13 22:40:37 +00:00
Marius Strobl
a84e1b3b24 When printing media with more than one media option set aggregate these
in a comma delimited list instead of repeating "mediaopt" for each one.
This matches how the options of the active media are printed with
print_media_word() and brings us in line what NetBSD does.

MFC after:	2 weeks
2010-11-13 21:03:19 +00:00
Joel Dahl
c2025a7660 Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
translating these manual pages.  Minor corrections by me.

Submitted by:	Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
2010-08-16 15:18:30 +00:00
John Baldwin
d99d8e2e38 Ethernet vlan(4) interfaces have valid Ethernet link layer addresses but
use a different interface type (IFT_L2VLAN vs IFT_ETHER).  Treat IFT_L2VLAN
interfaces like IFT_ETHER interfaces when handling link layer addresses.

Reviewed by:	syrinx (bsnmpd)
MFC after:	1 week
2010-08-06 15:09:21 +00:00
Joel Dahl
f6ac23919b Fix typos and spelling mistakes. 2010-08-06 14:33:42 +00:00
Joel Dahl
a53bb70bda Spelling fixes. 2010-07-31 21:09:49 +00:00
Bjoern A. Zeeb
68a6303904 Document the 'short preamble' capability for 802.11bg.
Reviewed by:	sam
MFC after:	4 days
2010-05-14 15:06:12 +00:00
Rui Paulo
2fb1e09dee Bump man page date. 2010-04-28 10:58:03 +00:00
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