ipx_if.h revision 11991
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 * 3411991Sjulian * @(#)$Id$ 3511819Sjulian */ 3611819Sjulian 3711819Sjulian#ifndef _NETIPX_IPX_IF_H_ 3811819Sjulian#define _NETIPX_IPX_IF_H_ 3911819Sjulian 4011819Sjulian/* 4111819Sjulian * Interface address. One of these structures 4211819Sjulian * is allocated for each interface with an internet address. 4311819Sjulian * The ifaddr structure contains the protocol-independent part 4411819Sjulian * of the structure and is assumed to be first. 4511819Sjulian */ 4611819Sjulian 4711819Sjulianstruct ipx_ifaddr { 4811819Sjulian struct ifaddr ia_ifa; /* protocol-independent info */ 4911819Sjulian#define ia_ifp ia_ifa.ifa_ifp 5011819Sjulian#define ia_flags ia_ifa.ifa_flags 5111819Sjulian struct ipx_ifaddr *ia_next; /* next in list of ipx addresses */ 5211819Sjulian struct sockaddr_ipx ia_addr; /* reserve space for my address */ 5311819Sjulian struct sockaddr_ipx ia_dstaddr; /* space for my broadcast address */ 5411819Sjulian#define ia_broadaddr ia_dstaddr 5511819Sjulian struct sockaddr_ipx ia_netmask; /* space for my network mask */ 5611819Sjulian}; 5711819Sjulian 5811819Sjulianstruct ipx_aliasreq { 5911819Sjulian char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */ 6011819Sjulian struct sockaddr_ipx ifra_addr; 6111819Sjulian struct sockaddr_ipx ifra_broadaddr; 6211819Sjulian#define ifra_dstaddr ifra_broadaddr 6311819Sjulian}; 6411819Sjulian/* 6511819Sjulian * Given a pointer to an ipx_ifaddr (ifaddr), 6611819Sjulian * return a pointer to the addr as a sockadd_ipx. 6711819Sjulian */ 6811819Sjulian 6911819Sjulian#define IA_SIPX(ia) (&(((struct ipx_ifaddr *)(ia))->ia_addr)) 7011819Sjulian 7111819Sjulian/* This is not the right place for this but where is? */ 7211819Sjulian 7311991Sjulian#define ETHERTYPE_IPX_8022 0x00e0 /* Ethernet_802.2 */ 7411991Sjulian#define ETHERTYPE_IPX_8023 0x0000 /* Ethernet_802.3 */ 7511991Sjulian#define ETHERTYPE_IPX_II 0x8137 /* Ethernet_II */ 7611991Sjulian#define ETHERTYPE_IPX_SNAP 0x8137 /* Ethernet_SNAP */ 7711991Sjulian 7811991Sjulian#define ETHERTYPE_IPX 0x8137 /* Only Ethernet_II Available */ 7911991Sjulian 8011819Sjulian#ifdef IPXIP 8111819Sjulianstruct ipxip_req { 8211819Sjulian struct sockaddr rq_ipx; /* must be ipx format destination */ 8311819Sjulian struct sockaddr rq_ip; /* must be ip format gateway */ 8411819Sjulian short rq_flags; 8511819Sjulian}; 8611819Sjulian#endif 8711819Sjulian 8811819Sjulian#ifdef KERNEL 8911947Sjulian 9011819Sjulianextern struct ifqueue ipxintrq; /* IPX input packet queue */ 9111819Sjulianextern struct ipx_ifaddr *ipx_ifaddr; 9211947Sjulian 9311947Sjulian#include <sys/cdefs.h> 9411947Sjulian 9511947Sjulian__BEGIN_DECLS 9611947Sjulianint ipx_ifinit __P((struct ifnet *ifp, struct ipx_ifaddr *ia, struct sockaddr_ipx *sipx, int scrub)); 9711947Sjulianvoid ipx_ifscrub __P((struct ifnet *ifp, struct ipx_ifaddr *ia)); 9811947Sjulianstruct ipx_ifaddr *ipx_iaonnetof __P((struct ipx_addr *dst)); 9911947Sjulian__END_DECLS 10011947Sjulian 10111819Sjulian#endif 10211819Sjulian 10311819Sjulian#endif 104