Commit Graph

31 Commits

Author SHA1 Message Date
Peter Wemm
41cd75b799 Make the supported media info output the default.
The -m switch is now accepted for backwards compatability.

Suggested by: davidg
1997-10-16 03:55:29 +00:00
Peter Wemm
c514950585 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.
1997-05-10 17:14:53 +00:00
Peter Wemm
eca42d3ce0 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
1997-05-10 14:47:35 +00:00
Peter Wemm
9c3b235f46 Restore unintentially lost backwards compat behavior of defaulting to
family inet if not specified.  (eg: "ifconfig ed0" down would fail because
no family was specified, even though the up/down status is not per family)

Pointed out by: Wolfgang Helbig <helbig@MX.BA-Stuttgart.De>
1997-05-07 04:28:26 +00:00
Peter Wemm
9906480a84 Commit hooks for ifmedia support. It's optional in the Makefile, and
can be trivially disabled.
1997-05-04 06:27:45 +00:00
Peter Wemm
ed055a8342 Second try at cleanups and fixes (without if_media stuff for the moment)
- parse command options using getopt for consistancy
- sanitise the command parsing so that it's less like spaghetti
- implement a "-l" option (idea from NetBSD - just list names)
- attempt to clean up the sysctl parsing loop some more.  It still needs
  to be taken out the back and shot though.
- cut down on global usage, but there's a lot more scope for this.
- make usage string a bit closer to reality (it was missing lots of things)

Unfortunately, I did this for the second time but with the memory of
the NetBSD version still recently in my mind.  It's hard to redo simple
changes or getopt stuff without making it look like what you've been
working with a few hours ago.
1997-05-04 06:14:47 +00:00
Peter Wemm
fa738d1534 force null commit to skip over rev 1.25 so there's less cvs trouble 1997-05-04 06:00:27 +00:00
Peter Wemm
c0ec1f37ef Revert $FreeBSD$ to $Id$ 1997-02-22 14:40:44 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Garrett Wollman
702a1d0148 Update to match changes in <net/if.h>. 1997-01-03 20:19:50 +00:00
Garrett Wollman
628d2ac1b0 Fix up programs which expect <net/if.h> to include <sys/time.h> to instead
do it themselves.  (Some of these programs actually depended on this
beyond compiling the definition of struct ifinfo!)  Also fix up some
other #include messes while we're at it.
1996-12-10 17:11:53 +00:00
Garrett Wollman
a1199adebc Fix lots of non-bug questionable code:
- Don't link against libkvm and don't uselessly include <kvm.h>.
- Declare constant objects as const.
- Declare functions with the correct types.
- Call functions with the correct parameters.

Not fixed:

- The sysctl parsing remains ugly (but it may be the best we can do).
- atnetrange() should use strtoul() rather than sscanf() for better
  error checking.
1996-11-21 19:36:09 +00:00
Julian Elischer
55d27aaac8 Get rid of an unexpectedly bogus sanity check under appletalk because
it stopped us from removing or setting loopback address
on lo0:

also make use of the fact the athe sockaddre_at struct now has a "netrange"
field.

