make kernel includes standard
[unix-history] / usr / src / sys / netns / ns_proto.c
CommitLineData
8ae0e4b4 1/*
240edf1f
KS
2 * Copyright (c) 1984, 1985, 1986, 1987 Regents of the University of California.
3 * All rights reserved.
8ae0e4b4 4 *
dbf0c423 5 * %sccs.include.redist.c%
240edf1f 6 *
5548a02f 7 * @(#)ns_proto.c 7.6 (Berkeley) %G%
8ae0e4b4 8 */
1d763a02 9
5548a02f
KB
10#include <sys/param.h>
11#include <sys/socket.h>
12#include <sys/protosw.h>
13#include <sys/domain.h>
14#include <sys/mbuf.h>
1d763a02 15
5548a02f
KB
16#include <net/radix.h>
17
18#include <netns/ns.h>
1d763a02
KS
19
20/*
21 * NS protocol family: IDP, ERR, PE, SPP, ROUTE.
22 */
9a6f0d01 23int ns_init();
1d763a02 24int idp_input(), idp_output(), idp_ctlinput(), idp_usrreq();
9a6f0d01 25int idp_raw_usrreq(), idp_ctloutput();
1d763a02
KS
26int spp_input(), spp_ctlinput();
27int spp_usrreq(), spp_usrreq_sp(), spp_ctloutput();
9a6f0d01 28int spp_init(), spp_fasttimo(), spp_slowtimo();
1d763a02
KS
29extern int raw_usrreq();
30
31extern struct domain nsdomain;
32
33struct protosw nssw[] = {
34{ 0, &nsdomain, 0, 0,
35 0, idp_output, 0, 0,
36 0,
37 ns_init, 0, 0, 0,
38},
39{ SOCK_DGRAM, &nsdomain, 0, PR_ATOMIC|PR_ADDR,
aee11411 40 0, 0, idp_ctlinput, idp_ctloutput,
1d763a02
KS
41 idp_usrreq,
42 0, 0, 0, 0,
43},
44{ SOCK_STREAM, &nsdomain, NSPROTO_SPP, PR_CONNREQUIRED|PR_WANTRCVD,
aee11411 45 spp_input, 0, spp_ctlinput, spp_ctloutput,
1d763a02
KS
46 spp_usrreq,
47 spp_init, spp_fasttimo, spp_slowtimo, 0,
48},
49{ SOCK_SEQPACKET,&nsdomain, NSPROTO_SPP, PR_CONNREQUIRED|PR_WANTRCVD|PR_ATOMIC,
aee11411 50 spp_input, 0, spp_ctlinput, spp_ctloutput,
1d763a02
KS
51 spp_usrreq_sp,
52 0, 0, 0, 0,
53},
54{ SOCK_RAW, &nsdomain, NSPROTO_RAW, PR_ATOMIC|PR_ADDR,
55 idp_input, idp_output, 0, idp_ctloutput,
56 idp_raw_usrreq,
57 0, 0, 0, 0,
58},
59{ SOCK_RAW, &nsdomain, NSPROTO_ERROR, PR_ATOMIC|PR_ADDR,
60 idp_ctlinput, idp_output, 0, idp_ctloutput,
61 idp_raw_usrreq,
62 0, 0, 0, 0,
63},
64};
65
66struct domain nsdomain =
67 { AF_NS, "network systems", 0, 0, 0,
5c48f39f
KS
68 nssw, &nssw[sizeof(nssw)/sizeof(nssw[0])], 0,
69 rn_inithead, 16, sizeof(struct sockaddr_ns)};
1d763a02 70