1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00
Mirror of the FreeBSD src repository https://git.FreeBSD.org/src.git .
Go to file
Andre Oppermann 312c75c362 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
bin The previous commit added code to rm(1) to warn about and remove any 2004-10-04 19:24:28 +00:00
contrib Merge local changes 2004-10-18 07:25:32 +00:00
crypto Add support for C3 Nehemiah ACE ("Padlock") AES crypto. This comes 2004-08-14 13:38:35 +00:00
etc When dumpdev is set to 'auto', and a suitable swap device is found, 2004-10-18 23:40:13 +00:00
games Properly initialise 'filename' so that random -l doesn't try to open NULL. 2004-10-03 15:34:15 +00:00
gnu Utilize SCRIPTS. 2004-10-18 21:44:17 +00:00
include Remove the obsolete <rune.h> interface. 2004-10-17 06:51:50 +00:00
kerberos5 Join the 21st century: Cryptography is no longer an optional component 2004-08-06 07:27:08 +00:00
lib uniq(1) is not an install tool, and using it was causing 2004-10-18 22:18:23 +00:00
libexec Remove definition of struct dom_binding, it's non-standard C code and 2004-10-17 19:33:33 +00:00
release Fix typo in rev. 1.58 (missing $) that invalidated the conditional and 2004-10-17 21:05:40 +00:00
rescue As with the non-rescue version don't build fore_dnld when NOATM is defined. 2004-08-16 03:16:48 +00:00
sbin Print a usage message if a non-option is specified. 2004-10-13 20:33:18 +00:00
secure Add support for C3 Nehemiah ACE ("Padlock") AES crypto. This comes 2004-08-14 13:38:35 +00:00
share Catch up with PHK's sio(4) rework [sys/dev/sio/sio.c rev. 1.456]. 2004-10-18 21:31:05 +00:00
sys Support for dynamically loadable and unloadable protocols within existing protocol 2004-10-19 15:13:30 +00:00
tools Typo fix. 2004-10-18 00:45:28 +00:00
usr.bin Replaced afterinstall: with equivalent FILES and SYMLINKS. 2004-10-18 17:16:01 +00:00
usr.sbin Utilize FILES, SCRIPTS, and SYMLINKS. While here, fixed a bug in 2004-10-18 21:42:15 +00:00
COPYRIGHT
installworld_newk
installworld_oldk
MAINTAINERS Remove vinum from the list. I no longer have the time and energy to 2004-09-08 02:08:33 +00:00
Makefile Fixed MAKEOBJDIRPREFIX variable type check in case the env(1) 2004-10-18 17:47:31 +00:00
Makefile.inc1 Catch another gcc-3.3 c++ include path reference and update it to 3.4. 2004-10-11 23:51:13 +00:00
README
UPDATING Add an entry about some tty devices being renamed. 2004-10-18 21:24:21 +00:00
UPDATING.64BTT Add a tip for people who are using database-related ports on a sparc64 2004-03-17 01:59:47 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel, the kernel-modules and the contents of /etc.  The
``buildkernel'' and ``installkernel'' targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process, documentation
for which can be found at:
   http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
And in the config(8) man page.
Note: If you want to build and install the kernel with the
``buildkernel'' and ``installkernel'' targets, you might need to build
world before.  More information is available in the handbook.

The sample kernel configuration files reside in the sys/<arch>/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file NOTES contains entries and documentation for all possible
devices, not just those commonly used.  It is the successor of the ancient
LINT file, but in contrast to LINT, it is not buildable as a kernel but a
pure reference and documentation file.


Source Roadmap:
---------------
bin		System/user commands.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html