xref: /original-bsd/sys/netiso/iso_var.h (revision 3705696b)
1 /*-
2  * Copyright (c) 1988, 1991, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)iso_var.h	8.1 (Berkeley) 06/10/93
8  */
9 
10 /***********************************************************
11 		Copyright IBM Corporation 1987
12 
13                       All Rights Reserved
14 
15 Permission to use, copy, modify, and distribute this software and its
16 documentation for any purpose and without fee is hereby granted,
17 provided that the above copyright notice appear in all copies and that
18 both that copyright notice and this permission notice appear in
19 supporting documentation, and that the name of IBM not be
20 used in advertising or publicity pertaining to distribution of the
21 software without specific, written prior permission.
22 
23 IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
24 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
25 IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
26 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
27 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
28 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
29 SOFTWARE.
30 
31 ******************************************************************/
32 
33 /*
34  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
35  */
36 /* $Header: iso_var.h,v 4.2 88/06/29 15:00:08 hagens Exp $
37  * $Source: /usr/argo/sys/netiso/RCS/iso_var.h,v $
38  */
39 
40 /*
41  *	Interface address, iso version. One of these structures is
42  *	allocated for each interface with an osi address. The ifaddr
43  *	structure conatins the protocol-independent part
44  *	of the structure, and is assumed to be first.
45  */
46 struct iso_ifaddr {
47 	struct ifaddr		ia_ifa;		/* protocol-independent info */
48 #define ia_ifp		ia_ifa.ifa_ifp
49 #define	ia_flags	ia_ifa.ifa_flags
50 	int					ia_snpaoffset;
51 	struct iso_ifaddr	*ia_next;	/* next in list of iso addresses */
52 	struct	sockaddr_iso ia_addr;	/* reserve space for interface name */
53 	struct	sockaddr_iso ia_dstaddr; /* reserve space for broadcast addr */
54 #define	ia_broadaddr	ia_dstaddr
55 	struct	sockaddr_iso ia_sockmask; /* reserve space for general netmask */
56 };
57 
58 struct	iso_aliasreq {
59 	char	ifra_name[IFNAMSIZ];		/* if name, e.g. "en0" */
60 	struct	sockaddr_iso ifra_addr;
61 	struct	sockaddr_iso ifra_dstaddr;
62 	struct	sockaddr_iso ifra_mask;
63 	int	ifra_snpaoffset;
64 };
65 
66 struct	iso_ifreq {
67 	char	ifr_name[IFNAMSIZ];		/* if name, e.g. "en0" */
68 	struct	sockaddr_iso ifr_Addr;
69 };
70 
71 /*
72  *	Given a pointer to an iso_ifaddr (ifaddr),
73  *	return a pointer to the addr as a sockaddr_iso
74  */
75 /*
76 #define	IA_SIS(ia) ((struct sockaddr_iso *)(ia.ia_ifa->ifa_addr))
77  * works if sockaddr_iso becomes variable sized.
78  */
79 #define	IA_SIS(ia) (&(((struct iso_ifaddr *)ia)->ia_addr))
80 
81 #define	SIOCDIFADDR_ISO	_IOW('i',25, struct iso_ifreq)	/* delete IF addr */
82 #define	SIOCAIFADDR_ISO	_IOW('i',26, struct iso_aliasreq)/* add/chg IFalias */
83 #define	SIOCGIFADDR_ISO	_IOWR('i',33, struct iso_ifreq)	/* get ifnet address */
84 #define	SIOCGIFDSTADDR_ISO _IOWR('i',34, struct iso_ifreq) /* get dst address */
85 #define	SIOCGIFNETMASK_ISO _IOWR('i',37, struct iso_ifreq) /* get dst address */
86 
87 /*
88  * This stuff should go in if.h or if_llc.h or someplace else,
89  * but for now . . .
90  */
91 
92 struct llc_etherhdr {
93 	char dst[6];
94 	char src[6];
95 	char len[2];
96 	char llc_dsap;
97 	char llc_ssap;
98 	char llc_ui_byte;
99 };
100 
101 struct snpa_hdr {
102 	struct	ifnet *snh_ifp;
103 	char	snh_dhost[6];
104 	char	snh_shost[6];
105 	short	snh_flags;
106 };
107 #ifdef KERNEL
108 struct iso_ifaddr	*iso_ifaddr;	/* linked list of iso address ifaces */
109 struct iso_ifaddr	*iso_localifa();	/* linked list of iso address ifaces */
110 struct ifqueue 		clnlintrq;		/* clnl packet input queue */
111 #endif /* KERNEL */
112