aboutsummaryrefslogtreecommitdiffstats
path: root/packet-sna.c
blob: d142aaf54a060ab149c55b5835e983713a2c6a81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
/* packet-sna.c
 * Routines for SNA
 * Gilbert Ramirez <gram@xiexie.org>
 *
 * $Id: packet-sna.c,v 1.1 1999/10/12 06:20:17 gram Exp $
 *
 * Ethereal - Network traffic analyzer
 * By Gerald Combs <gerald@unicom.net>
 * Copyright 1998 Gerald Combs
 *
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif

#include <glib.h>
#include "packet.h"

/*
 * http://www.wanresources.com/snacell.html
 *
 */

static int proto_sna = -1;
static int hf_sna_th = -1;
static int hf_sna_th_0 = -1;
static int hf_sna_th_fid = -1;
static int hf_sna_th_mpf = -1;
static int hf_sna_th_odai = -1;
static int hf_sna_th_efi = -1;
static int hf_sna_th_daf = -1;
static int hf_sna_th_oaf = -1;
static int hf_sna_th_snf = -1;
static int hf_sna_th_dcf = -1;
static int hf_sna_th_lsid = -1;
static int hf_sna_rh = -1;
static int hf_sna_rh_0 = -1;
static int hf_sna_rh_1 = -1;
static int hf_sna_rh_2 = -1;
static int hf_sna_rh_rri = -1;
static int hf_sna_rh_ru_category = -1;
static int hf_sna_rh_fi = -1;
static int hf_sna_rh_sdi = -1;
static int hf_sna_rh_bci = -1;
static int hf_sna_rh_eci = -1;
static int hf_sna_rh_dr1 = -1;
static int hf_sna_rh_lcci = -1;
static int hf_sna_rh_dr2 = -1;
static int hf_sna_rh_eri = -1;
static int hf_sna_rh_rti = -1;
static int hf_sna_rh_rlwi = -1;
static int hf_sna_rh_qri = -1;
static int hf_sna_rh_pi = -1;
static int hf_sna_rh_bbi = -1;
static int hf_sna_rh_ebi = -1;
static int hf_sna_rh_cdi = -1;
static int hf_sna_rh_csi = -1;
static int hf_sna_rh_edi = -1;
static int hf_sna_rh_pdi = -1;
static int hf_sna_rh_cebi = -1;
static int hf_sna_ru = -1;

/* Format Identifier */
static const value_string sna_th_fid_vals[] = {
	{ 0x0,	"SNA device <--> Non-SNA Device" },
	{ 0x1,	"Subarea Node <--> Subarea Node" },
	{ 0x2,	"Subarea Node <--> PU2" },
	{ 0x3,	"Subarea Node or SNA host <--> Subarea Node" },
	{ 0x4,	"?" },
	{ 0x5,	"?" },
	{ 0xf,	"Adjaced Subarea Nodes" },
	{ 0x0,	NULL }
};

/* Mapping Field */
static const value_string sna_th_mpf_vals[] = {
	{ 0, "Middle segment of a BIU" },
	{ 1, "Last segment of a BIU" },
	{ 2, "First segment of a BIU" },
	{ 3 , "Whole BIU" },
	{ 0,   NULL }
};

/* Expedited Flow Indicator */
static const value_string sna_th_efi_vals[] = {
	{ 0, "Normal Flow" },
	{ 1, "Expedited Flow" }
};

/* Request/Response Indicator */
static const value_string sna_rh_rri_vals[] = {
	{ 0, "Request" },
	{ 1, "Response" }
};

/* Request/Response Unit Category */
static const value_string sna_rh_ru_category_vals[] = {
	{ 0x00, "Function Management Data (FMD)" },
	{ 0x01, "Network Control (NC)" },
	{ 0x10, "Data Flow Control (DFC)" },
	{ 0x11, "Session Control (SC)" },
};

/* Format Indicator */
static const true_false_string sna_rh_fi_truth =
	{ "FM Header", "No FM Header" };

/* Sense Data Included */
static const true_false_string sna_rh_sdi_truth =
	{ "Included", "Not Included" };

