Commit Graph

67 Commits

Author SHA1 Message Date
Brooks Davis
1ce95f7862 Actuall make plumb work in addition to create as per the manpage.
PR:		bin/29812
Submitted by:	Joao Carlos Mendes Luis <jonny@eng05.embratel.net.br>
2001-08-17 22:16:11 +00:00
Hajimu UMEMOTO
59e7e5d169 ifconfig if0 netmask xxx.xxx.xxx.0 didn't change the netmask.
PR:		bin/28833
MFC after:	3 days
2001-07-26 16:44:19 +00:00
David E. O'Brien
b5cd49315a Dike out the IPX bits if RELEASE_CRUNCH is defined. 2001-07-21 00:35:11 +00:00
Brooks Davis
3e61dca08d Support network device cloning via create and destroy options.
Reviewed by:	ru, ume
Obtained from:	NetBSD
MFC after:	1 week
2001-07-02 20:52:34 +00:00
Hajimu UMEMOTO
3384154590 Sync with recent KAME.
This work was based on kame-20010528-freebsd43-snap.tgz and some
critical problem after the snap was out were fixed.
There are many many changes since last KAME merge.

TODO:
  - The definitions of SADB_* in sys/net/pfkeyv2.h are still different
    from RFC2407/IANA assignment because of binary compatibility
    issue.  It should be fixed under 5-CURRENT.
  - ip6po_m member of struct ip6_pktopts is no longer used.  But, it
    is still there because of binary compatibility issue.  It should
    be removed under 5-CURRENT.

Reviewed by:	itojun
Obtained from:	KAME
MFC after:	3 weeks
2001-06-11 12:39:29 +00:00
Poul-Henning Kamp
ca299b1fc0 When using interfaces that support if_media, the supported media list is
printed on a single, very long, and generally unreadable line.  This
isn't very useful.  It's also really ugly and most of the time you don't
care what media is supported anyway.

PR:		27701
Submitted by:	Brooks Davis <brooks@one-eyed-alien.net>
2001-05-29 09:13:44 +00:00
Poul-Henning Kamp
419d8080a4 Currently, each wireless networking driver has it's own control program
despite the fact that most people want to set exactly the same settings
regardless of which card they have.  It has been repeatidly suggested
that this configuration should be done via ifconfig.  This patch
implements the required functionality in ifconfig and add support to the
wi and an drivers.  It also provides partial, untested support for the
awi driver.

PR:		25577
Submitted by:	Brooks Davis <brooks@one-eyed-alien.net>
2001-05-26 09:27:08 +00:00
Jesper Skriver
e1387e5d19 Implement slash/CIDR notation for IPv4 and IPv6 addresses.
MFC after: 1 week

Reviewed by:	phk
Obtained from:	NetBSD
2001-05-04 18:45:36 +00:00
Hajimu UMEMOTO
bf8a1b099f if no address is setted, do not call ioctl(SIOCAIFADDR)
Obtained from:	KAME
2001-02-21 18:15:18 +00:00
Andrey A. Chernov
17927a641c Add missing && which absense stops 'make world' 2000-11-30 23:01:43 +00:00
Luigi Rizzo
ee7b8babab remove an undefined reference when no VLAN support is compiled in. 2000-11-30 21:35:09 +00:00
Hajimu UMEMOTO
1ada402aa4 Add missing initialization for IPv6 address lifetime.
PR:		misc/22884
Obtained from:	KAME
2000-11-27 08:44:57 +00:00
Archie Cobbs
abc3361a8b Show the actual command line usage in the man page and usage error string. 2000-07-19 17:24:53 +00:00
Archie Cobbs
d80e7aa796 Make "ifconfig" with no arguments equivalent to "ifconfig -a". 2000-07-18 22:07:31 +00:00
John Baldwin
de010cdfd0 Add support to the 'ether' address family to support setting of addresses.
This allows you to set ether addresses with 'ifconfig ether'.  Also, use
some saner socket address families that allow several special case tests
to be removed.
2000-07-12 16:41:47 +00:00
Bill Paul
b106252c19 Implement SIOCSIFLLADDR, which allows you to change the link-level
address on an interface. This basically allows you to do what my
little setmac module/utility does via ifconfig. This involves the
following changes:

socket.h: define SIOCSIFLLADDR
if.c: add support for SIOCSIFLLADDR, which resets the values in
      the arpcom struct and sockaddr_dl for the specified interface.
      Note that if the interface is already up, we need to down/up
      it in order to program the underlying hardware's receive filter.
ifconfig.c: add lladdr command
ifconfig.8: document lladdr command

You can now force the MAC address on any ethernet interface to be
whatever you want. (The change is not sticky across reboots of course:
we don't actually reprogram the EEPROM or anything.) Actually, you
can reprogram the MAC address on other kinds of interfaces too; this
shouldn't be ethernet-specific (though at the moment it's limited to
6 bytes of address data).

