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 | * |
240edf1f KS |
5 | * Redistribution and use in source and binary forms are permitted |
6 | * provided that this notice is preserved and that due credit is given | |
7 | * to the University of California at Berkeley. The name of the University | |
8 | * may not be used to endorse or promote products derived from this | |
9 | * software without specific prior written permission. This software | |
10 | * is provided ``as is'' without express or implied warranty. | |
11 | * | |
12 | * @(#)ns_proto.c 7.2 (Berkeley) %G% | |
8ae0e4b4 | 13 | */ |
1d763a02 KS |
14 | |
15 | #include "param.h" | |
16 | #include "socket.h" | |
17 | #include "protosw.h" | |
18 | #include "domain.h" | |
19 | #include "mbuf.h" | |
20 | ||
21 | #include "ns.h" | |
22 | ||
23 | /* | |
24 | * NS protocol family: IDP, ERR, PE, SPP, ROUTE. | |
25 | */ | |
9a6f0d01 | 26 | int ns_init(); |
1d763a02 | 27 | int idp_input(), idp_output(), idp_ctlinput(), idp_usrreq(); |
9a6f0d01 | 28 | int idp_raw_usrreq(), idp_ctloutput(); |
1d763a02 KS |
29 | int spp_input(), spp_ctlinput(); |
30 | int spp_usrreq(), spp_usrreq_sp(), spp_ctloutput(); | |
9a6f0d01 | 31 | int spp_init(), spp_fasttimo(), spp_slowtimo(); |
1d763a02 KS |
32 | extern int raw_usrreq(); |
33 | ||
34 | extern struct domain nsdomain; | |
35 | ||
36 | struct protosw nssw[] = { | |
37 | { 0, &nsdomain, 0, 0, | |
38 | 0, idp_output, 0, 0, | |
39 | 0, | |
40 | ns_init, 0, 0, 0, | |
41 | }, | |
42 | { SOCK_DGRAM, &nsdomain, 0, PR_ATOMIC|PR_ADDR, | |
aee11411 | 43 | 0, 0, idp_ctlinput, idp_ctloutput, |
1d763a02 KS |
44 | idp_usrreq, |
45 | 0, 0, 0, 0, | |
46 | }, | |
47 | { SOCK_STREAM, &nsdomain, NSPROTO_SPP, PR_CONNREQUIRED|PR_WANTRCVD, | |
aee11411 | 48 | spp_input, 0, spp_ctlinput, spp_ctloutput, |
1d763a02 KS |
49 | spp_usrreq, |
50 | spp_init, spp_fasttimo, spp_slowtimo, 0, | |
51 | }, | |
52 | { SOCK_SEQPACKET,&nsdomain, NSPROTO_SPP, PR_CONNREQUIRED|PR_WANTRCVD|PR_ATOMIC, | |
aee11411 | 53 | spp_input, 0, spp_ctlinput, spp_ctloutput, |
1d763a02 KS |
54 | spp_usrreq_sp, |
55 | 0, 0, 0, 0, | |
56 | }, | |
57 | { SOCK_RAW, &nsdomain, NSPROTO_RAW, PR_ATOMIC|PR_ADDR, | |
58 | idp_input, idp_output, 0, idp_ctloutput, | |
59 | idp_raw_usrreq, | |
60 | 0, 0, 0, 0, | |
61 | }, | |
62 | { SOCK_RAW, &nsdomain, NSPROTO_ERROR, PR_ATOMIC|PR_ADDR, | |
63 | idp_ctlinput, idp_output, 0, idp_ctloutput, | |
64 | idp_raw_usrreq, | |
65 | 0, 0, 0, 0, | |
66 | }, | |
67 | }; | |
68 | ||
69 | struct domain nsdomain = | |
70 | { AF_NS, "network systems", 0, 0, 0, | |
71 | nssw, &nssw[sizeof(nssw)/sizeof(nssw[0])] }; | |
72 |