The NetBSD Project

CVS log for src/sbin/ifconfig/media.c

[BACK] Up to [] / src / sbin / ifconfig

Request diff between arbitrary revisions

Default branch: MAIN

Revision 1.14 / (download) - annotate - [select for diffs], Mon Apr 4 19:33:44 2022 UTC (10 months ago) by andvar
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, HEAD
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

fix various typos, mainly in comments.

Revision 1.13 / (download) - annotate - [select for diffs], Wed Oct 14 13:37:14 2020 UTC (2 years, 3 months ago) by roy
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.12: +10 -5 lines
Diff to previous 1.12 (colored)

ifconfig: go back to using direct ioctls rather than data from getifaddrs

AF_LINK may not be the first address returned for the interface.
Technically, it *might* not even exist on the interface even though
other families do.
This is likely a driver bug if this really is the case though.

As such it's just easier to use direct ioctls rather than thump around
getifaddrs results. As it stands, the code makes a lot of getifaddrs
calls anyway, so an extra ioctl or two won't break the bank.

Revision 1.12 / (download) - annotate - [select for diffs], Mon Oct 5 17:29:22 2020 UTC (2 years, 4 months ago) by roy
Branch: MAIN
Changes since 1.11: +4 -4 lines
Diff to previous 1.11 (colored)

Minor correction to prior

Revision 1.11 / (download) - annotate - [select for diffs], Mon Oct 5 16:17:05 2020 UTC (2 years, 4 months ago) by roy
Branch: MAIN
Changes since 1.10: +20 -20 lines
Diff to previous 1.10 (colored)

ifconfig: Warn once more if media supported but no types

This reverts media.c -r1.7

Revision 1.10 / (download) - annotate - [select for diffs], Tue Sep 22 14:14:17 2020 UTC (2 years, 4 months ago) by roy
Branch: MAIN
Changes since 1.9: +57 -32 lines
Diff to previous 1.9 (colored)

ifconfig: Report link state even if media is not supported

For AF_LINK addrs from getifaddrs(2), ifa_data is struct if_data.
This in turn holds ifi_link_state which we can use to report
link status if the interface does not support media where it's normally

Based on OpenBSD.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Jun 7 06:02:58 2020 UTC (2 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.8: +5 -5 lines
Diff to previous 1.8 (colored)

Update for proplib(3) API changes.

Revision / (download) - annotate - [select for diffs], Mon Jun 10 22:05:34 2019 UTC (3 years, 7 months ago) by christos
Branch: phil-wifi
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored) next main 1.8 (colored)

Sync with HEAD

Revision 1.8 / (download) - annotate - [select for diffs], Mon Apr 22 10:44:55 2019 UTC (3 years, 9 months ago) by msaitoh
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, is-mlppp-base, is-mlppp
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

Suggested by Christos:
 - Dont' cast malloc()'s return value.
 - Use calloc() instead of malloc().

