Commit Graph

86 Commits

Author SHA1 Message Date
christos
0f7d471853 Factor out the hand-crafting of mbufs from the interface files. Reviewed by
gimpy. XXX: I could have used bpf_mtap2 on some of the new functions, but I
chose not to, because I just wanted to do what amounts to a code move.
2004-08-19 20:58:23 +00:00
itojun
d2f1c029b9 kill sprintf, use snprintf 2004-04-21 18:40:37 +00:00
agc
aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
itojun
5576ac2656 bpf_mtap() does not care about M_PKTHDR at the top. M_COPY_PKTHDR has some
consequences, so avoid it.  if we need to attach dummy headers, we should
use M_PREPEND instead.
2003-05-01 07:52:58 +00:00
matt
65e5548a17 Add MBUFTRACE kernel option.
Do a little mbuf rework while here.  Change all uses of MGET*(*, M_WAIT, *)
to m_get*(M_WAIT, *).  These are not performance critical and making them
call m_get saves considerable space.  Add m_clget analogue of MCLGET and
make corresponding change for M_WAIT uses.
Modify netinet, gem, fxp, tulip, nfs to support MBUFTRACE.
Begin to change netstat to use sysctl.
2003-02-26 06:31:08 +00:00
itojun
822449ac65 KNF - return is not a function. 2002-09-11 05:36:26 +00:00
atatat
31144d9976 Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command".  ERESTART is -1, which can lead to
confusion.  ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4.  No ioctl code should now return -1 anywhere.  The
ioctl() system call is now properly restartable.
2002-03-17 19:40:26 +00:00
kleink
67dfac7357 Include <machine/intr.h> unconditionally, instead of only doing so if
__HAVE_GENERIC_SOFT_INTERRUPTS and relying on <sys/param.h> to provide it
otherwise; pointed out by Aymeric Vincent.
2002-01-14 18:19:15 +00:00
lukem
34d65a3414 add RCSIDs 2001-11-12 23:49:33 +00:00
martin
accb35c3a2 Fix slight glitch from rev. 1.70: bp is not adjusted for next loop after
outputting some data.
Fix provided by isaki@par.odn.ne.jp in PR kern/13472.
2001-07-15 21:17:29 +00:00
itojun
4d51fe368b change the meaning of ifnet.if_lastchange to meet RFC1573 ifLastChange.
follows BSD/OS practice and ucd-snmp code (FreeBSD does it for specific
interfaces only).

was: if_lastchange get updated on every packet transmission/receipt.
now: if_lastchange get updated when IFF_UP is changed.
2001-06-14 05:44:23 +00:00
itojun
96a42a18dc fix mbuf leak due to meaningless MGETHDR. from niels provos 2001-05-30 16:42:02 +00:00
thorpej
bf2dcec4f5 Remove the use of splimp() from the NetBSD kernel. splnet()
and only splnet() is allowed for the protection of data structures
used by network devices.
2001-04-13 23:29:55 +00:00
enami
2ceebb6c0e Remove unnecessary test of tp->t_linesw against NULL; they are results
of confusion while correcting compilation error after t_line is
replaced with t_linesw.
2001-03-31 00:35:21 +00:00
thorpej
fc5dafc79b Fix a rather annoying problem where the sockaddr_dl which holds
the link level name for the interface (ifp->if_sadl) is allocated
before ifp->if_addrlen is initialized, which could lead to allocating
too little space for the link level address.

Do this by splitting allocation of the link level name out of
if_attach() and into if_alloc_sadl(), which is normally called
by functions like ether_ifattach().  Network interfaces which
don't have a link-specific attach routine must call if_alloc_sadl()
themselves (example: gif).

Link level names are freed by if_free_sadl(), which can be called
from e.g. ether_ifdetach().  Drivers never need call if_free_sadl()
themselves as if_detach() will do it if it is not already done.

