ipx_proto.c revision 149848
1139823Simp/*- 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 3511819Sjulian */ 3611819Sjulian 37116189Sobrien#include <sys/cdefs.h> 38116189Sobrien__FBSDID("$FreeBSD: head/sys/netipx/ipx_proto.c 149848 2005-09-07 10:06:14Z obrien $"); 39116189Sobrien 4031742Seivind#include "opt_ipx.h" 4131742Seivind 4211819Sjulian#include <sys/param.h> 4311819Sjulian#include <sys/socket.h> 4411819Sjulian#include <sys/protosw.h> 4511819Sjulian#include <sys/domain.h> 4611819Sjulian#include <sys/kernel.h> 4744078Sdfr#include <sys/queue.h> 4813266Swollman#include <sys/sysctl.h> 4911819Sjulian 5011819Sjulian#include <net/radix.h> 5111819Sjulian 5211819Sjulian#include <netipx/ipx.h> 5325652Sjhay#include <netipx/ipx_var.h> 5411819Sjulian#include <netipx/spx.h> 5511819Sjulian 5625652Sjhaystatic struct pr_usrreqs nousrreqs; 5725347Sjhay 5811819Sjulian/* 5911819Sjulian * IPX protocol family: IPX, ERR, PXP, SPX, ROUTE. 6011819Sjulian */ 6111819Sjulian 62149848Sobrienstatic struct domain ipxdomain; 63149848Sobrien 6426965Sjhaystatic struct protosw ipxsw[] = { 6511819Sjulian{ 0, &ipxdomain, 0, 0, 6615682Sgpalmer 0, 0, 0, 0, 6711819Sjulian 0, 6824659Sjhay ipx_init, 0, 0, 0, 6925347Sjhay &nousrreqs 7011819Sjulian}, 7111819Sjulian{ SOCK_DGRAM, &ipxdomain, 0, PR_ATOMIC|PR_ADDR, 7211819Sjulian 0, 0, ipx_ctlinput, ipx_ctloutput, 7324659Sjhay 0, 7424659Sjhay 0, 0, 0, 0, 7524659Sjhay &ipx_usrreqs 7611819Sjulian}, 7711819Sjulian{ SOCK_STREAM, &ipxdomain, IPXPROTO_SPX, PR_CONNREQUIRED|PR_WANTRCVD, 7815682Sgpalmer 0, 0, spx_ctlinput, spx_ctloutput, 7924659Sjhay 0, 8024659Sjhay spx_init, spx_fasttimo, spx_slowtimo, 0, 8124659Sjhay &spx_usrreqs 8211819Sjulian}, 8311819Sjulian{ SOCK_SEQPACKET,&ipxdomain, IPXPROTO_SPX, PR_CONNREQUIRED|PR_WANTRCVD|PR_ATOMIC, 8415682Sgpalmer 0, 0, spx_ctlinput, spx_ctloutput, 8524659Sjhay 0, 8624659Sjhay 0, 0, 0, 0, 8724659Sjhay &spx_usrreq_sps 8811819Sjulian}, 8911819Sjulian{ SOCK_RAW, &ipxdomain, IPXPROTO_RAW, PR_ATOMIC|PR_ADDR, 9015682Sgpalmer 0, 0, 0, ipx_ctloutput, 9124659Sjhay 0, 9224659Sjhay 0, 0, 0, 0, 9324659Sjhay &ripx_usrreqs 9411819Sjulian}, 9511819Sjulian}; 9611819Sjulian 9733181Seivindstatic struct domain ipxdomain = 98139584Srwatson { AF_IPX, "network systems", 0, 0, 0, 9911819Sjulian ipxsw, &ipxsw[sizeof(ipxsw)/sizeof(ipxsw[0])], 0, 10011819Sjulian rn_inithead, 16, sizeof(struct sockaddr_ipx)}; 10111819Sjulian 10211819SjulianDOMAIN_SET(ipx); 10313266SwollmanSYSCTL_NODE(_net, PF_IPX, ipx, CTLFLAG_RW, 0, 10413266Swollman "IPX/SPX"); 10513266Swollman 10613266SwollmanSYSCTL_NODE(_net_ipx, IPXPROTO_RAW, ipx, CTLFLAG_RW, 0, "IPX"); 10713266SwollmanSYSCTL_NODE(_net_ipx, IPXPROTO_SPX, spx, CTLFLAG_RW, 0, "SPX"); 108