/* Begin Chain Indicator */
static const true_false_string sna_rh_bci_truth =
	{ "First in Chain", "Not First in Chain" };

/* End Chain Indicator */
static const true_false_string sna_rh_eci_truth =
	{ "Last in Chain", "Not Last in Chain" };

/* Lengith-Checked Compression Indicator */
static const true_false_string sna_rh_lcci_truth =
	{ "Compressed", "Not Compressed" };

/* Response Type Indicator */
static const true_false_string sna_rh_rti_truth =
	{ "Negative", "Positive" };

/* Exception Response Indicator */
static const true_false_string sna_rh_eri_truth =
	{ "Exception", "Definite" };

/* Queued Response Indicator */
static const true_false_string sna_rh_qri_truth =
	{ "Enqueue response in TC queues", "Response bypasses TC queues" };

/* Code Selection Indicator */
static const value_string sna_rh_csi_vals[] = {
	{ 0, "EBCDIC" },
	{ 1, "ASCII" }
};

static int  dissect_fid0_1 (const u_char*, int, frame_data*, proto_tree*);
static int  dissect_fid2 (const u_char*, int, frame_data*, proto_tree*);
static int  dissect_fid3 (const u_char*, int, frame_data*, proto_tree*);
static void dissect_rh (const u_char*, int, frame_data*, proto_tree*);

