2008-09-09 03:36:53 +04:00
|
|
|
/* $NetBSD: if_llc.h,v 1.20 2008/09/08 23:36:55 gmcgarry Exp $ */
|
1994-06-29 10:29:24 +04:00
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
/*
|
1994-05-13 10:01:27 +04:00
|
|
|
* Copyright (c) 1988, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
1993-03-21 12:45:37 +03:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
2003-08-07 20:26:28 +04:00
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
1993-03-21 12:45:37 +03:00
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
1994-06-29 10:29:24 +04:00
|
|
|
* @(#)if_llc.h 8.1 (Berkeley) 6/10/93
|
1993-03-21 12:45:37 +03:00
|
|
|
*/
|
|
|
|
|
1998-02-09 20:43:44 +03:00
|
|
|
#ifndef _NET_IF_LLC_H_
|
|
|
|
#define _NET_IF_LLC_H_
|
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
/*
|
|
|
|
* IEEE 802.2 Link Level Control headers, for use in conjunction with
|
|
|
|
* 802.{3,4,5} media access control methods.
|
|
|
|
*
|
|
|
|
* Headers here do not use bit fields due to shortcommings in many
|
|
|
|
* compilers.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct llc {
|
2008-02-20 20:05:52 +03:00
|
|
|
uint8_t llc_dsap;
|
|
|
|
uint8_t llc_ssap;
|
1993-03-21 12:45:37 +03:00
|
|
|
union {
|
|
|
|
struct {
|
2008-02-20 20:05:52 +03:00
|
|
|
uint8_t control;
|
|
|
|
uint8_t format_id;
|
|
|
|
uint8_t class;
|
|
|
|
uint8_t window_x2;
|
2008-09-09 03:36:53 +04:00
|
|
|
} type_u /* XXX __packed ??? */;
|
1993-03-21 12:45:37 +03:00
|
|
|
struct {
|
2008-02-20 20:05:52 +03:00
|
|
|
uint8_t num_snd_x2;
|
|
|
|
uint8_t num_rcv_x2;
|
2008-09-09 03:36:53 +04:00
|
|
|
} type_i /* XXX __packed ??? */;
|
1993-03-21 12:45:37 +03:00
|
|
|
struct {
|
2008-02-20 20:05:52 +03:00
|
|
|
uint8_t control;
|
|
|
|
uint8_t num_rcv_x2;
|
2008-09-09 03:36:53 +04:00
|
|
|
} type_s /* XXX __packed ??? */;
|
1994-05-13 10:01:27 +04:00
|
|
|
struct {
|
2008-02-20 20:05:52 +03:00
|
|
|
uint8_t control;
|
1997-05-01 18:42:24 +04:00
|
|
|
/*
|
|
|
|
* We cannot put the following fields in a structure because
|
|
|
|
* the structure rounding might cause padding.
|
|
|
|
*/
|
2008-02-20 20:05:52 +03:00
|
|
|
uint8_t frmr_rej_pdu0;
|
|
|
|
uint8_t frmr_rej_pdu1;
|
|
|
|
uint8_t frmr_control;
|
|
|
|
uint8_t frmr_control_ext;
|
|
|
|
uint8_t frmr_cause;
|
2008-09-09 03:36:53 +04:00
|
|
|
} type_frmr /* XXX __packed ??? */;
|
1993-03-21 12:45:37 +03:00
|
|
|
struct {
|
2008-02-20 20:05:52 +03:00
|
|
|
uint8_t control;
|
|
|
|
uint8_t org_code[3];
|
|
|
|
uint16_t ether_type;
|
2007-12-25 21:33:32 +03:00
|
|
|
} type_snap __packed;
|
1994-05-13 10:01:27 +04:00
|
|
|
struct {
|
2008-02-20 20:05:52 +03:00
|
|
|
uint8_t control;
|
|
|
|
uint8_t control_ext;
|
2008-09-09 03:36:53 +04:00
|
|
|
} type_raw /* XXX __packed ??? */;
|
|
|
|
} llc_un /* XXX __packed ??? */;
|
2007-12-25 21:33:32 +03:00
|
|
|
} __packed;
|
1997-05-02 03:07:13 +04:00
|
|
|
|
|
|
|
struct frmrinfo {
|
2008-02-20 20:05:52 +03:00
|
|
|
uint8_t frmr_rej_pdu0;
|
|
|
|
uint8_t frmr_rej_pdu1;
|
|
|
|
uint8_t frmr_control;
|
|
|
|
uint8_t frmr_control_ext;
|
|
|
|
uint8_t frmr_cause;
|
2007-12-25 21:33:32 +03:00
|
|
|
} __packed;
|
1997-05-02 03:07:13 +04:00
|
|
|
|
1997-05-01 18:42:24 +04:00
|
|
|
#define llc_control llc_un.type_u.control
|
|
|
|
#define llc_control_ext llc_un.type_raw.control_ext
|
|
|
|
#define llc_fid llc_un.type_u.format_id
|
|
|
|
#define llc_class llc_un.type_u.class
|
|
|
|
#define llc_window llc_un.type_u.window_x2
|
1997-05-03 01:08:54 +04:00
|
|
|
#define llc_frmrinfo llc_un.type_frmr.frmr_rej_pdu0
|
|
|
|
#define llc_frmr_pdu0 llc_un.type_frmr.frmr_rej_pdu0
|
|
|
|
#define llc_frmr_pdu1 llc_un.type_frmr.frmr_rej_pdu1
|
1997-05-01 18:42:24 +04:00
|
|
|
#define llc_frmr_control llc_un.type_frmr.frmr_control
|
|
|
|
#define llc_frmr_control_ext llc_un.type_frmr.frmr_control_ext
|
|
|
|
#define llc_frmr_cause llc_un.type_frmr.frmr_cause
|
1999-03-23 01:29:27 +03:00
|
|
|
#define llc_snap llc_un.type_snap
|
1994-05-13 10:01:27 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Don't use sizeof(struct llc_un) for LLC header sizes
|
|
|
|
*/
|
|
|
|
#define LLC_ISFRAMELEN 4
|
|
|
|
#define LLC_UFRAMELEN 3
|
|
|
|
#define LLC_FRMRLEN 7
|
1999-03-23 01:29:27 +03:00
|
|
|
#define LLC_SNAPFRAMELEN 8
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1994-05-13 10:01:27 +04:00
|
|
|
/*
|
|
|
|
* Unnumbered LLC format commands
|
|
|
|
*/
|
1993-03-21 12:45:37 +03:00
|
|
|
#define LLC_UI 0x3
|
|
|
|
#define LLC_UI_P 0x13
|
1994-05-13 10:01:27 +04:00
|
|
|
#define LLC_DISC 0x43
|
|
|
|
#define LLC_DISC_P 0x53
|
|
|
|
#define LLC_UA 0x63
|
|
|
|
#define LLC_UA_P 0x73
|
1993-03-21 12:45:37 +03:00
|
|
|
#define LLC_TEST 0xe3
|
|
|
|
#define LLC_TEST_P 0xf3
|
1994-05-13 10:01:27 +04:00
|
|
|
#define LLC_FRMR 0x87
|
|
|
|
#define LLC_FRMR_P 0x97
|
|
|
|
#define LLC_DM 0x0f
|
|
|
|
#define LLC_DM_P 0x1f
|
|
|
|
#define LLC_XID 0xaf
|
|
|
|
#define LLC_XID_P 0xbf
|
|
|
|
#define LLC_SABME 0x6f
|
|
|
|
#define LLC_SABME_P 0x7f
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1994-05-13 10:01:27 +04:00
|
|
|
/*
|
|
|
|
* Supervisory LLC commands
|
|
|
|
*/
|
|
|
|
#define LLC_RR 0x01
|
|
|
|
#define LLC_RNR 0x05
|
|
|
|
#define LLC_REJ 0x09
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Info format - dummy only
|
|
|
|
*/
|
|
|
|
#define LLC_INFO 0x00
|
1993-04-19 07:45:34 +04:00
|
|
|
|
1994-05-13 10:01:27 +04:00
|
|
|
/*
|
|
|
|
* ISO PDTR 10178 contains among others
|
|
|
|
*/
|
2001-04-10 23:30:41 +04:00
|
|
|
#define LLC_8021D_LSAP 0x42
|
1994-05-13 10:01:27 +04:00
|
|
|
#define LLC_X25_LSAP 0x7e
|
|
|
|
#define LLC_SNAP_LSAP 0xaa
|
|
|
|
#define LLC_ISO_LSAP 0xfe
|
1998-02-09 20:43:44 +03:00
|
|
|
|
2006-12-10 14:35:36 +03:00
|
|
|
/*
|
|
|
|
* LLC XID definitions from 802.2, as needed
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define LLC_XID_FORMAT_BASIC 0x81
|
|
|
|
#define LLC_XID_BASIC_MINLEN (LLC_UFRAMELEN + 3)
|
|
|
|
|
|
|
|
#define LLC_XID_CLASS_I 0x1
|
|
|
|
#define LLC_XID_CLASS_II 0x3
|
|
|
|
#define LLC_XID_CLASS_III 0x5
|
|
|
|
#define LLC_XID_CLASS_IV 0x7
|
|
|
|
|
|
|
|
|
2005-12-11 02:21:38 +03:00
|
|
|
#endif /* !_NET_IF_LLC_H_ */
|