Commit Graph

212 Commits

Author SHA1 Message Date
Gary Palmer
c23670e294 Clean up -Wunused warnings.
Reviewed by:		bde
1996-06-12 05:11:41 +00:00
Gary Palmer
97d15c1062 Add $Id$ 1996-06-10 23:17:45 +00:00
Gary Palmer
e39a0280cb Change the use if ifnet.if_lastchange to be more in line with
SNMP requirements. Update description of ifnet.if_lastchange in if.h
to indicate this.
1996-06-10 23:07:36 +00:00
Poul-Henning Kamp
5f8f505749 Also count bytes in if_tun. kern/1253
Reviewed by:	phk
Submitted by:	John Capo <jc@irbs.com>
1996-06-09 17:24:25 +00:00
Bruce Evans
0453d3cbb3 Changed some memcpy()'s back to bcopy()'s.
gcc only inlines memcpy()'s whose count is constant and didn't inline
these.  I want memcpy() in the kernel go away so that it's obvious that
it doesn't need to be optimized.  Now it is only used for one struct
copy in si.c.
1996-06-08 08:19:03 +00:00
David Greenman
a76f92a8f0 Fix bug in bpf_ifname() where the unit didn't get added correctly to the
name string. This function should be rewritten to deal with more than
10 units of a given type.

Pointed out by:	jmf@free-gate.com (Jean-Marc Frailong)
(I fixed it slightly differently)
1996-06-08 06:12:58 +00:00
Garrett Wollman
58639ed39a Don't allow trailing garbage after the unit number in ifunit(). 1996-06-05 17:12:41 +00:00
Gary Palmer
a330e1f1a5 Set ifnet.baudrate for ethernet / FDDI interfaces too. Makes
SNMP slightly more informative

Reviewed by: Garrett Wollman
1996-06-01 23:25:10 +00:00
Marc G. Fournier
51d976f16a added missing semicolon
Submitted by:	 Jeffrey Hsu <hsu@freefall.freebsd.org>
1996-05-26 22:05:36 +00:00
Poul-Henning Kamp
d0aa157d5b If tunnel is busy we return EBUSY, not ENXIO. 1996-05-26 17:04:48 +00:00
Julian Elischer
655929bfba Obtained from: netatalk distribution netatalk@itd.umich.edu
Kernel Appletalk protocol support
both CAP and netatalk can make use of this..
still needs some owrk but  it seemd the right tiime to commit it
so other can experiment.
1996-05-24 01:35:45 +00:00
Andrey A. Chernov
49968bb8cf When two units swapped, copy SC_STATIC flag too, not clear it 1996-05-13 14:18:18 +00:00
Andrey A. Chernov
d99bab06b5 Prevent mixing of static and dynamic unit allocation strategies 1996-05-13 14:09:34 +00:00
Gary Palmer
6ddbf1e299 Clean up various compiler warnings. Most (if not all) were benign
Reviewed by:	bde
1996-05-08 04:29:08 +00:00
Garrett Wollman
9f9b3dc4ae Add three new route flags to help determine what sort of address
the destination represents.  For IP:

- Iff it is a host route, RTF_LOCAL and RTF_BROADCAST indicate local
  (belongs to this host) and broadcast addresses, respectively.

- For all routes, RTF_MULTICAST is set if the destination is multicast.

