"Fossies" - the Fresh Open Source Software Archive 
Member "tcpflow-1.6.1/src/wifipcap/llc.h" (19 Feb 2021, 3782 Bytes) of package /linux/misc/tcpflow-1.6.1.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "llc.h" see the
Fossies "Dox" file reference documentation.
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
9 * this paragraph in its entirety in the documentation or other materials
10 * provided with the distribution, and (3) all advertising materials mentioning
11 * features or use of this software display the following acknowledgement:
12 * ``This product includes software developed by the University of California,
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: /home/cvs/wifitools/wifipcap/llc.h,v 1.1.1.1 2006/12/14 01:22:11 jpang Exp $ (LBL)
22 */
23
24 /*
25 * Definitions for information in the LLC header.
26 */
27
28 #ifndef UNI_LLC_H
29 #define UNI_LLC_H
30
31 #define LLC_U_FMT 3
32 #define LLC_GSAP 1
33 #define LLC_IG 1 /* Individual / Group */
34 #define LLC_S_FMT 1
35
36 #define LLC_U_POLL 0x10
37 #define LLC_IS_POLL 0x0100
38 #define LLC_XID_FI 0x81
39
40 #define LLC_U_CMD(u) ((u) & 0xef)
41 #define LLC_UI 0x03
42 #define LLC_UA 0x63
43 #define LLC_DISC 0x43
44 #define LLC_DM 0x0f
45 #define LLC_SABME 0x6f
46 #define LLC_TEST 0xe3
47 #define LLC_XID 0xaf
48 #define LLC_FRMR 0x87
49
50 #define LLC_S_CMD(is) (((is) >> 2) & 0x03)
51 #define LLC_RR 0x0001
52 #define LLC_RNR 0x0005
53 #define LLC_REJ 0x0009
54
55 #define LLC_IS_NR(is) (((is) >> 9) & 0x7f)
56 #define LLC_I_NS(is) (((is) >> 1) & 0x7f)
57
58 #ifndef LLCSAP_NULL
59 #define LLCSAP_NULL 0x00
60 #endif
61 #ifndef LLCSAP_GLOBAL
62 #define LLCSAP_GLOBAL 0xff
63 #endif
64 #ifndef LLCSAP_8021B_I
65 #define LLCSAP_8021B_I 0x02
66 #endif
67 #ifndef LLCSAP_8021B_G
68 #define LLCSAP_8021B_G 0x03
69 #endif
70 #ifndef LLCSAP_SNA
71 #define LLCSAP_SNA 0x04
72 #endif
73 #ifndef LLCSAP_IP
74 #define LLCSAP_IP 0x06
75 #endif
76 #ifndef LLCSAP_PROWAYNM
77 #define LLCSAP_PROWAYNM 0x0e
78 #endif
79 #ifndef LLCSAP_8021D
80 #define LLCSAP_8021D 0x42
81 #endif
82 #ifndef LLCSAP_RS511
83 #define LLCSAP_RS511 0x4e
84 #endif
85 #ifndef LLCSAP_ISO8208
86 #define LLCSAP_ISO8208 0x7e
87 #endif
88 #ifndef LLCSAP_PROWAY
89 #define LLCSAP_PROWAY 0x8e
90 #endif
91 #ifndef LLCSAP_SNAP
92 #define LLCSAP_SNAP 0xaa
93 #endif
94 #ifndef LLCSAP_IPX
95 #define LLCSAP_IPX 0xe0
96 #endif
97 #ifndef LLCSAP_NETBEUI
98 #define LLCSAP_NETBEUI 0xf0
99 #endif
100 #ifndef LLCSAP_ISONS
101 #define LLCSAP_ISONS 0xfe
102 #endif
103
104 /*
105 * PIDs for use with OUI_CISCO.
106 */
107 #define PID_CISCO_CDP 0x2000 /* Cisco Discovery Protocol */
108
109 /*
110 * PIDs for use with OUI_RFC2684.
111 */
112 #define PID_RFC2684_ETH_FCS 0x0001 /* Ethernet, with FCS */
113 #define PID_RFC2684_ETH_NOFCS 0x0007 /* Ethernet, without FCS */
114 #define PID_RFC2684_802_4_FCS 0x0002 /* 802.4, with FCS */
115 #define PID_RFC2684_802_4_NOFCS 0x0008 /* 802.4, without FCS */
116 #define PID_RFC2684_802_5_FCS 0x0003 /* 802.5, with FCS */
117 #define PID_RFC2684_802_5_NOFCS 0x0009 /* 802.5, without FCS */
118 #define PID_RFC2684_FDDI_FCS 0x0004 /* FDDI, with FCS */
119 #define PID_RFC2684_FDDI_NOFCS 0x000a /* FDDI, without FCS */
120 #define PID_RFC2684_802_6_FCS 0x0005 /* 802.6, with FCS */
121 #define PID_RFC2684_802_6_NOFCS 0x000b /* 802.6, without FCS */
122 #define PID_RFC2684_BPDU 0x000e /* BPDUs */
123
124 /* Jeff: endian-fixed llc/snap header + ethernet type */
125 struct llc_hdr_t {
126 uint8_t dsap;
127 uint8_t ssap;
128 uint8_t control;
129 uint16_t oui;
130 uint16_t type;
131 };
132 #endif