Commit Graph

65 Commits

Author SHA1 Message Date
itojun 04ac848d6f introduce m->m_pkthdr.aux to hold random data which needs to be passed
between protocol handlers.

ipsec socket pointers, ipsec decryption/auth information, tunnel
decapsulation information are in my mind - there can be several other usage.
at this moment, we use this for ipsec socket pointer passing.  this will
avoid reuse of m->m_pkthdr.rcvif in ipsec code.

due to the change, MHLEN will be decreased by sizeof(void *) - for example,
for i386, MHLEN was 100 bytes, but is now 96 bytes.
we may want to increase MSIZE from 128 to 256 for some of our architectures.

take caution if you use it for keeping some data item for long period
of time - use extra caution on M_PREPEND() or m_adj(), as they may result
in loss of m->m_pkthdr.aux pointer (and mbuf leak).

this will bump kernel version.

(as discussed in tech-net, tested in kame tree)
2000-03-01 12:49:27 +00:00
thorpej c1185c1020 PRU_PURGEADDR -> PRU_PURGEIF, per a discussion w/ itojun. In the IPv4
and IPv6 code, also use this to traverse PCB tables, looking for cached
routes referencing the dying ifnet, forcing them to be refreshed.
2000-02-02 23:28:08 +00:00
thorpej 2af8db77c9 Grumble, forward decl for struct ifaddr. 2000-02-02 08:14:20 +00:00
itojun f781f298a6 remove ns_purgeaddr() prototype - it's in netns/ns_var.h (added by thorpej) 2000-02-02 08:09:57 +00:00
thorpej b2408b62bf Add missing prototype for ns_purgeaddr(). 2000-02-02 08:06:49 +00:00
itojun 2111a79d6a add missing prototype for if_detach. 2000-02-02 05:07:57 +00:00
thorpej d844a3ac41 First-draft if_detach() implementation, originally from Bill Studnemund,
although this version has been changed somewhat:
- reference counting on ifaddrs isn't as complete as Bill's original
  work was.  This is hard to get right, and we should attack one
  protocol at a time.
- This doesn't do reference counting or dynamic allocation of ifnets yet.
- This version introduces a new PRU -- PRU_PURGEADDR, which is used to
  purge an ifaddr from a protocol.  The old method Bill used didn't work
  on all protocols, and it only worked on some because it was Very Lucky.

This mostly works ... i.e. works for my USB Ethernet, except for a dangling
ifaddr reference left by the IPv6 code; have not yet tracked this down.
2000-02-01 22:52:04 +00:00
thorpej 33e8c5b1df Improve the readability of one small piece of code. 2000-02-01 00:18:29 +00:00
itojun 559075a711 make sure we do not pass bogus socket pointer to IPv4 IPsec.
XXX we (KAME) are trying to invent cleaner way to pass socket pointer to
ip{,6}_output... so please permit this mess for now.
1999-12-24 05:01:33 +00:00
drochner 87568e8d82 defopt the XNS protocol (options NS), clean up the use of related
option headers / defines
1999-10-25 19:18:10 +00:00
simonb fd8040a031 s/acknowledgment/acknowledgement/ 1999-09-10 03:24:14 +00:00
darrenr 67cac86e57 add PR_LISTEN to protocols which support listen(2) 1999-07-01 05:53:04 +00:00
thorpej b29e386709 Domains are associated with protocol families, not address families. 1999-01-14 01:28:23 +00:00
matt 3ad026ac87 vax -> __vax__ (and mips to __mips__ in ultrix_misc.c) 1998-10-20 01:46:27 +00:00
christos dd6e9d3e5a fix comment and copyright spacing. 1998-09-13 15:21:32 +00:00
thorpej 78f9387863 Add/move some Ethertypes, PR #5997, Heiko W.Rupp. 1998-09-09 04:32:39 +00:00
christos 9b63f5f407 Assign copyright to TNF. 1998-09-05 14:30:31 +00:00
jonathan 011f2bda08 defopt NS, NSIP. 1998-07-05 06:49:00 +00:00
jonathan 3751946b97 defopt INET, NETATALK. 1998-07-05 00:51:04 +00:00
cgd 651b44e211 Rework the way kernel include files are installed. In the new method,
as with user-land programs, include files are installed by each directory
in the tree that has includes to install.  (This allows more flexibility
as to what gets installed, makes 'partial installs' easier, and gives us
more options as to which machines' includes get installed at any given
time.)  The old SYS_INCLUDES={symlinks,copies} behaviours are _both_
still supported, though at least one bug in the 'symlinks' case is
fixed by this change.  Include files can't be build before installation,
so directories that have includes as targets (e.g. dev/pci) have to move
those targets into a different Makefile.
1998-06-12 23:22:30 +00:00
kleink a04dace856 Spelling error. 1998-05-09 14:24:31 +00:00
fvdl e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
kleink 59fe905973 Fix variable declarations: register -> register int. 1998-02-14 19:34:12 +00:00
thorpej c5dab54215 - Be more careful with type sizes (many u_long -> u_int32_t in protocol
structures).
- Use NTOH*() and HTON*() where appropriate.
- Some slight formatting cleanup in a few places.
1997-07-18 19:30:33 +00:00
thorpej a0e791807e Eliminate use of dtom() from the network code, allowing more flexible
use of mbuf external storage and increasing performance (by eliminating
an m_pullup() for clusters in the IP reassembly code).

