xref: /freebsd/sys/net/if_llc.h (revision df8bae1de4b67ccf57f4afebd4e2bf258c38910d)
1df8bae1dSRodney W. Grimes /*
2df8bae1dSRodney W. Grimes  * Copyright (c) 1988, 1993
3df8bae1dSRodney W. Grimes  *	The Regents of the University of California.  All rights reserved.
4df8bae1dSRodney W. Grimes  *
5df8bae1dSRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
6df8bae1dSRodney W. Grimes  * modification, are permitted provided that the following conditions
7df8bae1dSRodney W. Grimes  * are met:
8df8bae1dSRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
9df8bae1dSRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
10df8bae1dSRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
11df8bae1dSRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
12df8bae1dSRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
13df8bae1dSRodney W. Grimes  * 3. All advertising materials mentioning features or use of this software
14df8bae1dSRodney W. Grimes  *    must display the following acknowledgement:
15df8bae1dSRodney W. Grimes  *	This product includes software developed by the University of
16df8bae1dSRodney W. Grimes  *	California, Berkeley and its contributors.
17df8bae1dSRodney W. Grimes  * 4. Neither the name of the University nor the names of its contributors
18df8bae1dSRodney W. Grimes  *    may be used to endorse or promote products derived from this software
19df8bae1dSRodney W. Grimes  *    without specific prior written permission.
20df8bae1dSRodney W. Grimes  *
21df8bae1dSRodney W. Grimes  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22df8bae1dSRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23df8bae1dSRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24df8bae1dSRodney W. Grimes  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25df8bae1dSRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26df8bae1dSRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27df8bae1dSRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28df8bae1dSRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29df8bae1dSRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30df8bae1dSRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31df8bae1dSRodney W. Grimes  * SUCH DAMAGE.
32df8bae1dSRodney W. Grimes  *
33df8bae1dSRodney W. Grimes  *      @(#)if_llc.h	8.1 (Berkeley) 6/10/93
34df8bae1dSRodney W. Grimes  */
35df8bae1dSRodney W. Grimes 
36df8bae1dSRodney W. Grimes /*
37df8bae1dSRodney W. Grimes  * IEEE 802.2 Link Level Control headers, for use in conjunction with
38df8bae1dSRodney W. Grimes  * 802.{3,4,5} media access control methods.
39df8bae1dSRodney W. Grimes  *
40df8bae1dSRodney W. Grimes  * Headers here do not use bit fields due to shortcommings in many
41df8bae1dSRodney W. Grimes  * compilers.
42df8bae1dSRodney W. Grimes  */
43df8bae1dSRodney W. Grimes 
44df8bae1dSRodney W. Grimes struct llc {
45df8bae1dSRodney W. Grimes 	u_char	llc_dsap;
46df8bae1dSRodney W. Grimes 	u_char	llc_ssap;
47df8bae1dSRodney W. Grimes 	union {
48df8bae1dSRodney W. Grimes 	    struct {
49df8bae1dSRodney W. Grimes 		u_char control;
50df8bae1dSRodney W. Grimes 		u_char format_id;
51df8bae1dSRodney W. Grimes 		u_char class;
52df8bae1dSRodney W. Grimes 		u_char window_x2;
53df8bae1dSRodney W. Grimes 	    } type_u;
54df8bae1dSRodney W. Grimes 	    struct {
55df8bae1dSRodney W. Grimes 		u_char num_snd_x2;
56df8bae1dSRodney W. Grimes 		u_char num_rcv_x2;
57df8bae1dSRodney W. Grimes 	    } type_i;
58df8bae1dSRodney W. Grimes 	    struct {
59df8bae1dSRodney W. Grimes 		u_char control;
60df8bae1dSRodney W. Grimes 		u_char num_rcv_x2;
61df8bae1dSRodney W. Grimes 	    } type_s;
62df8bae1dSRodney W. Grimes 	    struct {
63df8bae1dSRodney W. Grimes 	        u_char control;
64df8bae1dSRodney W. Grimes 		struct frmrinfo {
65df8bae1dSRodney W. Grimes 			u_char rej_pdu_0;
66df8bae1dSRodney W. Grimes 			u_char rej_pdu_1;
67df8bae1dSRodney W. Grimes 			u_char frmr_control;
68df8bae1dSRodney W. Grimes 			u_char frmr_control_ext;
69df8bae1dSRodney W. Grimes 			u_char frmr_cause;
70df8bae1dSRodney W. Grimes 		} frmrinfo;
71df8bae1dSRodney W. Grimes 	    } type_frmr;
72df8bae1dSRodney W. Grimes 	    struct {
73df8bae1dSRodney W. Grimes 		u_char control;
74df8bae1dSRodney W. Grimes 		u_char org_code[3];
75df8bae1dSRodney W. Grimes 		u_short ether_type;
76df8bae1dSRodney W. Grimes 	    } type_snap;
77df8bae1dSRodney W. Grimes 	    struct {
78df8bae1dSRodney W. Grimes 		u_char control;
79df8bae1dSRodney W. Grimes 		u_char control_ext;
80df8bae1dSRodney W. Grimes 	    } type_raw;
81df8bae1dSRodney W. Grimes 	} llc_un;
82df8bae1dSRodney W. Grimes };
83df8bae1dSRodney W. Grimes #define llc_control            llc_un.type_u.control
84df8bae1dSRodney W. Grimes #define	llc_control_ext        llc_un.type_raw.control_ext
85df8bae1dSRodney W. Grimes #define llc_fid                llc_un.type_u.format_id
86df8bae1dSRodney W. Grimes #define llc_class              llc_un.type_u.class
87df8bae1dSRodney W. Grimes #define llc_window             llc_un.type_u.window_x2
88df8bae1dSRodney W. Grimes #define llc_frmrinfo           llc_un.type_frmr.frmrinfo
89df8bae1dSRodney W. Grimes #define llc_frmr_pdu0          llc_un.type_frmr.frmrinfo.rej_pdu0
90df8bae1dSRodney W. Grimes #define llc_frmr_pdu1          llc_un.type_frmr.frmrinfo.rej_pdu1
91df8bae1dSRodney W. Grimes #define llc_frmr_control       llc_un.type_frmr.frmrinfo.frmr_control
92df8bae1dSRodney W. Grimes #define llc_frmr_control_ext   llc_un.type_frmr.frmrinfo.frmr_control_ext
93df8bae1dSRodney W. Grimes #define llc_frmr_cause         llc_un.type_frmr.frmrinfo.frmr_control_ext
94df8bae1dSRodney W. Grimes 
95df8bae1dSRodney W. Grimes /*
96df8bae1dSRodney W. Grimes  * Don't use sizeof(struct llc_un) for LLC header sizes
97df8bae1dSRodney W. Grimes  */
98df8bae1dSRodney W. Grimes #define LLC_ISFRAMELEN 4
99df8bae1dSRodney W. Grimes #define LLC_UFRAMELEN  3
100df8bae1dSRodney W. Grimes #define LLC_FRMRLEN    7
101df8bae1dSRodney W. Grimes 
102df8bae1dSRodney W. Grimes /*
103df8bae1dSRodney W. Grimes  * Unnumbered LLC format commands
104df8bae1dSRodney W. Grimes  */
105df8bae1dSRodney W. Grimes #define LLC_UI		0x3
106df8bae1dSRodney W. Grimes #define LLC_UI_P	0x13
107df8bae1dSRodney W. Grimes #define LLC_DISC	0x43
108df8bae1dSRodney W. Grimes #define	LLC_DISC_P	0x53
109df8bae1dSRodney W. Grimes #define LLC_UA		0x63
110df8bae1dSRodney W. Grimes #define LLC_UA_P	0x73
111df8bae1dSRodney W. Grimes #define LLC_TEST	0xe3
112df8bae1dSRodney W. Grimes #define LLC_TEST_P	0xf3
113df8bae1dSRodney W. Grimes #define LLC_FRMR	0x87
114df8bae1dSRodney W. Grimes #define	LLC_FRMR_P	0x97
115df8bae1dSRodney W. Grimes #define LLC_DM		0x0f
116df8bae1dSRodney W. Grimes #define	LLC_DM_P	0x1f
117df8bae1dSRodney W. Grimes #define LLC_XID		0xaf
118df8bae1dSRodney W. Grimes #define LLC_XID_P	0xbf
119df8bae1dSRodney W. Grimes #define LLC_SABME	0x6f
120df8bae1dSRodney W. Grimes #define LLC_SABME_P	0x7f
121df8bae1dSRodney W. Grimes 
122df8bae1dSRodney W. Grimes /*
123df8bae1dSRodney W. Grimes  * Supervisory LLC commands
124df8bae1dSRodney W. Grimes  */
125df8bae1dSRodney W. Grimes #define	LLC_RR		0x01
126df8bae1dSRodney W. Grimes #define	LLC_RNR		0x05
127df8bae1dSRodney W. Grimes #define	LLC_REJ		0x09
128df8bae1dSRodney W. Grimes 
129df8bae1dSRodney W. Grimes /*
130df8bae1dSRodney W. Grimes  * Info format - dummy only
131df8bae1dSRodney W. Grimes  */
132df8bae1dSRodney W. Grimes #define	LLC_INFO	0x00
133df8bae1dSRodney W. Grimes 
134df8bae1dSRodney W. Grimes /*
135df8bae1dSRodney W. Grimes  * ISO PDTR 10178 contains among others
136df8bae1dSRodney W. Grimes  */
137df8bae1dSRodney W. Grimes #define LLC_X25_LSAP	0x7e
138df8bae1dSRodney W. Grimes #define LLC_SNAP_LSAP	0xaa
139df8bae1dSRodney W. Grimes #define LLC_ISO_LSAP	0xfe
140df8bae1dSRodney W. Grimes 
141df8bae1dSRodney W. Grimes 
142df8bae1dSRodney W. Grimes 
143df8bae1dSRodney W. Grimes 
144df8bae1dSRodney W. Grimes 
145df8bae1dSRodney W. Grimes 
146