00001 /* 00002 * Copyright (c) 2004 Massachusetts Institute of Technology 00003 * John Bicket 00004 */ 00005 00006 /* 00007 * Originally derived from the following. 00008 */ 00009 /*- 00010 * Copyright (c) 2002-2004 Sam Leffler, Errno Consulting 00011 * All rights reserved. 00012 * 00013 * Redistribution and use in source and binary forms, with or without 00014 * modification, are permitted provided that the following conditions 00015 * are met: 00016 * 1. Redistributions of source code must retain the above copyright 00017 * notice, this list of conditions and the following disclaimer, 00018 * without modification. 00019 * 2. Redistributions in binary form must reproduce at minimum a disclaimer 00020 * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any 00021 * redistribution must be conditioned upon including a substantially 00022 * similar Disclaimer requirement for further binary redistribution. 00023 * 3. Neither the names of the above-listed copyright holders nor the names 00024 * of any contributors may be used to endorse or promote products derived 00025 * from this software without specific prior written permission. 00026 * 00027 * Alternatively, this software may be distributed under the terms of the 00028 * GNU General Public License ("GPL") version 2 as published by the Free 00029 * Software Foundation. 00030 * 00031 * NO WARRANTY 00032 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00033 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00034 * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY 00035 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 00036 * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, 00037 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00038 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00039 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 00040 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00041 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 00042 * THE POSSIBILITY OF SUCH DAMAGES. 00043 * 00044 * $Id: if_llc.h,v 1.2 2004/06/11 22:36:06 jbicket Exp $ 00045 * $NetBSD: if_llc.h,v 1.12 1999/11/19 20:41:19 thorpej Exp $ 00046 * $Id: if_llc.h,v 1.2 2004/06/11 22:36:06 jbicket Exp $ 00047 */ 00048 00049 /* 00050 * Copyright (c) 1988, 1993 00051 * The Regents of the University of California. All rights reserved. 00052 * 00053 * Redistribution and use in source and binary forms, with or without 00054 * modification, are permitted provided that the following conditions 00055 * are met: 00056 * 1. Redistributions of source code must retain the above copyright 00057 * notice, this list of conditions and the following disclaimer. 00058 * 2. Redistributions in binary form must reproduce the above copyright 00059 * notice, this list of conditions and the following disclaimer in the 00060 * documentation and/or other materials provided with the distribution. 00061 * 3. All advertising materials mentioning features or use of this software 00062 * must display the following acknowledgement: 00063 * This product includes software developed by the University of 00064 * California, Berkeley and its contributors. 00065 * 4. Neither the name of the University nor the names of its contributors 00066 * may be used to endorse or promote products derived from this software 00067 * without specific prior written permission. 00068 * 00069 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 00070 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00071 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00072 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 00073 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00074 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00075 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00076 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00077 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00078 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00079 * SUCH DAMAGE. 00080 * 00081 * @(#)if_llc.h 8.1 (Berkeley) 6/10/93 00082 * $FreeBSD: src/sys/net/if_llc.h,v 1.9 2002/09/23 06:25:08 alfred Exp $ 00083 */ 00084 00085 #ifndef _NET_IF_LLC_H_ 00086 #define _NET_IF_LLC_H_ 00087 00088 /* 00089 * IEEE 802.2 Link Level Control headers, for use in conjunction with 00090 * 802.{3,4,5} media access control methods. 00091 * 00092 * Headers here do not use bit fields due to shortcommings in many 00093 * compilers. 00094 */ 00095 00096 struct llc { 00097 u_int8_t llc_dsap; 00098 u_int8_t llc_ssap; 00099 union { 00100 struct { 00101 u_int8_t control; 00102 u_int8_t format_id; 00103 u_int8_t class; 00104 u_int8_t window_x2; 00105 } type_u __packed; 00106 struct { 00107 u_int8_t num_snd_x2; 00108 u_int8_t num_rcv_x2; 00109 } type_i __packed; 00110 struct { 00111 u_int8_t control; 00112 u_int8_t num_rcv_x2; 00113 } type_s __packed; 00114 struct { 00115 u_int8_t control; 00116 /* 00117 * We cannot put the following fields in a structure because 00118 * the structure rounding might cause padding. 00119 */ 00120 u_int8_t frmr_rej_pdu0; 00121 u_int8_t frmr_rej_pdu1; 00122 u_int8_t frmr_control; 00123 u_int8_t frmr_control_ext; 00124 u_int8_t frmr_cause; 00125 } type_frmr __packed; 00126 struct { 00127 u_int8_t control; 00128 u_int8_t org_code[3]; 00129 u_int16_t ether_type; 00130 } type_snap __packed; 00131 struct { 00132 u_int8_t control; 00133 u_int8_t control_ext; 00134 } type_raw __packed; 00135 } llc_un /* XXX __packed ??? */; 00136 } __packed; 00137 00138 struct frmrinfo { 00139 u_int8_t frmr_rej_pdu0; 00140 u_int8_t frmr_rej_pdu1; 00141 u_int8_t frmr_control; 00142 u_int8_t frmr_control_ext; 00143 u_int8_t frmr_cause; 00144 } __packed; 00145 00146 #define llc_control llc_un.type_u.control 00147 #define llc_control_ext llc_un.type_raw.control_ext 00148 #define llc_fid llc_un.type_u.format_id 00149 #define llc_class llc_un.type_u.class 00150 #define llc_window llc_un.type_u.window_x2 00151 #define llc_frmrinfo llc_un.type_frmr.frmr_rej_pdu0 00152 #define llc_frmr_pdu0 llc_un.type_frmr.frmr_rej_pdu0 00153 #define llc_frmr_pdu1 llc_un.type_frmr.frmr_rej_pdu1 00154 #define llc_frmr_control llc_un.type_frmr.frmr_control 00155 #define llc_frmr_control_ext llc_un.type_frmr.frmr_control_ext 00156 #define llc_frmr_cause llc_un.type_frmr.frmr_cause 00157 #define llc_snap llc_un.type_snap 00158 00159 /* 00160 * Don't use sizeof(struct llc_un) for LLC header sizes 00161 */ 00162 #define LLC_ISFRAMELEN 4 00163 #define LLC_UFRAMELEN 3 00164 #define LLC_FRMRLEN 7 00165 #define LLC_SNAPFRAMELEN 8 00166 00167 /* 00168 * Unnumbered LLC format commands 00169 */ 00170 #define LLC_UI 0x3 00171 #define LLC_UI_P 0x13 00172 #define LLC_DISC 0x43 00173 #define LLC_DISC_P 0x53 00174 #define LLC_UA 0x63 00175 #define LLC_UA_P 0x73 00176 #define LLC_TEST 0xe3 00177 #define LLC_TEST_P 0xf3 00178 #define LLC_FRMR 0x87 00179 #define LLC_FRMR_P 0x97 00180 #define LLC_DM 0x0f 00181 #define LLC_DM_P 0x1f 00182 #define LLC_XID 0xaf 00183 #define LLC_XID_P 0xbf 00184 #define LLC_SABME 0x6f 00185 #define LLC_SABME_P 0x7f 00186 00187 /* 00188 * Supervisory LLC commands 00189 */ 00190 #define LLC_RR 0x01 00191 #define LLC_RNR 0x05 00192 #define LLC_REJ 0x09 00193 00194 /* 00195 * Info format - dummy only 00196 */ 00197 #define LLC_INFO 0x00 00198 00199 /* 00200 * ISO PDTR 10178 contains among others 00201 */ 00202 #define LLC_X25_LSAP 0x7e 00203 #define LLC_SNAP_LSAP 0xaa 00204 #define LLC_ISO_LSAP 0xfe 00205 00206 #endif /* _NET_IF_LLC_H_ */