History log of /freebsd-head/sbin/ifconfig/ifconfig.h
Revision Date Author Comments
dde41c97866152e8c7eb1f52f07e3e5ac43b2652 17-Apr-2018 gallatin <gallatin@FreeBSD.org> Make lagg creation more fault tolerant

- Warn, don't exit, when SIOCSLAGGPORT returns an error.

When we exit with an error during lagg creation, a single
failed NIC (which no longer attaches) can prevent lagg
creation and other configuration, such as adding an IPv4
address, and thus leave a machine unreachable.

- Preserve non-EEXISTS errors for exit status from SIOCSLAGGPORT,
in case scripts are looking for it. Hopefully this can be
extended if other parts of ifconfig can allow a "soft" failure.

- Improve the warning message to mention what lagg and what
member are problematic.

Reviewed by: jtl, glebius
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D15046
7551d83c353e040b32c6ac205e577dbc5f2c8955 27-Nov-2017 pfg <pfg@FreeBSD.org> various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
00d578928eca75be320b36d37543a7e2a4f9fbdb 27-May-2016 grehan <grehan@FreeBSD.org> Create branch for bhyve graphics import.
a0a9dc5d39bce93901950e25e91887b10edd6402 06-Mar-2016 kp <kp@FreeBSD.org> MFC r295836:
ifconfig(8): can't use 'name' or 'description' when creating interface with auto numbering

If one does 'ifconfig tap create name blah', it will return error because the
'name' command doesn't properly populate the request sent to ioctl(...). The
'description' command has the same bug, and is also fixed with this patch.

If one does 'ifconfig tap create mtu 9000 name blah', it DOES work, but 'tap0'
(or other sequence number) is echoed, instead of the expected 'blah'. (assuming
the name change actually succeeded)

PR: 206876
Submitted by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Differential Revision: https://reviews.freebsd.org/D5341
33ef68fedb3270f37fc4d216f733431e0e22f138 20-Feb-2016 kp <kp@FreeBSD.org> ifconfig(8): can't use 'name' or 'description' when creating interface with auto numbering

If one does 'ifconfig tap create name blah', it will return error because the
'name' command doesn't properly populate the request sent to ioctl(...). The
'description' command has the same bug, and is also fixed with this patch.

If one does 'ifconfig tap create mtu 9000 name blah', it DOES work, but 'tap0'
(or other sequence number) is echoed, instead of the expected 'blah'. (assuming
the name change actually succeeded)

Submitted by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Differential Revision: https://reviews.freebsd.org/D5341
a91e3ef58a004aace2995a6dec20856019ce1c7d 15-Aug-2015 melifaro <melifaro@FreeBSD.org> MFC r270064,r270068,r270069,r270115,r270129,r270287,r270822,r271014,
r271524,r273541,r282967,r283009,r283364.

Add support for reading i2c SFP/SFP+ data from NIC driver and
presenting most interesting fields via ifconfig -v.
This version supports Intel ixgbe driver only.

Tested on: Cisco,Intel,Mellanox,ModuleTech,Molex transceivers

* Add new net/sff8436.h containing constants used to access
QSFP+ data via i2c inteface. These constants has been taken
from SFF-8436 "QSFP+ 10 Gbs 4X PLUGGABLE TRANSCEIVER" standard
rev 4.8.
* Add support for printing QSFP+ information from 40G NICs
such as Chelsio T5.

Example:
cxl1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=ec07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,.....>
ether 00:07:43:28:ad:08
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet 40Gbase-LR4 <full-duplex>
status: active
plugged: QSFP+ 40GBASE-LR4 (MPO Parallel Optic)
vendor: OEM PN: OP-QSFP-40G-LR4 SN: 20140318001 DATE: 2014-03-18
module temperature: 64.06 C voltage: 3.26 Volts
lane 1: RX: 0.47 mW (-3.21 dBm) TX: 2.78 mW (4.46 dBm)
lane 2: RX: 0.20 mW (-6.94 dBm) TX: 2.80 mW (4.47 dBm)
lane 3: RX: 0.18 mW (-7.38 dBm) TX: 2.79 mW (4.47 dBm)
lane 4: RX: 0.90 mW (-0.45 dBm) TX: 2.80 mW (4.48 dBm)

Tested on: Chelsio T5
Tested on: Mellanox/Huawei passive/active cables/transceivers.

Sponsored by: Yandex LLC
9299c6512883c5b5bb8bbf52e127a19f5b24682a 13-Jun-2015 bryanv <bryanv@FreeBSD.org> MFC r271603:

