ipx_pcb.h revision 92745
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_pcb.h
3512057Sjulian *
3650477Speter * $FreeBSD: head/sys/netipx/ipx_pcb.h 92745 2002-03-20 02:39:27Z alfred $
3711819Sjulian */
3811819Sjulian
3911819Sjulian#ifndef _NETIPX_IPX_PCB_H_
4012470Sbde#define	_NETIPX_IPX_PCB_H_
4111819Sjulian
4211819Sjulian/*
4311819Sjulian * IPX protocol interface control block.
4411819Sjulian */
4511819Sjulianstruct ipxpcb {
4611819Sjulian	struct	ipxpcb *ipxp_next;	/* doubly linked list */
4711819Sjulian	struct	ipxpcb *ipxp_prev;
4811819Sjulian	struct	ipxpcb *ipxp_head;
4911819Sjulian	struct	socket *ipxp_socket;	/* back pointer to socket */
5011819Sjulian	struct	ipx_addr ipxp_faddr;	/* destination address */
5111819Sjulian	struct	ipx_addr ipxp_laddr;	/* socket's address */
5211819Sjulian	caddr_t	ipxp_pcb;		/* protocol specific stuff */
5311819Sjulian	struct	route ipxp_route;	/* routing information */
5411819Sjulian	struct	ipx_addr ipxp_lastdst;	/* validate cached route for dg socks*/
5511819Sjulian	long	ipxp_notify_param;	/* extra info passed via ipx_pcbnotify*/
5611819Sjulian	short	ipxp_flags;
5711819Sjulian	u_char	ipxp_dpt;		/* default packet type for ipx_output */
5811819Sjulian	u_char	ipxp_rpt;		/* last received packet type by ipx_input() */
5911819Sjulian};
6011819Sjulian
6111819Sjulian/* possible flags */
6211819Sjulian
6325652Sjhay#define IPXP_IN_ABORT		0x1	/* calling abort through socket */
6425652Sjhay#define IPXP_RAWIN		0x2	/* show headers on input */
6525652Sjhay#define IPXP_RAWOUT		0x4	/* show header on output */
6625652Sjhay#define IPXP_ALL_PACKETS	0x8	/* Turn off higher proto processing */
6750519Sjhay#define	IPXP_CHECKSUM		0x10	/* use checksum on this socket */
6811819Sjulian
6925652Sjhay#define	IPX_WILDCARD		1
7011819Sjulian
7111819Sjulian#define ipxp_lport ipxp_laddr.x_port
7211819Sjulian#define ipxp_fport ipxp_faddr.x_port
7311819Sjulian
7411819Sjulian#define	sotoipxpcb(so)		((struct ipxpcb *)((so)->so_pcb))
7511819Sjulian
7611819Sjulian/*
7711819Sjulian * Nominal space allocated to a IPX socket.
7811819Sjulian */
7919947Sjhay#define	IPXSNDQ		16384
8019947Sjhay#define	IPXRCVQ		40960
8111819Sjulian
8255205Speter#ifdef _KERNEL
8311819Sjulianextern struct ipxpcb ipxpcb;			/* head of list */
8411947Sjulian
8592745Salfredint	ipx_pcballoc(struct socket *so, struct ipxpcb *head,
8692745Salfred			  struct thread *p);
8792745Salfredint	ipx_pcbbind(struct ipxpcb *ipxp, struct sockaddr *nam,
8892745Salfred			 struct thread *p);
8992745Salfredint	ipx_pcbconnect(struct ipxpcb *ipxp, struct sockaddr *nam,
9092745Salfred			    struct thread *p);
9192745Salfredvoid	ipx_pcbdetach(struct ipxpcb *ipxp);
9292745Salfredvoid	ipx_pcbdisconnect(struct ipxpcb *ipxp);
9312470Sbdestruct ipxpcb *
9492745Salfred	ipx_pcblookup(struct ipx_addr *faddr, int lport, int wildp);
9592745Salfredvoid	ipx_pcbnotify(struct ipx_addr *dst, int errno,
9692745Salfred			   void (*notify)(struct ipxpcb *), long param);
9792745Salfredvoid	ipx_setpeeraddr(struct ipxpcb *ipxp, struct sockaddr **nam);
9892745Salfredvoid	ipx_setsockaddr(struct ipxpcb *ipxp, struct sockaddr **nam);
9955205Speter#endif /* _KERNEL */
10011819Sjulian
10126965Sjhay#endif /* !_NETIPX_IPX_PCB_H_ */
102