ipx_proto.c revision 12057
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 *
3612057Sjulian * $Id: ipx_proto.c,v 1.2 1995/10/31 23:36:36 julian 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>
4511819Sjulian
4611819Sjulian#include <net/radix.h>
4711819Sjulian
4811819Sjulian#include <netipx/ipx.h>
4911819Sjulian#include <netipx/spx.h>
5011819Sjulian
5111819Sjulian/*
5211819Sjulian * IPX protocol family: IPX, ERR, PXP, SPX, ROUTE.
5311819Sjulian */
5411819Sjulian
5511819Sjulianstruct protosw ipxsw[] = {
5611819Sjulian{ 0,		&ipxdomain,	0,		0,
5711819Sjulian  0,		ipx_output,	0,		0,
5811819Sjulian  0,
5911819Sjulian  ipx_init,	0,		0,		0
6011819Sjulian},
6111819Sjulian{ SOCK_DGRAM,	&ipxdomain,	0,		PR_ATOMIC|PR_ADDR,
6211819Sjulian  0,		0,		ipx_ctlinput,	ipx_ctloutput,
6311819Sjulian  ipx_usrreq,
6411819Sjulian  0,		0,		0,		0
6511819Sjulian},
6611819Sjulian{ SOCK_STREAM,	&ipxdomain,	IPXPROTO_SPX,	PR_CONNREQUIRED|PR_WANTRCVD,
6711819Sjulian  spx_input,	0,		spx_ctlinput,	spx_ctloutput,
6811819Sjulian  spx_usrreq,
6911819Sjulian  spx_init,	spx_fasttimo,	spx_slowtimo,	0
7011819Sjulian},
7111819Sjulian{ SOCK_SEQPACKET,&ipxdomain,	IPXPROTO_SPX,	PR_CONNREQUIRED|PR_WANTRCVD|PR_ATOMIC,
7211819Sjulian  spx_input,	0,		spx_ctlinput,	spx_ctloutput,
7311819Sjulian  spx_usrreq_sp,
7411819Sjulian  0,		0,		0,		0
7511819Sjulian},
7611819Sjulian{ SOCK_RAW,	&ipxdomain,	IPXPROTO_RAW,	PR_ATOMIC|PR_ADDR,
7711819Sjulian  ipx_input,	ipx_output,	0,		ipx_ctloutput,
7811819Sjulian  ipx_raw_usrreq,
7911819Sjulian  0,		0,		0,		0
8011819Sjulian},
8111819Sjulian{ SOCK_RAW,	&ipxdomain,	IPXPROTO_ERROR,	PR_ATOMIC|PR_ADDR,
8211819Sjulian  ipx_ctlinput,	ipx_output,	0,		ipx_ctloutput,
8311819Sjulian  ipx_raw_usrreq,
8411819Sjulian  0,		0,		0,		0
8511819Sjulian},
8611819Sjulian#ifdef IPTUNNEL
8711819Sjulian#if 0
8811819Sjulian{ SOCK_RAW,	&ipxdomain,	IPPROTO_IPX,	PR_ATOMIC|PR_ADDR,
8911819Sjulian  iptun_input,	rip_output,	iptun_ctlinput,	0,
9011819Sjulian  rip_usrreq,
9111819Sjulian  0,		0,		0,		0,
9211819Sjulian},
9311819Sjulian#endif
9411819Sjulian#endif
9511819Sjulian};
9611819Sjulian
9711819Sjulianstruct domain ipxdomain =
9811819Sjulian    { 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);
103