ipx_proto.c revision 25347
111819Sjulian/* 211819Sjulian * Copyright (c) 1995, Mike Mitchell 311819Sjulian * Copyright (c) 1984, 1985, 1986, 1987, 1993 411819Sjulian * The Regents of the University of California. All rights reserved. 511819Sjulian * 611819Sjulian * Redistribution and use in source and binary forms, with or without 711819Sjulian * modification, are permitted provided that the following conditions 811819Sjulian * are met: 911819Sjulian * 1. Redistributions of source code must retain the above copyright 1011819Sjulian * notice, this list of conditions and the following disclaimer. 1111819Sjulian * 2. Redistributions in binary form must reproduce the above copyright 1211819Sjulian * notice, this list of conditions and the following disclaimer in the 1311819Sjulian * documentation and/or other materials provided with the distribution. 1411819Sjulian * 3. All advertising materials mentioning features or use of this software 1511819Sjulian * must display the following acknowledgement: 1611819Sjulian * This product includes software developed by the University of 1711819Sjulian * California, Berkeley and its contributors. 1811819Sjulian * 4. Neither the name of the University nor the names of its contributors 1911819Sjulian * may be used to endorse or promote products derived from this software 2011819Sjulian * without specific prior written permission. 2111819Sjulian * 2211819Sjulian * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2311819Sjulian * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2411819Sjulian * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2511819Sjulian * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2611819Sjulian * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2711819Sjulian * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2811819Sjulian * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2911819Sjulian * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3011819Sjulian * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3111819Sjulian * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3211819Sjulian * SUCH DAMAGE. 3311819Sjulian * 3412057Sjulian * @(#)ipx_proto.c 3512057Sjulian * 3625347Sjhay * $Id: ipx_proto.c,v 1.8 1997/04/05 20:05:08 jhay Exp $ 3711819Sjulian */ 3811819Sjulian 3911819Sjulian#include <sys/param.h> 4011819Sjulian#include <sys/socket.h> 4111819Sjulian#include <sys/protosw.h> 4211819Sjulian#include <sys/domain.h> 4311819Sjulian#include <sys/kernel.h> 4411819Sjulian#include <sys/mbuf.h> 4513266Swollman#include <sys/sysctl.h> 4611819Sjulian 4711819Sjulian#include <net/radix.h> 4811819Sjulian 4911819Sjulian#include <netipx/ipx.h> 5011819Sjulian#include <netipx/spx.h> 5111819Sjulian 5225347Sjhaystatic struct pr_usrreqs nousrreqs; 5325347Sjhay 5411819Sjulian/* 5511819Sjulian * IPX protocol family: IPX, ERR, PXP, SPX, ROUTE. 5611819Sjulian */ 5711819Sjulian 5811819Sjulianstruct protosw ipxsw[] = { 5911819Sjulian{ 0, &ipxdomain, 0, 0, 6015682Sgpalmer 0, 0, 0, 0, 6111819Sjulian 0, 6224659Sjhay ipx_init, 0, 0, 0, 6325347Sjhay &nousrreqs 6411819Sjulian}, 6511819Sjulian{ SOCK_DGRAM, &ipxdomain, 0, PR_ATOMIC|PR_ADDR, 6611819Sjulian 0, 0, ipx_ctlinput, ipx_ctloutput, 6724659Sjhay 0, 6824659Sjhay 0, 0, 0, 0, 6924659Sjhay &ipx_usrreqs 7011819Sjulian}, 7111819Sjulian{ SOCK_STREAM, &ipxdomain, IPXPROTO_SPX, PR_CONNREQUIRED|PR_WANTRCVD, 7215682Sgpalmer 0, 0, spx_ctlinput, spx_ctloutput, 7324659Sjhay 0, 7424659Sjhay spx_init, spx_fasttimo, spx_slowtimo, 0, 7524659Sjhay &spx_usrreqs 7611819Sjulian}, 7711819Sjulian{ SOCK_SEQPACKET,&ipxdomain, IPXPROTO_SPX, PR_CONNREQUIRED|PR_WANTRCVD|PR_ATOMIC, 7815682Sgpalmer 0, 0, spx_ctlinput, spx_ctloutput, 7924659Sjhay 0, 8024659Sjhay 0, 0, 0, 0, 8124659Sjhay &spx_usrreq_sps 8211819Sjulian}, 8311819Sjulian{ SOCK_RAW, &ipxdomain, IPXPROTO_RAW, PR_ATOMIC|PR_ADDR, 8415682Sgpalmer 0, 0, 0, ipx_ctloutput, 8524659Sjhay 0, 8624659Sjhay 0, 0, 0, 0, 8724659Sjhay &ripx_usrreqs 8811819Sjulian}, 8911819Sjulian{ SOCK_RAW, &ipxdomain, IPXPROTO_ERROR, PR_ATOMIC|PR_ADDR, 9015682Sgpalmer 0, 0, 0, ipx_ctloutput, 9124659Sjhay 0, 9224659Sjhay 0, 0, 0, 0, 9324659Sjhay &ripx_usrreqs 9411819Sjulian}, 9511819Sjulian#ifdef IPTUNNEL 9611819Sjulian#if 0 9711819Sjulian{ SOCK_RAW, &ipxdomain, IPPROTO_IPX, PR_ATOMIC|PR_ADDR, 9811819Sjulian iptun_input, rip_output, iptun_ctlinput, 0, 9924659Sjhay 0, 10011819Sjulian 0, 0, 0, 0, 10124659Sjhay &rip_usrreqs 10211819Sjulian}, 10311819Sjulian#endif 10411819Sjulian#endif 10511819Sjulian}; 10611819Sjulian 10711819Sjulianstruct domain ipxdomain = 10811819Sjulian { AF_IPX, "network systems", 0, 0, 0, 10911819Sjulian ipxsw, &ipxsw[sizeof(ipxsw)/sizeof(ipxsw[0])], 0, 11011819Sjulian rn_inithead, 16, sizeof(struct sockaddr_ipx)}; 11111819Sjulian 11211819SjulianDOMAIN_SET(ipx); 11313266SwollmanSYSCTL_NODE(_net, PF_IPX, ipx, CTLFLAG_RW, 0, 11413266Swollman "IPX/SPX"); 11513266Swollman 11613266SwollmanSYSCTL_NODE(_net_ipx, IPXPROTO_RAW, ipx, CTLFLAG_RW, 0, "IPX"); 11713266SwollmanSYSCTL_NODE(_net_ipx, IPXPROTO_SPX, spx, CTLFLAG_RW, 0, "SPX"); 11813266SwollmanSYSCTL_NODE(_net_ipx, IPXPROTO_ERROR, error, CTLFLAG_RW, 0, 11913266Swollman "Error Protocol"); 120