Add DEF_CLONE_CMD_ARG2
80ccb248ca5a4784c12f1eb4893ff05034603733 14-Sep-2014 bryanv <bryanv@FreeBSD.org> Add DEF_CLONE_CMD_ARG2

This will be used in the forthcoming vxlan import.

Reviewed by: gnn
Phabric: https://reviews.freebsd.org/D382
0c02adae03a55821b773682cdcca772d82058321 16-Aug-2014 melifaro <melifaro@FreeBSD.org> Add support for reading i2c SFP/SFP+ data from NIC driver and
presenting most interesting fields via ifconfig -v.
This version supports Intel ixgbe driver only.

Tested on: Cisco,Intel,Mellanox,ModuleTech,Molex transceivers
MFC after: 2 weeks
eb1a5f8de9f7ea602c373a710f531abbf81141c4 21-Feb-2014 gjb <gjb@FreeBSD.org> Move ^/user/gjb/hacking/release-embedded up one directory, and remove
^/user/gjb/hacking since this is likely to be merged to head/ soon.

Sponsored by: The FreeBSD Foundation
6b01bbf146ab195243a8e7d43bb11f8835c76af8 27-Dec-2013 gjb <gjb@FreeBSD.org> Copy head@r259933 -> user/gjb/hacking/release-embedded for initial
inclusion of (at least) arm builds with the release.

Sponsored by: The FreeBSD Foundation
27a36f6ac8242750daa092abd7180b10d16f4508 16-Dec-2011 glebius <glebius@FreeBSD.org> 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]
09f9c897d33c41618ada06fbbcf1a9b3812dee53 19-Oct-2010 jamie <jamie@FreeBSD.org> A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.
f1216d1f0ade038907195fc114b7e630623b402c 19-Mar-2010 delphij <delphij@FreeBSD.org> Create a custom branch where I will be able to do the merge.
e55dc5c4eb8e9b93da21c537889150f3b177e253 23-Jun-2009 delphij <delphij@FreeBSD.org> - Use size_t instead of int when appropriate;
- Use C99 sparse initialization.

With these changes ifconfig(8) is WARNS=2 clean.
2af9e81296d11b332adae2fe9855f658a4660ae8 27-Feb-2009 rpaulo <rpaulo@FreeBSD.org> 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)
19b6af98ec71398e77874582eb84ec5310c7156f 22-Nov-2008 dfr <dfr@FreeBSD.org> Clone Kip's Xen on stable/6 tree so that I can work on improving FreeBSD/amd64
performance in Xen's HVM mode.
cf5320822f93810742e3d4a1ac8202db8482e633 19-Oct-2008 lulf <lulf@FreeBSD.org> - Import the HEAD csup code which is the basis for the cvsmode work.
760cb14114d6d37050b99926fbc0a9fc1592774c 25-Apr-2008 sam <sam@FreeBSD.org> MFC: Fix handling of create operation together with setting other parameters.
1cec369535292eab06c22690afab8043336f2e23 31-Mar-2008 sam <sam@FreeBSD.org> 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
b936eeb39ddebd2dd21440a77901dc032bd0f608 13-Jun-2007 rwatson <rwatson@FreeBSD.org> 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>
3271b465acb86d1da777c15e67a67ea952a8ddb8 11-Jun-2007 sam <sam@FreeBSD.org> 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
cd822ec72803ef63ba2d56e1fcdc837cd656a1b5 24-Feb-2007 sam <sam@FreeBSD.org> use getifaddrs from libc instead of private code

Reviewed by: bms
MFC after: 1 month
5fe5db7b92d100880e8e1049b140630a29d38514 09-Jul-2006 sam <sam@FreeBSD.org> 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
6ef35a9033cdebfe27efd05ad442122a02ec3c12 21-Jul-2005 rwatson <rwatson@FreeBSD.org> Merge ifconfig.8:1.98, ifconfig.c:1.115, ifconfig.h:1.17,
ifieee80211.c:1.19 from HEAD to RELENG_6:

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).

Approved by: re (kensmith)
2df666ab6946c86d6f646d4417a3bbd60f66cafc 14-Jul-2005 rwatson <rwatson@FreeBSD.org> 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
93dc7c672e88559f4ae90f91fdc693a94c8d940a 08-Apr-2005 stefanf <stefanf@FreeBSD.org> ISO C does not allow unnamed union members.
65cf57f523204a7d6cd5d3c0982549ff4e7a3c01 31-Dec-2004 sam <sam@FreeBSD.org> 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.
476c9d3a010c9ec2db658c943141a6cee92cd794 11-Dec-2004 sam <sam@FreeBSD.org> add a callback mechanism for code that wants to defer committing changes
until all the command line args have been processed