void
dissect_sna(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {

	proto_tree	*sna_tree = NULL, *th_tree = NULL, *rh_tree = NULL;
	proto_item	*sna_ti, *th_ti, *rh_ti;
	guint8		th_fid;
	int		sna_header_len = 0, th_header_len = 0;

	if (IS_DATA_IN_FRAME(offset)) {
		/* Transmission Header Format Identifier */
		th_fid = hi_nibble(pd[offset]);
	}
	else {
		/* If our first byte isn't here, stop dissecting */
		return;
	}

	/* Summary information */
	if (check_col(fd, COL_PROTOCOL))
		col_add_str(fd, COL_PROTOCOL, "SNA");
	if (check_col(fd, COL_INFO))
		col_add_str(fd, COL_INFO, val_to_str(th_fid, sna_th_fid_vals, "Unknown FID: %01x"));

	if (tree) {

		/* Don't bother setting length. We'll set it later after we find
		 * the lengths of TH/RH/RU */
		sna_ti = proto_tree_add_item(tree, proto_sna, offset, 0, NULL);
		sna_tree = proto_item_add_subtree(sna_ti, ETT_SNA);

		/* --- TH --- */
		/* Don't bother setting length. We'll set it later after we find
		 * the length of TH */
		th_ti = proto_tree_add_item(sna_tree, hf_sna_th,  offset, 0, NULL);
		th_tree = proto_item_add_subtree(th_ti, ETT_SNA_TH);

		switch(th_fid) {
			case 0x0:
			case 0x1:
				th_header_len = dissect_fid0_1(pd, offset, fd, th_tree);
				break;
			case 0x2:
				th_header_len = dissect_fid2(pd, offset, fd, th_tree);
				break;
			case 0x3:
				th_header_len = dissect_fid3(pd, offset, fd, th_tree);
				break;
			default:
				dissect_data(pd, offset+1, fd, tree);
		}

		sna_header_len += th_header_len;
		offset += th_header_len;

		proto_item_set_len(th_ti, th_header_len);

		/* --- RH --- */
		if (BYTES_ARE_IN_FRAME(offset, 3)) {
			rh_ti = proto_tree_add_item(sna_tree, hf_sna_rh, offset, 3, NULL);
			rh_tree = proto_item_add_subtree(rh_ti, ETT_SNA_RH);
			dissect_rh(pd, offset, fd, rh_tree);
			sna_header_len += 3;
			offset += 3;
		}
		else {
			/* If our first byte isn't here, stop dissecting */
			return;
		}

		proto_item_set_len(sna_ti, sna_header_len);

	}
	if (IS_DATA_IN_FRAME(offset+1)) {
		dissect_data(pd, offset, fd, tree);
	}
}

/* FID Types 0 and 1 */
static int
dissect_fid0_1 (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {

	proto_tree	*bf_tree;
	proto_item	*bf_item;
	guint8		th_0;
	guint16		daf, oaf, snf, dcf;

	static int bytes_in_header = 10;

	if (!BYTES_ARE_IN_FRAME(offset, bytes_in_header)) {
		return 0;
	}

	th_0 = pd[offset+0];
	daf = pntohs(&pd[offset+2]);
	oaf = pntohs(&pd[offset+4]);
	snf = pntohs(&pd[offset+6]);
	dcf = pntohs(&pd[offset+8]);

	/* Create the bitfield tree */
	bf_item = proto_tree_add_item(tree, hf_sna_th_0, offset, 1, th_0);
	bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_TH_FID);

	proto_tree_add_item(bf_tree, hf_sna_th_fid, offset, 1, th_0);
	proto_tree_add_item(bf_tree, hf_sna_th_mpf, offset, 1, th_0);
	proto_tree_add_item(bf_tree, hf_sna_th_efi ,offset, 1, th_0);

	proto_tree_add_text(tree, offset+1, 1, "Reserved");
	proto_tree_add_item(tree, hf_sna_th_daf ,offset+2, 1, daf);
	proto_tree_add_item(tree, hf_sna_th_oaf ,offset+4, 1, oaf);
	proto_tree_add_item(tree, hf_sna_th_snf ,offset+6, 2, snf);
	proto_tree_add_item(tree, hf_sna_th_dcf ,offset+8, 2, dcf);

	if (check_col(fd, COL_RES_DL_DST))
		col_add_fstr(fd, COL_RES_DL_DST, "%02X", daf);
	if (check_col(fd, COL_RES_DL_SRC))
		col_add_fstr(fd, COL_RES_DL_SRC, "%02X", oaf);

	return bytes_in_header;

}


/* FID Type 2 */
static int
dissect_fid2 (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {

	proto_tree	*bf_tree;
	proto_item	*bf_item;
	guint8		th_0, daf, oaf;
	guint16		snf;

	static int bytes_in_header = 6;

	if (!BYTES_ARE_IN_FRAME(offset, bytes_in_header)) {
		return 0;
	}

	th_0 = pd[offset+0];
	daf = pd[offset+2];
	oaf = pd[offset+3];

	snf = pntohs(&pd[offset+4]);

	/* Create the bitfield tree */
	bf_item = proto_tree_add_item(tree, hf_sna_th_0, offset, 1, th_0);
	bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_TH_FID);

	proto_tree_add_item(bf_tree, hf_sna_th_fid, offset, 1, th_0);
	proto_tree_add_item(bf_tree, hf_sna_th_mpf, offset, 1, th_0);
	proto_tree_add_item(bf_tree, hf_sna_th_odai ,offset, 1, th_0);
	proto_tree_add_item(bf_tree, hf_sna_th_efi ,offset, 1, th_0);

	proto_tree_add_text(tree, offset+1, 1, "Reserved");
	proto_tree_add_item(tree, hf_sna_th_daf ,offset+2, 1, daf);
	proto_tree_add_item(tree, hf_sna_th_oaf ,offset+3, 1, oaf);
	proto_tree_add_item(tree, hf_sna_th_snf ,offset+4, 2, snf);

	if (check_col(fd, COL_RES_DL_DST))
		col_add_fstr(fd, COL_RES_DL_DST, "%02X", daf);
	if (check_col(fd, COL_RES_DL_SRC))
		col_add_fstr(fd, COL_RES_DL_SRC, "%02X", oaf);

	return bytes_in_header;
}

/* FID Type 3 */
static int
dissect_fid3 (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {

	proto_tree	*bf_tree;
	proto_item	*bf_item;
	guint8		th_0;
	guint8		lsid;

	static int bytes_in_header = 2;

	if (!BYTES_ARE_IN_FRAME(offset, bytes_in_header)) {
		return 0;
	}

	th_0 = pd[offset+0];
	lsid = pd[offset+1];

	/* Create the bitfield tree */
	bf_item = proto_tree_add_item(tree, hf_sna_th_0, offset, 1, th_0);
	bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_TH_FID);

	proto_tree_add_item(bf_tree, hf_sna_th_fid, offset, 1, th_0);
	proto_tree_add_item(bf_tree, hf_sna_th_mpf, offset, 1, th_0);
	proto_tree_add_item(bf_tree, hf_sna_th_efi ,offset, 1, th_0);

	proto_tree_add_item(tree, hf_sna_th_lsid ,offset+1, 1, lsid);

	return bytes_in_header;
}

/* RH */
static void
dissect_rh (const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {

	proto_tree	*bf_tree;
	proto_item	*bf_item;
	gboolean	is_response;
	guint8		rh_0, rh_1, rh_2;

	rh_0 = pd[offset+0];
	rh_1 = pd[offset+1];
	rh_2 = pd[offset+2];

	is_response = (rh_0 & 0x80);

	/* Create the bitfield tree for byte 0*/
	bf_item = proto_tree_add_item(tree, hf_sna_rh_0, offset, 1, rh_0);
	bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_RH_0);

	proto_tree_add_item(bf_tree, hf_sna_rh_rri, offset, 1, rh_0);
	proto_tree_add_item(bf_tree, hf_sna_rh_ru_category, offset, 1, rh_0);
	proto_tree_add_item(bf_tree, hf_sna_rh_fi, offset, 1, rh_0);
	proto_tree_add_item(bf_tree, hf_sna_rh_sdi, offset, 1, rh_0);
	if (is_response) {
		proto_tree_add_item(bf_tree, hf_sna_rh_bci, offset, 1, rh_0);
		proto_tree_add_item(bf_tree, hf_sna_rh_eci, offset, 1, rh_0);
	}

	offset += 1;

	/* Create the bitfield tree for byte 1*/
	bf_item = proto_tree_add_item(tree, hf_sna_rh_1, offset, 1, rh_1);
	bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_RH_1);

	proto_tree_add_item(bf_tree, hf_sna_rh_dr1,  offset, 1, rh_1);

	if (!is_response) {
		proto_tree_add_item(bf_tree, hf_sna_rh_lcci, offset, 1, rh_1);
	}

	proto_tree_add_item(bf_tree, hf_sna_rh_dr2,  offset, 1, rh_1);

	if (is_response) {
		proto_tree_add_item(bf_tree, hf_sna_rh_rti,  offset, 1, rh_1);
	}
	else {
		proto_tree_add_item(bf_tree, hf_sna_rh_eri,  offset, 1, rh_1);
		proto_tree_add_item(bf_tree, hf_sna_rh_rlwi, offset, 1, rh_1);
	}

	proto_tree_add_item(bf_tree, hf_sna_rh_qri, offset, 1, rh_1);
	proto_tree_add_item(bf_tree, hf_sna_rh_pi,  offset, 1, rh_1);

	offset += 1;

	/* Create the bitfield tree for byte 2*/
	bf_item = proto_tree_add_item(tree, hf_sna_rh_2, offset, 1, rh_2);

	if (!is_response) {
		bf_tree = proto_item_add_subtree(bf_item, ETT_SNA_RH_2);

		proto_tree_add_item(bf_tree, hf_sna_rh_bbi,  offset, 1, rh_2);
		proto_tree_add_item(bf_tree, hf_sna_rh_ebi,  offset, 1, rh_2);
		proto_tree_add_item(bf_tree, hf_sna_rh_cdi,  offset, 1, rh_2);
		proto_tree_add_item(bf_tree, hf_sna_rh_csi,  offset, 1, rh_2);
		proto_tree_add_item(bf_tree, hf_sna_rh_edi,  offset, 1, rh_2);
		proto_tree_add_item(bf_tree, hf_sna_rh_pdi,  offset, 1, rh_2);
		proto_tree_add_item(bf_tree, hf_sna_rh_cebi, offset, 1, rh_2);
	}

	/* XXX - check for sdi. If TRUE, the next 4 bytes will be sense data */
}

