1 /* $NetBSD: iso_var.h,v 1.28 2007/12/05 23:47:19 dyoung Exp $ */
4 * Copyright (c) 1988, 1991, 1993
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * @(#)iso_var.h 8.1 (Berkeley) 6/10/93
34 /***********************************************************
35 Copyright IBM Corporation 1987
39 Permission to use, copy, modify, and distribute this software and its
40 documentation for any purpose and without fee is hereby granted,
41 provided that the above copyright notice appear in all copies and that
42 both that copyright notice and this permission notice appear in
43 supporting documentation, and that the name of IBM not be
44 used in advertising or publicity pertaining to distribution of the
45 software without specific, written prior permission.
47 IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
48 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
49 IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
50 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
51 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
52 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
55 ******************************************************************/
56 #ifndef _NETISO_ISO_VAR_H_
57 #define _NETISO_ISO_VAR_H_
59 #include <sys/callout.h>
62 * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
66 * Interface address, iso version. One of these structures is
67 * allocated for each interface with an osi address. The ifaddr
68 * structure conatins the protocol-independent part
69 * of the structure, and is assumed to be first.
72 struct ifaddr ia_ifa
; /* protocol-independent info */
73 #define ia_ifp ia_ifa.ifa_ifp
74 #define ia_flags ia_ifa.ifa_flags
76 TAILQ_ENTRY(iso_ifaddr
) ia_list
; /* list of iso addresses */
77 struct sockaddr_iso ia_addr
; /* reserve space for interface name */
78 struct sockaddr_iso ia_dstaddr
; /* reserve space for broadcast addr */
79 #define ia_broadaddr ia_dstaddr
80 struct sockaddr_iso ia_sockmask
; /* reserve space for general
85 char ifra_name
[IFNAMSIZ
]; /* if name, e.g. "en0" */
86 struct sockaddr_iso ifra_addr
;
87 struct sockaddr_iso ifra_dstaddr
;
88 struct sockaddr_iso ifra_mask
;
93 char ifr_name
[IFNAMSIZ
]; /* if name, e.g. "en0" */
94 struct sockaddr_iso ifr_Addr
;
98 * Given a pointer to an iso_ifaddr (ifaddr),
99 * return a pointer to the addr as a sockaddr_iso
101 #define IA_SIS(ia) (&(((struct iso_ifaddr *)(ia))->ia_addr))
103 #define SIOCDIFADDR_ISO _IOW('i',25, struct iso_ifreq) /* delete IF addr */
104 #define SIOCAIFADDR_ISO _IOW('i',26, struct iso_aliasreq) /* add/chg IFalias */
105 #define SIOCGIFADDR_ISO _IOWR('i',33, struct iso_ifreq) /* get ifnet address */
106 #define SIOCGIFDSTADDR_ISO _IOWR('i',34, struct iso_ifreq) /* get dst address */
107 #define SIOCGIFNETMASK_ISO _IOWR('i',37, struct iso_ifreq) /* get dst address */
110 * This stuff should go in if.h or if_llc.h or someplace else,
114 struct llc_etherhdr
{
124 struct ifnet
*snh_ifp
;
130 TAILQ_HEAD(iso_ifaddrhead
, iso_ifaddr
);
131 extern struct iso_ifaddrhead iso_ifaddr
; /* linked list of iso address ifaces */
132 extern struct ifqueue clnlintrq
; /* clnl packet input queue */
133 extern int iso_systype
;
137 extern const int isoctlerrmap
[];
138 extern const char all_es_snpa
[], all_is_snpa
[];
140 extern struct callout snpac_age_ch
;
141 extern struct callout esis_config_ch
;
144 int iso_addrmatch1 (const struct iso_addr
*, const struct iso_addr
*);
145 int iso_addrmatch (const struct sockaddr_iso
*, const struct sockaddr_iso
*);
146 int iso_netmatch (const struct sockaddr_iso
*, const struct sockaddr_iso
*);
147 u_long
iso_hashchar (void *, int);
148 int iso_hash (struct sockaddr_iso
*, struct afhash
*);
149 int iso_netof (struct iso_addr
*, void *);
150 int iso_control (struct socket
*, u_long
, void *, struct ifnet
*,
152 void iso_purgeaddr(struct ifaddr
*);
153 void iso_purgeif (struct ifnet
*);
154 void iso_ifscrub (struct ifnet
*, struct iso_ifaddr
*);
155 int iso_ifinit (struct ifnet
*, struct iso_ifaddr
*, struct sockaddr_iso
*,
157 struct ifaddr
*iso_ifwithidi (struct sockaddr
*);
158 int iso_ck_addr (struct iso_addr
*);
159 int iso_eqtype (struct iso_addr
*, struct iso_addr
*);
160 struct iso_ifaddr
*iso_localifa (const struct sockaddr_iso
*);
161 int iso_nlctloutput (int, int, void *, struct mbuf
*);
162 void dump_isoaddr(const struct sockaddr_iso
*);
163 void iso_insque(void *, void *);
164 void iso_remque(void *);
167 int iso_check_csum (struct mbuf
*, int);
168 void iso_gen_csum (struct mbuf
*, int, int);
169 int m_datalen (struct mbuf
*);
170 int m_compress (struct mbuf
*, struct mbuf
**);
173 void llc_rtrequest (int, struct rtentry
*, const struct rt_addrinfo
*);
174 void iso_setmcasts (struct ifnet
*, int);
175 int iso_snparesolve(struct ifnet
*, const struct sockaddr_iso
*,
177 void snpac_free (struct llinfo_llc
*);
178 int snpac_add (struct ifnet
*, struct iso_addr
*, void *, int,
180 int snpac_ioctl (struct socket
*, u_long
, void *, struct lwp
*);
181 void snpac_logdefis (struct rtentry
*);
182 void snpac_age (void *);
183 int snpac_ownmulti (void *, u_int
);
184 void snpac_flushifp (struct ifnet
*);
185 void snpac_rtrequest (int, struct iso_addr
*, struct iso_addr
*,
186 struct iso_addr
*, int, struct rtentry
**);
187 void snpac_addrt (struct ifnet
*, struct iso_addr
*, struct iso_addr
*,
190 #endif /* !_NETISO_ISO_VAR_H_ */