Commit Graph

275 Commits

Author SHA1 Message Date
Joerg Wunsch
00bbbd73e9 Round #2. This basically brings back the changes from rev 1.12.
I have only separated both to make it more convenient merging all this
into 2.2.
1997-01-17 23:56:20 +00:00
Joerg Wunsch
e4107dcf00 This mega-merge brings Matt Thomas' 960801 FDDI driver (almost) up
to -current.

Thanks goes to Ulrike Nitzsche <ulrike@ifw-dresden.de> for giving me
a chance to test this.  Only the PCI driver is tested though.

One final patch will follow in a separate commit.  This is so that
everything up to here can be dragged into 2.2, if we decide so.

Reviewed by:	joerg
Submitted by:	Matt Thomas <matt@3am-software.com>
1997-01-17 23:54:45 +00:00
Garrett Wollman
c7e54a6a04 Don't try to do anything with the `ifr' parameter for SIOCADDMULTI
and SIOCDELMULTI; it is guaranteed to be null in the new system.
1997-01-17 19:38:16 +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
477180fbc8 Use the new if_multiaddrs list for multicast addresses rather than the
previous hackery involving struct in_ifaddr and arpcom.  Get rid of the
abominable multi_kludge.  Update all network interfaces to use the
new machanism.  Distressingly few Ethernet drivers program the multicast
filter properly (assuming the hardware has one, which it usually does).
1997-01-13 21:26:53 +00:00
Garrett Wollman
b20531189a Fix typo. I hate waking up at 4:45 in the morning... 1997-01-08 15:23:17 +00:00
Garrett Wollman
4f079e2ff0 Correctly account for header length in m_pkthdr.len when sending
packets through BPF.

Submitted by:	seki@sysrap.cs.fujitsu.co.jp in PR#2415
1997-01-08 14:17:27 +00:00
Garrett Wollman
373f88ed5c Fix a few oversights in the new multicast membership interface. 1997-01-08 13:20:25 +00:00
Garrett Wollman
1158dfb736 Checkpoint the beginnings of the new kernel interface for
multicast group memberships.  This is not actually operative
at the moment (a lot of other code still needs to be changed), but
this seemed like a useful reference point to check in so that
others (i.e. Bill Fenner) have fair warning of where we are going.
1997-01-07 19:15:32 +00:00
Garrett Wollman
9cb3aff230 Move the ethertypes from <netinet/if_ether.h> to <net/ethernet.h>.
Many programs need the numbers but don't need the internals of ARP.

More commits to follow...
1997-01-03 19:51:54 +00:00
Garrett Wollman
19ff91c6b0 Separate kernel-internal data structures from exposed user interface
to interfaces.  (Amazing nobody had done this!)

More commits to fix up user-land to follow.
1997-01-03 19:50:26 +00:00
Bruce Evans
323416489d More cleanups to satisfy the following rules:
- C++ should be supported for application functions (use __BEGIN_DECLS,
  etc.).
- prototypes should be sorted.
- comments on #endif's should spell identifiers the same as the code.
- comments on #endif's should have the same sense as the code (use `!'
  to match ifndef, etc.).
1996-12-19 18:12:06 +00:00
Garrett Wollman
992af1d001 Clean up Bill's additions. 1996-12-19 15:42:52 +00:00
Bill Paul
18fe100709 Add prototypes for ethers.3 functions as per wollman:
> wollman     96/12/10 09:19:15
>
>   Modified:    lib/libc/net  ether_addr.c ethers.3
>   Log:
>   Get struct ether_addr directly from <net/ethernet.h> rather than pulling
>   in lots of unrelated junk from <net/if.h> and <net/if_ether.h>.  These
>   functions still aren't prototyped anywhere (but should be in
>   <net/ethernet.h>---got that, Bill?).

(Note that this file has no copyright header; one should probably
be added.)
1996-12-18 21:42:38 +00:00
Bruce Evans
8b1f0fa595 Fixed pedantic syntax error. 1996-12-18 19:36:01 +00:00
Bill Fenner
c812f23a41 Change default tun MTU back to 1500.
Use the interface MTU instead of the constant when deciding what
	packets to accept.
Allow using the SIOCSIFMTU ioctl (e.g. "ifconfig tun0 mtu XXX") to
	set the MTU.
