xref: /freebsd/contrib/libpcap/llc.h (revision 0a94d38f)
1dc2c7305SBill Fenner /*
2dc2c7305SBill Fenner  * Copyright (c) 1993, 1994, 1997
3dc2c7305SBill Fenner  *	The Regents of the University of California.  All rights reserved.
4dc2c7305SBill Fenner  *
5dc2c7305SBill Fenner  * Redistribution and use in source and binary forms, with or without
6dc2c7305SBill Fenner  * modification, are permitted provided that: (1) source code distributions
7dc2c7305SBill Fenner  * retain the above copyright notice and this paragraph in its entirety, (2)
8dc2c7305SBill Fenner  * distributions including binary code include the above copyright notice and
9dc2c7305SBill Fenner  * this paragraph in its entirety in the documentation or other materials
10dc2c7305SBill Fenner  * provided with the distribution, and (3) all advertising materials mentioning
11dc2c7305SBill Fenner  * features or use of this software display the following acknowledgement:
12dc2c7305SBill Fenner  * ``This product includes software developed by the University of California,
13dc2c7305SBill Fenner  * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
14dc2c7305SBill Fenner  * the University nor the names of its contributors may be used to endorse
15dc2c7305SBill Fenner  * or promote products derived from this software without specific prior
16dc2c7305SBill Fenner  * written permission.
17dc2c7305SBill Fenner  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18dc2c7305SBill Fenner  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19dc2c7305SBill Fenner  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20dc2c7305SBill Fenner  */
210a94d38fSBill Fenner 
22dc2c7305SBill Fenner /*
23dc2c7305SBill Fenner  * Definitions for information in the LLC header.
24dc2c7305SBill Fenner  */
25dc2c7305SBill Fenner 
26dc2c7305SBill Fenner #define	LLC_U_FMT	3
27dc2c7305SBill Fenner #define	LLC_GSAP	1
28dc2c7305SBill Fenner #define	LLC_IG	        1 /* Individual / Group */
29dc2c7305SBill Fenner #define LLC_S_FMT	1
30dc2c7305SBill Fenner 
31dc2c7305SBill Fenner #define	LLC_U_POLL	0x10
32dc2c7305SBill Fenner #define	LLC_IS_POLL	0x0100
33dc2c7305SBill Fenner #define	LLC_XID_FI	0x81
34dc2c7305SBill Fenner 
35dc2c7305SBill Fenner #define LLC_U_CMD_MASK	0xef
36dc2c7305SBill Fenner #define	LLC_UI		0x03
37dc2c7305SBill Fenner #define	LLC_UA		0x63
38dc2c7305SBill Fenner #define	LLC_DISC	0x43
39dc2c7305SBill Fenner #define	LLC_DM		0x0f
40dc2c7305SBill Fenner #define	LLC_SABME	0x6f
41dc2c7305SBill Fenner #define	LLC_TEST	0xe3
42dc2c7305SBill Fenner #define	LLC_XID		0xaf
43dc2c7305SBill Fenner #define	LLC_FRMR	0x87
44dc2c7305SBill Fenner 
45dc2c7305SBill Fenner #define LLC_S_CMD_MASK	0x0f
46dc2c7305SBill Fenner #define	LLC_RR		0x0001
47dc2c7305SBill Fenner #define	LLC_RNR		0x0005
48dc2c7305SBill Fenner #define	LLC_REJ		0x0009
49dc2c7305SBill Fenner 
50dc2c7305SBill Fenner #define LLC_IS_NR(is)	(((is) >> 9) & 0x7f)
51dc2c7305SBill Fenner #define LLC_I_NS(is)	(((is) >> 1) & 0x7f)
52dc2c7305SBill Fenner 
53dc2c7305SBill Fenner /*
54dc2c7305SBill Fenner  * 802.2 LLC SAP values.
55dc2c7305SBill Fenner  */
56dc2c7305SBill Fenner 
57dc2c7305SBill Fenner #ifndef LLCSAP_NULL
58dc2c7305SBill Fenner #define	LLCSAP_NULL		0x00
59dc2c7305SBill Fenner #endif
60dc2c7305SBill Fenner #ifndef LLCSAP_GLOBAL
61dc2c7305SBill Fenner #define	LLCSAP_GLOBAL		0xff
62dc2c7305SBill Fenner #endif
63dc2c7305SBill Fenner #ifndef LLCSAP_8021B_I
640a94d38fSBill Fenner #define	LLCSAP_8021B_I		0x02
650a94d38fSBill Fenner #endif
660a94d38fSBill Fenner #ifndef LLCSAP_8021B_G
670a94d38fSBill Fenner #define	LLCSAP_8021B_G		0x03
680a94d38fSBill Fenner #endif
690a94d38fSBill Fenner #ifndef LLCSAP_IP
70 #define	LLCSAP_IP		0x06
71 #endif
72 #ifndef LLCSAP_PROWAYNM
73 #define	LLCSAP_PROWAYNM		0x0e
74 #endif
75 #ifndef LLCSAP_8021D
76 #define	LLCSAP_8021D		0x42
77 #endif
78 #ifndef LLCSAP_RS511
79 #define	LLCSAP_RS511		0x4e
80 #endif
81 #ifndef LLCSAP_ISO8208
82 #define	LLCSAP_ISO8208		0x7e
83 #endif
84 #ifndef LLCSAP_PROWAY
85 #define	LLCSAP_PROWAY		0x8e
86 #endif
87 #ifndef LLCSAP_SNAP
88 #define	LLCSAP_SNAP		0xaa
89 #endif
90 #ifndef LLCSAP_IPX
91 #define LLCSAP_IPX		0xe0
92 #endif
93 #ifndef LLCSAP_NETBEUI
94 #define LLCSAP_NETBEUI		0xf0
95 #endif
96 #ifndef LLCSAP_ISONS
97 #define	LLCSAP_ISONS		0xfe
98 #endif
99