freebsd-skq/sys
andre 504a86a63b Support for dynamically loadable and unloadable protocols within existing protocol
families.

The protosw[] array of any particular protocol family ("domain") is of fixed size
defined at compile time.  This made it impossible to dynamically add or remove any
protocols to or from it.  We work around this by introducing so called SPACER's
which are embedded into the protosw[] array at compile time.  The SPACER's have
a special protocol number (32767) to indicate the fact that they are SPACER's but
are otherwise NULL.  Only as many protocols can be dynamically loaded as SPACER's
are provided in the protosw[] structure.

The pr_usrreqs structure is treated more special and contains pointers to dummy
functions only returning EOPNOTSUPP.  This is needed because the use of those
functions pointers is usually not checked within the kernel because until now it
was assumed to be a valid function pointer.  Instead of fixing all potential
callers we just return a proper error code.

Two new functions provide a clean API to register and unregister a protocol.  The
register function expects a pointer to a valid and complete struct protosw including
a pointer to struct pru_usrreqs provided by the caller.  Upon successful registration
the pr_init() function will be called to finish initialization of the protocol.  The
unregister function restores the SPACER in place of the protocol again.  It is the
responseability of the caller to ensure proper closing of all sockets and freeing
of memory allocation by the unloading protocol.

 sys/protosw.h

  o Define generic PROTO_SPACER to be 32767
  o Prototypes for all pru_*_notsupp() functions
  o Prototypes for pf_proto_[un]register() functions

 kern/uipc_domain.c

  o Global struct pr_usrreqs nousrreqs containing valid pointers to the
    pru_*_notsupp() functions
  o New functions pf_proto_[un]register()

 kern/uipc_socket2.c

  o New functions bodies for all pru_*_notsupp() functions
2004-10-19 15:13:30 +00:00
..
alpha Add new function ttyinitmode() which sets our systemwide default 2004-10-18 21:51:27 +00:00
amd64 Print flags in the nexus for child devices. 2004-10-14 22:36:47 +00:00
arm Use a default MD_ROOT_SIZE of 65535. 2004-10-11 14:42:06 +00:00
boot document host_start_mem. 2004-10-15 06:59:07 +00:00
cam Remove references to the second byte of a CCB containing the LUN, as this 2004-10-13 09:31:04 +00:00
coda Do not use devsw() but si_devsw direction. This is still bogus but a 2004-09-23 12:19:24 +00:00
compat Put on my peril sensitive sunglasses and add a flags field to the internal 2004-10-11 22:04:16 +00:00
conf Add dcons_os.{c,h}. 2004-10-13 05:41:09 +00:00
contrib Add an additional struct inpcb * argument to pfil(9) in order to enable 2004-09-29 04:54:33 +00:00
crypto
ddb
dev Return the unit number of a channel instead of a hardcoded '1' from 2004-10-19 10:29:00 +00:00
doc
fs Rework how we store process times in the kernel such that we always store 2004-10-05 18:51:11 +00:00
gdb
geom Ehh. Introduce a hack: Wait for 3 seconds, so GEOM is able to give us 2004-10-14 07:55:29 +00:00
gnu Desupport device nodes on EXT2 filesystems. 2004-09-27 20:38:46 +00:00
i4b Mark i4b IPR and SPPP drivers as NET_NEEDS_GIANT(), as they both 2004-10-12 09:25:52 +00:00
i386 Add new function ttyinitmode() which sets our systemwide default 2004-10-18 21:51:27 +00:00
ia64 Add new function ttyinitmode() which sets our systemwide default 2004-10-18 21:51:27 +00:00
isa Remove local hacks to set flags now that the device probe does this for us. 2004-10-14 22:21:59 +00:00
isofs/cd9660 Hold proper thread count while frobbing drivers ioctl. 2004-09-24 07:24:02 +00:00
kern Support for dynamically loadable and unloadable protocols within existing protocol 2004-10-19 15:13:30 +00:00
libkern Don't attempt to profile __udivsi3() and friends, as mcount() uses them. 2004-10-01 16:44:08 +00:00
modules Major overhaul. 2004-10-18 20:13:57 +00:00
net Push acquisition of the accept mutex out of sofree() into the caller 2004-10-18 22:19:43 +00:00
net80211
netatalk Push acquisition of the accept mutex out of sofree() into the caller 2004-10-18 22:19:43 +00:00
netatm Push acquisition of the accept mutex out of sofree() into the caller 2004-10-18 22:19:43 +00:00
netgraph Push acquisition of the accept mutex out of sofree() into the caller 2004-10-18 22:19:43 +00:00
netinet Add a macro for the destruction of INP_INFO_LOCK's used by loadable modules. 2004-10-19 14:34:13 +00:00
netinet6 Be more careful to only index valid IP protocols and be more verbose with 2004-10-19 14:26:44 +00:00
netipsec Remove extraneous SECPOLICY_LOCK_DESTROY calls that cause the mutex to be 2004-10-02 00:19:05 +00:00
netipx Push acquisition of the accept mutex out of sofree() into the caller 2004-10-18 22:19:43 +00:00
netkey Merge netipsec/key.c:1.17 into KAME pfkey implementation: 2004-09-30 00:49:55 +00:00
netnatm Push acquisition of the accept mutex out of sofree() into the caller 2004-10-18 22:19:43 +00:00
netncp Add missing zero flag argument. 2004-10-12 08:22:08 +00:00
netsmb
nfs
nfs4client Remove NFS4 vop method vector for devices: we are desupporing device nodes 2004-09-27 20:02:50 +00:00
nfsclient Add a missing newline character. 2004-10-14 19:00:44 +00:00
nfsserver Correct several instances where calls to vfs_getvfs() resulting in 2004-10-18 11:23:11 +00:00
opencrypto
pc98 Merged from sys/dev/sio/sio.c (Use generic tty code). 2004-10-15 08:22:37 +00:00
pccard
pci fix (for me) the problems where if_de gets really slow after time 2004-10-18 23:06:12 +00:00
posix4
powerpc Add sc_iostart to softc and unbreak the build. 2004-09-27 19:51:58 +00:00
rpc Prefer C99's __func__ over GCC's __FUNCTION__. 2004-09-23 18:25:46 +00:00
security
sparc64 Flush the register windows before we start changing the context. 2004-10-09 16:42:09 +00:00
sys Support for dynamically loadable and unloadable protocols within existing protocol 2004-10-19 15:13:30 +00:00
tools
ufs Fix fsbtodb() for UFS1. This fixes an overflow for file sizes >1 TB, 2004-10-09 20:16:06 +00:00
vm Correct two errors in PG_BUSY management by vm_page_cowfault(). Both 2004-10-18 08:11:59 +00:00
Makefile