NetBSD/sys/netinet6
dyoung 4c9b6756a5 1) Introduce a new socket option, (SOL_SOCKET, SO_NOHEADER), that
tells a socket that it should both add a protocol header to tx'd
   datagrams and remove the header from rx'd datagrams:

        int onoff = 1, s = socket(...);
        setsockopt(s, SOL_SOCKET, SO_NOHEADER, &onoff);

2) Add an implementation of (SOL_SOCKET, SO_NOHEADER) for raw IPv4
   sockets.

3) Reorganize the protocols' pr_ctloutput implementations a bit.
   Consistently return ENOPROTOOPT when an option is unsupported,
   and EINVAL if a supported option's arguments are incorrect.
   Reorganize the flow of code so that it's more clear how/when
   options are passed down the stack until they are handled.

   Shorten some pr_ctloutput staircases for readability.

4) Extract common mbuf code into subroutines, add new sockaddr
   methods, and introduce a new subroutine, fsocreate(), for reuse
   later; use it first in sys_socket():

struct mbuf *m_getsombuf(struct socket *so)

        Create an mbuf and make its owner the socket `so'.

struct mbuf *m_intopt(struct socket *so, int val)

        Create an mbuf, make its owner the socket `so', put the
        int `val' into it, and set its length to sizeof(int).


int fsocreate(..., int *fd)

        Create a socket, a la socreate(9), put the socket into the
        given LWP's descriptor table, return the descriptor at `fd'
        on success.

void *sockaddr_addr(struct sockaddr *sa, socklen_t *slenp)
const void *sockaddr_const_addr(const struct sockaddr *sa, socklen_t *slenp)

        Extract a pointer to the address part of a sockaddr.  Write
        the length of the address  part at `slenp', if `slenp' is
        not NULL.

socklen_t sockaddr_getlen(const struct sockaddr *sa)

        Return the length of a sockaddr.  This just evaluates to
        sa->sa_len.  I only add this for consistency with code that
        appears in a portable userland library that I am going to
        import.

const struct sockaddr *sockaddr_any(const struct sockaddr *sa)

        Return the "don't care" sockaddr in the same family as
        `sa'.  This is the address a client should sobind(9) if it
        does not care the source address and, if applicable, the
        port et cetera that it uses.

const void *sockaddr_anyaddr(const struct sockaddr *sa, socklen_t *slenp)

        Return the "don't care" sockaddr in the same family as
        `sa'.  This is the address a client should sobind(9) if it
        does not care the source address and, if applicable, the
        port et cetera that it uses.
2007-09-19 04:33:42 +00:00
..
Makefile
ah.h
ah_aesxcbcmac.c
ah_aesxcbcmac.h
ah_core.c
ah_input.c
ah_output.c
dest6.c
esp.h
esp_aesctr.c
esp_aesctr.h
esp_core.c
esp_input.c
esp_output.c
esp_rijndael.c
esp_rijndael.h
files.ipsec
files.netinet6
frag6.c
icmp6.c 1) Introduce a new socket option, (SOL_SOCKET, SO_NOHEADER), that 2007-09-19 04:33:42 +00:00
in6.c Cosmetic: shorten staircase. 2007-09-16 18:01:30 +00:00
in6.h Use malloc(9) for sockaddrs instead of pool(9), and remove dom_sa_pool 2007-08-30 02:17:34 +00:00
in6_cksum.c
in6_gif.c
in6_gif.h
in6_ifattach.c Constify. 2007-08-10 22:43:26 +00:00
in6_ifattach.h
in6_offload.c
in6_offload.h
in6_pcb.c Take steps to hide the radix_node implementation of the forwarding table 2007-07-19 20:48:52 +00:00
in6_pcb.h
in6_proto.c 1) Introduce a new socket option, (SOL_SOCKET, SO_NOHEADER), that 2007-09-19 04:33:42 +00:00
in6_src.c
in6_var.h Remove SIOCSIFALIFETIME_IN6, which could not possibly have ever worked. 2007-09-11 19:54:51 +00:00
ip6_etherip.c
ip6_etherip.h
ip6_flow.c Don't call rtcache_check() from the fast-forward code, which runs 2007-08-20 19:42:34 +00:00
ip6_forward.c
ip6_id.c
ip6_input.c In some FAST_IPSEC, spl level is not restored correctly. Fix that. 2007-09-11 14:18:09 +00:00
ip6_mroute.c
ip6_mroute.h
ip6_output.c 1) Introduce a new socket option, (SOL_SOCKET, SO_NOHEADER), that 2007-09-19 04:33:42 +00:00
ip6_var.h Take steps to hide the radix_node implementation of the forwarding table 2007-07-19 20:48:52 +00:00
ip6protosw.h Take steps to hide the radix_node implementation of the forwarding table 2007-07-19 20:48:52 +00:00
ipcomp.h
ipcomp_core.c
ipcomp_input.c
ipcomp_output.c
ipsec.c fix printf format. 2007-07-10 18:25:50 +00:00
ipsec.h
mld6.c Use sockaddr_in6_init(). 2007-08-31 21:40:41 +00:00
mld6_var.h
nd6.c We cannot sleep in a software interrupt, so do not sockaddr_dl_alloc(..., 2007-09-02 19:42:21 +00:00
nd6.h Use malloc(9) for sockaddrs instead of pool(9), and remove dom_sa_pool 2007-08-30 02:17:34 +00:00
nd6_nbr.c Use malloc(9) for sockaddrs instead of pool(9), and remove dom_sa_pool 2007-08-30 02:17:34 +00:00
nd6_rtr.c Remove dead code. 2007-08-07 02:17:21 +00:00
pim6.h
pim6_var.h
raw_ip6.c 1) Introduce a new socket option, (SOL_SOCKET, SO_NOHEADER), that 2007-09-19 04:33:42 +00:00
raw_ip6.h
route6.c
scope6.c
scope6_var.h
udp6.h
udp6_output.c
udp6_usrreq.c
udp6_var.h