The RTF_BROADCAST flag is used by ip_output() to eliminate a call to
in_broadcast() in a common case; this gives about 1% in our packet-generation
experiments.  All three flags might be used (although they aren't now)
to determine whether a packet can be forwarded; a given host route can
represent a forwardable address if:

	(rt->rt_flags & (RTF_HOST | RTF_LOCAL | RTF_BROADCAST | RTF_MULTICAST))
	== RTF_HOST

Obviously, one still has to do all the work if a host route is not present,
but this code allows one to cache the results of such a lookup if rtalloc1()
is called without masking RTF_PRCLONING.
1996-05-06 17:42:13 +00:00
David Greenman
2a8d579fc8 Regardless of whether or not the check for IPv4 is useful, we certainly
don't need to assign the "ip" pointer twice.
1996-04-25 02:34:37 +00:00
Poul-Henning Kamp
3fb9e5a20b Reject all IP versions but 4. 1996-04-24 15:44:34 +00:00
Bruce Evans
c5294719c3 Eliminated sloppy common-style declarations. Now there are no duplicated
common labels for LINT.  There are still some common declarations for the
!KERNEL case in tcp_debug.h and spx_debug.h.  trpt depends on the ones in
tcp_debug.h.
1996-04-13 12:45:57 +00:00
David Greenman
06fc5af99c When cslip gets an uncompressed packet, it attempts to save off the TCP/IP
header for use in decompressing subsequant packets. If cslip gets garbage
(such as what happens when there is a port speed mismatch or modem line
noise), it will occasionally mistake the packet as a valid uncompressed
packet. When it tries to save off the header, it doesn't bother to check
for the validity of the header length and will happily clobber not only
the cslip data structure, but parts of other kernel memory that happens
to follow it...causing, ahem, undesired behavior.
1996-04-11 06:46:24 +00:00
Bruce Evans
6ffde942bf Removed never-used #includes of <machine/cpu.h>. Many were apparently
copied from bad examples.
1996-04-07 17:39:28 +00:00
Bruce Evans
3157adc8af Removed now-unused #includes of <machine/cpu.h>. They were for bootverbose
being declared in the wrong place.
1996-04-07 17:32:42 +00:00
Bill Fenner
6ac3b69d76 Eliminate panic("rtfree") caused by double-freeing the route
when rt == rt->rt_gwroute .  rt == rt->gwroute shouldn't happen
in the first place, but that's another problem.

(try "route add -host <hostonmynet> <hostonmynet>; ping <hostonmynet>;
route delete <hostonmynet>")
1996-03-29 08:02:30 +00:00
Marc G. Fournier
ccbc58d3ca Using devfs_add_devswf() instead of devfs_add_devsw()
Reviewed by:	julian@freebsd.org
1996-03-28 14:33:59 +00:00
Bruce Evans
6c4591a089 Fixed ownerships of callout devices. 1996-03-27 20:03:32 +00:00
David Greenman
2ee45d7d28 Move or add #include <queue.h> in preparation for upcoming struct socket
changes.
1996-03-11 15:13:58 +00:00
Andrey A. Chernov
f7163ba751 Make user-level PPP on-demand with dynamic IP actually work.
Story so fr:
1) PPP on-demand with static IP works.
2) PPP on-demand with dynamic IP says "Host is down" on any IP request
The problem is that tun driver check its READY state by *first* ifconfig address.
i.e.:
set ifaddr <addr> <addr2>
works (static IP) and
set ifaddr 0 <addr2>
not works (dynamic IP) because first address is equal 0.
Since tun is always POINTOPOINT interface, dst address is more meaningfull.
I change checking to second (dst) address in READY test.
PPP on-demand finally works.
1996-03-08 11:07:07 +00:00
Peter Wemm
4bd4912865 Add more options into the conf/options and i386/conf/options.i386 files
and the #include hooks so that 'make depend' is more useful.  This
covers most of the options I regularly use (but not all) and some other
easy ones.
1996-03-02 18:24:13 +00:00
Poul-Henning Kamp
f0d807c7fe Make tundebug sysctl writable. 1996-02-09 09:23:56 +00:00
Garrett Wollman
a9ad85b0df If a slow input queue was defined by the driver, initialize it. 1996-02-08 21:34:56 +00:00
Garrett Wollman
9b44ff2214 Clean up Ethernet drivers:
- fill in and use ifp->if_softc
	- use if_bpf rather than private cookie variables
	- change bpf interface to take advantage of this
	- call ether_ifattach() directly from Ethernet drivers
	- delete kludge in if_attach() that did this indirectly
1996-02-06 18:51:28 +00:00
Garrett Wollman
5eb1d25adb Make me feel a little better by filling in reasonable values for rmx_sendpipe
and rmx_recvpipe.  This has no demonstrable effect on performance.
(ttcp reports about 44 Mbit/s for all the buffer sizes I tried between
16384 and 65536.)
1996-02-05 19:34:27 +00:00
Mike Pritchard
6c5e9bbdf5 Fix a bunch of spelling errors in the comment fields of
a bunch of system include files.
1996-01-30 23:02:38 +00:00
Garrett Wollman
7c399a896a Delete the if_private[] array in struct ifnet; this turned out to be
of limited utility.  In their place, add bunch of pointers
which will eventually be needed by the polled-interrupt scheme we're working
here.  (It will probably be a while before the code is written and
committed here.)  At the same time, a `void *if_softc' field
was added to the beginning of the structure to make certain driver
writers happier.

The practical upshot of all this is that you need to
recompile utilities such as netstat which manipulate struct ifnet.
1996-01-26 22:09:54 +00:00
Poul-Henning Kamp
18b7be4064 The last part of the ether_sprint -> %6D change.
Sorry for the delay.
(%D is for hexdumping.)
1996-01-26 09:29:29 +00:00
Poul-Henning Kamp
1ce9bf88c3 Use new printf features rather than local kludges. 1996-01-24 21:12:23 +00:00
Garrett Wollman
fde327d6ab Fix memory leak in case of adding a host route on top of another one.
Pointed-out-by:  Bill Fenner <fenner@parc.xerox.com>
1996-01-24 20:27:19 +00:00
Garrett Wollman
602d513c5a in_proto.c: spell ``Internet'' right and put whitespace after commas.
others: start to populate the link-layer branch of the net mib, by
moving ARP to its proper place.  (ARP is not a protocol family, it's an
interface layer between a medium-access layer and a protocol family.)
sysctl(8) needs to be taught about the structure of this branch, unless
Poul-Henning implements dynamic MIB exploration soon.
1995-12-20 21:53:53 +00:00
Bruce Evans
b62d102cbb Uniformized pr_ctlinput protosw functions. The third arg is now `void
*' instead of caddr_t and it isn't optional (it never was).  Most of the
netipx (and netns) pr_ctlinput functions abuse the second arg instead of
using the third arg but fixing this is beyond the scope of this round
of changes.
1995-12-16 02:14:44 +00:00
Poul-Henning Kamp
f708ef1b9e Another mega commit to staticize things. 1995-12-14 09:55:16 +00:00
Peter Wemm
8c1f170b90 Make FIONREAD return the actual that a read() would return, not just the
amount of data in the first mbuf.