Reviewed by: ambrisko
68cd8761a723205e9d0dbd54067af7db9f163492 08-Dec-2004 sam <sam@FreeBSD.org> 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
0242ed134b11f2e07839056e0f2d2311860e39a5 30-Mar-2004 sam <sam@FreeBSD.org> add support for setting 802.11 rtsthreshold, transmit power,
and 11g protection mode

Reviewed by: imp (just code)
280fcfee010f264faacd1e395fd9a429bdb87843 27-Jan-2004 brooks <brooks@FreeBSD.org> 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.
1e1e2faff9349ae3ff2a353151c0f008eb767008 28-Apr-2003 sam <sam@FreeBSD.org> add a "mode" directive to specify the operating mode for multi-mode devices;
this is mostly intended for use with multi-mode 802.11 devices that support
some combination of 11a, 11b, and 11g
d98de7a2cf71a2e2d7fa1681696f9e0784cf85a5 23-Oct-2002 rwatson <rwatson@FreeBSD.org> Rename ifconfig's "mac" argument to "maclabel" to prevent confusion
regarding 802.1 MAC and Mandatory Access Control (MAC). Some
potential for confusion remains further in other areas of the
system regarding Message Authentication Codes (MAC).

Requested by: wollman
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
2450bdb69b00fa80c6300b0490ce491af643f642 23-Oct-2002 rwatson <rwatson@FreeBSD.org> Teach ifconfig(8) how to print and set the MAC labels on network
interfaces using the 'mac' argument. Without MAC support in the
kernel, this does not change the behavior of ifconfig.

Approved by: re
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
de9bff5d04a6648d18315758ba3fc3c56bef1f05 29-May-2001 phk <phk@FreeBSD.org> When using interfaces that support if_media, the supported media list is
printed on a single, very long, and generally unreadable line. This
isn't very useful. It's also really ugly and most of the time you don't
care what media is supported anyway.

PR: 27701
Submitted by: Brooks Davis <brooks@one-eyed-alien.net>
1aacce7a450370feff7a5e098c12e915e4f731f8 26-May-2001 phk <phk@FreeBSD.org> Currently, each wireless networking driver has it's own control program
despite the fact that most people want to set exactly the same settings
regardless of which card they have. It has been repeatidly suggested
that this configuration should be done via ifconfig. This patch
implements the required functionality in ifconfig and add support to the
wi and an drivers. It also provides partial, untested support for the
awi driver.

PR: 25577
Submitted by: Brooks Davis <brooks@one-eyed-alien.net>
b42951578188c5aab5c9f8cbcde4a743f8092cdc 02-Apr-2000 cvs2svn <cvs2svn@FreeBSD.org> This commit was manufactured by cvs2svn to create branch 'ALSA'.
76f0c923fe4b2a1616453876611dc76b4f6b5355 28-Aug-1999 peter <peter@FreeBSD.org> $Id$ -> $FreeBSD$
a1b49dc15234a4ca3eddd3dbaac7e6d80043d7a2 15-Mar-1999 wpaul <wpaul@FreeBSD.org> Grrr... botched remote commit. Let's try this again: vlan updates,
take two.
0506343883d62f6649f7bbaf1a436133cef6261d 11-Jan-1998 cvs2svn <cvs2svn@FreeBSD.org> This commit was manufactured by cvs2svn to create branch 'jb'.
7c6e96080c4fb49bf912942804477d202a53396c 10-Jan-1998 cvs2svn <cvs2svn@FreeBSD.org> This commit was manufactured by cvs2svn to create branch 'JB'.
ef73892b1acfc074fbfd815642d36a0659a87649 10-May-1997 peter <peter@FreeBSD.org> Clean up some more. Move parsing of sysctl iflist data into a single
place rather than updating the main loop's index variables from within
a subroutine and other revolting things like that. Move some more
globals into local variables.
6f36e2eccf49524bd4de897bfe7947bf6020aec1 10-May-1997 peter <peter@FreeBSD.org> Grumble.. My last patchup here didn't quite work either. I hate this
program and it's use of global variables. Somehow, I managed to miss the
most obvious case.. "ifconfig ed0 10.0.0.1" failed (no "inet")

Submitted by: dfr
54b5e92f49c141588dd1ac95ea0899bb19eee068 04-May-1997 peter <peter@FreeBSD.org> Commit hooks for ifmedia support. It's optional in the Makefile, and
can be trivially disabled.