Get rid of get_ber_last_reated_item() and fix dissection of wIN-TriggerList.
[obnox/wireshark/wip.git] / epan / dissectors / packet-t30.c
1 /* packet-t30.c
2  * Routines for T.30 packet dissection
3  * 2006  Alejandro Vaquero, add T30 reassemble and dissection
4  *
5  * $Id$
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26 #ifdef HAVE_CONFIG_H
27 # include "config.h"
28 #endif
29
30 #include <glib.h>
31 #include <epan/packet.h>
32 #include <epan/expert.h>
33 #include <stdio.h>
34 #include <string.h>
35
36 #include "packet-t38.h"
37 #include <epan/prefs.h>
38 #include <epan/emem.h>
39
40 #include "packet-t30.h"
41
42 /* T30 */
43 static int proto_t30 = -1;
44 static int hf_t30_Address = -1;
45 static int hf_t30_Control = -1;
46 static int hf_t30_Facsimile_Control = -1;
47 static int hf_t30_fif_sm = -1;
48 static int hf_t30_fif_rtif = -1;
49 static int hf_t30_fif_3gmn = -1;
50 static int hf_t30_fif_v8c = -1;
51 static int hf_t30_fif_op = -1;
52 static int hf_t30_fif_rtfc = -1;
53 static int hf_t30_fif_rfo = -1;
54 static int hf_t30_fif_dsr = -1;
55 static int hf_t30_fif_dsr_dcs = -1;
56 static int hf_t30_fif_res = -1;
57 static int hf_t30_fif_tdcc = -1;
58 static int hf_t30_fif_rwc = -1;
59 static int hf_t30_fif_rw_dcs = -1;
60 static int hf_t30_fif_rlc = -1;
61 static int hf_t30_fif_rl_dcs = -1;
62 static int hf_t30_fif_msltcr = -1;
63 static int hf_t30_fif_mslt_dcs = -1;
64 static int hf_t30_fif_ext = -1;
65 static int hf_t30_fif_cm = -1;
66 static int hf_t30_fif_ecm = -1;
67 static int hf_t30_fif_fs_dcs = -1;
68 static int hf_t30_fif_t6 = -1;
69 static int hf_t30_fif_fvc = -1;
70 static int hf_t30_fif_mspc = -1;
71 static int hf_t30_fif_ps = -1;
72 static int hf_t30_fif_t43 = -1;
73 static int hf_t30_fif_pi = -1;
74 static int hf_t30_fif_vc32k = -1;
75 static int hf_t30_fif_r8x15 = -1;
76 static int hf_t30_fif_300x300 = -1;
77 static int hf_t30_fif_r16x15 = -1;
78 static int hf_t30_fif_ibrp = -1;
79 static int hf_t30_fif_mbrp = -1;
80 static int hf_t30_fif_msltchr = -1;
81 static int hf_t30_fif_rts = -1;
82 static int hf_t30_fif_sp = -1;
83 static int hf_t30_fif_sc = -1;
84 static int hf_t30_fif_passw = -1;
85 static int hf_t30_fif_sit = -1;
86 static int hf_t30_fif_rttd = -1;
87 static int hf_t30_fif_bft = -1;
88 static int hf_t30_fif_dtm = -1;
89 static int hf_t30_fif_edi = -1;
90 static int hf_t30_fif_btm = -1;
91 static int hf_t30_fif_rttcmmd = -1;
92 static int hf_t30_fif_chrm = -1;
93 static int hf_t30_fif_mm = -1;
94 static int hf_t30_fif_pm26 = -1;
95 static int hf_t30_fif_dnc = -1;
96 static int hf_t30_fif_do = -1;
97 static int hf_t30_fif_jpeg = -1;
98 static int hf_t30_fif_fcm = -1;
99 static int hf_t30_fif_pht = -1;
100 static int hf_t30_fif_12c = -1;
101 static int hf_t30_fif_ns = -1;
102 static int hf_t30_fif_ci = -1;
103 static int hf_t30_fif_cgr = -1;
104 static int hf_t30_fif_nalet = -1;
105 static int hf_t30_fif_naleg = -1;
106 static int hf_t30_fif_spscb = -1;
107 static int hf_t30_fif_spsco = -1;
108 static int hf_t30_fif_hkm = -1;
109 static int hf_t30_fif_rsa = -1;
110 static int hf_t30_fif_oc = -1;
111 static int hf_t30_fif_hfx40 = -1;
112 static int hf_t30_fif_acn2c = -1;
113 static int hf_t30_fif_acn3c = -1;
114 static int hf_t30_fif_hfx40i = -1;
115 static int hf_t30_fif_ahsn2 = -1;
116 static int hf_t30_fif_ahsn3 = -1;
117 static int hf_t30_fif_t441 = -1;
118 static int hf_t30_fif_t442 = -1;
119 static int hf_t30_fif_t443 = -1;
120 static int hf_t30_fif_plmss = -1;
121 static int hf_t30_fif_cg300 = -1;
122 static int hf_t30_fif_100x100cg = -1;
123 static int hf_t30_fif_spcbft = -1;
124 static int hf_t30_fif_ebft = -1;
125 static int hf_t30_fif_isp = -1;
126 static int hf_t30_fif_ira = -1;
127 static int hf_t30_fif_600x600 = -1;
128 static int hf_t30_fif_1200x1200 = -1;
129 static int hf_t30_fif_300x600 = -1;
130 static int hf_t30_fif_400x800 = -1;
131 static int hf_t30_fif_600x1200 = -1;
132 static int hf_t30_fif_cg600x600 = -1;
133 static int hf_t30_fif_cg1200x1200 = -1;
134 static int hf_t30_fif_dspcam = -1;
135 static int hf_t30_fif_dspccm = -1;
136 static int hf_t30_fif_bwmrcp = -1;
137 static int hf_t30_fif_t45 = -1;
138 static int hf_t30_fif_sdmc = -1;
139 static int hf_t30_fif_number = -1;
140 static int hf_t30_fif_country_code = -1;
141 static int hf_t30_fif_non_stand_bytes = -1;
142 static int hf_t30_t4_frame_num = -1;
143 static int hf_t30_t4_data = -1;
144 static int hf_t30_partial_page_fcf2 = -1;
145 static int hf_t30_partial_page_i1 = -1;
146 static int hf_t30_partial_page_i2 = -1;
147 static int hf_t30_partial_page_i3 = -1;
148
149 static gint ett_t30 = -1;
150 static gint ett_t30_fif = -1;
151
152 static const value_string t30_control_vals[] = {
153     { 0xC0, "non-final frames within the procedure" },
154     { 0xC8, "final frames within the procedure" },
155     { 0,    NULL }
156 };
157
158 #define T30_FC_DIS  0x01
159 #define T30_FC_CSI  0x02
160 #define T30_FC_NSF  0x04
161 #define T30_FC_DTC  0x81
162 #define T30_FC_CIG  0x82
163 #define T30_FC_NSC  0x84
164 #define T30_FC_PWD  0x83
165 #define T30_FC_SEP  0x85
166 #define T30_FC_PSA  0x86
167 #define T30_FC_CIA  0x87
168 #define T30_FC_ISP  0x88
169 #define T30_FC_DCS  0x41
170 #define T30_FC_TSI  0x42
171 #define T30_FC_NSS  0x44
172 #define T30_FC_SUB  0x43
173 #define T30_FC_SID  0x45
174 #define T30_FC_TSA  0x46
175 #define T30_FC_IRA  0x47
176 #define T30_FC_CFR  0x21
177 #define T30_FC_FTT  0x22
178 #define T30_FC_CSA  0x24
179 #define T30_FC_EOM  0x71
180 #define T30_FC_MPS  0x72
181 #define T30_FC_EOP  0x74
182 #define T30_FC_PRI_EOM  0x79
183 #define T30_FC_PRI_MPS  0x7A
184 #define T30_FC_PRI_EOP  0x7C
185 #define T30_FC_PRI_EOP2 0x78
186 #define T30_FC_MCF  0x31
187 #define T30_FC_RTP  0x33
188 #define T30_FC_RTN  0x32
189 #define T30_FC_PIP  0x35
190 #define T30_FC_PIN  0x34
191 #define T30_FC_FDM  0x3F
192 #define T30_FC_DCN  0x5F
193 #define T30_FC_CRP  0x58
194 #define T30_FC_FNV  0x53
195 #define T30_FC_TNR  0x57
196 #define T30_FC_TR   0x56
197 #define T30_FC_MCF  0x31
198 #define T30_FC_PID  0x36
199 #define T30_FC_PPR  0x3D
200 #define T30_FC_RNR  0x37
201 #define T30_FC_CRP  0x58
202 #define T30_FC_CTC  0x48
203 #define T30_FC_CTR  0x23
204 #define T30_FC_PPS  0x7D
205 #define T30_FC_EOR  0x73
206 #define T30_FC_RR   0x76
207 #define T30_FC_ERR  0x38
208 #define T30_FC_FCD  0x60
209 #define T30_FC_RCP  0x61
210
211 const value_string t30_facsimile_control_field_vals[] = {
212     { T30_FC_DIS, "Digital Identification Signal" },
213     { T30_FC_CSI, "Called Subscriber Identification" },
214     { T30_FC_NSF, "Non-Standard Facilities" },
215     { T30_FC_DTC, "Digital Transmit Command" },
216     { T30_FC_CIG, "Calling Subscriber Identification" },
217     { T30_FC_NSC, "Non-Standard facilities Command" },
218     { T30_FC_PWD, "Password" },
219     { T30_FC_SEP, "Selective Polling" },
220     { T30_FC_PSA, "Polled Subaddress" },
221     { T30_FC_CIA, "Calling subscriber Internet Address" },
222     { T30_FC_ISP, "Internet Selective Polling Address" },
223     { T30_FC_DCS, "Digital Command Signal" },
224     { T30_FC_TSI, "Transmitting Subscriber Identification" },
225     { T30_FC_NSS, "Non-Standard facilities Set-up" },
226     { T30_FC_SUB, "Subaddress" },
227     { T30_FC_SID, "Sender Identification" },
228     { T30_FC_TSA, "Transmitting Subscriber Internet address" },
229     { T30_FC_IRA, "Internet Routing Address" },
230     { T30_FC_CFR, "Confirmation To Receive" },
231     { T30_FC_FTT, "Failure To Train" },
232     { T30_FC_CSA, "Called Subscriber Internet Address" },
233     { T30_FC_EOM, "End Of Message" },
234     { T30_FC_MPS, "MultiPage Signal" },
235     { T30_FC_EOP, "End Of Procedure" },
236     { T30_FC_PRI_EOM, "Procedure Interrupt-End Of Message" },
237     { T30_FC_PRI_MPS, "Procedure Interrupt-MultiPage Signal" },
238     { T30_FC_PRI_EOP, "Procedure Interrupt-End Of Procedure" },
239     { T30_FC_PRI_EOP2, "Procedure Interrupt-End Of Procedure" },
240     { T30_FC_MCF, "Message Confirmation" },
241     { T30_FC_RTP, "Retrain Positive" },
242     { T30_FC_RTN, "Retrain Negative" },
243     { T30_FC_PIP, "Procedure Interrupt Positive" },
244     { T30_FC_PIN, "Procedure Interrupt Negative" },
245     { T30_FC_FDM, "File Diagnostics Message" },
246     { T30_FC_DCN, "Disconnect" },
247     { T30_FC_CRP, "Command Repeat" },
248     { T30_FC_FNV, "Field Not Valid" },
249     { T30_FC_TNR, "Transmit not ready" },
250     { T30_FC_TR, "Transmit ready" },
251     { T30_FC_MCF, "Message Confirmation" },
252     { T30_FC_PID, "Procedure Interrupt Disconnect" },
253     { T30_FC_PPR, "Partial Page Request" },
254     { T30_FC_RNR, "Receive Not Ready" },
255     { T30_FC_CRP, "Command Repeat" },
256     { T30_FC_CTC, "Continue To Correct" },
257     { T30_FC_CTR, "Response for Continue To Correct" },
258     { T30_FC_PPS, "Partial Page Signal" },
259     { T30_FC_EOR, "End Of Retransmission" },
260     { T30_FC_RR, "Receive Ready" },
261     { T30_FC_ERR, "Response for End of Retransmission" },
262     { T30_FC_FCD, "Facsimile coded data" },
263     { T30_FC_RCP, "Return to control for partial page" },
264     { 0, NULL }
265 };
266
267 const value_string t30_facsimile_control_field_vals_short[] = {
268     { T30_FC_DIS, "DIS" },
269     { T30_FC_CSI, "CSI" },
270     { T30_FC_NSF, "NSF" },
271     { T30_FC_DTC, "DTC" },
272     { T30_FC_CIG, "CIG" },
273     { T30_FC_NSC, "NSC" },
274     { T30_FC_PWD, "PWD" },
275     { T30_FC_SEP, "SEP" },
276     { T30_FC_PSA, "PSA" },
277     { T30_FC_CIA, "CIA" },
278     { T30_FC_ISP, "ISP" },
279     { T30_FC_DCS, "DCS" },
280     { T30_FC_TSI, "TSI" },
281     { T30_FC_NSS, "NSS" },
282     { T30_FC_SUB, "SUB" },
283     { T30_FC_SID, "SID" },
284     { T30_FC_TSA, "TSA" },
285     { T30_FC_IRA, "IRA" },
286     { T30_FC_CFR, "CFR" },
287     { T30_FC_FTT, "FTT" },
288     { T30_FC_CSA, "CSA" },
289     { T30_FC_EOM, "EOM" },
290     { T30_FC_MPS, "MPS" },
291     { T30_FC_EOP, "EOP" },
292     { T30_FC_PRI_EOM, "PRI_EOM" },
293     { T30_FC_PRI_MPS, "PRI_MPS" },
294     { T30_FC_PRI_EOP, "EOP" },
295     { T30_FC_PRI_EOP2, "EOP2" },
296     { T30_FC_MCF, "MCF" },
297     { T30_FC_RTP, "RTP" },
298     { T30_FC_RTN, "RTN" },
299     { T30_FC_PIP, "PIP" },
300     { T30_FC_PIN, "PIN" },
301     { T30_FC_FDM, "FDM" },
302     { T30_FC_DCN, "DCN" },
303     { T30_FC_CRP, "CRP" },
304     { T30_FC_FNV, "FNV" },
305     { T30_FC_TNR, "TNR" },
306     { T30_FC_TR, "TR" },
307     { T30_FC_MCF, "MCF" },
308     { T30_FC_PID, "PID" },
309     { T30_FC_PPR, "PPR" },
310     { T30_FC_RNR, "RNR" },
311     { T30_FC_CRP, "CRP" },
312     { T30_FC_CTC, "CTC" },
313     { T30_FC_CTR, "CTR" },
314     { T30_FC_PPS, "PPS" },
315     { T30_FC_EOR, "EOR" },
316     { T30_FC_RR, "RR" },
317     { T30_FC_ERR, "ERR" },
318     { T30_FC_FCD, "FCD" },
319     { T30_FC_RCP, "RCP" },
320     { 0, NULL }
321 };
322
323 static const value_string t30_data_signalling_rate_vals[] = {
324     { 0x00, "ITU-T V.27 ter fall-back mode" },
325     { 0x04, "ITU-T V.27 ter" },
326     { 0x08, "ITU-T V.29" },
327     { 0x0C, "ITU-T V.27 ter and V.29" },
328     { 0x02, "Not used" },
329     { 0x06, "Reserved" },
330     { 0x0A, "Not used" },
331     { 0x0E, "Invalid" },
332     { 0x01, "Not used" },
333     { 0x05, "Reserved" },
334     { 0x09, "Not used" },
335     { 0x0D, "ITU-T V.27 ter, V.29, and V.17" },
336     { 0x03, "Not used" },
337     { 0x07, "Reserved" },
338     { 0x0B, "Not used" },
339     { 0x0F, "Reserved" },
340     { 0,    NULL }
341 };
342
343 static const value_string t30_data_signalling_rate_dcs_vals[] = {
344     { 0x00, "2400 bit/s, ITU-T V.27 ter" },
345     { 0x04, "4800 bit/s, ITU-T V.27 ter" },
346     { 0x08, "9600 bit/s, ITU-T V.29" },
347     { 0x0C, "7200 bit/s, ITU-T V.29" },
348     { 0x02, "Invalid" },
349     { 0x06, "Invalid" },
350     { 0x0A, "Reserved" },
351     { 0x0E, "Reserved" },
352     { 0x01, "14 400 bit/s, ITU-T V.17" },
353     { 0x05, "12 000 bit/s, ITU-T V.17" },
354     { 0x09, "9600 bit/s, ITU-T V.17" },
355     { 0x0D, "7200 bit/s, ITU-T V.17" },
356     { 0x03, "Reserved" },
357     { 0x07, "Reserved" },
358     { 0x0B, "Reserved" },
359     { 0x0F, "Reserved" },
360     { 0,    NULL }
361 };
362
363 static const value_string t30_recording_width_capabilities_vals[] = {
364     { 0x00, "Scan line length 215 mm +- 1%" },
365     { 0x01, "Scan line length 215 mm +- 1% and Scan line length 255 mm +- 1% and Scan line length 303 mm +- 1%" },
366     { 0x02, "Scan line length 215 mm +- 1% and Scan line length 255 mm +- 1%" },
367     { 0x03, "Invalid" },
368     { 0,    NULL }
369 };
370
371 static const value_string t30_recording_width_dcs_vals[] = {
372     { 0x00, "Scan line length 215 mm +- 1%" },
373     { 0x01, "Scan line length 303 mm +- 1%" },
374     { 0x02, "Scan line length 255 mm +- 1%" },
375     { 0x03, "Invalid" },
376     { 0,    NULL }
377 };
378
379 static const value_string t30_recording_length_capability_vals[] = {
380     { 0x00, "A4 (297 mm)" },
381     { 0x01, "Unlimited" },
382     { 0x02, "A4 (297 mm) and B4 (364 mm)" },
383     { 0x03, "Invalid" },
384     { 0,    NULL }
385 };
386
387 static const value_string t30_recording_length_dcs_vals[] = {
388     { 0x00, "A4 (297 mm)" },
389     { 0x01, "Unlimited" },
390     { 0x02, "B4 (364 mm)" },
391     { 0x03, "Invalid" },
392     { 0,    NULL }
393 };
394
395 static const value_string t30_minimum_scan_line_time_rec_vals[] = {
396     { 0x00, "20 ms at 3.85 l/mm: T7.7 = T3.85" },
397     { 0x01, "40 ms at 3.85 l/mm: T7.7 = T3.85" },
398     { 0x02, "10 ms at 3.85 l/mm: T7.7 = T3.85" },
399     { 0x04, "05 ms at 3.85 l/mm: T7.7 = T3.85" },
400     { 0x03, "10 ms at 3.85 l/mm: T7.7 = 1/2 T3.85" },
401     { 0x06, "20 ms at 3.85 l/mm: T7.7 = 1/2 T3.85" },
402     { 0x05, "40 ms at 3.85 l/mm: T7.7 = 1/2 T3.85" },
403     { 0x07, "00 ms at 3.85 l/mm: T7.7 = T3.85" },
404     { 0,    NULL }
405 };
406
407 static const value_string t30_partial_page_fcf2_vals[] = {
408     { 0x00, "NULL code which indicates the partial page boundary" },
409     { 0xF1, "EOM in optional T.4 error correction mode" },
410     { 0xF2, "MPS in optional T.4 error correction mode" },
411     { 0xF4, "EOP in optional T.4 error correction mode" },
412     { 0xF8, "EOS in optional T.4 error correction mode" },
413     { 0xF9, "PRI-EOM in optional T.4 error correction mode" },
414     { 0xFA, "PRI-MPS in optional T.4 error correction mode" },
415     { 0xFC, "PRI-EOP in optional T.4 error correction mode" },
416     { 0,    NULL }
417 };
418
419 static const value_string t30_minimum_scan_line_time_dcs_vals[] = {
420     { 0x00, "20 ms" },
421     { 0x01, "40 ms" },
422     { 0x02, "10 ms" },
423     { 0x04, "05 ms" },
424     { 0x07, "00 ms" },
425     { 0,    NULL }
426 };
427
428 static const value_string t30_SharedDataMemory_capacity_vals[] = {
429     { 0x00, "Not available" },
430     { 0x01, "Level 1 = 1.0 Mbytes" },
431     { 0x02, "Level 2 = 2.0 Mbytes" },
432     { 0x03, "Level 3 = unlimited (i.e. >= 32 Mbytes)" },
433     { 0,    NULL }
434 };
435
436 static const true_false_string t30_octets_preferred_value = {
437   "64 octets preferred",
438   "256 octets preferred",
439 };
440
441 static const true_false_string t30_extension_ind_value = {
442   "information continues through the next octet",
443   "last octet",
444 };
445
446 static const true_false_string t30_compress_value = {
447   "Uncompressed mode",
448   "Compressed mode",
449 };
450
451 static const true_false_string t30_minimum_scan_value = {
452   "T15.4 = 1/2 T7.7",
453   "T15.4 = T7.7",
454 };
455
456 static const true_false_string t30_duplex_operation_value = {
457   "Duplex  and half duplex operation",
458   "Half duplex operation only",
459 };
460
461 static const true_false_string t30_frame_size_dcs_value = {
462   "64 octets",
463   "256 octets",
464 };
465
466 static const true_false_string t30_res_type_sel_value = {
467   "inch based resolution",
468   "metric based resolution",
469 };
470
471 guint8 reverse_byte(guint8 val)
472 {
473     return ( ((val & 0x80)>>7) | ((val & 0x40)>>5) |
474         ((val & 0x20)>>3) | ((val & 0x10)>>1) |
475         ((val & 0x08)<<1) | ((val & 0x04)<<3) |
476         ((val & 0x02)<<5) | ((val & 0x01)<<7) );
477 }
478
479 #define LENGTH_T30_NUM  20
480 gchar *
481 t30_get_string_numbers(tvbuff_t *tvb, int offset, int len)
482 {
483     gchar *buf;
484     int i;
485
486     /* the length must be 20 bytes per T30 rec*/
487     if (len != LENGTH_T30_NUM) return NULL;
488
489     buf=ep_alloc(LENGTH_T30_NUM+1);
490
491     for (i=0; i<LENGTH_T30_NUM; i++)
492         buf[LENGTH_T30_NUM-i-1] = reverse_byte(tvb_get_guint8(tvb, offset+i));
493
494     /* add end of string */
495     buf[LENGTH_T30_NUM] = '\0';
496
497     return g_strstrip(buf);
498
499 }
500
501 static void
502 dissect_t30_numbers(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree)
503 {
504     gchar *str_num=NULL;
505
506     str_num = t30_get_string_numbers(tvb, offset, len);
507     if (str_num) {
508         proto_tree_add_string_format(tree, hf_t30_fif_number, tvb, offset, LENGTH_T30_NUM, str_num, "Number: %s", str_num);
509
510         if (check_col(pinfo->cinfo, COL_INFO))
511             col_append_fstr(pinfo->cinfo, COL_INFO, " - Number:%s", str_num );
512
513         if (pinfo->private_data)
514           g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, "Num: %s", str_num);
515     }
516     else {
517         proto_tree_add_text(tree, tvb, offset, tvb_reported_length_remaining(tvb, offset), "[MALFORMED OR SHORT PACKET: number of digits must be 20]");
518
519         if (check_col(pinfo->cinfo, COL_INFO))
520             col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET: number of digits must be 20]" );
521     }
522 }
523
524 static void
525 dissect_t30_facsimile_coded_data(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree)
526 {
527     guint8 octet;
528     guint8 *t4_data;
529
530     if (len < 2) {
531         proto_tree_add_text(tree, tvb, offset, tvb_reported_length_remaining(tvb, offset), "[MALFORMED OR SHORT PACKET: FCD length must be at least 2 bytes]");
532         expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR, "T30 FCD length must be at least 2 bytes");
533         if (check_col(pinfo->cinfo, COL_INFO))
534             col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET]");
535         return;
536     }
537
538     octet = tvb_get_guint8(tvb, offset);
539     proto_tree_add_uint(tree, hf_t30_t4_frame_num, tvb, offset, 1, reverse_byte(octet));
540     offset++;
541
542     if (check_col(pinfo->cinfo, COL_INFO))
543         col_append_fstr(pinfo->cinfo, COL_INFO, " - Frame num:%d", reverse_byte(octet));
544
545     if (pinfo->private_data)
546       g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, "Frm num: %d", reverse_byte(octet));
547
548     t4_data = ep_alloc(len-1);
549     tvb_memcpy(tvb, t4_data, offset, len-1);
550     proto_tree_add_bytes(tree, hf_t30_t4_data, tvb, offset, len-1, t4_data);
551 }
552
553 static void
554 dissect_t30_non_standard_cap(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree)
555 {
556     guint8 octet;
557     guint8 *non_standard_bytes;
558
559     if (len < 2) {
560         proto_tree_add_text(tree, tvb, offset, tvb_reported_length_remaining(tvb, offset), "[MALFORMED OR SHORT PACKET: NSC length must be at least 2 bytes]");
561         expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR, "T30 NSC length must be at least 2 bytes");
562         if (check_col(pinfo->cinfo, COL_INFO))
563             col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET]");
564         return;
565     }
566
567     octet = tvb_get_guint8(tvb, offset);
568     proto_tree_add_uint(tree, hf_t30_fif_country_code, tvb, offset, 1, octet);
569     offset++;
570
571     non_standard_bytes = ep_alloc(len-1);
572     tvb_memcpy(tvb, non_standard_bytes, offset, len-1);
573     proto_tree_add_bytes(tree, hf_t30_fif_non_stand_bytes, tvb, offset, len-1, non_standard_bytes);
574
575 }
576
577 static void
578 dissect_t30_partial_page_signal(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree)
579 {
580     guint8 octet, page_count, block_count, frame_count;
581
582     if (len != 4) {
583         proto_tree_add_text(tree, tvb, offset, tvb_reported_length_remaining(tvb, offset), "[MALFORMED OR SHORT PACKET: PPS length must be 4 bytes]");
584         expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR, "T30 PPS length must be 4 bytes");
585         if (check_col(pinfo->cinfo, COL_INFO))
586             col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET]");
587         return;
588     }
589
590     octet = tvb_get_guint8(tvb, offset);
591     proto_tree_add_uint(tree, hf_t30_partial_page_fcf2, tvb, offset, 1, octet);
592     offset += 1;
593
594     octet = tvb_get_guint8(tvb, offset);
595     page_count = reverse_byte(octet);
596     proto_tree_add_uint(tree, hf_t30_partial_page_i1, tvb, offset, 1, page_count);
597     offset++;
598
599     octet = tvb_get_guint8(tvb, offset);
600     block_count = reverse_byte(octet);
601     proto_tree_add_uint(tree, hf_t30_partial_page_i2, tvb, offset, 1, block_count);
602     offset++;
603
604     octet = tvb_get_guint8(tvb, offset);
605     frame_count = reverse_byte(octet);
606     proto_tree_add_uint(tree, hf_t30_partial_page_i3, tvb, offset, 1, frame_count);
607     offset++;
608
609     if (check_col(pinfo->cinfo, COL_INFO))
610         col_append_fstr(pinfo->cinfo, COL_INFO, " - PC:%d BC:%d FC:%d", page_count, block_count, frame_count);
611
612     if (pinfo->private_data)
613       g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, "PC:%d BC:%d FC:%d", page_count, block_count, frame_count);
614
615 }
616
617 static void
618 dissect_t30_dis_dtc(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree, gboolean dis_dtc)
619 {
620     guint8 octet;
621
622     if (len < 3) {
623         proto_tree_add_text(tree, tvb, offset, tvb_reported_length_remaining(tvb, offset), "[MALFORMED OR SHORT PACKET: DIS length must be at least 4 bytes]");
624         expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR, "T30 DIS length must be at least 4 bytes");
625         if (check_col(pinfo->cinfo, COL_INFO))
626             col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET]");
627         return;
628     }
629
630     /* bits 1 to 8 */
631     octet = tvb_get_guint8(tvb, offset);
632
633     proto_tree_add_boolean(tree, hf_t30_fif_sm, tvb, offset, 1, octet);
634     proto_tree_add_boolean(tree, hf_t30_fif_rtif, tvb, offset, 1, octet);
635     proto_tree_add_boolean(tree, hf_t30_fif_3gmn, tvb, offset, 1, octet);
636     if (dis_dtc) {
637         proto_tree_add_boolean(tree, hf_t30_fif_v8c, tvb, offset, 1, octet);
638         proto_tree_add_boolean(tree, hf_t30_fif_op, tvb, offset, 1, octet);
639     }
640     /* bits 9 to 16 */
641     offset += 1;
642     octet = tvb_get_guint8(tvb, offset);
643
644     if (dis_dtc) proto_tree_add_boolean(tree, hf_t30_fif_rtfc, tvb, offset, 1, octet);
645     proto_tree_add_boolean(tree, hf_t30_fif_rfo, tvb, offset, 1, octet);
646     if (dis_dtc) {
647         proto_tree_add_uint(tree, hf_t30_fif_dsr, tvb, offset, 1, octet);
648
649         if (check_col(pinfo->cinfo, COL_INFO))
650             col_append_fstr(pinfo->cinfo, COL_INFO, " - DSR:%s", val_to_str((octet&0x3C) >> 2, t30_data_signalling_rate_vals, "<unknown>"));
651
652         if (pinfo->private_data)
653           g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, "DSR:%s", val_to_str((octet&0x3C) >> 2, t30_data_signalling_rate_vals, "<unknown>"));
654     }
655     else {
656         proto_tree_add_uint(tree, hf_t30_fif_dsr_dcs, tvb, offset, 1, octet);
657
658         if (check_col(pinfo->cinfo, COL_INFO))
659             col_append_fstr(pinfo->cinfo, COL_INFO, " - DSR:%s", val_to_str((octet&0x3C) >> 2, t30_data_signalling_rate_dcs_vals, "<unknown>"));
660
661         if (pinfo->private_data)
662           g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, "DSR:%s", val_to_str((octet&0x3C) >> 2, t30_data_signalling_rate_dcs_vals, "<unknown>"));
663     }
664     proto_tree_add_boolean(tree, hf_t30_fif_res, tvb, offset, 1, octet);
665     proto_tree_add_boolean(tree, hf_t30_fif_tdcc, tvb, offset, 1, octet);
666
667     /* bits 17 to 24 */
668     offset += 1;
669     octet = tvb_get_guint8(tvb, offset);
670
671     if (dis_dtc) {
672         proto_tree_add_uint(tree, hf_t30_fif_rwc, tvb, offset, 1, octet);
673         proto_tree_add_uint(tree, hf_t30_fif_rlc, tvb, offset, 1, octet);
674         proto_tree_add_uint(tree, hf_t30_fif_msltcr, tvb, offset, 1, octet);
675     } else {
676         proto_tree_add_uint(tree, hf_t30_fif_rw_dcs, tvb, offset, 1, octet);
677         proto_tree_add_uint(tree, hf_t30_fif_rl_dcs, tvb, offset, 1, octet);
678         proto_tree_add_uint(tree, hf_t30_fif_mslt_dcs, tvb, offset, 1, octet);
679     }
680     proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
681
682     if ( !(octet & 0x01) || (len < 4) ) return; /* no extension */
683
684     /* bits 25 to 32 */
685     offset += 1;
686     octet = tvb_get_guint8(tvb, offset);
687
688     proto_tree_add_boolean(tree, hf_t30_fif_cm, tvb, offset, 1, octet);
689     proto_tree_add_boolean(tree, hf_t30_fif_ecm, tvb, offset, 1, octet);
690     if (!dis_dtc) proto_tree_add_boolean(tree, hf_t30_fif_fs_dcs, tvb, offset, 1, octet);
691     proto_tree_add_boolean(tree, hf_t30_fif_t6, tvb, offset, 1, octet);
692     proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
693
694     if ( !(octet & 0x01) || (len < 5) ) return; /* no extension */
695
696     /* bits 33 to 40 */
697     offset += 1;
698     octet = tvb_get_guint8(tvb, offset);
699
700     proto_tree_add_boolean(tree, hf_t30_fif_fvc, tvb, offset, 1, octet);
701     if (dis_dtc) {
702         proto_tree_add_boolean(tree, hf_t30_fif_mspc, tvb, offset, 1, octet);
703         proto_tree_add_boolean(tree, hf_t30_fif_ps, tvb, offset, 1, octet);
704     }
705     proto_tree_add_boolean(tree, hf_t30_fif_t43, tvb, offset, 1, octet);
706     proto_tree_add_boolean(tree, hf_t30_fif_pi, tvb, offset, 1, octet);
707     proto_tree_add_boolean(tree, hf_t30_fif_vc32k, tvb, offset, 1, octet);
708     proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
709
710     if ( !(octet & 0x01) || (len < 6) ) return; /* no extension */
711
712     /* bits 41 to 48 */
713     offset += 1;
714     octet = tvb_get_guint8(tvb, offset);
715
716     proto_tree_add_boolean(tree, hf_t30_fif_r8x15, tvb, offset, 1, octet);
717     proto_tree_add_boolean(tree, hf_t30_fif_300x300, tvb, offset, 1, octet);
718     proto_tree_add_boolean(tree, hf_t30_fif_r16x15, tvb, offset, 1, octet);
719     if (dis_dtc) {
720         proto_tree_add_boolean(tree, hf_t30_fif_ibrp, tvb, offset, 1, octet);
721         proto_tree_add_boolean(tree, hf_t30_fif_mbrp, tvb, offset, 1, octet);
722         proto_tree_add_boolean(tree, hf_t30_fif_msltchr, tvb, offset, 1, octet);
723         proto_tree_add_boolean(tree, hf_t30_fif_sp, tvb, offset, 1, octet);
724     } else {
725         proto_tree_add_boolean(tree, hf_t30_fif_rts, tvb, offset, 1, octet);
726     }
727     proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
728
729     if ( !(octet & 0x01) || (len < 7) ) return; /* no extension */
730
731     /* bits 49 to 56 */
732     offset += 1;
733     octet = tvb_get_guint8(tvb, offset);
734
735     proto_tree_add_boolean(tree, hf_t30_fif_sc, tvb, offset, 1, octet);
736     if (dis_dtc) {
737         proto_tree_add_boolean(tree, hf_t30_fif_passw, tvb, offset, 1, octet);
738         proto_tree_add_boolean(tree, hf_t30_fif_rttd, tvb, offset, 1, octet);
739     } else {
740         proto_tree_add_boolean(tree, hf_t30_fif_sit, tvb, offset, 1, octet);
741     }
742     proto_tree_add_boolean(tree, hf_t30_fif_bft, tvb, offset, 1, octet);
743     proto_tree_add_boolean(tree, hf_t30_fif_dtm, tvb, offset, 1, octet);
744     proto_tree_add_boolean(tree, hf_t30_fif_edi, tvb, offset, 1, octet);
745     proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
746
747     if ( !(octet & 0x01) || (len < 8) ) return; /* no extension */
748
749     /* bits 57 to 64 */
750     offset += 1;
751     octet = tvb_get_guint8(tvb, offset);
752
753     proto_tree_add_boolean(tree, hf_t30_fif_btm, tvb, offset, 1, octet);
754     if (dis_dtc) proto_tree_add_boolean(tree, hf_t30_fif_rttcmmd, tvb, offset, 1, octet);
755     proto_tree_add_boolean(tree, hf_t30_fif_chrm, tvb, offset, 1, octet);
756     proto_tree_add_boolean(tree, hf_t30_fif_mm, tvb, offset, 1, octet);
757     proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
758
759     if ( !(octet & 0x01) || (len < 9) ) return; /* no extension */
760
761     /* bits 65 to 72 */
762     offset += 1;
763     octet = tvb_get_guint8(tvb, offset);
764
765     proto_tree_add_boolean(tree, hf_t30_fif_pm26, tvb, offset, 1, octet);
766     proto_tree_add_boolean(tree, hf_t30_fif_dnc, tvb, offset, 1, octet);
767     proto_tree_add_boolean(tree, hf_t30_fif_do, tvb, offset, 1, octet);
768     proto_tree_add_boolean(tree, hf_t30_fif_jpeg, tvb, offset, 1, octet);
769     proto_tree_add_boolean(tree, hf_t30_fif_fcm, tvb, offset, 1, octet);
770     if (!dis_dtc) proto_tree_add_boolean(tree, hf_t30_fif_pht, tvb, offset, 1, octet);
771     proto_tree_add_boolean(tree, hf_t30_fif_12c, tvb, offset, 1, octet);
772     proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
773
774     if ( !(octet & 0x01) || (len < 10) ) return;    /* no extension */
775
776     /* bits 73 to 80 */
777     offset += 1;
778     octet = tvb_get_guint8(tvb, offset);
779
780     proto_tree_add_boolean(tree, hf_t30_fif_ns, tvb, offset, 1, octet);
781     proto_tree_add_boolean(tree, hf_t30_fif_ci, tvb, offset, 1, octet);
782     proto_tree_add_boolean(tree, hf_t30_fif_cgr, tvb, offset, 1, octet);
783     proto_tree_add_boolean(tree, hf_t30_fif_nalet, tvb, offset, 1, octet);
784     proto_tree_add_boolean(tree, hf_t30_fif_naleg, tvb, offset, 1, octet);
785     proto_tree_add_boolean(tree, hf_t30_fif_spscb, tvb, offset, 1, octet);
786     proto_tree_add_boolean(tree, hf_t30_fif_spsco, tvb, offset, 1, octet);
787     proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
788
789     if ( !(octet & 0x01) || (len < 11) ) return;    /* no extension */
790
791     /* bits 81 to 88 */
792     offset += 1;
793     octet = tvb_get_guint8(tvb, offset);
794
795     proto_tree_add_boolean(tree, hf_t30_fif_hkm, tvb, offset, 1, octet);
796     proto_tree_add_boolean(tree, hf_t30_fif_rsa, tvb, offset, 1, octet);
797     proto_tree_add_boolean(tree, hf_t30_fif_oc, tvb, offset, 1, octet);
798     proto_tree_add_boolean(tree, hf_t30_fif_hfx40, tvb, offset, 1, octet);
799     proto_tree_add_boolean(tree, hf_t30_fif_acn2c, tvb, offset, 1, octet);
800     proto_tree_add_boolean(tree, hf_t30_fif_acn3c, tvb, offset, 1, octet);
801     proto_tree_add_boolean(tree, hf_t30_fif_hfx40i, tvb, offset, 1, octet);
802     proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
803
804     if ( !(octet & 0x01) || (len < 12) ) return;    /* no extension */
805
806     /* bits 89 to 96 */
807     offset += 1;
808     octet = tvb_get_guint8(tvb, offset);
809
810     proto_tree_add_boolean(tree, hf_t30_fif_ahsn2, tvb, offset, 1, octet);
811     proto_tree_add_boolean(tree, hf_t30_fif_ahsn3, tvb, offset, 1, octet);
812     proto_tree_add_boolean(tree, hf_t30_fif_t441, tvb, offset, 1, octet);
813     proto_tree_add_boolean(tree, hf_t30_fif_t442, tvb, offset, 1, octet);
814     proto_tree_add_boolean(tree, hf_t30_fif_t443, tvb, offset, 1, octet);
815     proto_tree_add_boolean(tree, hf_t30_fif_plmss, tvb, offset, 1, octet);
816     proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
817
818     if ( !(octet & 0x01) || (len < 13) ) return;    /* no extension */
819
820     /* bits 97 to 104 */
821     offset += 1;
822     octet = tvb_get_guint8(tvb, offset);
823
824     proto_tree_add_boolean(tree, hf_t30_fif_cg300, tvb, offset, 1, octet);
825     proto_tree_add_boolean(tree, hf_t30_fif_100x100cg, tvb, offset, 1, octet);
826     proto_tree_add_boolean(tree, hf_t30_fif_spcbft, tvb, offset, 1, octet);
827     if (dis_dtc) {
828         proto_tree_add_boolean(tree, hf_t30_fif_ebft, tvb, offset, 1, octet);
829         proto_tree_add_boolean(tree, hf_t30_fif_isp, tvb, offset, 1, octet);
830     }
831     proto_tree_add_boolean(tree, hf_t30_fif_ira, tvb, offset, 1, octet);
832     proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
833
834     if ( !(octet & 0x01) || (len < 14) ) return;    /* no extension */
835
836     /* bits 105 to 112 */
837     offset += 1;
838     octet = tvb_get_guint8(tvb, offset);
839
840     proto_tree_add_boolean(tree, hf_t30_fif_600x600, tvb, offset, 1, octet);
841     proto_tree_add_boolean(tree, hf_t30_fif_1200x1200, tvb, offset, 1, octet);
842     proto_tree_add_boolean(tree, hf_t30_fif_300x600, tvb, offset, 1, octet);
843     proto_tree_add_boolean(tree, hf_t30_fif_400x800, tvb, offset, 1, octet);
844     proto_tree_add_boolean(tree, hf_t30_fif_600x1200, tvb, offset, 1, octet);
845     proto_tree_add_boolean(tree, hf_t30_fif_cg600x600, tvb, offset, 1, octet);
846     proto_tree_add_boolean(tree, hf_t30_fif_cg1200x1200, tvb, offset, 1, octet);
847     proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
848
849     if ( !(octet & 0x01) || (len < 15) ) return;    /* no extension */
850
851     /* bits 113 to 120 */
852     offset += 1;
853     octet = tvb_get_guint8(tvb, offset);
854
855     proto_tree_add_boolean(tree, hf_t30_fif_dspcam, tvb, offset, 1, octet);
856     proto_tree_add_boolean(tree, hf_t30_fif_dspccm, tvb, offset, 1, octet);
857     if (dis_dtc) proto_tree_add_boolean(tree, hf_t30_fif_bwmrcp, tvb, offset, 1, octet);
858     proto_tree_add_boolean(tree, hf_t30_fif_t45, tvb, offset, 1, octet);
859     proto_tree_add_uint(tree, hf_t30_fif_sdmc, tvb, offset, 1, octet);
860     proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
861
862     if ( !(octet & 0x01) ) return;  /* no extension */
863
864 }
865
866 static int
867 dissect_t30_hdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
868 {
869     int offset = 0;
870     proto_item *it;
871     proto_tree *tr;
872     proto_tree *tr_fif;
873     proto_item *it_fcf;
874     guint8 octet;
875     guint32 frag_len;
876     proto_item *item;
877
878     if (tvb_reported_length_remaining(tvb, offset) < 3) {
879         proto_tree_add_text(tree, tvb, offset, tvb_reported_length_remaining(tvb, offset), "[MALFORMED OR SHORT PACKET: hdlc T30 length must be at least 4 bytes]");
880         expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR, "T30 length must be at least 4 bytes");
881         if (check_col(pinfo->cinfo, COL_INFO))
882             col_append_str(pinfo->cinfo, COL_INFO, " (HDLC Reassembled: [MALFORMED OR SHORT PACKET])");
883         return offset;
884     }
885
886 /*  if (tree) {
887         proto_item *item;*/
888         if (check_col(pinfo->cinfo, COL_INFO))
889             col_append_str(pinfo->cinfo, COL_INFO, " (HDLC Reassembled:");
890
891         it=proto_tree_add_protocol_format(tree, proto_t30, tvb, offset, -1,
892         "ITU-T Recommendation T.30");
893         tr=proto_item_add_subtree(it, ett_t30);
894
895         octet = tvb_get_guint8(tvb, offset);
896         item = proto_tree_add_uint(tr, hf_t30_Address, tvb, offset, 1, octet);
897         if (octet != 0xFF) expert_add_info_format(pinfo, item, PI_REASSEMBLE, PI_WARN, "T30 Address must be 0xFF");
898         offset += 1;
899
900         octet = tvb_get_guint8(tvb, offset);
901         item = proto_tree_add_uint(tr, hf_t30_Control, tvb, offset, 1, octet);
902         if ((octet != 0xC0) && (octet != 0xC8)) expert_add_info_format(pinfo, item, PI_REASSEMBLE, PI_WARN, "T30 Control Field must be 0xC0 or 0xC8");
903         offset += 1;
904
905         octet = tvb_get_guint8(tvb, offset);
906         it_fcf = proto_tree_add_uint(tr, hf_t30_Facsimile_Control, tvb, offset, 1, octet & 0x7F);
907         offset += 1;
908
909         tr_fif = proto_item_add_subtree(it_fcf, ett_t30_fif);
910
911         frag_len = tvb_length_remaining(tvb, offset);
912         if (pinfo->private_data) ((t38_packet_info*)pinfo->private_data)->t30_Facsimile_Control = octet;
913
914         if (check_col(pinfo->cinfo, COL_INFO))
915             col_append_fstr(pinfo->cinfo, COL_INFO, " %s - %s", val_to_str(octet & 0x7F, t30_facsimile_control_field_vals_short, "<unknown>"),
916                 val_to_str(octet & 0x7F, t30_facsimile_control_field_vals, "<unknown>") );
917
918         switch (octet & 0x7F) {
919         case T30_FC_DIS:
920         case T30_FC_DTC:
921             dissect_t30_dis_dtc(tvb, offset, pinfo, frag_len, tr_fif, TRUE);
922             break;
923         case T30_FC_DCS:
924             dissect_t30_dis_dtc(tvb, offset, pinfo, frag_len, tr_fif, FALSE);
925             break;
926         case T30_FC_CSI:
927         case T30_FC_CIG:
928         case T30_FC_TSI:
929         case T30_FC_PWD:
930         case T30_FC_SEP:
931         case T30_FC_SUB:
932         case T30_FC_SID:
933         case T30_FC_PSA:
934             dissect_t30_numbers(tvb, offset, pinfo, frag_len, tr_fif);
935             break;
936         case T30_FC_NSF:
937         case T30_FC_NSC:
938         case T30_FC_NSS:
939             dissect_t30_non_standard_cap(tvb, offset, pinfo, frag_len, tr_fif);
940             break;
941         case T30_FC_FCD:
942             dissect_t30_facsimile_coded_data(tvb, offset, pinfo, frag_len, tr_fif);
943             break;
944         case T30_FC_PPS:
945             dissect_t30_partial_page_signal(tvb, offset, pinfo, frag_len, tr_fif);
946             break;
947         }
948
949         if (check_col(pinfo->cinfo, COL_INFO))
950             col_append_str(pinfo->cinfo, COL_INFO, ")");
951
952 /*  }*/
953
954     return offset;
955 }
956
957 /* Wireshark Protocol Registration */
958 void
959 proto_register_t30(void)
960 {
961     static hf_register_info hf_t30[] =
962     {
963         {  &hf_t30_Address,
964             { "Address", "t30.Address", FT_UINT8, BASE_HEX,
965               NULL, 0, "Address Field", HFILL }},
966         {  &hf_t30_Control,
967             { "Control", "t30.Control", FT_UINT8, BASE_HEX,
968               VALS(t30_control_vals), 0, "Address Field", HFILL }},
969         {  &hf_t30_Facsimile_Control,
970             { "Facsimile Control", "t30.FacsimileControl", FT_UINT8, BASE_DEC,
971               VALS(t30_facsimile_control_field_vals), 0, "Facsimile Control", HFILL }},
972
973         {  &hf_t30_fif_sm,
974             { "Store and forward Internet fax- Simple mode (ITU-T T.37)", "t30.fif.sm", FT_BOOLEAN,  8,
975               TFS(&flags_set_truth), 0x80, "", HFILL }},
976         {  &hf_t30_fif_rtif,
977             { "Real-time Internet fax (ITU T T.38)", "t30.fif.rtif", FT_BOOLEAN,  8,
978               TFS(&flags_set_truth), 0x20, "", HFILL }},
979         {  &hf_t30_fif_3gmn,
980             { "3rd Generation Mobile Network", "t30.fif.3gmn", FT_BOOLEAN,  8,
981               TFS(&flags_set_truth), 0x10, "", HFILL }},
982         {  &hf_t30_fif_v8c,
983             { "V.8 capabilities", "t30.fif.v8c", FT_BOOLEAN,  8,
984               TFS(&flags_set_truth), 0x04, "", HFILL }},
985         {  &hf_t30_fif_op,
986             { "Octets preferred", "t30.fif.op", FT_BOOLEAN,  8,
987               TFS(&t30_octets_preferred_value), 0x02, "", HFILL }},
988         {  &hf_t30_fif_rtfc,
989             { "Ready to transmit a facsimile document (polling)", "t30.fif.rtfc", FT_BOOLEAN,  8,
990               TFS(&flags_set_truth), 0x80, "", HFILL }},
991         {  &hf_t30_fif_rfo,
992             { "Receiver fax operation", "t30.fif.rfo", FT_BOOLEAN,  8,
993               TFS(&flags_set_truth), 0x40, "", HFILL }},
994         {  &hf_t30_fif_dsr,
995             { "Data signalling rate", "t30.fif.dsr", FT_UINT8,  BASE_HEX,
996               VALS(t30_data_signalling_rate_vals), 0x3C, "", HFILL }},
997         {  &hf_t30_fif_dsr_dcs,
998             { "Data signalling rate", "t30.fif.dsr_dcs", FT_UINT8,  BASE_HEX,
999               VALS(t30_data_signalling_rate_dcs_vals), 0x3C, "", HFILL }},
1000         {  &hf_t30_fif_res,
1001             { "R8x7.7 lines/mm and/or 200x200 pels/25.4 mm", "t30.fif.res", FT_BOOLEAN,  8,
1002               TFS(&flags_set_truth), 0x02, "", HFILL }},
1003         {  &hf_t30_fif_tdcc,
1004             { "Two dimensional coding capability", "t30.fif.tdcc", FT_BOOLEAN,  8,
1005               TFS(&flags_set_truth), 0x01, "", HFILL }},
1006         {  &hf_t30_fif_rwc,
1007             { "Recording width capabilities", "t30.fif.rwc", FT_UINT8,  BASE_HEX,
1008               VALS(t30_recording_width_capabilities_vals), 0xC0, "", HFILL }},
1009         {  &hf_t30_fif_rw_dcs,
1010             { "Recording width", "t30.fif.rw_dcs", FT_UINT8,  BASE_HEX,
1011               VALS(t30_recording_width_dcs_vals), 0xC0, "", HFILL }},
1012         {  &hf_t30_fif_rlc,
1013             { "Recording length capability", "t30.fif.rlc", FT_UINT8,  BASE_HEX,
1014               VALS(t30_recording_length_capability_vals), 0x30, "", HFILL }},
1015         {  &hf_t30_fif_rl_dcs,
1016             { "Recording length capability", "t30.fif.rl_dcs", FT_UINT8,  BASE_HEX,
1017               VALS(t30_recording_length_dcs_vals), 0x30, "", HFILL }},
1018         {  &hf_t30_fif_msltcr,
1019             { "Minimum scan line time capability at the receiver", "t30.fif.msltcr", FT_UINT8,  BASE_HEX,
1020               VALS(t30_minimum_scan_line_time_rec_vals), 0x0E, "", HFILL }},
1021         {  &hf_t30_fif_mslt_dcs,
1022             { "Minimum scan line time", "t30.fif.mslt_dcs", FT_UINT8,  BASE_HEX,
1023               VALS(t30_minimum_scan_line_time_dcs_vals), 0x0E, "", HFILL }},
1024         {  &hf_t30_fif_ext,
1025             { "Extension indicator", "t30.fif.ext", FT_BOOLEAN,  8,
1026               TFS(&t30_extension_ind_value), 0x01, "", HFILL }},
1027
1028         {  &hf_t30_fif_cm,
1029             { "Compress/Uncompress mode", "t30.fif.cm", FT_BOOLEAN,  8,
1030               TFS(&t30_compress_value), 0x40, "", HFILL }},
1031         {  &hf_t30_fif_ecm,
1032             { "Error correction mode", "t30.fif.ecm", FT_BOOLEAN,  8,
1033               TFS(&flags_set_truth), 0x20, "", HFILL }},
1034         {  &hf_t30_fif_fs_dcs,
1035             { "Frame size", "t30.fif.fs_dcm", FT_BOOLEAN,  8,
1036               TFS(&t30_frame_size_dcs_value), 0x10, "", HFILL }},
1037         {  &hf_t30_fif_t6,
1038             { "T.6 coding capability", "t30.fif.t6", FT_BOOLEAN,  8,
1039               TFS(&flags_set_truth), 0x02, "", HFILL }},
1040
1041         {  &hf_t30_fif_fvc,
1042             { "Field valid capability", "t30.fif.fvc", FT_BOOLEAN,  8,
1043               TFS(&flags_set_truth), 0x80, "", HFILL }},
1044         {  &hf_t30_fif_mspc,
1045             { "Multiple selective polling capability", "t30.fif.mspc", FT_BOOLEAN,  8,
1046               TFS(&flags_set_truth), 0x40, "", HFILL }},
1047         {  &hf_t30_fif_ps,
1048             { "Polled Subaddress", "t30.fif.ps", FT_BOOLEAN,  8,
1049               TFS(&flags_set_truth), 0x20, "", HFILL }},
1050         {  &hf_t30_fif_t43,
1051             { "T.43 coding", "t30.fif.t43", FT_BOOLEAN,  8,
1052               TFS(&flags_set_truth), 0x10, "", HFILL }},
1053         {  &hf_t30_fif_pi,
1054             { "Plane interleave", "t30.fif.pi", FT_BOOLEAN,  8,
1055               TFS(&flags_set_truth), 0x08, "", HFILL }},
1056         {  &hf_t30_fif_vc32k,
1057             { "Voice coding with 32k ADPCM (ITU T G.726)", "t30.fif.vc32k", FT_BOOLEAN,  8,
1058               TFS(&flags_set_truth), 0x04, "", HFILL }},
1059
1060         {  &hf_t30_fif_r8x15,
1061             { "R8x15.4 lines/mm", "t30.fif.r8x15", FT_BOOLEAN,  8,
1062               TFS(&flags_set_truth), 0x80, "", HFILL }},
1063         {  &hf_t30_fif_300x300,
1064             { "300x300 pels/25.4 mm", "t30.fif.300x300", FT_BOOLEAN,  8,
1065               TFS(&flags_set_truth), 0x40, "", HFILL }},
1066         {  &hf_t30_fif_r16x15,
1067             { "R16x15.4 lines/mm and/or 400x400 pels/25.4 mm", "t30.fif.r16x15", FT_BOOLEAN,  8,
1068               TFS(&flags_set_truth), 0x20, "", HFILL }},
1069         {  &hf_t30_fif_ibrp,
1070             { "Inch based resolution preferred", "t30.fif.ibrp", FT_BOOLEAN,  8,
1071               TFS(&flags_set_truth), 0x10, "", HFILL }},
1072         {  &hf_t30_fif_mbrp,
1073             { "Metric based resolution preferred", "t30.fif.mbrp", FT_BOOLEAN,  8,
1074               TFS(&flags_set_truth), 0x08, "", HFILL }},
1075         {  &hf_t30_fif_msltchr,
1076             { "Minimum scan line time capability for higher resolutions", "t30.fif.msltchr", FT_BOOLEAN,  8,
1077               TFS(&t30_minimum_scan_value), 0x04, "", HFILL }},
1078         {  &hf_t30_fif_rts,
1079             { "Resolution type selection", "t30.fif.rts", FT_BOOLEAN,  8,
1080               TFS(&t30_res_type_sel_value), 0x10, "", HFILL }},
1081         {  &hf_t30_fif_sp,
1082             { "Selective polling", "t30.fif.sp", FT_BOOLEAN,  8,
1083               TFS(&flags_set_truth), 0x02, "", HFILL }},
1084
1085         {  &hf_t30_fif_sc,
1086             { "Subaddressing capability", "t30.fif.sc", FT_BOOLEAN,  8,
1087               TFS(&flags_set_truth), 0x80, "", HFILL }},
1088         {  &hf_t30_fif_passw,
1089             { "Password", "t30.fif.passw", FT_BOOLEAN,  8,
1090               TFS(&flags_set_truth), 0x40, "", HFILL }},
1091         {  &hf_t30_fif_sit,
1092             { "Sender Identification transmission", "t30.fif.sit", FT_BOOLEAN,  8,
1093               TFS(&flags_set_truth), 0x40, "", HFILL }},
1094         {  &hf_t30_fif_rttd,
1095             { "Ready to transmit a data file (polling)", "t30.fif.rttd", FT_BOOLEAN,  8,
1096               TFS(&flags_set_truth), 0x20, "", HFILL }},
1097         {  &hf_t30_fif_bft,
1098             { "Binary File Transfer (BFT)", "t30.fif.bft", FT_BOOLEAN,  8,
1099               TFS(&flags_set_truth), 0x08, "", HFILL }},
1100         {  &hf_t30_fif_dtm,
1101             { "Document Transfer Mode (DTM)", "t30.fif.dtm", FT_BOOLEAN,  8,
1102               TFS(&flags_set_truth), 0x04, "", HFILL }},
1103         {  &hf_t30_fif_edi,
1104             { "Electronic Data Interchange (EDI)", "t30.fif.edi", FT_BOOLEAN,  8,
1105               TFS(&flags_set_truth), 0x02, "", HFILL }},
1106
1107         {  &hf_t30_fif_btm,
1108             { "Basic Transfer Mode (BTM)", "t30.fif.btm", FT_BOOLEAN,  8,
1109               TFS(&flags_set_truth), 0x80, "", HFILL }},
1110         {  &hf_t30_fif_rttcmmd,
1111             { "Ready to transmit a character or mixed mode document (polling)", "t30.fif.rttcmmd", FT_BOOLEAN,  8,
1112               TFS(&flags_set_truth), 0x20, "", HFILL }},
1113         {  &hf_t30_fif_chrm,
1114             { "Character mode", "t30.fif.cm", FT_BOOLEAN,  8,
1115               TFS(&flags_set_truth), 0x10, "", HFILL }},
1116         {  &hf_t30_fif_mm,
1117             { "Mixed mode (Annex E/T.4)", "t30.fif.mm", FT_BOOLEAN,  8,
1118               TFS(&flags_set_truth), 0x04, "", HFILL }},
1119
1120         {  &hf_t30_fif_pm26,
1121             { "Processable mode 26 (ITU T T.505)", "t30.fif.pm26", FT_BOOLEAN,  8,
1122               TFS(&flags_set_truth), 0x80, "", HFILL }},
1123         {  &hf_t30_fif_dnc,
1124             { "Digital network capability", "t30.fif.dnc", FT_BOOLEAN,  8,
1125               TFS(&flags_set_truth), 0x40, "", HFILL }},
1126         {  &hf_t30_fif_do,
1127             { "Duplex operation", "t30.fif.do", FT_BOOLEAN,  8,
1128               TFS(&t30_duplex_operation_value), 0x20, "", HFILL }},
1129         {  &hf_t30_fif_jpeg,
1130             { "JPEG coding", "t30.fif.jpeg", FT_BOOLEAN,  8,
1131               TFS(&flags_set_truth), 0x10, "", HFILL }},
1132         {  &hf_t30_fif_fcm,
1133             { "Full colour mode", "t30.fif.fcm", FT_BOOLEAN,  8,
1134               TFS(&flags_set_truth), 0x08, "", HFILL }},
1135         {  &hf_t30_fif_pht,
1136             { "Preferred Huffman tables", "t30.fif.pht", FT_BOOLEAN,  8,
1137               TFS(&flags_set_truth), 0x08, "", HFILL }},
1138         {  &hf_t30_fif_12c,
1139             { "12 bits/pel component", "t30.fif.12c", FT_BOOLEAN,  8,
1140               TFS(&flags_set_truth), 0x02, "", HFILL }},
1141
1142         {  &hf_t30_fif_ns,
1143             { "No subsampling (1:1:1)", "t30.fif.ns", FT_BOOLEAN,  8,
1144               TFS(&flags_set_truth), 0x80, "", HFILL }},
1145         {  &hf_t30_fif_ci,
1146             { "Custom illuminant", "t30.fif.ci", FT_BOOLEAN,  8,
1147               TFS(&flags_set_truth), 0x40, "", HFILL }},
1148         {  &hf_t30_fif_cgr,
1149             { "Custom gamut range", "t30.fif.cgr", FT_BOOLEAN,  8,
1150               TFS(&flags_set_truth), 0x20, "", HFILL }},
1151         {  &hf_t30_fif_nalet,
1152             { "North American Letter (215.9 x 279.4 mm) capability", "t30.fif.nalet", FT_BOOLEAN,  8,
1153               TFS(&flags_set_truth), 0x10, "", HFILL }},
1154         {  &hf_t30_fif_naleg,
1155             { "North American Legal (215.9 x 355.6 mm) capability", "t30.fif.naleg", FT_BOOLEAN,  8,
1156               TFS(&flags_set_truth), 0x08, "", HFILL }},
1157         {  &hf_t30_fif_spscb,
1158             { "Single-progression sequential coding (ITU-T T.85) basic capability", "t30.fif.spscb", FT_BOOLEAN,  8,
1159               TFS(&flags_set_truth), 0x04, "", HFILL }},
1160         {  &hf_t30_fif_spsco,
1161             { "Single-progression sequential coding (ITU-T T.85) optional L0 capability", "t30.fif.spsco", FT_BOOLEAN,  8,
1162               TFS(&flags_set_truth), 0x02, "", HFILL }},
1163
1164         {  &hf_t30_fif_hkm,
1165             { "HKM key management capability", "t30.fif.hkm", FT_BOOLEAN,  8,
1166               TFS(&flags_set_truth), 0x80, "", HFILL }},
1167         {  &hf_t30_fif_rsa,
1168             { "RSA key management capability", "t30.fif.rsa", FT_BOOLEAN,  8,
1169               TFS(&flags_set_truth), 0x40, "", HFILL }},
1170         {  &hf_t30_fif_oc,
1171             { "Override capability", "t30.fif.oc", FT_BOOLEAN,  8,
1172               TFS(&flags_set_truth), 0x20, "", HFILL }},
1173         {  &hf_t30_fif_hfx40,
1174             { "HFX40 cipher capability", "t30.fif.hfx40", FT_BOOLEAN,  8,
1175               TFS(&flags_set_truth), 0x10, "", HFILL }},
1176         {  &hf_t30_fif_acn2c,
1177             { "Alternative cipher number 2 capability", "t30.fif.acn2c", FT_BOOLEAN,  8,
1178               TFS(&flags_set_truth), 0x08, "", HFILL }},
1179         {  &hf_t30_fif_acn3c,
1180             { "Alternative cipher number 3 capability", "t30.fif.acn3c", FT_BOOLEAN,  8,
1181               TFS(&flags_set_truth), 0x04, "", HFILL }},
1182         {  &hf_t30_fif_hfx40i,
1183             { "HFX40-I hashing capability", "t30.fif.hfx40i", FT_BOOLEAN,  8,
1184               TFS(&flags_set_truth), 0x02, "", HFILL }},
1185
1186         {  &hf_t30_fif_ahsn2,
1187             { "Alternative hashing system number 2 capability", "t30.fif.ahsn2", FT_BOOLEAN,  8,
1188               TFS(&flags_set_truth), 0x80, "", HFILL }},
1189         {  &hf_t30_fif_ahsn3,
1190             { "Alternative hashing system number 3 capability", "t30.fif.ahsn3", FT_BOOLEAN,  8,
1191               TFS(&flags_set_truth), 0x40, "", HFILL }},
1192         {  &hf_t30_fif_t441,
1193             { "T.44 (Mixed Raster Content)", "t30.fif.t441", FT_BOOLEAN,  8,
1194               TFS(&flags_set_truth), 0x10, "", HFILL }},
1195         {  &hf_t30_fif_t442,
1196             { "T.44 (Mixed Raster Content)", "t30.fif.t442", FT_BOOLEAN,  8,
1197               TFS(&flags_set_truth), 0x08, "", HFILL }},
1198         {  &hf_t30_fif_t443,
1199             { "T.44 (Mixed Raster Content)", "t30.fif.t443", FT_BOOLEAN,  8,
1200               TFS(&flags_set_truth), 0x04, "", HFILL }},
1201         {  &hf_t30_fif_plmss,
1202             { "Page length maximum strip size for T.44 (Mixed Raster Content)", "t30.fif.plmss", FT_BOOLEAN,  8,
1203               TFS(&flags_set_truth), 0x02, "", HFILL }},
1204
1205         {  &hf_t30_fif_cg300,
1206             { "Colour/gray-scale 300 pels/25.4 mm x 300 lines/25.4 mm or 400 pels/25.4 mm x 400 lines/25.4 mm resolution", "t30.fif.cg300", FT_BOOLEAN,  8,
1207               TFS(&flags_set_truth), 0x80, "", HFILL }},
1208         {  &hf_t30_fif_100x100cg,
1209             { "100 pels/25.4 mm x 100 lines/25.4 mm for colour/gray scale", "t30.fif.100x100cg", FT_BOOLEAN,  8,
1210               TFS(&flags_set_truth), 0x40, "", HFILL }},
1211         {  &hf_t30_fif_spcbft,
1212             { "Simple Phase C BFT Negotiations capability", "t30.fif.spcbft", FT_BOOLEAN,  8,
1213               TFS(&flags_set_truth), 0x20, "", HFILL }},
1214         {  &hf_t30_fif_ebft,
1215             { "Extended BFT Negotiations capability", "t30.fif.ebft", FT_BOOLEAN,  8,
1216               TFS(&flags_set_truth), 0x10, "", HFILL }},
1217         {  &hf_t30_fif_isp,
1218             { "Internet Selective Polling Address (ISP)", "t30.fif.isp", FT_BOOLEAN,  8,
1219               TFS(&flags_set_truth), 0x08, "", HFILL }},
1220         {  &hf_t30_fif_ira,
1221             { "Internet Routing Address (IRA)", "t30.fif.ira", FT_BOOLEAN,  8,
1222               TFS(&flags_set_truth), 0x04, "", HFILL }},
1223
1224         {  &hf_t30_fif_600x600,
1225             { "600 pels/25.4 mm x 600 lines/25.4 mm", "t30.fif.600x600", FT_BOOLEAN,  8,
1226               TFS(&flags_set_truth), 0x80, "", HFILL }},
1227         {  &hf_t30_fif_1200x1200,
1228             { "1200 pels/25.4 mm x 1200 lines/25.4 mm", "t30.fif.1200x1200", FT_BOOLEAN,  8,
1229               TFS(&flags_set_truth), 0x40, "", HFILL }},
1230         {  &hf_t30_fif_300x600,
1231             { "300 pels/25.4 mm x 600 lines/25.4 mm", "t30.fif.300x600", FT_BOOLEAN,  8,
1232               TFS(&flags_set_truth), 0x20, "", HFILL }},
1233         {  &hf_t30_fif_400x800,
1234             { "400 pels/25.4 mm x 800 lines/25.4 mm", "t30.fif.400x800", FT_BOOLEAN,  8,
1235               TFS(&flags_set_truth), 0x10, "", HFILL }},
1236         {  &hf_t30_fif_600x1200,
1237             { "600 pels/25.4 mm x 1200 lines/25.4 mm", "t30.fif.600x1200", FT_BOOLEAN,  8,
1238               TFS(&flags_set_truth), 0x08, "", HFILL }},
1239         {  &hf_t30_fif_cg600x600,
1240             { "Colour/gray scale 600 pels/25.4 mm x 600 lines/25.4 mm resolution", "t30.fif.cg600x600", FT_BOOLEAN,  8,
1241               TFS(&flags_set_truth), 0x04, "", HFILL }},
1242         {  &hf_t30_fif_cg1200x1200,
1243             { "Colour/gray scale 1200 pels/25.4 mm x 1200 lines/25.4 mm resolution", "t30.fif.cg1200x1200", FT_BOOLEAN,  8,
1244               TFS(&flags_set_truth), 0x02, "", HFILL }},
1245
1246         {  &hf_t30_fif_dspcam,
1247             { "Double sided printing capability (alternate mode)", "t30.fif.dspcam", FT_BOOLEAN,  8,
1248               TFS(&flags_set_truth), 0x80, "", HFILL }},
1249         {  &hf_t30_fif_dspccm,
1250             { "Double sided printing capability (continuous mode)", "t30.fif.dspccm", FT_BOOLEAN,  8,
1251               TFS(&flags_set_truth), 0x40, "", HFILL }},
1252         {  &hf_t30_fif_bwmrcp,
1253             { "Black and white mixed raster content profile (MRCbw)", "t30.fif.bwmrcp", FT_BOOLEAN,  8,
1254               TFS(&flags_set_truth), 0x20, "", HFILL }},
1255         {  &hf_t30_fif_t45,
1256             { "T.45 (run length colour encoding)", "t30.fif.t45", FT_BOOLEAN,  8,
1257               TFS(&flags_set_truth), 0x10, "", HFILL }},
1258         {  &hf_t30_fif_sdmc,
1259             { "SharedDataMemory capacity", "t30.fif.sdmc", FT_UINT8,  BASE_HEX,
1260               VALS(t30_SharedDataMemory_capacity_vals), 0x0C, "", HFILL }},
1261
1262         { &hf_t30_fif_number,
1263           { "Number", "t30.fif.number", FT_STRING, BASE_NONE, NULL, 0x0,
1264             "", HFILL }},
1265
1266         {  &hf_t30_fif_country_code,
1267             { "ITU-T Country code", "t30.fif.country_code", FT_UINT8, BASE_DEC,
1268               NULL, 0, "ITU-T Country code", HFILL }},
1269         {  &hf_t30_fif_non_stand_bytes,
1270             { "Non-standard capabilities", "t30.fif.non_standard_cap", FT_BYTES, BASE_HEX,
1271               NULL, 0, "Non-standard capabilities", HFILL }},
1272
1273         {  &hf_t30_t4_frame_num,
1274             { "T.4 Frame number", "t30.t4.frame_num", FT_UINT8, BASE_DEC,
1275               NULL, 0, "T.4 Frame number", HFILL }},
1276         {  &hf_t30_t4_data,
1277             { "T.4 Facsimile data field", "t30.t4.data", FT_BYTES, BASE_HEX,
1278               NULL, 0, "T.4 Facsimile data field", HFILL }},
1279
1280         {  &hf_t30_partial_page_fcf2,
1281             { "Post-message command", "t30.pps.fcf2", FT_UINT8, BASE_DEC,
1282               VALS(t30_partial_page_fcf2_vals), 0, "Post-message command", HFILL }},
1283         {  &hf_t30_partial_page_i1,
1284             { "Page counter", "t30.t4.page_count", FT_UINT8, BASE_DEC,
1285               NULL, 0, "Page counter", HFILL }},
1286         {  &hf_t30_partial_page_i2,
1287             { "Block counter", "t30.t4.block_count", FT_UINT8, BASE_DEC,
1288               NULL, 0, "Block counter", HFILL }},
1289         {  &hf_t30_partial_page_i3,
1290             { "Frame counter", "t30.t4.frame_count", FT_UINT8, BASE_DEC,
1291               NULL, 0, "Frame counter", HFILL }},
1292     };
1293
1294     static gint *t30_ett[] =
1295     {
1296         &ett_t30,
1297         &ett_t30_fif,
1298     };
1299
1300
1301     /* T30 */
1302     proto_t30 = proto_register_protocol("T.30", "T.30", "t30");
1303     proto_register_field_array(proto_t30, hf_t30, array_length(hf_t30));
1304     proto_register_subtree_array(t30_ett, array_length(t30_ett));
1305
1306     new_register_dissector("t30.hdlc", dissect_t30_hdlc, proto_t30);
1307
1308 }
1309
1310 void
1311 proto_reg_handoff_t30(void)
1312 {
1313
1314 }
1315