Commit Graph

98 Commits

Author SHA1 Message Date
enami 16fcce9bb7 Allocate flagreq on stack. 2000-04-20 02:08:55 +00:00
itojun 4a58ed7b4f use getifaddrs, not SIOCGIFCONF, to avoid alignment constraints.
TODO: maybe it's better to pass struct ifaddrs * to in{,6}_alias.
2000-04-13 07:39:57 +00:00
itojun dbe85fd5ef clarify in_alias() and in_status().
in_status() handles the whole inet address family.  in_alias() handles
printout for single address (for both the primary address or an alias).
it is more consistent with, for example, the way at_status() is used.
2000-04-13 07:16:54 +00:00
enami 2a9be1168a Explicitly pick up ''the first address'' to delete. 2000-04-03 03:54:42 +00:00
onoe 36af21fa48 Set flagreq.ifr_name before issueing SIOCGIFFLAGS for setifflags.
Withoug this change, flagreq was never initialized and ifconfig w/o addr
always failed with ENXIO.
2000-03-20 21:10:03 +00:00
castor 70e0196cb3 Fix PR bin/9629. The global variable ifr was used to save interface
flags even though the media routines tweak it.
2000-03-18 21:10:50 +00:00
enami 5fa4437659 Remove unnecessary continue statement. 2000-03-06 09:00:13 +00:00
enami f7f205fedf Remove now unnecessary assignment. It looks like 4.4lite merge left over. 2000-03-06 08:45:35 +00:00
enami e5f114df26 Don't copy from destination to destination. 2000-03-06 08:08:15 +00:00
thorpej 600e504f64 Per a discussion on gcc-bugs, port-alpha/9494 is not a compiler bug, but
rather a bug in the code (which is violating the C standard by casting
an unaligned pointer to a pointer with more strict alignment constraints).

Fix the code to not do such things.  Fixes port-alpha/9494.
2000-03-06 01:06:17 +00:00
enami 6059f8bc37 Fix typo. 2000-03-01 03:32:55 +00:00
enami eb6c30723e Salvage the better comment appeared in rev 1.51 but gone in 1.53. 2000-03-01 03:21:56 +00:00
itojun bd3400c592 more fix to SIOCGIFCONF alignment. 2000-02-18 08:14:26 +00:00
itojun a6cfc0a168 note that ifconfig delete does not work for IPv6
this is intentional - IPv6 assumes multiple addresses on an interface,
and it is not very safe to "delete" arbitrary one.  -alias with
explicit IPv6 address works fine.
2000-01-31 18:02:01 +00:00
itojun 809b9a5822 add "nwid" directive.
XXX there are too many flags that are not listed in usage().
what should we do?
2000-01-31 17:22:28 +00:00
mycroft 3d237fafa8 Fix a buglet that caused media-specific options to *always* be printed, even if
they were not set.
2000-01-25 06:11:25 +00:00
thorpej 409e9f1b38 Fix a logic buglet in status printing code. 2000-01-25 02:16:57 +00:00
thorpej efe1032de0 - Print 802.11 status (i.e. network ID) after mtu, etc. but before
protcol addresses.
- When searching for status bits, use the currently selected media type,
  not the currently active media type.
2000-01-25 01:46:57 +00:00
thorpej 98ac9f3fdb Update copyright. 2000-01-25 01:03:21 +00:00
thorpej 4e10c0202f Make display of media status information (e.g. carrier, etc.) table-driven
and easily extensible (by merely adding to the tables in ifmedia.h).
2000-01-25 00:59:39 +00:00
chopps 2377e11b8d allow setting (and reporting) nwid for ieee 802.11 devices. 2000-01-24 23:24:16 +00:00
thorpej 9e4fad9efa Fix a bug in get_media_options() which wasn't caught with global options;
make sure we only return option bits.
2000-01-24 22:31:27 +00:00
joda 4aafeffb6f implement netmask slash notation for IP and IPv6 addresses 2000-01-12 10:29:35 +00:00
itojun 5f036cce1d bring in KAME scopeid hack. always show scopeid if it is scoped.
sync with latest KAME.
1999-12-13 15:24:45 +00:00
itojun b9cc391094 prepare -DKAME_SCOPEID for extended scope id printing (commented out) 1999-12-12 11:44:53 +00:00
itojun a338a0d47b add reference to "inet6" family.
document -alias.
1999-12-09 01:28:25 +00:00
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