1 /* 2 * Copyright (c) 1984, 1985, 1986, 1987 Regents of the University of California. 3 * All rights reserved. 4 * 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) 01/20/88 13 */ 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 */ 26 int ns_init(); 27 int idp_input(), idp_output(), idp_ctlinput(), idp_usrreq(); 28 int idp_raw_usrreq(), idp_ctloutput(); 29 int spp_input(), spp_ctlinput(); 30 int spp_usrreq(), spp_usrreq_sp(), spp_ctloutput(); 31 int spp_init(), spp_fasttimo(), spp_slowtimo(); 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, 43 0, 0, idp_ctlinput, idp_ctloutput, 44 idp_usrreq, 45 0, 0, 0, 0, 46 }, 47 { SOCK_STREAM, &nsdomain, NSPROTO_SPP, PR_CONNREQUIRED|PR_WANTRCVD, 48 spp_input, 0, spp_ctlinput, spp_ctloutput, 49 spp_usrreq, 50 spp_init, spp_fasttimo, spp_slowtimo, 0, 51 }, 52 { SOCK_SEQPACKET,&nsdomain, NSPROTO_SPP, PR_CONNREQUIRED|PR_WANTRCVD|PR_ATOMIC, 53 spp_input, 0, spp_ctlinput, spp_ctloutput, 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 73