Commit | Line | Data |
---|---|---|
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 | * |
5c48f39f | 7 | * @(#)ns_proto.c 7.5 (Berkeley) %G% |
8ae0e4b4 | 8 | */ |
1d763a02 KS |
9 | |
10 | #include "param.h" | |
11 | #include "socket.h" | |
12 | #include "protosw.h" | |
13 | #include "domain.h" | |
14 | #include "mbuf.h" | |
5c48f39f | 15 | #include "net/radix.h" |
1d763a02 KS |
16 | |
17 | #include "ns.h" | |
18 | ||
19 | /* | |
20 | * NS protocol family: IDP, ERR, PE, SPP, ROUTE. | |
21 | */ | |
9a6f0d01 | 22 | int ns_init(); |
1d763a02 | 23 | int idp_input(), idp_output(), idp_ctlinput(), idp_usrreq(); |
9a6f0d01 | 24 | int idp_raw_usrreq(), idp_ctloutput(); |
1d763a02 KS |
25 | int spp_input(), spp_ctlinput(); |
26 | int spp_usrreq(), spp_usrreq_sp(), spp_ctloutput(); | |
9a6f0d01 | 27 | int spp_init(), spp_fasttimo(), spp_slowtimo(); |
1d763a02 KS |
28 | extern int raw_usrreq(); |
29 | ||
30 | extern struct domain nsdomain; | |
31 | ||
32 | struct protosw nssw[] = { | |
33 | { 0, &nsdomain, 0, 0, | |
34 | 0, idp_output, 0, 0, | |
35 | 0, | |
36 | ns_init, 0, 0, 0, | |
37 | }, | |
38 | { SOCK_DGRAM, &nsdomain, 0, PR_ATOMIC|PR_ADDR, | |
aee11411 | 39 | 0, 0, idp_ctlinput, idp_ctloutput, |
1d763a02 KS |
40 | idp_usrreq, |
41 | 0, 0, 0, 0, | |
42 | }, | |
43 | { SOCK_STREAM, &nsdomain, NSPROTO_SPP, PR_CONNREQUIRED|PR_WANTRCVD, | |
aee11411 | 44 | spp_input, 0, spp_ctlinput, spp_ctloutput, |
1d763a02 KS |
45 | spp_usrreq, |
46 | spp_init, spp_fasttimo, spp_slowtimo, 0, | |
47 | }, | |
48 | { SOCK_SEQPACKET,&nsdomain, NSPROTO_SPP, PR_CONNREQUIRED|PR_WANTRCVD|PR_ATOMIC, | |
aee11411 | 49 | spp_input, 0, spp_ctlinput, spp_ctloutput, |
1d763a02 KS |
50 | spp_usrreq_sp, |
51 | 0, 0, 0, 0, | |
52 | }, | |
53 | { SOCK_RAW, &nsdomain, NSPROTO_RAW, PR_ATOMIC|PR_ADDR, | |
54 | idp_input, idp_output, 0, idp_ctloutput, | |
55 | idp_raw_usrreq, | |
56 | 0, 0, 0, 0, | |
57 | }, | |
58 | { SOCK_RAW, &nsdomain, NSPROTO_ERROR, PR_ATOMIC|PR_ADDR, | |
59 | idp_ctlinput, idp_output, 0, idp_ctloutput, | |
60 | idp_raw_usrreq, | |
61 | 0, 0, 0, 0, | |
62 | }, | |
63 | }; | |
64 | ||
65 | struct domain nsdomain = | |
66 | { AF_NS, "network systems", 0, 0, 0, | |
5c48f39f KS |
67 | nssw, &nssw[sizeof(nssw)/sizeof(nssw[0])], 0, |
68 | rn_inithead, 16, sizeof(struct sockaddr_ns)}; | |
1d763a02 | 69 |