While here, add the ability to pass an AF_LINK address to
SIOCSIFADDR in ether_ioctl() (this is what caused me to notice
the problem that the above fixes).
2001-01-17 00:30:49 +00:00
thorpej
569e9a31e2 For SLIP/STRIP/PPP, use generic soft interrupts, if available. 2001-01-15 16:33:30 +00:00
thorpej
ba4e91812d After freeing the input buffer, set the pointer to it to NULL. 2001-01-12 19:27:32 +00:00
thorpej
acd96e1307 Don't use splimp() to block both net and tty interrupts. Instead,
block both interrupt levels as appropriate.
2001-01-12 19:26:48 +00:00
thorpej
c292853354 Plug a memory leak. 2001-01-11 22:43:02 +00:00
thorpej
7c5fe175c0 Defer output processing to the software interrupt. 2001-01-11 21:15:58 +00:00
thorpej
4c9cb837ba Move the VJ uncompress code into the software interrupt. 2001-01-10 23:29:42 +00:00
thorpej
efed547b78 Once we have a complete frame, schedule a SLIP software interrupt,
and manipulate ipintrq from there.  This will allow us to clean up
the use of splimp() in this file later.
2001-01-09 05:04:23 +00:00
thorpej
692a2bc939 Make the buffer management in SLIP just a little less evil. 2001-01-09 04:42:48 +00:00
thorpej
541812a992 ALTQ'ify. 2000-12-18 20:41:44 +00:00
thorpej
ed7695a765 Fill in if_dlt. 2000-12-18 19:44:33 +00:00
thorpej
c5293456da Adapt to bpfattach() changes, and further centralize the bpfattach()
and bpfdetach() calls into link-type subroutines where possible.
2000-12-12 18:00:22 +00:00
itohy
344f9b7b00 Set the default line discipline to t_linesw, rather than just NULL it. 2000-11-02 12:00:49 +00:00
itohy
486a58959c Adapt to the new line discipline scheme. 2000-11-02 11:00:53 +00:00
thorpej
5cae63e123 NetBSD -> __NetBSD__ in an #ifdef, and nuke sc_bpf; there's one in
the ifnet already.
2000-07-12 23:02:38 +00:00
augustss
c1ebd1929a Kill some more register declarations. 2000-03-30 09:45:33 +00:00
simonb
0fd09c8496 Don't need to include <sys/conf.h> here. 2000-03-29 03:43:33 +00:00
dbj
a6f0126b1a fixes to compile if NBPFILTER == 0 1999-03-27 22:48:36 +00:00
tron
bbee1b42b1 Make it possible to set MTU via "ifconfig" at run time. "SLMTU" is now
used to set the initial value.
1999-03-25 00:52:14 +00:00
kleink
44b31a4395 Use #error instead of causing parse errors; noticed by Heiko. 1998-10-06 18:38:08 +00:00
mrg
a317393b79 use __NetBSD__ not NetBSD 1998-08-26 15:12:55 +00:00
jtk
14119e2944 use #ifdef INET so this compiles again 1998-07-06 13:51:32 +00:00
jonathan
3751946b97 defopt INET, NETATALK. 1998-07-05 00:51:04 +00:00
enami
7972ef1160 Add missing comma. 1998-03-23 13:08:56 +00:00
fair
782eb42847 add the ability to run SLIP with CLOCAL set, per PR#3586 1998-03-23 04:41:16 +00:00
fvdl
e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
christos
cf463415ec Update to ppp-2.3b5 1997-05-17 21:11:59 +00:00
thorpej
d1c9089a16 Update for the new mbuf code, in a slighly kludgy way. Basically, these
drivers played a somewhat evil trick with clusters, which is now
replaced by a somewhat evil trick with regular malloc'd memory.
1997-03-27 20:36:14 +00:00
christos
a1dcf4b026 backout previous kprintf change 1996-10-13 02:10:01 +00:00
christos
10191279fb - printf -> kprintf, sprintf -> ksprintf 1996-10-10 22:59:41 +00:00
mrg
c01edc3a02 use sc_unit instead of pointer arthimetic. 1996-08-09 08:34:00 +00:00
cgd
1c5ea3c014 print difference between pointers with %ld, so that -Wformat works
on the Alpha and for consistency.  Also, other minor formatting cleanups.
1996-07-10 18:15:22 +00:00
thorpej
2fadbc363c Move a mis-placed line on slattach() so that SLIOCGUNIT works properly.
From Jonathan O'Brien <obrien@phoenix.sfsu.edu>.
1996-06-02 16:22:32 +00:00
thorpej
4edabe2501 Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit.  Updated interface to (*if_watchdog)() and (*if_reset)()
to take a struct ifnet *, rather than a unit number.
1996-05-07 02:40:22 +00:00
christos
206e75c6f1 Net prototypes 1996-02-13 21:59:53 +00:00
mycroft
5482957905 splnet --> splsoftnet 1995-08-12 23:59:09 +00:00