Sync usage with man page.
[netbsd-mini2440.git] / sys / netiso / iso_var.h
blob3c262b89c66ac00ead2384aadce126ff742b978f
1 /* $NetBSD: iso_var.h,v 1.28 2007/12/05 23:47:19 dyoung Exp $ */
3 /*-
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
9 * are met:
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
29 * SUCH DAMAGE.
31 * @(#)iso_var.h 8.1 (Berkeley) 6/10/93
34 /***********************************************************
35 Copyright IBM Corporation 1987
37 All Rights Reserved
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
53 SOFTWARE.
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.
71 struct iso_ifaddr {
72 struct ifaddr ia_ifa; /* protocol-independent info */
73 #define ia_ifp ia_ifa.ifa_ifp
74 #define ia_flags ia_ifa.ifa_flags
75 int ia_snpaoffset;
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
81 * netmask */
84 struct iso_aliasreq {
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;
89 int ifra_snpaoffset;
92 struct iso_ifreq {
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,
111 * but for now . . .
114 struct llc_etherhdr {
115 char dst[6];
116 char src[6];
117 char len[2];
118 char llc_dsap;
119 char llc_ssap;
120 char llc_ui_byte;
123 struct snpa_hdr {
124 struct ifnet *snh_ifp;
125 char snh_dhost[6];
126 char snh_shost[6];
127 short snh_flags;
129 #ifdef _KERNEL
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;
134 struct afhash;
135 struct llinfo_llc;
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;
143 /* iso.c */
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 *,
151 struct lwp *);
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 *,
156 int);
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 *);
166 /* iso_chksum.c */
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 **);
172 /* iso_snpac.c */
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 *,
176 void *, int *);
177 void snpac_free (struct llinfo_llc *);
178 int snpac_add (struct ifnet *, struct iso_addr *, void *, int,
179 u_short, 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 *,
188 struct iso_addr *);
189 #endif /* _KERNEL */
190 #endif /* !_NETISO_ISO_VAR_H_ */