]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Support for dynamically loadable and unloadable IP protocols in the ipmux.
authorandre <andre@FreeBSD.org>
Tue, 19 Oct 2004 15:45:57 +0000 (15:45 +0000)
committerandre <andre@FreeBSD.org>
Tue, 19 Oct 2004 15:45:57 +0000 (15:45 +0000)
commit00d43f4bd8218e12e456cef93e786e0a910ba560
tree5e1381e3fd7b17aca48188a8e5c4717260ca205f
parent8112f95a8c58a972c772b025bf4229fb1623a162
Support for dynamically loadable and unloadable IP protocols in the ipmux.

With pr_proto_register() it has become possible to dynamically load protocols
within the PF_INET domain.  However the PF_INET domain has a second important
structure called ip_protox[] that is derived from the 'struct protosw inetsw[]'
and takes care of the de-multiplexing of the various protocols that ride on
top of IP packets.

The functions ipproto_[un]register() allow to dynamically adjust the ip_protox[]
array mux in a consistent and easy way.  To register a protocol within
ip_protox[] the existence of a corresponding and matching protocol definition
in inetsw[] is required.  The function does not allow to overwrite an already
registered protocol.  The unregister function simply replaces the mux slot with
the default index pointer to IPPROTO_RAW as it was previously.
sys/netinet/ip_input.c
sys/netinet/ip_var.h