ipx_pcb.h revision 11947
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 * 3411819Sjulian * @(#)ipx_pcb.h 3511819Sjulian */ 3611819Sjulian 3711819Sjulian#ifndef _NETIPX_IPX_PCB_H_ 3811819Sjulian#define _NETIPX_IPX_PCB_H_ 3911819Sjulian 4011819Sjulian/* 4111819Sjulian * IPX protocol interface control block. 4211819Sjulian */ 4311819Sjulianstruct ipxpcb { 4411819Sjulian struct ipxpcb *ipxp_next; /* doubly linked list */ 4511819Sjulian struct ipxpcb *ipxp_prev; 4611819Sjulian struct ipxpcb *ipxp_head; 4711819Sjulian struct socket *ipxp_socket; /* back pointer to socket */ 4811819Sjulian struct ipx_addr ipxp_faddr; /* destination address */ 4911819Sjulian struct ipx_addr ipxp_laddr; /* socket's address */ 5011819Sjulian caddr_t ipxp_pcb; /* protocol specific stuff */ 5111819Sjulian struct route ipxp_route; /* routing information */ 5211819Sjulian struct ipx_addr ipxp_lastdst; /* validate cached route for dg socks*/ 5311819Sjulian long ipxp_notify_param; /* extra info passed via ipx_pcbnotify*/ 5411819Sjulian short ipxp_flags; 5511819Sjulian u_char ipxp_dpt; /* default packet type for ipx_output */ 5611819Sjulian u_char ipxp_rpt; /* last received packet type by ipx_input() */ 5711819Sjulian}; 5811819Sjulian 5911819Sjulian/* possible flags */ 6011819Sjulian 6111819Sjulian#define IPXP_IN_ABORT 0x1 /* calling abort through socket */ 6211819Sjulian#define IPXP_RAWIN 0x2 /* show headers on input */ 6311819Sjulian#define IPXP_RAWOUT 0x4 /* show header on output */ 6411819Sjulian#define IPXP_ALL_PACKETS 0x8 /* Turn off higher proto processing */ 6511819Sjulian 6611819Sjulian#define IPX_WILDCARD 1 6711819Sjulian 6811819Sjulian#define ipxp_lport ipxp_laddr.x_port 6911819Sjulian#define ipxp_fport ipxp_faddr.x_port 7011819Sjulian 7111819Sjulian#define sotoipxpcb(so) ((struct ipxpcb *)((so)->so_pcb)) 7211819Sjulian 7311819Sjulian/* 7411819Sjulian * Nominal space allocated to a IPX socket. 7511819Sjulian */ 7611819Sjulian#define IPXSNDQ 2048 7711819Sjulian#define IPXRCVQ 2048 7811819Sjulian 7911819Sjulian 8011819Sjulian#ifdef KERNEL 8111947Sjulian 8211819Sjulianextern struct ipxpcb ipxpcb; /* head of list */ 8311947Sjulian 8411947Sjulian#include <sys/cdefs.h> 8511947Sjulian 8611947Sjulian__BEGIN_DECLS 8711947Sjulianint ipx_pcballoc __P((struct socket *so, struct ipxpcb *head)); 8811947Sjulianint ipx_pcbbind __P((struct ipxpcb *ipxp, struct mbuf *nam)); 8911947Sjulianint ipx_pcbconnect __P((struct ipxpcb *ipxp, struct mbuf *nam)); 9011947Sjulianvoid ipx_pcbdisconnect __P((struct ipxpcb *ipxp)); 9111947Sjulianvoid ipx_pcbdetach __P((struct ipxpcb *ipxp)); 9211947Sjulianvoid ipx_setsockaddr __P((struct ipxpcb *ipxp, struct mbuf *nam)); 9311947Sjulianvoid ipx_setpeeraddr __P((struct ipxpcb *ipxp, struct mbuf *nam)); 9411947Sjulianvoid ipx_pcbnotify __P((struct ipx_addr *dst, int errno, int (*notify)(), long param)); 9511947Sjulianstruct ipxpcb *ipx_pcblookup __P((struct ipx_addr *faddr, int lport, int wildp)); 9611947Sjulian__END_DECLS 9711947Sjulian 9811819Sjulian#endif 9911819Sjulian 10011819Sjulian#endif 101