Changes from Koji Imada <koji@math.human.nagoya-u.ac.jp>, in PR #3628
and #3480, with ever-so-slight integration changes by me.
1997-06-24 02:25:59 +00:00
christos 3a56279cee PR/3408: From Koji Imada: mv_faults on SPP connections. 1997-03-29 17:01:38 +00:00
christos cb32007a8b backout previous kprintf change 1996-10-13 01:59:55 +00:00
christos 1005eb6f98 printf -> kprintf, sprintf -> ksprintf 1996-10-10 23:25:50 +00:00
christos 98d5537195 - make this compile again
- printf -> kprintf, sprintf -> ksprintf
1996-10-10 23:22:58 +00:00
mycroft 90cf086c4f Restructure ns_control() like other protocols. 1996-09-08 14:49:41 +00:00
mycroft 5fda0ab8a3 Make sure the control mbufs are freed in all cases.
Return ENOPROTOOPT rather than picking pseudo-random error values.
Restructure *_ctloutput() functions to match other protocols.
1996-09-08 14:48:21 +00:00
mycroft 49d52c9b1c Pass a proc pointer down to the usrreq and pcbbind functions for PRU_ATTACH, PRU_BIND and
PRU_CONTROL.  The usrreq interface really needs to be split up, but this will have to wait.
Remove SS_PRIV completely.
1996-05-22 13:54:55 +00:00
scottr 64da2bdad9 Include <machine/cpu.h> to get setsoftnet().
XXX - We need this for at least amiga and hp300.  This change must die,
      and is intended as a temporary workaround only.
1996-05-09 22:29:25 +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 4dd67bbcd4 Fix(?) (I have no way to test this) netns crash when receiving PRC_REDIRECT's
I handled them in a similar way with other protocols, by calling:
    ns_pcbnotify(..., ns_rtchange, ...)
I hope it works.
Fixes PR/2266
1996-03-27 14:44:14 +00:00
christos acdfea75a0 ns_cksum.c: Bring prototype into scope.
ns_var.c: Add forward declaration for struct sockaddr;
1996-03-14 18:44:41 +00:00
christos 6c52b1a5eb Fixed bug I introduced in the previous changes. In the ctlinput functions,
I used the void * arg, instead of the sockaddr argument...
1996-02-18 05:42:59 +00:00
christos f0684ee41d netns prototypes 1996-02-13 22:13:43 +00:00
mycroft 873ed30f83 so_pcb should be a void *. 1995-08-17 02:57:20 +00:00
mycroft af8b19a276 Allocate PCBs with malloc(), not mgetclr(). 1995-08-16 00:32:40 +00:00
mycroft 5482957905 splnet --> splsoftnet 1995-08-12 23:59:09 +00:00
mycroft 8598ef4a21 Initialize ns_ifaddr. 1995-07-27 20:37:27 +00:00
mycroft 7d87f9110f Clean this up a bit. Use queue.h more; de-uglify casts. 1995-06-13 08:36:58 +00:00
mycroft e47a488874 nsipstart() should return void. 1995-04-11 04:25:21 +00:00
briggs 6efcd1b6d4 KERNEL -> _KERNEL 1995-03-29 21:57:43 +00:00
jtc f76f1f89ad KERNEL -> _KERNEL 1995-03-26 20:35:13 +00:00
cgd e7c1a9e7f9 cast pointers correctly, ioctl cmds are u_longs, most int != long type bogons 1995-03-08 02:14:50 +00:00
mycroft 5ab475b686 Reduce some redundant code. 1995-02-01 09:10:38 +00:00
cgd 6ac2bbfc35 be more careful with types, also pull in headers where necessary. 1994-10-30 21:43:03 +00:00
cgd 707aae0bd3 don't redefine time. 1994-09-20 06:42:10 +00:00