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) 1/20/88 13: */ 14: 15: #include "param.h" 16: #ifdef NS 17: #include "socket.h" 18: #include "protosw.h" 19: #include "domain.h" 20: #include "mbuf.h" 21: 22: #include "ns.h" 23: 24: /* 25: * NS protocol family: IDP, ERR, PE, SPP, ROUTE. 26: */ 27: int ns_init(); 28: int idp_input(), idp_output(), idp_ctlinput(), idp_usrreq(); 29: int idp_raw_usrreq(), idp_ctloutput(); 30: int spp_input(), spp_ctlinput(); 31: int spp_usrreq(), spp_usrreq_sp(), spp_ctloutput(); 32: int spp_init(), spp_fasttimo(), spp_slowtimo(); 33: extern int raw_usrreq(); 34: 35: extern struct domain nsdomain; 36: 37: struct protosw nssw[] = { 38: { 0, &nsdomain, 0, 0, 39: 0, idp_output, 0, 0, 40: 0, 41: ns_init, 0, 0, 0, 42: }, 43: { SOCK_DGRAM, &nsdomain, 0, PR_ATOMIC|PR_ADDR, 44: 0, 0, idp_ctlinput, idp_ctloutput, 45: idp_usrreq, 46: 0, 0, 0, 0, 47: }, 48: { SOCK_STREAM, &nsdomain, NSPROTO_SPP, PR_CONNREQUIRED|PR_WANTRCVD, 49: spp_input, 0, spp_ctlinput, spp_ctloutput, 50: spp_usrreq, 51: spp_init, spp_fasttimo, spp_slowtimo, 0, 52: }, 53: { SOCK_SEQPACKET,&nsdomain, NSPROTO_SPP, PR_CONNREQUIRED|PR_WANTRCVD|PR_ATOMIC, 54: spp_input, 0, spp_ctlinput, spp_ctloutput, 55: spp_usrreq_sp, 56: 0, 0, 0, 0, 57: }, 58: { SOCK_RAW, &nsdomain, NSPROTO_RAW, PR_ATOMIC|PR_ADDR, 59: idp_input, idp_output, 0, idp_ctloutput, 60: idp_raw_usrreq, 61: 0, 0, 0, 0, 62: }, 63: { SOCK_RAW, &nsdomain, NSPROTO_ERROR, PR_ATOMIC|PR_ADDR, 64: idp_ctlinput, idp_output, 0, idp_ctloutput, 65: idp_raw_usrreq, 66: 0, 0, 0, 0, 67: }, 68: }; 69: 70: struct domain nsdomain = 71: { AF_NS, "network systems", 0, 0, 0, 72: nssw, &nssw[sizeof(nssw)/sizeof(nssw[0])] }; 73: 74: #endif