void
proto_register_sna(void)
{
        static hf_register_info hf[] = {
                { &hf_sna_th,
                { "Transmission Header",	"sna.th", FT_NONE, BASE_NONE, NULL, 0x0,
			"" }},

                { &hf_sna_th_0,
                { "Transmission Header Byte 0",	"sna.th.0", FT_UINT8, BASE_HEX, NULL, 0x0,
			"Byte 0 of Tranmission Header contains FID, MPF, ODAI,"
			" and EFI as bitfields." }},

                { &hf_sna_th_fid,
                { "Format Identifer",		"sna.th.fid", FT_UINT8, BASE_HEX, VALS(sna_th_fid_vals), 0xf0,
			"Format Identification" }},

                { &hf_sna_th_mpf,
                { "Mapping Field",		"sna.th.mpf", FT_UINT8, BASE_NONE, VALS(sna_th_mpf_vals), 0x0c,
			"The Mapping Field specifies whether the information field"
			" associated with the TH is a complete or partial BIU." }},

		{ &hf_sna_th_odai,
		{ "ODAI Assignment Indicator",	"sna.th.odai", FT_UINT8, BASE_DEC, NULL, 0x02,
			"The ODAI indicates which node assigned the OAF'-DAF' values"
			" carried in the TH." }},

                { &hf_sna_th_efi,
                { "Expedited Flow Indicator",	"sna.th.efi", FT_UINT8, BASE_DEC, VALS(sna_th_efi_vals), 0x01,
			"The EFI designates whether the PIU belongs to the normal"
			" or expedited flow." }},

                { &hf_sna_th_daf,
                { "Destination Address Field",	"sna.th.daf", FT_UINT16, BASE_HEX, NULL, 0x0,
			"" }},

                { &hf_sna_th_oaf,
                { "Origin Address Field",	"sna.th.oaf", FT_UINT16, BASE_HEX, NULL, 0x0,
			"" }},

                { &hf_sna_th_snf,
                { "Sequence Number Field",	"sna.th.snf", FT_UINT16, BASE_NONE, NULL, 0x0,
			"The Sequence Number Field contains a numerical identifier for"
			" the associated BIU."}},

                { &hf_sna_th_dcf,
                { "Data Count Field",	"sna.th.dcf", FT_UINT16, BASE_DEC, NULL, 0x0,
			"A binary count of the number of bytes in the BIU or BIU segment associated "
			"with the tranmission header. The count does not include any of the bytes "
			"in the transmission header."}},

                { &hf_sna_th_lsid,
                { "Local Session Identification",	"sna.th.lsid", FT_UINT8, BASE_HEX, NULL, 0x0,
			"" }},

                { &hf_sna_rh,
                { "Request/Response Header",	"sna.rh", FT_NONE, BASE_NONE, NULL, 0x0,
			"" }},

                { &hf_sna_rh_0,
                { "Request/Response Header Byte 0",	"sna.rh.0", FT_UINT8, BASE_HEX, NULL, 0x0,
			"" }},

                { &hf_sna_rh_1,
                { "Request/Response Header Byte 1",	"sna.rh.1", FT_UINT8, BASE_HEX, NULL, 0x0,
			"" }},

                { &hf_sna_rh_2,
                { "Request/Response Header Byte 2",	"sna.rh.2", FT_UINT8, BASE_HEX, NULL, 0x0,
			"" }},

                { &hf_sna_rh_rri,
                { "Request/Response Indicator",	"sna.rh.rri", FT_UINT8, BASE_DEC, VALS(sna_rh_rri_vals), 0x80,
			"Denotes whether this is a request or a response." }},

                { &hf_sna_rh_ru_category,
                { "Request/Response Unit Category",	"sna.rh.ru_category", FT_UINT8, BASE_HEX,
			VALS(sna_rh_ru_category_vals), 0x60,
			"" }},

		{ &hf_sna_rh_fi,
		{ "Format Indicator",		"sna.rh.fi", FT_BOOLEAN, 8, TFS(&sna_rh_fi_truth), 0x08,
			"" }},

		{ &hf_sna_rh_sdi,
		{ "Sense Data Included",	"sna.rh.sdi", FT_BOOLEAN, 8, TFS(&sna_rh_sdi_truth), 0x04,
			"Indicates that a 4-byte sense data field is included in the associated RU." }},

		{ &hf_sna_rh_bci,
		{ "Begin Chain Indicator",	"sna.rh.bci", FT_BOOLEAN, 8, TFS(&sna_rh_bci_truth), 0x02,
			"" }},

		{ &hf_sna_rh_eci,
		{ "End Chain Indicator",	"sna.rh.eci", FT_BOOLEAN, 8, TFS(&sna_rh_eci_truth), 0x01,
			"" }},

		{ &hf_sna_rh_dr1,
		{ "Definite Response 1 Indicator",	"sna.rh.dr1", FT_BOOLEAN, 8, NULL, 0x80,
			"" }},

		{ &hf_sna_rh_lcci,
		{ "Length-Checked Compression Indicator",	"sna.rh.lcci", FT_BOOLEAN, 8,
			TFS(&sna_rh_lcci_truth), 0x40,
			"" }},

		{ &hf_sna_rh_dr2,
		{ "Definite Response 2 Indicator",	"sna.rh.dr2", FT_BOOLEAN, 8, NULL, 0x20,
			"" }},

		{ &hf_sna_rh_eri,
		{ "Exception Response Indicator",	"sna.rh.eri", FT_BOOLEAN, 8, NULL, 0x10,
			"Used in conjunction with DR1I and DR2I to indicate, in a request, "
			"the form of response requested." }},

		{ &hf_sna_rh_rti,
		{ "Response Type Indicator",	"sna.rh.rti", FT_BOOLEAN, 8, TFS(&sna_rh_rti_truth), 0x10,
			"" }},

		{ &hf_sna_rh_rlwi,
		{ "Request Larger Window Indicator",	"sna.rh.rlwi", FT_BOOLEAN, 8, NULL, 0x04,
			"Indicates whether a larger pacing window was requested." }},

		{ &hf_sna_rh_qri,
		{ "Queued Response Indicator",	"sna.rh.qri", FT_BOOLEAN, 8, TFS(&sna_rh_qri_truth), 0x02,
			"" }},

		{ &hf_sna_rh_pi,
		{ "Pacing Indicator",	"sna.rh.pi", FT_BOOLEAN, 8, NULL, 0x01,
			"" }},

		{ &hf_sna_rh_bbi,
		{ "Begin Bracket Indicator",	"sna.rh.bbi", FT_BOOLEAN, 8, NULL, 0x80,
			"" }},

		{ &hf_sna_rh_ebi,
		{ "End Bracket Indicator",	"sna.rh.ebi", FT_BOOLEAN, 8, NULL, 0x40,
			"" }},

		{ &hf_sna_rh_cdi,
		{ "Change Direction Indicator",	"sna.rh.cdi", FT_BOOLEAN, 8, NULL, 0x20,
			"" }},

		{ &hf_sna_rh_csi,
		{ "Code Selection Indicator",	"sna.rh.csi", FT_BOOLEAN, 8, VALS(sna_rh_csi_vals), 0x08,
			"Specifies the encoding used for the associated FMD RU." }},

		{ &hf_sna_rh_edi,
		{ "Enciphered Data Indicator",	"sna.rh.edi", FT_BOOLEAN, 8, NULL, 0x04,
			"Indicates that information in the associated RU is enciphered under "
			"session-level cryptography protocols." }},

		{ &hf_sna_rh_pdi,
		{ "Padded Data Indicator",	"sna.rh.pdi", FT_BOOLEAN, 8, NULL, 0x02,
			"Indicates that the RU was padded at the end, before encipherment, to the next "
			"integral multiple of 8 bytes." }},

		{ &hf_sna_rh_cebi,
		{ "Conditional End Bracket Indicator",	"sna.rh.cebi", FT_BOOLEAN, 8, NULL, 0x01,
			"Used to indicate the beginning or end of a group of exchanged "
			"requests and responses called a bracket. Only used on LU-LU sessions." }},

                { &hf_sna_ru,
                { "Request/Response Unit",	"sna.ru", FT_NONE, BASE_NONE, NULL, 0x0,
			""}},
        };

        proto_sna = proto_register_protocol("Systems Network Architecture", "sna");
	proto_register_field_array(proto_sna, hf, array_length(hf));
}