1 /* 2 * Copyright (c) 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)if_llc.h 8.1 (Berkeley) 06/10/93 8 */ 9 10 /* 11 * IEEE 802.2 Link Level Control headers, for use in conjunction with 12 * 802.{3,4,5} media access control methods. 13 * 14 * Headers here do not use bit fields due to shortcommings in many 15 * compilers. 16 */ 17 18 struct llc { 19 u_char llc_dsap; 20 u_char llc_ssap; 21 union { 22 struct { 23 u_char control; 24 u_char format_id; 25 u_char class; 26 u_char window_x2; 27 } type_u; 28 struct { 29 u_char num_snd_x2; 30 u_char num_rcv_x2; 31 } type_i; 32 struct { 33 u_char control; 34 u_char num_rcv_x2; 35 } type_s; 36 struct { 37 u_char control; 38 struct frmrinfo { 39 u_char rej_pdu_0; 40 u_char rej_pdu_1; 41 u_char frmr_control; 42 u_char frmr_control_ext; 43 u_char frmr_cause; 44 } frmrinfo; 45 } type_frmr; 46 struct { 47 u_char control; 48 u_char org_code[3]; 49 u_short ether_type; 50 } type_snap; 51 struct { 52 u_char control; 53 u_char control_ext; 54 } type_raw; 55 } llc_un; 56 }; 57 #define llc_control llc_un.type_u.control 58 #define llc_control_ext llc_un.type_raw.control_ext 59 #define llc_fid llc_un.type_u.format_id 60 #define llc_class llc_un.type_u.class 61 #define llc_window llc_un.type_u.window_x2 62 #define llc_frmrinfo llc_un.type_frmr.frmrinfo 63 #define llc_frmr_pdu0 llc_un.type_frmr.frmrinfo.rej_pdu0 64 #define llc_frmr_pdu1 llc_un.type_frmr.frmrinfo.rej_pdu1 65 #define llc_frmr_control llc_un.type_frmr.frmrinfo.frmr_control 66 #define llc_frmr_control_ext llc_un.type_frmr.frmrinfo.frmr_control_ext 67 #define llc_frmr_cause llc_un.type_frmr.frmrinfo.frmr_control_ext 68 69 /* 70 * Don't use sizeof(struct llc_un) for LLC header sizes 71 */ 72 #define LLC_ISFRAMELEN 4 73 #define LLC_UFRAMELEN 3 74 #define LLC_FRMRLEN 7 75 76 /* 77 * Unnumbered LLC format commands 78 */ 79 #define LLC_UI 0x3 80 #define LLC_UI_P 0x13 81 #define LLC_DISC 0x43 82 #define LLC_DISC_P 0x53 83 #define LLC_UA 0x63 84 #define LLC_UA_P 0x73 85 #define LLC_TEST 0xe3 86 #define LLC_TEST_P 0xf3 87 #define LLC_FRMR 0x87 88 #define LLC_FRMR_P 0x97 89 #define LLC_DM 0x0f 90 #define LLC_DM_P 0x1f 91 #define LLC_XID 0xaf 92 #define LLC_XID_P 0xbf 93 #define LLC_SABME 0x6f 94 #define LLC_SABME_P 0x7f 95 96 /* 97 * Supervisory LLC commands 98 */ 99 #define LLC_RR 0x01 100 #define LLC_RNR 0x05 101 #define LLC_REJ 0x09 102 103 /* 104 * Info format - dummy only 105 */ 106 #define LLC_INFO 0x00 107 108 /* 109 * ISO PDTR 10178 contains among others 110 */ 111 #define LLC_X25_LSAP 0x7e 112 #define LLC_SNAP_LSAP 0xaa 113 #define LLC_ISO_LSAP 0xfe 114 115 116 117 118 119 120