HomeFreeBSD

protosw: refactor protosw and domain static declaration and load

Description

protosw: refactor protosw and domain static declaration and load

o Assert that every protosw has pr_attach. Now this structure is

only for socket protocols declarations and nothing else.

o Merge struct pr_usrreqs into struct protosw. This was suggested

in 1996 by wollman@ (see 7b187005d18ef), and later reiterated
in 2006 by rwatson@ (see 6fbb9cf860dcd).

o Make struct domain hold a variable sized array of protosw pointers.

For most protocols these pointers are initialized statically.
Those domains that may have loadable protocols have spacers. IPv4
and IPv6 have 8 spacers each (andre@ dff3237ee54ea).

o For inetsw and inet6sw leave a comment noting that many protosw

entries very likely are dead code.

o Refactor pf_proto_[un]register() into protosw_[un]register().
o Isolate pr_*_notsupp() methods into uipc_domain.c

Reviewed by: melifaro
Differential revision: https://reviews.freebsd.org/D36232

Details

Provenance
glebiusAuthored on Aug 17 2022, 6:50 PM
Reviewer
melifaro
Differential Revision
D36232: protosw: refactor protosw and domain static declaration and load
Parents
rGd9f6ac882a95: protosw: retire PRU_ flags and their char names
Branches
Unknown
Tags
Unknown