llc.h (56893) | llc.h (75115) |
---|---|
1/* 2 * Copyright (c) 1993, 1994, 1997 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that: (1) source code distributions 7 * retain the above copyright notice and this paragraph in its entirety, (2) 8 * distributions including binary code include the above copyright notice and --- 4 unchanged lines hidden (view full) --- 13 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of 14 * the University nor the names of its contributors may be used to endorse 15 * or promote products derived from this software without specific prior 16 * written permission. 17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 20 * | 1/* 2 * Copyright (c) 1993, 1994, 1997 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that: (1) source code distributions 7 * retain the above copyright notice and this paragraph in its entirety, (2) 8 * distributions including binary code include the above copyright notice and --- 4 unchanged lines hidden (view full) --- 13 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of 14 * the University nor the names of its contributors may be used to endorse 15 * or promote products derived from this software without specific prior 16 * written permission. 17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 20 * |
21 * @(#) $Header: /tcpdump/master/tcpdump/llc.h,v 1.6.1.1 1999/10/07 23:47:10 mcr Exp $ (LBL) | 21 * @(#) $Header: /tcpdump/master/tcpdump/llc.h,v 1.8 2000/12/18 07:55:36 guy Exp $ (LBL) |
22 */ 23 24/* 25 * This stuff should come from a system header file, but there's no 26 * obviously portable way to do that and it's not really going 27 * to change from system to system. 28 */ 29 30/* 31 * A somewhat abstracted view of the LLC header 32 */ 33 34struct llc { | 22 */ 23 24/* 25 * This stuff should come from a system header file, but there's no 26 * obviously portable way to do that and it's not really going 27 * to change from system to system. 28 */ 29 30/* 31 * A somewhat abstracted view of the LLC header 32 */ 33 34struct llc { |
35 u_char dsap; 36 u_char ssap; | 35 u_int8_t dsap; 36 u_int8_t ssap; |
37 union { | 37 union { |
38 u_char u_ctl; 39 u_short is_ctl; | 38 u_int8_t u_ctl; 39 u_int16_t is_ctl; |
40 struct { | 40 struct { |
41 u_char snap_ui; 42 u_char snap_pi[5]; | 41 u_int8_t snap_ui; 42 u_int8_t snap_pi[5]; |
43 } snap; 44 struct { | 43 } snap; 44 struct { |
45 u_char snap_ui; 46 u_char snap_orgcode[3]; 47 u_char snap_ethertype[2]; | 45 u_int8_t snap_ui; 46 u_int8_t snap_orgcode[3]; 47 u_int8_t snap_ethertype[2]; |
48 } snap_ether; 49 } ctl; 50}; 51 52#define llcui ctl.snap.snap_ui 53#define llcpi ctl.snap.snap_pi 54#define orgcode ctl.snap_ether.snap_orgcode 55#define ethertype ctl.snap_ether.snap_ethertype 56#define llcis ctl.is_ctl 57#define llcu ctl.u_ctl 58 59#define LLC_U_FMT 3 60#define LLC_GSAP 1 61#define LLC_S_FMT 1 62 63#define LLC_U_POLL 0x10 | 48 } snap_ether; 49 } ctl; 50}; 51 52#define llcui ctl.snap.snap_ui 53#define llcpi ctl.snap.snap_pi 54#define orgcode ctl.snap_ether.snap_orgcode 55#define ethertype ctl.snap_ether.snap_ethertype 56#define llcis ctl.is_ctl 57#define llcu ctl.u_ctl 58 59#define LLC_U_FMT 3 60#define LLC_GSAP 1 61#define LLC_S_FMT 1 62 63#define LLC_U_POLL 0x10 |
64#define LLC_IS_POLL 0x0001 | 64#define LLC_IS_POLL 0x0100 |
65#define LLC_XID_FI 0x81 66 67#define LLC_U_CMD(u) ((u) & 0xef) 68#define LLC_UI 0x03 69#define LLC_UA 0x63 70#define LLC_DISC 0x43 71#define LLC_DM 0x0f 72#define LLC_SABME 0x6f 73#define LLC_TEST 0xe3 74#define LLC_XID 0xaf 75#define LLC_FRMR 0x87 76 | 65#define LLC_XID_FI 0x81 66 67#define LLC_U_CMD(u) ((u) & 0xef) 68#define LLC_UI 0x03 69#define LLC_UA 0x63 70#define LLC_DISC 0x43 71#define LLC_DM 0x0f 72#define LLC_SABME 0x6f 73#define LLC_TEST 0xe3 74#define LLC_XID 0xaf 75#define LLC_FRMR 0x87 76 |
77#define LLC_S_CMD(is) (((is) >> 10) & 0x03) 78#define LLC_RR 0x0100 79#define LLC_RNR 0x0500 80#define LLC_REJ 0x0900 | 77#define LLC_S_CMD(is) (((is) >> 1) & 0x03) 78#define LLC_RR 0x0001 79#define LLC_RNR 0x0005 80#define LLC_REJ 0x0009 |
81 | 81 |
82#define LLC_IS_NR(is) (((is) >> 1) & 0x7f) 83#define LLC_I_NS(is) (((is) >> 9) & 0x7f) | 82#define LLC_IS_NR(is) (((is) >> 9) & 0x7f) 83#define LLC_I_NS(is) (((is) >> 1) & 0x7f) |
84 85#ifndef LLCSAP_NULL 86#define LLCSAP_NULL 0x00 87#endif 88#ifndef LLCSAP_GLOBAL 89#define LLCSAP_GLOBAL 0xff 90#endif 91#ifndef LLCSAP_8021B --- 29 unchanged lines hidden --- | 84 85#ifndef LLCSAP_NULL 86#define LLCSAP_NULL 0x00 87#endif 88#ifndef LLCSAP_GLOBAL 89#define LLCSAP_GLOBAL 0xff 90#endif 91#ifndef LLCSAP_8021B --- 29 unchanged lines hidden --- |