Commit Graph

91 Commits

Author SHA1 Message Date
Peter Wemm
566214a32a Give wider types to sscanf to fix two warnings (u_short cannot be > 0xffff)
and to make sure that we catch oversized arguments rather than silently
truncate them.  I dont know if sscanf will reject an integer if it will
not fit in the short return variable or not, but this way it should be
detected.
2003-10-26 04:36:47 +00:00
Ruslan Ermilov
deb62e2887 By popular demand, added the "static ARP" per-interface option. 2003-10-01 08:32:37 +00:00
Sam Leffler
4e61f6f1f6 add a "mode" directive to specify the operating mode for multi-mode devices;
this is mostly intended for use with multi-mode 802.11 devices that support
some combination of 11a, 11b, and 11g
2003-04-28 16:37:38 +00:00
Matthew N. Dodd
71d66ceb2c Don't abuse module names to facilitate ifconfig module loading;
such abuse isn't really needed.  (And if we do need type information
associated with a module then we should make it explicit and not
use hacks.)
2003-04-15 06:25:58 +00:00
Peter Wemm
059c32d2eb Kill #ifdef NS code 2003-03-05 19:18:05 +00:00
Matthew N. Dodd
83d5e173ac Add missing #if USE_IF_MEDIA/#endif. 2003-01-23 18:31:56 +00:00
Max Khon
b8701b5430 fix link_status() in non-Ethernet case
MFC after:	1 week
2003-01-22 00:14:34 +00:00
Sam Leffler
94da260035 o display new interface capability bits
o capitilize capability bit strings for consistency

Approved by:	re
2002-11-15 00:02:21 +00:00
Poul-Henning Kamp
fb3133242f Report the MONITOR bit. 2002-10-24 17:23:52 +00:00
Robert Watson
97490f4b3c Rename ifconfig's "mac" argument to "maclabel" to prevent confusion
regarding 802.1 MAC and Mandatory Access Control (MAC).  Some
potential for confusion remains further in other areas of the
system regarding Message Authentication Codes (MAC).

Requested by:	wollman
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-23 22:50:04 +00:00
Robert Watson
2d58d642d2 Teach ifconfig(8) how to print and set the MAC labels on network
interfaces using the 'mac' argument.  Without MAC support in the
kernel, this does not change the behavior of ifconfig.

Approved by:	re
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-23 03:40:47 +00:00
Dima Dorfman
b6fcb4fec3 Don't crash when the user feeds us nonesense in the form:
ifconfig IF ether WHATEVER -alias

PR:		42544
Submitted by:	Mike Makonnen <makonnen@pacbell.net>
2002-10-02 02:17:59 +00:00
Poul-Henning Kamp
afbe3a0f81 Add the "Monitor" interface flag.
Setting this flag on an ethernet interface blocks transmission of packets
and discards incoming packets after BPF processing.

This is useful if you want to monitor network trafic but not interact
with the network in question.

Sponsored by:	http://www.babeltech.dk
2002-09-27 18:57:47 +00:00
Maxim Sobolev
ffb079be0c Implement user-setable promiscuous mode (a new `promisc' flag for ifconfig(8)).
Also, for all interfaces in this mode pass all ethernet frames to upper layer,
even those not addressed to our own MAC, which allows packets encapsulated
in those frames be processed with packet filters (ipfw(8) et al).

Emphatically requested by:	Anton Turygin <pa3op@ukr-link.net>
Valuable suggestions by:	fenner
2002-08-19 15:16:38 +00:00
Maxim Sobolev
3471c917ec Fix last-minute typo which breaks the world.
Submitted by:	many
2002-08-19 08:59:20 +00:00
Maxim Sobolev
62f7648682 Increase size of ifnet.if_flags from 16 bits (short) to 32 bits (int). To avoid
breaking application ABI use unused ifreq.ifru_flags[1] for upper 16 bits in
SIOCSIFFLAGS and SIOCGIFFLAGS ioctl's.

Reviewed by:	-hackers, -net
2002-08-18 07:05:00 +00:00
Hajimu UMEMOTO
331a2db8a9 Add eui64 option which fills interface index (lowermost 64bit of
an IPv6 address) automatically.
This should obsolete prefix(8).

Obtained from:	NetBSD
MFC after:	2 weeks
2002-06-15 15:35:24 +00:00
Warner Losh
bc123897ed De-__P, use ansi function definitions 2002-04-18 17:14:09 +00:00
Ruslan Ermilov
1876df83f4 Turn "ether" address family into a generic "link" family
that could be used to set/get arbitrary length link level
addresses.  Alias "lladdr" parameter and "ether" family
to the new "link" family for backward compatibility.

PR:		bin/31476
MFC after:	1 week
2002-03-27 14:29:23 +00:00
David E. O'Brien
3d438ad61f Remove 'register' keyword.
It does not help modern compilers, and some may take some hit from it.
(I also found several functions that listed *every* of its 10 local vars with
 "register" -- just how many free registers do people think machines have?)
2002-03-20 17:55:10 +00:00
Ruslan Ermilov
47af9353ea MTU and metric are available with NET_RT_IFLIST.
MFC after:	3 days
2001-12-03 15:12:45 +00:00
Jonathan Lemon
1643c8f3eb When specifying an interface to ifconfig, first look up the interface
index, then retrieve statistics for that index, rather than retrieving
all interfaces and then looking for a matching name.  This allows the
user to refer to an interface via an alias name.

While I'm here, also perform a few assorted cleanups.
2001-10-17 18:30:13 +00:00
Jonathan Lemon
5fc10eaf8e Split hwcsum into rxcsum and txcsum components. 2001-09-18 20:13:48 +00:00
Jonathan Lemon
f35b9d165f Teach ifconfig about the new interface capability words. 2001-09-18 17:43:30 +00:00
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