1996-12-16 19:23:34 +00:00
Garrett Wollman
59562606b9 Convert the interface address and IP interface address structures
to TAILQs.  Fix places which referenced these for no good reason
that I can see (the references remain, but were fixed to compile
again; they are still questionable).
1996-12-13 21:29:07 +00:00
Garrett Wollman
294121822b Use queue macros for the list of interfaces. Next stop: ifaddrs! 1996-12-11 20:38:25 +00:00
Garrett Wollman
4963f4cd96 Include <net/if_arp.h> in the one header that requires it,
<netinet/if_ether.h>, rather than in <net/if.h>, most of whose callers
have no need of it.

Pointed-out-by:	bde
1996-12-11 17:46:33 +00:00
Garrett Wollman
662f33aaf6 Finally, after six years, remove the ``quick hack for SNMP'' that was
``going away soon''.
1996-12-10 18:03:51 +00:00
David Greenman
fb5831565c 1) Implement SIOCSIFMTU in ether_ioctl(), and change ether_ioctl's return
type to be int so that errors can be returned.
2) Use the new SIOCSIFMTU ether_ioctl support in the few drivers that are
   using ether_ioctl().
3) In if_fxp.c: treat if_bpf as a token, not as a pointer. Don't bother
   testing for FXP_NTXSEG being reached in fxp_start()...just check for
   non-NULL 'm'. Change fxp_ioctl() to use ether_ioctl().
1996-12-10 07:29:50 +00:00
Julian Elischer
610600118c 2 small changes:
1/ increase the tun MTU from 1500 to 1600 to allow it to be used with
packets formatted according to RFC1490 and RFC1717

2/ allow the tsleep() when reading, to be interruptable by signals
so that one can now do:
od -xc </dev/tun0
to dump packets for debugging without getting hung.

Passed on by: Archie@whistle.com (archie Cobbs)

Nice but not neccessary in 2.2
1996-12-02 21:07:33 +00:00
David Greenman
5b73c1866a Fixed broken SIOCGIFADDR. It was copying out garbage as the ethernet
address.
1996-11-18 04:55:44 +00:00
David Greenman
fda73cc59a Killed "unknown protocol" printf. 1996-11-12 08:43:32 +00:00
Bill Fenner
a73356a1be Fix comments, which appear to have been mangled long ago and far away. 1996-10-21 23:05:57 +00:00
Jordan K. Hubbard
d0ec898db5 ns_nettype should be declared, not externed. 1996-10-18 15:59:25 +00:00
Jordan K. Hubbard
88e038fe4a Netcon's changes for their extended NS support. This only effects
people compiling with NS, so the effects on everyone else are nil.
1996-10-17 17:16:58 +00:00
Bruce Evans
4458ac71b1 Removed nested include if <sys/socket.h> from <net/if.h> and
<net/if_arp.h> and fixed the things that depended on it.  The nested
include just allowed unportable programs to compile and made my
simple #include checking program report that networking code doesn't
need to include <sys/socket.h>.
1996-10-12 19:49:43 +00:00
Garrett Wollman
a3af8d44a3 Add primitive link MIB support. 1996-10-11 18:40:48 +00:00
Garrett Wollman
6303c69c89 Get rid of obsolete RTF_MASK and RTF_CHAINDELETE flags. 1996-10-09 18:35:10 +00:00
Garrett Wollman
011acecf50 Remove some historical cruft inherited from the loopback driver in which
there were three possible different code paths through which we could
discard a packet (which, after all, is the entire function of this interface).
1996-10-07 19:11:55 +00:00
Julian Elischer
b0a76b8898 No code changes what so ever, but added about 150 lines of comments
Sorry if this makes it harder to merge in lite2 stuff but hey..
At least I can figure out what is going on whenever I end up going through those
files again..

do we have a policy regarding commenting existing code?
1996-09-10 07:10:05 +00:00
Satoshi Asami
1225e2435d Second phase of merge, get rid of more machine-independent-dependencies.
Get rid of pc98/pc98/pc98_device.h.

Submitted by:	The FreeBSD(98) Development Team
1996-09-03 10:24:29 +00:00
Bill Fenner
704b066633 Bugfix and simplification for rev 1.34: make sure that the route
is non-null before trying to delete it in rt_setgate(), which then
allows removal of the special-case code from the RTM_ADD case.
This should fix the panics that joerg and Phil Karn have been seeing.
1996-09-02 02:49:40 +00:00
John Hay
a48bd49079 Get rid of the ifdef MULTICAST's. I think the rest of the kernel got rid
of them 2 years ago.
1996-08-30 16:44:36 +00:00
Satoshi Asami
91eb961985 Re-sync with the state of PC98 world. This will be the last commit before
we start merging things in earnest...

