Commit Graph

79 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 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
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 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 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 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 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
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
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