Nobody ran up to me and said "this is the politically correct way to
do this!" so I don't want to hear any complaints from people who think
I could have done it more elegantly. Consider yourselves lucky I didn't
do it by having ifconfig tread all over /dev/kmem.
2000-06-16 20:14:43 +00:00
Peter Wemm
3812e2664a Purely cosmetic tweak, use consistant whitespace with scopeid. 2000-03-06 05:29:56 +00:00
Yoshinobu Inoue
62585e33b0 Print scope id for scoped addrs.
Approved by: jkh
2000-02-28 18:38:19 +00:00
Robert Watson
d6d1cb48a9 Introduce `add'' and remove'' as alternatives to alias'' and `delete''.
Improve compatibility with BSD/OS, and also more accurately reflect that
IP aliases aren't really any different than the primary IP address on an
interface.

Reviewed by:	dcs
Approved by:	jkh
2000-02-26 18:55:39 +00:00
Yoshinobu Inoue
94fafad064 Support IPv6 scoped addr in ifconfig and route
IPv6 scoped addr display is not yet supported by ifconfig
   and route. Now almost of IPv6 apps support it, so its support
   in ifconfig and route is important to keep consisetncy, and
   to avoid user confusion.

Approved by: jkh
2000-02-10 03:03:09 +00:00
Ruslan Ermilov
749daf9e05 - do not dereference a null pointer.
- minor sanity.

PR:		15318
1999-12-29 13:53:13 +00:00
Bill Fumerola
f06590f690 Spelling correction (adress -> address) 1999-12-16 01:05:48 +00:00
Yoshinobu Inoue
cfa1ca9dfa udp IPv6 support, IPv6/IPv4 tunneling support in kernel,
packet divert at kernel for IPv6/IPv4 translater daemon

This includes queue related patch submitted by jburkhol@home.com.

Submitted by: queue related patch from jburkhol@home.com
Reviewed by: freebsd-arch, cvs-committers
Obtained from: KAME project
1999-12-07 17:39:16 +00:00
Mike Smith
f3722ef609 If we don't appear to have a module loaded supporting the interface
we're about to operate on, try to load one.  Don't complain if the
load fails, and always press on regardless (there may not be a module
suitable or required).

With the renaming of the PCI ethernet driver modules and the addition
of appropriate miibus dependancies on those modules that need it, it is
now no longer necessary to compile many ethernet drivers into the kernel;
they will be loaded on demand the first time they are ifconfig'ed.

Inspiration from: mount
Reviewed by:	obrien
1999-09-20 07:58:08 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Poul-Henning Kamp
6003dc8e9b Move the IFSTATUS stuff after the address listing. 1999-06-19 20:07:24 +00:00
Poul-Henning Kamp
413dd0ba39 Add a new interface ioctl, to return "aux status".
This is inteded for to allow ifconfig to print various unstructured
information from an interface.

The data is returned from the kernel in ASCII form, see the comment in
if.h for some technicalities.

Canonical cut&paste example to be found in if_tun.c

Initial use:
        Now tun* interfaces tell the PID of the process which opened them.

Future uses could be (volounteers welcome!):
        Have ppp/slip interfaces tell which tty they use.
        Make sync interfaces return their media state: red/yellow/blue
        alarm, timeslot assignment and so on.
        Make ethernets warn about missing heartbeats and/or cables
1999-06-19 18:42:31 +00:00
Poul-Henning Kamp
cf4b937128 Introduce IFF_SMART bit.
This means that the driver will add/delete routes when it knows it is
up/down, rather than have the generic code belive it is up if configured.

This is probably most useful for serial lines, although many PHY chips
could probably tell us if we're connected to the cable/hub as well.
1999-06-06 09:17:51 +00:00
Bill Paul
97ed1257f9 Grrr... botched remote commit. Let's try this again: vlan updates,
take two.
1999-03-15 01:22:01 +00:00
Poul-Henning Kamp
511d9c69ba unifdef -UISO
Inspired by bdes comment to PR: 7419
1998-08-07 06:36:53 +00:00
Bruce Evans
91ba27a769 ioctl() request args are unsigned longs, so don't attempt to store
them as ints.  Among other bugs, doing so at best caused benign
overflow followed by fatal sign extension on machines with 32-bit
ints and 64-bit longs.
1998-07-06 19:54:39 +00:00
Philippe Charnier
e333b9445f Update man page to allow adding address_family when -l is used (this is a no op
for now). Correct use of .Nm. Short usage string (see man page for full list).
Spelling.  Use err(3).
1998-07-06 06:53:43 +00:00
Eivind Eklund
83e6569390 Make 'ifconfig -l ether' only list Ethernet interfaces. This is
useful, intuitive, and match the old comments in the source.
Previously, 'ifconfig -l ether' and 'ifconfig -l' were equal.
1998-03-19 20:58:45 +00:00
Warner Losh
b1a3bc5ea0 style(9) corrections
Submitted by:	bde
1997-12-26 23:28:17 +00:00
Warner Losh
9ae323c5f0 Be extra paranoid about trusting the size of the address returned from
gethostbyaddr.
Submitted by:	Julian Assange
1997-12-24 00:57:41 +00:00
Steve Price
0f30219fa8 Fix a misleading comment.
PR:		bin/4861
Submitted by:	Alex <garbanzo@hooked.net>
1997-10-27 03:28:44 +00:00
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