Commit Graph

72 Commits

Author SHA1 Message Date
itojun
76a67357f0 fix alignment problem of SIOCGIFCONF, on 64bit arch. 1999-07-29 15:40:48 +00:00
thorpej
c483de17ca Make the previous actually compile. 1999-07-26 19:38:36 +00:00
darrenr
0717bdfdf2 cleanup error message 1999-07-26 12:00:47 +00:00
darrenr
870447b902 don't allow destination addresses to be set for non-Point-to-point interfaces 1999-07-26 11:56:55 +00:00
sommerfeld
8bfcc5ad34 Add a new -s option to make it easier to test the link-level status
(i.e., 10baseT carrier/no carrier) of an interface from scripts

ifconfig -s <interface> will exit with a false status if the interface
reports its unconnected.

-s also works in conjunction with -l and -a, filtering out interfaces
which are reporting down.

Also, add -b (which shows only broadcast interfaces with -l and -a).

I find these options useful in network autoconfig scripts for mobile
systems.
1999-07-03 17:31:15 +00:00
itojun
9a6abc8c5d s/CFLAGS/CPPFLAGS/ for -D and -I. 1999-07-03 06:26:25 +00:00
itojun
565fad43fa write up IPv6 operations (prefixlen and others) 1999-07-02 15:45:46 +00:00
itojun
25eb444e29 make ifconfig IPv6-ready.
TODO: update manpage for new options.
1999-07-01 13:19:20 +00:00
thorpej
e9d0bd756d Fix a slight braino in last. 1999-05-18 18:01:08 +00:00
thorpej
52971adece Don't force `inet' on status display; get all address families that have
configured addresses.  From Jun-ichiro itojun Hagino, PR #7593.
1999-05-17 16:00:05 +00:00
chopps
20a608fe88 revert the previous changes that removed special cased ioctls for ISO
stuff.
1999-04-01 08:12:23 +00:00
christos
7852090868 Add support for displaying interface alias information. Based on PR/6109 by
Phil Nelson.
1998-09-06 17:51:32 +00:00
thorpej
6bd72c7fd7 Cross-reference ifmedia(4). 1998-08-09 00:39:02 +00:00
thorpej
1dc9284e4f Document "instance". 1998-08-08 22:50:13 +00:00
thorpej
e1a1084860 Oops, add the "instance" command to the usage info. 1998-08-08 22:40:57 +00:00
thorpej
ecbe14b11c Allow the user to explicitly set the media instance. 1998-08-08 22:33:17 +00:00
thorpej
2e7d9319e9 Hm, actions might not always be deferred; rename appropriately. 1998-08-08 18:14:20 +00:00
thorpej
051e24ecad Completely rewrite the engine that sets media and media options. Previous
code would hit the interface multiple times.  Now, all media and media
options are gathered and processed at once, hitting the interface only
once (except to grab the currently selected media exactly once; there is
no way to avoid that).
1998-08-08 01:30:18 +00:00
thorpej
1549ffa563 Implement a suggestion from Wolfgang Solfrank on the "supported media"
display.  The display now looks like this:

bishop:thorpej 35$ obj.alpha/ifconfig -m fxp0
fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        media: Ethernet autoselect (100baseTX full-duplex)
        status: active
        supported Ethernet media:
                media autoselect
                media 100baseTX mediaopt full-duplex
                media 100baseTX
                media 10baseT mediaopt full-duplex
                media 10baseT
                media 100baseTX mediaopt loopback
        inet 129.99.50.41 netmask 0xffffff00 broadcast 129.99.50.255
bishop:thorpej 36$

The intent here is to allow cut'n'pasting of the output to a command
line, or allow easier automatic extraction from scripts, etc.

XXX Still at issue is what to do about non-0 media instances.
1998-08-06 19:22:00 +00:00
thorpej
3f0296f8ce Print the media instance if it's not zero, a reasonable compromise such
that no one will have to see those ugly instance numbers if they have
an interface with only one PHY (most of them out there).
1998-08-06 03:47:28 +00:00
thorpej
85fd419492 Completely rewrite the way media descriptions are represented. The same
data structure is used, but a much saner matching mechanism is used, one
which allows greater ease in adding new types.

Also, rewrite the way media words are displayed.  The status display now
looks like this:

bishop:thorpej 137$ ifconfig -m fxp0
fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        media: Ethernet autoselect (10baseT)
        status: active
        supported media:
                Ethernet autoselect
                Ethernet 100baseTX <full-duplex>
                Ethernet 100baseTX
                Ethernet 10baseT <full-duplex>
                Ethernet 10baseT
                Ethernet 100baseTX <loopback>
        inet 129.99.50.41 netmask 0xffffff00 broadcast 129.99.50.255
bishop:thorpej 138$