CVS ----------------------------------------------------------------------
1996-09-04 19:41:31 +00:00
Julian Elischer
3a67d2bc37 Submitted by: archie@whistle.com
appletalk cleanups
1996-07-23 01:18:47 +00:00
Alexander Langer
c6c1bba8d4 Grammar fix described by wollman in response to PR 1363. 1996-07-14 17:51:08 +00:00
Julian Elischer
e05f2836d9 Submitted by: Archie@whistle.com
Obtained from: Whistle Communications
patches to allow ifconfig to work with appletalk addresses etc.
1996-07-09 02:38:13 +00:00
Garrett Wollman
cbc17e711e XNS sort-of-support is no more. 1996-02-13 17:30:37 +00:00
Garrett Wollman
0761cb293e Remove support for OSI networking in user-land (#ifdef OSI aor CCITT)
in preparation for its removal from the kernel source tree.  NB: because
a function was deleted, libc is now at version 3.0 (was 2.2 previously).
1996-02-06 20:36:15 +00:00
Andrey A. Chernov
34b8a752b1 Add missing comma in usage printf 1996-01-30 17:38:45 +00:00
Peter Wemm
e416b391a4 Yet another "fix" for some of the mistakes in the recent versions..
I discovered that when asking for the IFLIST via sysctl(), if you
specify only AF_INET address, it actually gives you only AF_INET..
(suprise, suprise..!)

Now, it should "do the right thing" in just about all cases...  The only
problem, is that "the right thing" isn't exactly clear in all cases.
1996-01-08 10:23:25 +00:00
Peter Wemm
79769a745d Fix some of my mistakes, slight cleanup, improve reliability (the old
ifconfig would segfault on "ifconfig ed0 ether up" and the like).

The main reason for this commit was that an "ifconfig -a" would also show
the AF_INET addresses in AF_IPX form (if the kernel was configured for IPX)
due to insufficient AF checking in my "new way" of doing it.
1996-01-08 03:46:27 +00:00
Peter Wemm
062d242e1a My really ugly hack to ifconfig to make it pick up interface aliases
and the ethernet address for non-root users.

I apologise to the world for propagating the ugliness of some of the code
constructs within ifconfig...  Fixing them would just abou mean rewriting
most of the function call interfaces, something I didn't have the stomach
for. :-)
1996-01-01 09:05:22 +00:00
Garrett Wollman
ee9a463848 Use a dynamically-sized buffer for SIOCGIFCONF so that `ifconfig -a'
actually retrieves all the information no matter how many interfaces
there are.  (Probably there are other utilities which need similar
modification.)

Submitted by:	Andrew Webster <awebster@dataradio.com>
1995-12-07 19:21:53 +00:00
Julian Elischer
cc6a66f20e Reviewed by: julian and jhay@mikom.csir.co.za
Submitted by:	Mike Mitchell, supervisor@alb.asctmd.com

This is a bulk mport of Mike's IPX/SPX protocol stacks and all the
related gunf that goes with it..
it is not guaranteed to work 100% correctly at this time
but as we had several people trying to work on it
I figured it would be better to get it checked in so
they could all get teh same thing to work on..

Mikes been using it for a year or so
but on 2.0

more changes and stuff will be merged in from other developers now that this is in.

Mike Mitchell, Network Engineer
AMTECH Systems Corporation, Technology and Manufacturing
8600 Jefferson Street, Albuquerque, New Mexico 87113 (505) 856-8000
supervisor@alb.asctmd.com
1995-10-26 20:31:59 +00:00
Rodney W. Grimes
5ebc7e6281 Remove trailing whitespace. 1995-05-30 06:12:45 +00:00
Paul Traina
ef6304d8c6 Replace call to obsolete inet_addr routine with inet_aton so we can specify
netmasks and broadcast addresses of 255.255.255.255.
1995-04-26 16:52:40 +00:00
Bill Paul
f7fa522e95 Impliment -ad and -au flags in addition to -a and document the change
in the man page. ifconfig -au affects all interfaces marked as up,
and ifconfig -ad affects only the interfaces marked down. ifconfig -a
still handles everything. This change is purely for compatibility with
SunOS, for those who might be accustomed to the SunOS ifconfig's
behavior.
1995-03-12 19:05:03 +00:00
Jordan K. Hubbard
a309172130 From: Wankle Rotary Engine <wpaul@skynet.ctr.columbia.edu>
- The -a flag now works just as it does in SunOS: '-a' is actually
  handled like a wildcard for all interfaces. 'ifconfig -a' displays
  the status of all interfaces, 'ifconfig -a netmask 0xffffff00' sets
  the netmask of all interfaces, and so forth. I don't know if many
  people really need to be able to set the netmasks of all interfaces
  at once, but the SunOS ifconfig seems to allow this, so there you
  have it.

- An 'ether_status' function has been added to display the ethernet
  address of all ethernet interfaces. Again, as in SunOS, you must
  be root in order for this to work. The ethernet address is read
  from /dev/kmem using kvm_open() and kvm_read(), much in the same
  was as it's done with netstat. If you choose to install ifconfig
  set-gid kmem then normal users will be able to see the ethernet
  address as well, though this may not be desireable. This feature
  requires a small change to the ifconfig Makefile: you need to link
  with -lkvm in order to use the kvm_*() functions.

Submitted by:	wpaul
1994-12-30 22:42:41 +00:00
Andreas Schulz
794cdf17ef Add parameters "compress", "normal" and "noicmp" for the slip usage.
These names are used in the slip.hosts file as examples, but ifconfig
have formerly only accepted link0, -link0 and link1 for this.
1994-11-20 19:45:58 +00:00
David Greenman
4db32b036d Added support for setting the per-interface MTU. 1994-08-08 10:45:06 +00:00
Rodney W. Grimes
8fae3551ec BSD 4.4 Lite sbin Sources
Note:  XNSrouted and routed NOT imported here, they shall be imported with
usr.sbin.
1994-05-26 06:35:07 +00:00