ipx_proto.c revision 31742
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 *
3631742Seivind * $Id: ipx_proto.c,v 1.11 1997/06/26 19:35:55 jhay Exp $
3711819Sjulian */
3811819Sjulian
3931742Seivind#include "opt_ipx.h"
4031742Seivind
4111819Sjulian#include <sys/param.h>
4211819Sjulian#include <sys/socket.h>
4311819Sjulian#include <sys/protosw.h>
4411819Sjulian#include <sys/domain.h>
4511819Sjulian#include <sys/kernel.h>
4613266Swollman#include <sys/sysctl.h>
4711819Sjulian
4811819Sjulian#include <net/radix.h>
4911819Sjulian
5011819Sjulian#include <netipx/ipx.h>
5125652Sjhay#include <netipx/ipx_var.h>
5211819Sjulian#include <netipx/spx.h>
5311819Sjulian
5425652Sjhayextern	struct domain ipxdomain;
5525652Sjhaystatic	struct pr_usrreqs nousrreqs;
5625347Sjhay
5711819Sjulian/*
5811819Sjulian * IPX protocol family: IPX, ERR, PXP, SPX, ROUTE.
5911819Sjulian */
6011819Sjulian
6126965Sjhaystatic struct protosw ipxsw[] = {
6211819Sjulian{ 0,		&ipxdomain,	0,		0,
6315682Sgpalmer  0,		0,		0,		0,
6411819Sjulian  0,
6524659Sjhay  ipx_init,	0,		0,		0,
6625347Sjhay  &nousrreqs
6711819Sjulian},
6811819Sjulian{ SOCK_DGRAM,	&ipxdomain,	0,		PR_ATOMIC|PR_ADDR,
6911819Sjulian  0,		0,		ipx_ctlinput,	ipx_ctloutput,
7024659Sjhay  0,
7124659Sjhay  0,		0,		0,		0,
7224659Sjhay  &ipx_usrreqs
7311819Sjulian},
7411819Sjulian{ SOCK_STREAM,	&ipxdomain,	IPXPROTO_SPX,	PR_CONNREQUIRED|PR_WANTRCVD,
7515682Sgpalmer  0,		0,		spx_ctlinput,	spx_ctloutput,
7624659Sjhay  0,
7724659Sjhay  spx_init,	spx_fasttimo,	spx_slowtimo,	0,
7824659Sjhay  &spx_usrreqs
7911819Sjulian},
8011819Sjulian{ SOCK_SEQPACKET,&ipxdomain,	IPXPROTO_SPX,	PR_CONNREQUIRED|PR_WANTRCVD|PR_ATOMIC,
8115682Sgpalmer  0,		0,		spx_ctlinput,	spx_ctloutput,
8224659Sjhay  0,
8324659Sjhay  0,		0,		0,		0,
8424659Sjhay  &spx_usrreq_sps
8511819Sjulian},
8611819Sjulian{ SOCK_RAW,	&ipxdomain,	IPXPROTO_RAW,	PR_ATOMIC|PR_ADDR,
8715682Sgpalmer  0,		0,		0,		ipx_ctloutput,
8824659Sjhay  0,
8924659Sjhay  0,		0,		0,		0,
9024659Sjhay  &ripx_usrreqs
9111819Sjulian},
9211819Sjulian#ifdef IPTUNNEL
9311819Sjulian#if 0
9411819Sjulian{ SOCK_RAW,	&ipxdomain,	IPPROTO_IPX,	PR_ATOMIC|PR_ADDR,
9511819Sjulian  iptun_input,	rip_output,	iptun_ctlinput,	0,
9624659Sjhay  0,
9711819Sjulian  0,		0,		0,		0,
9824659Sjhay  &rip_usrreqs
9911819Sjulian},
10011819Sjulian#endif
10111819Sjulian#endif
10211819Sjulian};
10311819Sjulian
10425652Sjhaystruct	domain ipxdomain =
10511819Sjulian    { AF_IPX, "network systems", 0, 0, 0,
10611819Sjulian      ipxsw, &ipxsw[sizeof(ipxsw)/sizeof(ipxsw[0])], 0,
10711819Sjulian      rn_inithead, 16, sizeof(struct sockaddr_ipx)};
10811819Sjulian
10911819SjulianDOMAIN_SET(ipx);
11013266SwollmanSYSCTL_NODE(_net,	PF_IPX,		ipx,	CTLFLAG_RW, 0,
11113266Swollman	"IPX/SPX");
11213266Swollman
11313266SwollmanSYSCTL_NODE(_net_ipx,	IPXPROTO_RAW,	ipx,	CTLFLAG_RW, 0, "IPX");
11413266SwollmanSYSCTL_NODE(_net_ipx,	IPXPROTO_SPX,	spx,	CTLFLAG_RW, 0, "SPX");
115