This makes it more clear which media type (e.g. Ethernet) is currently
in-use, handy for devices such as the TI ThunderLAN which can also have
both Ethernet and Token Ring PHYs attached.
1998-08-06 02:24:40 +00:00
thorpej
d2d470e18d Copyright assigned to The NetBSD Foundation, Inc. 1998-08-05 23:35:17 +00:00
enami
4385d9fe62 - Use .Nm "" instead of .Nm ifconfig in SYNOPSIS.
- Delete space at the end of line.
1997-10-11 02:44:36 +00:00
lukem
76e13a0128 all but the first .Nm in SYNOPSIS need to be spelt out. [bin/4256] 1997-10-10 16:12:45 +00:00
enami
21d836180a Don't declare optind. 1997-10-01 02:18:14 +00:00
lukem
92f7af5b8d * cleanup for WARNS=1
* deprecate register
* use .Nm correctly
1997-09-15 01:53:35 +00:00
mrg
70707ec9bc note that we have set ifflags so that we can reset them again after
setting the interface address.  this is necessary as we may want to
configure an interface `down' by default, but, SIOCAIFADDR turns the
interface back on for us.
1997-09-08 05:26:08 +00:00
is
2b70f759c5 ifr_metric vs. ifr_mtu: don't confuse people. Its a union anyway. 1997-07-14 12:54:27 +00:00
lukem
39cef8b32a Don't define the address of an interface to 0.0.0.0 if it's just being
brought "up" (without an address); don't give it an address at all.
From Koji Imada <koji@math.human.nagoya-u.ac.jp> in [bin/3477]
1997-05-30 05:44:11 +00:00
lukem
b4123d6862 Add "mask" argument to description of "broadcast".
From Thorsten Frueauf <frueauf@ira.uka.de> in [misc/3657]
1997-05-30 03:49:36 +00:00
thorpej
fd196425a8 Force the ifaliasreq "addreq" to have 4-byte alignment, so that casting
one of its sockaddrs to a sockaddr_in doesn't cause an unaligned access
fault on the Alpha.
1997-05-05 06:32:11 +00:00
lukem
13d5dd4446 Implemented two modifier flags for -a and -l: -d (only show "down" interfaces)
and -u (only show "up" interfaces)
1997-04-21 01:17:57 +00:00
is
d743f36705 Add mtu n parameter. Part of code by Matthias Pfaller (PR 1648). 1997-04-10 19:10:16 +00:00
jeremy
90a04776b1 Fix typo in media selector example. (from frueauf@ira.uka.de)
Fixes half of PR#3470.
1997-04-10 06:30:26 +00:00
christos
8e9ba6bac6 - netatalk additions
- KNF
- prototype fixes
- ifconfig -a now prints all the address family parameters for all configured
  interfaces.
1997-04-03 02:07:58 +00:00
thorpej
dbdde72e82 Add a "-l" flag, which lists available network interfaces, with no
additional information.
1997-03-27 22:50:09 +00:00
thorpej
a285d77f82 Print the station address of interfaces that have one. From
Matt Thomas <matt@3am-software.com>
1997-03-26 01:46:49 +00:00
thorpej
315d0c6cbb Display the correct interface name in the event SIOCGIFMEDIA "succeeds"
but doesn't return any media types.
1997-03-25 01:37:11 +00:00
thorpej
66addb16d6 Fix a slight bogon in printing active/current media, from Matt Thomas. 1997-03-24 00:45:30 +00:00
thorpej
797e996927 Fix lookup_media_word() to properly distinguish between the "autoselect"
media type and error.  (oops!)
1997-03-18 05:04:50 +00:00
thorpej
af71bad528 Do that last change somewhat differently; We need to know the
currently selected media, and thus cannot allow E2BIG, since the
top-level kernel ioctl code won't perform the copyout of the
ifmediareq if it sees an "error".
1997-03-18 01:50:01 +00:00
thorpej
55e07c34a2 Ignore E2BIG in domediaopt() like we do in setmedia(). Oversight pointed
out by Andrew Gallatin <gallatin@CS.Duke.EDU>.
1997-03-18 00:37:34 +00:00
thorpej
4fcebbc43a Add support for BSD/OS-style media selection:
- new "media" keyword specified media to select:
		ifconfig de0 media utp
	- new "mediaopt/-mediaopt" keywords for setting/clearing
	  media options (such as full-duplex)
	- new "-m" flag to display all supported media types for
	  a given interface.
Also, some generial cleanup of argument parsing while I was there.
Manual page updates from Jeremy Cooper <jeremy@netbsd.org>.
1997-03-17 03:08:46 +00:00
mycroft
f5b5efa5d5 Update to match kernel changes. 1996-09-08 14:37:39 +00:00
pk
9a4742e3ce Merge with lite-2. 1996-01-04 21:27:29 +00:00
pk
5f0532320e Agree with kernel on format of SIOCGIFCONF results. 1996-01-04 20:11:20 +00:00
gwr
ad5a72a23c Add support for -DINET_ONLY to make this smaller in a ramdisk. 1995-10-08 23:03:54 +00:00
mycroft
7888507f63 Use inet_aton(), not inet_addr(). Suggested by John Hawkinson. 1995-05-19 20:17:16 +00:00
cgd
0114e805ce convert to new RCS Id conventions; reduce my headache 1995-03-18 14:54:19 +00:00
glass
ddbe84a0ec fix usage message to include -a. fix command line handling for same 1995-01-21 21:22:16 +00:00