Revision / (download) - annotate - [select for diffs], Fri Nov 4 14:48:55 2016 UTC (6 years, 3 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.6: +22 -22 lines
Diff to previous 1.6 (colored) next main 1.7 (colored)

Sync with HEAD

Revision 1.7 / (download) - annotate - [select for diffs], Wed Sep 14 11:46:43 2016 UTC (6 years, 4 months ago) by roy
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: phil-wifi
Changes since 1.6: +22 -22 lines
Diff to previous 1.6 (colored)

Don't bail if SIOGIFMEDIA doesn't return any media lists because we
can still report link status.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Aug 29 14:35:00 2011 UTC (11 years, 5 months ago) by joerg
Branch: MAIN
CVS Tags: yamt-pagecache-tag8, yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-pagecache, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, localcount-20160914, agc-symver-base, agc-symver
Branch point for: pgoyette-localcount
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

Use __dead

Revision 1.5 / (download) - annotate - [select for diffs], Mon Dec 13 17:35:08 2010 UTC (12 years, 1 month ago) by pooka
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Changes since 1.4: +4 -3 lines
Diff to previous 1.4 (colored)

Convert from the .ifdef RUMP_ACTION stuff to RUMPPRG.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Jul 1 16:44:05 2010 UTC (12 years, 7 months ago) by dyoung
Branch: MAIN
Changes since 1.3: +9 -9 lines
Diff to previous 1.3 (colored)

Add to the string parse object (pstr), and its constructors, a flag that
tells whether it should detect and convert to binary a hexadecimal octet
string of the form 0x0123ABab, or leave those strings undecoded.

If the argument for a 'media', 'mediamode', 'mediaopt', '-mediaopt',
'nwkey', or 'bssid' keyword is a hexadecimal octet string, do not detect
and decode it.  (Note that setifnwkey decodes hexadecimal strings on its

This fixes a bug noticed by Jim Miller where the trailing zero-octets
were discarded from hexadecimal octet-string arguments for 'nwkey'.

Revision / (download) - annotate - [select for diffs], Sun Sep 28 11:17:11 2008 UTC (14 years, 4 months ago) by mjf
Branch: mjf-devfs2
Changes since +463 -0 lines
Diff to previous (colored) to branchpoint 1.3 (colored) next main 1.4 (colored)

Sync with HEAD.

Revision / (download) - annotate - [select for diffs], Thu Sep 18 04:28:25 2008 UTC (14 years, 4 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since +463 -0 lines
Diff to previous (colored) to branchpoint 1.3 (colored) next main 1.4 (colored)

Sync with wrstuden-revivesa-base-2.

Revision, Tue Jul 15 21:27:58 2008 UTC (14 years, 6 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.3: +0 -463 lines

file media.c was added on branch mjf-devfs2 on 2008-09-28 11:17:11 +0000

Revision, Tue Jul 15 21:27:58 2008 UTC (14 years, 6 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.3: +0 -463 lines

file media.c was added on branch wrstuden-revivesa on 2008-09-18 04:28:25 +0000

Revision 1.3 / (download) - annotate - [select for diffs], Tue Jul 15 21:27:58 2008 UTC (14 years, 6 months ago) by dyoung
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, mjf-devfs2-base, matt-premerge-20091211, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend
Branch point for: wrstuden-revivesa, mjf-devfs2
Changes since 1.2: +11 -11 lines
Diff to previous 1.2 (colored)

Cosmetic: s/xenv/oenv/

Revision 1.2 / (download) - annotate - [select for diffs], Tue Jul 15 20:56:13 2008 UTC (14 years, 6 months ago) by dyoung
Branch: MAIN
Changes since 1.1: +13 -1 lines
Diff to previous 1.1 (colored)

Only describe flags -L and -m in the usage if they are available.
That helps me get rid of some conditional compilation (INET6) in

Let each protocol/feature-module print its own usage, so that the
ifconfig usage reflects the modules that are actually compiled-in.

Write usage information for carp(4) options.

Revision 1.1 / (download) - annotate - [select for diffs], Wed Jul 2 07:44:15 2008 UTC (14 years, 7 months ago) by dyoung
Branch: MAIN

Let us add/remove features from ifconfig, such as support for
various address families (inet, inet6, iso, atalk) and protocols
(802.11, 802.3ad, CARP), simply by trimming the list of sources in
the Makefile.  This helps one customize ifconfig for an embedded
device or for install media, and it eliminates a lot of grotty
#ifdef'age.  Now, the ifconfig syntax and semantics are finalized
at run-time using the constructor routines in each address-family/protocol

(In principle, ifconfig could load virtually all of its syntax from
shared objects.)

Extract a lot of common code into subroutines, in order to shrink
the ifconfig binary a bit.  Make all of the address families share
code for address addition/replacement/removal, and delete "legacy"
code for manipulating addresses.  That may have broken atalk and
iso, despite my best efforts.

Extract an include file,, containing the make-fu that
both ifconfig and x_ifconfig share.

Sprinkle static.  Change some int's to bool's.  Constify.

Add RCS Ids to carp.c and env.c.  Move media code to a new file,
media.c.  Delete several unneeded header files.

Set, reset, and display the IEEE 802.11 attribute, 'dot11RTSThreshold'.

Bug fix: do not require both a interface address and a destination
address for point-to-point interfaces, but accept a interface
address by itself.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

CVSweb <>