ipx_if.h revision 11947
157429Smarkm/*
257429Smarkm * Copyright (c) 1995, Mike Mitchell
357429Smarkm * Copyright (c) 1984, 1985, 1986, 1987, 1993
457429Smarkm *	The Regents of the University of California.  All rights reserved.
557429Smarkm *
657429Smarkm * Redistribution and use in source and binary forms, with or without
757429Smarkm * modification, are permitted provided that the following conditions
865674Skris * are met:
965674Skris * 1. Redistributions of source code must retain the above copyright
1065674Skris *    notice, this list of conditions and the following disclaimer.
1165674Skris * 2. Redistributions in binary form must reproduce the above copyright
1265674Skris *    notice, this list of conditions and the following disclaimer in the
1357429Smarkm *    documentation and/or other materials provided with the distribution.
1457429Smarkm * 3. All advertising materials mentioning features or use of this software
1557429Smarkm *    must display the following acknowledgement:
16124211Sdes *	This product includes software developed by the University of
1757429Smarkm *	California, Berkeley and its contributors.
1857429Smarkm * 4. Neither the name of the University nor the names of its contributors
1957429Smarkm *    may be used to endorse or promote products derived from this software
2076262Sgreen *    without specific prior written permission.
2157429Smarkm *
2258582Skris * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2358582Skris * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2476262Sgreen * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2576262Sgreen * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2676262Sgreen * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2758582Skris * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2898684Sdes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2998684Sdes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3098684Sdes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3198684Sdes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3298684Sdes * SUCH DAMAGE.
3398684Sdes *
3498684Sdes *	@(#)ipx_if.h
3598684Sdes */
3698684Sdes
3798684Sdes#ifndef _NETIPX_IPX_IF_H_
3898684Sdes#define _NETIPX_IPX_IF_H_
3998684Sdes
4098684Sdes/*
4198684Sdes * Interface address.  One of these structures
4298684Sdes * is allocated for each interface with an internet address.
4398684Sdes * The ifaddr structure contains the protocol-independent part
4498684Sdes * of the structure and is assumed to be first.
4598684Sdes */
4698684Sdes
4798684Sdesstruct ipx_ifaddr {
4898684Sdes	struct	ifaddr ia_ifa;		/* protocol-independent info */
4998684Sdes#define	ia_ifp		ia_ifa.ifa_ifp
5057429Smarkm#define	ia_flags	ia_ifa.ifa_flags
5157429Smarkm	struct	ipx_ifaddr *ia_next;	/* next in list of ipx addresses */
5257429Smarkm	struct	sockaddr_ipx ia_addr;	/* reserve space for my address */
5357429Smarkm	struct	sockaddr_ipx ia_dstaddr;	/* space for my broadcast address */
5460576Skris#define ia_broadaddr	ia_dstaddr
5598684Sdes	struct	sockaddr_ipx ia_netmask;	/* space for my network mask */
5657429Smarkm};
5798684Sdes
5857429Smarkmstruct	ipx_aliasreq {
5998684Sdes	char	ifra_name[IFNAMSIZ];		/* if name, e.g. "en0" */
6098684Sdes	struct	sockaddr_ipx ifra_addr;
6157429Smarkm	struct	sockaddr_ipx ifra_broadaddr;
6298684Sdes#define ifra_dstaddr ifra_broadaddr
6398684Sdes};
6458582Skris/*
6558582Skris * Given a pointer to an ipx_ifaddr (ifaddr),
66124211Sdes * return a pointer to the addr as a sockadd_ipx.
6798684Sdes */
6857429Smarkm
6998684Sdes#define	IA_SIPX(ia) (&(((struct ipx_ifaddr *)(ia))->ia_addr))
7057429Smarkm
7157429Smarkm/* This is not the right place for this but where is? */
7257429Smarkm#define	ETHERTYPE_IPX	0x8137
7357429Smarkm
7457429Smarkm#ifdef	IPXIP
7557429Smarkmstruct ipxip_req {
7657429Smarkm	struct sockaddr rq_ipx;	/* must be ipx format destination */
7798684Sdes	struct sockaddr rq_ip;	/* must be ip format gateway */
78124211Sdes	short rq_flags;
7998684Sdes};
8057429Smarkm#endif
8157429Smarkm
8257429Smarkm#ifdef	KERNEL
8357429Smarkm
8457429Smarkmextern struct	ifqueue	ipxintrq;	/* IPX input packet queue */
8557429Smarkmextern struct	ipx_ifaddr *ipx_ifaddr;
8657429Smarkm
8757429Smarkm#include <sys/cdefs.h>
8898684Sdes
8957429Smarkm__BEGIN_DECLS
9057429Smarkmint ipx_ifinit __P((struct ifnet *ifp, struct ipx_ifaddr *ia, struct sockaddr_ipx *sipx, int scrub));
9157429Smarkmvoid ipx_ifscrub __P((struct ifnet *ifp, struct ipx_ifaddr *ia));
92struct ipx_ifaddr *ipx_iaonnetof __P((struct ipx_addr *dst));
93__END_DECLS
94
95#endif
96
97#endif
98