Obtained from: Bob Smart <smart@mel.dit.csiro.au> (for NetBSD & SunOS)
1995-12-11 13:24:58 +00:00
Bruce Evans
7bf60cac80 Restored used variable `name[32]' (used by DEVFS).
Removed an `#ifdef __FreeBSD__'.  Hundreds, if not thousands of other
FreeBSD-specific things aren't ifdefed.
1995-12-10 01:20:17 +00:00
Poul-Henning Kamp
3bda9f9bd5 Staticize, clean lint. 1995-12-09 20:47:15 +00:00
Poul-Henning Kamp
d2f265fab8 Julian forgot to make the *devsw structures static. 1995-12-08 23:23:00 +00:00
Julian Elischer
87f6c6625d Pass 3 of the great devsw changes
most devsw referenced functions are now static, as they are
in the same file as their devsw structure. I've also added DEVFS
support for nearly every device in the system, however
many of the devices have 'incorrect' names under DEVFS
because I couldn't quickly work out the correct naming conventions.
(but devfs won't be coming on line for a month or so anyhow so that doesn't
matter)

If you "OWN" a device which would normally have an entry in /dev
then search for the devfs_add_devsw() entries and munge to make them right..
check out similar devices to see what I might have done in them in you
can't see what's going on..
for a laugh compare conf.c conf.h defore and after... :)
I have not doen DEVFS entries for any DISKSLICE devices yet as that will be
a much more complicated job.. (pass 5 :)

pass 4 will be to make the devsw tables of type (cdevsw * )
rather than (cdevsw)
seems to work here..
complaints to the usual places.. :)
1995-12-08 11:19:42 +00:00
Bruce Evans
0310c19f5d Replaced #includes of <sys/user.h> by less gross headers, usually
<sys/vm.h>.  Many device drivers need only the definition of vtophys()
from vm.

Added nearby #includes of <sys/conf.h> where appropriate.
1995-12-06 23:52:35 +00:00
David Greenman
4a5f1499b0 all:
Removed ifnet.if_init and ifnet.if_reset as they are generally unused.
Change the parameter passed to if_watchdog to be a ifnet * rather than
a unit number. All of this is an attempt to move toward not needing an
array of softc pointers (which is usually static in size) to point to
the driver softc.

if_ed.c:
Changed some of the argument passing to some functions to make a little
more sense.

if_ep.c, if_vx.c:
Killed completely bogus use of if_timer. It was being set in such a way
that the interface was being reset once per second (blech!).
1995-12-05 02:01:59 +00:00
Bruce Evans
88e2f526f5 Added a prototype.
Declared dsioctl() as static consistently.  Note that both if_disc.c
and subr_diskslice.c use the same prefix `ds' and there is a name
conflict for dsioctl().
1995-12-03 19:08:55 +00:00
Bruce Evans
1630f073cf Moved inline functions for insque() and remque() to <sys/queue.h>.
Protected them with `#ifdef KERNEL' so that <sys/queue.h> is valid C++.
Added the necessary #includes of <sys/queue.h>.

These functions are bogus and should be replaced by the queue macros.
1995-12-03 13:45:34 +00:00
Bruce Evans
ce7609a49c Completed function declarations and/or added prototypes. 1995-12-02 19:38:06 +00:00
Bruce Evans
af32e59f16 Fixed call to mrt_ioctl(). mrt_ioctl() for some reason has different
number of args when MROUTING is defined.
1995-12-02 19:28:24 +00:00