Submitted by:	The FreeBSD(98) Development Team
1996-08-30 10:43:14 +00:00
Garrett Wollman
1de1c45200 Add some padding to struct ifmibdata and move the `struct ifdata' to
the end of that sstructure to make evolution easier.

Add definitions for the 802.3/Ethernet MIB.  To implement this, simply
add a `struct ifmib_iso_8802_3' somewhere in your interface's softc,
point if_linkmib to it, set if_linkmiblen, and fill in the statistics
with appropriate values.  (I didn't want to create Yet Another Ethernet-
related header file, otherwise this would have been separated out.)
1996-08-28 18:32:19 +00:00
Julian Elischer
aba926bda4 correct a field comment that someone must have accidentally spammed
as it's still used for what the original BSD4.4 comment says it's for.
1996-08-26 23:17:17 +00:00
Julian Elischer
8a15e7f475 change a comment to match what the BSD4.4 book says. 1996-08-26 22:04:47 +00:00
Peter Wemm
3271a3a4f3 route.c:RTM_ADD does not check for a netmask before doing a tree walk
like it does elsewhere.  This is probably only happens when incorrect
args are given to route(8), or when running with non-IPv4 stacks but
incorrect args to the route command is no excuse for panicing!

Submitted by: Michael Clay <mclay@weareb.org>, PR#1532
1996-08-24 03:11:13 +00:00
Paul Traina
11a53ef3f3 Update to match definitions in LBL June 96 release 1996-08-19 20:28:25 +00:00
Julian Elischer
a1153b1a69 Submitted by: archie@whistle.com
allow a tunnel interface to be openned even if it has no remote address yet.
this may be needed if you have used
route add default -interface tun0
where the remote end might not even HAVE a number (e.g. netcom links)
1996-08-09 22:57:06 +00:00
Julian Elischer
381dd1d2ca Submitted by: archie@whistle.com
This is a patch to sys/net/if.c. What it does is patch the algorithm
for finding an IP address on an interface which most closely matches
a given IP address. The problem with it is when no address matches,
and you have to just pick one at random. Then the code ends up picking
the last IP address in the list. This patch changes things so it
picks up the first address instead.
Usually the first address is more useful as the later ones are aliases.
1996-08-07 04:09:05 +00:00
Poul-Henning Kamp
26a8b0bf7e Megacommit to straigthen out ETHER_ mess.
I'm pretty convinced after looking at this that the majority of our
drivers are confused about the in/exclusion of ETHER_CRC_LEN :-(
1996-08-06 21:14:36 +00:00
Poul-Henning Kamp
88e1602b1f use <net/ethernet.h> 1996-08-05 14:03:10 +00:00
Poul-Henning Kamp
e4b54c028f This file is the (intended) definitive source of the ETHER_ macros. 1996-08-05 14:02:38 +00:00
Poul-Henning Kamp
86101139cf Make the NS and IPX cases compile again. 1996-08-04 11:45:37 +00:00
Poul-Henning Kamp
30106f6a8c Add a callback pointer to the interfaces "init" routine.
Add ether_ioctl() which can take care of the SIOC[SG]IFADDR cases for
most (ethernet) drivers.
1996-08-04 10:54:13 +00:00
Garrett Wollman
bbd17bf8e1 Add better support for retrieving management information from network
interfaces.  This creates two new tables in the net.link.generic branch
of the MIB; one contains (essentially) `ifdata' structures, and the other
contains a blob provided by the interface (and presumably used to
implement link-layer-specific MIB variables).  A number of things
have been moved around in the `ifnet' and `ifdata' structures, so
NEW VERSIONS OF ifconfig(8) AND routed(8) ARE REQUIRED.  (A simple
recompile is all that's necessary.)

I have a sample program which uses this interface for those interested
in making use of it.
1996-07-30 19:17:07 +00:00
Garrett Wollman
fcd6781acb Fix a bug in ifa_ifwithnet() which caused a page fault in bcmp()
when attepmting to add certain types of routes.  This problem
only manifested itself in the presence of unconfigured point-to-point
interfaces.

Noticed by: Chuck Cranor <chuck@maria.wustl.edu>
1996-07-24 19:59:53 +00:00