Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-t30.c
blobb751d454b4a2621fbeecf8606b9c4085a5786139
1 /* packet-t30.c
2 * Routines for T.30 packet dissection
3 * 2006 Alejandro Vaquero, add T30 reassemble and dissection
5 * http://www.itu.int/rec/T-REC-T.30-200509-I/en
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * SPDX-License-Identifier: GPL-2.0-or-later
14 #include "config.h"
18 #include <epan/packet.h>
19 #include <epan/expert.h>
20 #include <epan/charsets.h>
21 #include <epan/tfs.h>
22 #include <wsutil/array.h>
24 #include "packet-t38.h"
25 #include "packet-t30.h"
27 void proto_register_t30(void);
29 /* T30 */
30 static int proto_t30;
31 static int hf_t30_Address;
32 static int hf_t30_Control;
33 static int hf_t30_Facsimile_Control;
34 static int hf_t30_fif_sm;
35 static int hf_t30_fif_rtif;
36 static int hf_t30_fif_3gmn;
37 static int hf_t30_fif_v8c;
38 static int hf_t30_fif_op;
39 static int hf_t30_fif_rtfc;
40 static int hf_t30_fif_rfo;
41 static int hf_t30_fif_dsr;
42 static int hf_t30_fif_dsr_dcs;
43 static int hf_t30_fif_res;
44 static int hf_t30_fif_tdcc;
45 static int hf_t30_fif_rwc;
46 static int hf_t30_fif_rw_dcs;
47 static int hf_t30_fif_rlc;
48 static int hf_t30_fif_rl_dcs;
49 static int hf_t30_fif_msltcr;
50 static int hf_t30_fif_mslt_dcs;
51 static int hf_t30_fif_ext;
52 static int hf_t30_fif_cm;
53 static int hf_t30_fif_ecm;
54 static int hf_t30_fif_fs_dcs;
55 static int hf_t30_fif_t6;
56 static int hf_t30_fif_fvc;
57 static int hf_t30_fif_mspc;
58 static int hf_t30_fif_ps;
59 static int hf_t30_fif_t43;
60 static int hf_t30_fif_pi;
61 static int hf_t30_fif_vc32k;
62 static int hf_t30_fif_r8x15;
63 static int hf_t30_fif_300x300;
64 static int hf_t30_fif_r16x15;
65 static int hf_t30_fif_ibrp;
66 static int hf_t30_fif_mbrp;
67 static int hf_t30_fif_msltchr;
68 static int hf_t30_fif_rts;
69 static int hf_t30_fif_sp;
70 static int hf_t30_fif_sc;
71 static int hf_t30_fif_passw;
72 static int hf_t30_fif_sit;
73 static int hf_t30_fif_rttd;
74 static int hf_t30_fif_bft;
75 static int hf_t30_fif_dtm;
76 static int hf_t30_fif_edi;
77 static int hf_t30_fif_btm;
78 static int hf_t30_fif_rttcmmd;
79 static int hf_t30_fif_chrm;
80 static int hf_t30_fif_mm;
81 static int hf_t30_fif_pm26;
82 static int hf_t30_fif_dnc;
83 static int hf_t30_fif_do;
84 static int hf_t30_fif_jpeg;
85 static int hf_t30_fif_fcm;
86 static int hf_t30_fif_pht;
87 static int hf_t30_fif_12c;
88 static int hf_t30_fif_ns;
89 static int hf_t30_fif_ci;
90 static int hf_t30_fif_cgr;
91 static int hf_t30_fif_nalet;
92 static int hf_t30_fif_naleg;
93 static int hf_t30_fif_spscb;
94 static int hf_t30_fif_spsco;
95 static int hf_t30_fif_hkm;
96 static int hf_t30_fif_rsa;
97 static int hf_t30_fif_oc;
98 static int hf_t30_fif_hfx40;
99 static int hf_t30_fif_acn2c;
100 static int hf_t30_fif_acn3c;
101 static int hf_t30_fif_hfx40i;
102 static int hf_t30_fif_ahsn2;
103 static int hf_t30_fif_ahsn3;
104 static int hf_t30_fif_t441;
105 static int hf_t30_fif_t442;
106 static int hf_t30_fif_t443;
107 static int hf_t30_fif_plmss;
108 static int hf_t30_fif_cg300;
109 static int hf_t30_fif_100x100cg;
110 static int hf_t30_fif_spcbft;
111 static int hf_t30_fif_ebft;
112 static int hf_t30_fif_isp;
113 static int hf_t30_fif_ira;
114 static int hf_t30_fif_600x600;
115 static int hf_t30_fif_1200x1200;
116 static int hf_t30_fif_300x600;
117 static int hf_t30_fif_400x800;
118 static int hf_t30_fif_600x1200;
119 static int hf_t30_fif_cg600x600;
120 static int hf_t30_fif_cg1200x1200;
121 static int hf_t30_fif_dspcam;
122 static int hf_t30_fif_dspccm;
123 static int hf_t30_fif_bwmrcp;
124 static int hf_t30_fif_t45;
125 static int hf_t30_fif_sdmc;
126 static int hf_t30_fif_number;
127 static int hf_t30_fif_country_code;
128 static int hf_t30_fif_non_stand_bytes;
129 static int hf_t30_t4_frame_num;
130 static int hf_t30_t4_data;
131 static int hf_t30_partial_page_fcf2;
132 static int hf_t30_partial_page_i1;
133 static int hf_t30_partial_page_i2;
134 static int hf_t30_partial_page_i3;
135 static int hf_t30_partial_page_request_frame_count;
136 static int hf_t30_partial_page_request_frames;
138 static int ett_t30;
139 static int ett_t30_fif;
141 static expert_field ei_t30_bad_length;
142 static expert_field ei_t30_Address_FF;
143 static expert_field ei_t30_Control_C0C8;
145 static const value_string t30_control_vals[] = {
146 { 0xC0, "non-final frames within the procedure" },
147 { 0xC8, "final frames within the procedure" },
148 { 0, NULL }
151 // initial identification - format 0000 XXXX
152 #define T30_FC_DIS 0x01
153 #define T30_FC_CSI 0x02
154 #define T30_FC_NSF 0x04
156 // pre-message response signals - format X010 XXXX
157 #define T30_FC_CFR 0x21
158 #define T30_FC_FTT 0x22
159 #define T30_FC_CTR 0x23
160 #define T30_FC_CSA 0x24
162 // post-message resopnses - format X011 XXXX
163 #define T30_FC_MCF 0x31
164 #define T30_FC_RTN 0x32
165 #define T30_FC_RTP 0x33
166 #define T30_FC_PIN 0x34
167 #define T30_FC_PIP 0x35
168 #define T30_FC_PID 0x36
169 #define T30_FC_RNR 0x37
170 #define T30_FC_ERR 0x38
171 #define T30_FC_PPR 0x3D
172 #define T30_FC_FDM 0x3F
174 // command to receive - format X100 XXXX
175 #define T30_FC_DCS 0x41
176 #define T30_FC_TSI 0x42
177 #define T30_FC_SUB 0x43
178 #define T30_FC_NSS 0x44
179 #define T30_FC_SID 0x45
180 #define T30_FC_TSA 0x46
181 #define T30_FC_IRA 0x47
182 #define T30_FC_CTC 0x48
184 // other line control signals - format X101 XXXX
185 #define T30_FC_FNV 0x53
186 #define T30_FC_TR 0x56
187 #define T30_FC_TNR 0x57
188 #define T30_FC_CRP 0x58
189 #define T30_FC_DCN 0x5F
191 // not sure about the format and mask
192 #define T30_FC_FCD 0x60
193 #define T30_FC_RCP 0x61
195 // post-message commands - format X111 XXXX
196 #define T30_FC_EOM 0x71
197 #define T30_FC_MPS 0x72
198 #define T30_FC_EOR 0x73
199 #define T30_FC_EOP 0x74
200 #define T30_FC_RR 0x76
201 #define T30_FC_PRI_EOP2 0x78
202 #define T30_FC_PRI_EOM 0x79
203 #define T30_FC_PRI_MPS 0x7A
204 #define T30_FC_PRI_EOP 0x7C
205 #define T30_FC_PPS 0x7D
207 // Command to send - format 1000 XXXX
208 #define T30_FC_DTC 0x81
209 #define T30_FC_CIG 0x82
210 #define T30_FC_PWD 0x83
211 #define T30_FC_NSC 0x84
212 #define T30_FC_SEP 0x85
213 #define T30_FC_PSA 0x86
214 #define T30_FC_CIA 0x87
215 #define T30_FC_ISP 0x88
223 static const value_string t30_facsimile_control_field_vals[] = {
224 /* 0x01 */ { T30_FC_DIS, "Digital Identification Signal" },
225 /* 0x02 */ { T30_FC_CSI, "Called Subscriber Identification" },
226 /* 0x04 */ { T30_FC_NSF, "Non-Standard Facilities" },
227 /* 0x21 */ { T30_FC_CFR, "Confirmation To Receive" },
228 /* 0x22 */ { T30_FC_FTT, "Failure To Train" },
229 /* 0x23 */ { T30_FC_CTR, "Response for Continue To Correct" },
230 /* 0x24 */ { T30_FC_CSA, "Called Subscriber Internet Address" },
231 /* 0x31 */ { T30_FC_MCF, "Message Confirmation" },
232 /* 0x32 */ { T30_FC_RTN, "Retrain Negative" },
233 /* 0x33 */ { T30_FC_RTP, "Retrain Positive" },
234 /* 0x34 */ { T30_FC_PIN, "Procedure Interrupt Negative" },
235 /* 0x35 */ { T30_FC_PIP, "Procedure Interrupt Positive" },
236 /* 0x36 */ { T30_FC_PID, "Procedure Interrupt Disconnect" },
237 /* 0x37 */ { T30_FC_RNR, "Receive Not Ready" },
238 /* 0x38 */ { T30_FC_ERR, "Response for End of Retransmission" },
239 /* 0x3D */ { T30_FC_PPR, "Partial Page Request" },
240 /* 0x3F */ { T30_FC_FDM, "File Diagnostics Message" },
241 /* 0x41 */ { T30_FC_DCS, "Digital Command Signal" },
242 /* 0x42 */ { T30_FC_TSI, "Transmitting Subscriber Identification" },
243 /* 0x43 */ { T30_FC_SUB, "Subaddress" },
244 /* 0x44 */ { T30_FC_NSS, "Non-Standard facilities Set-up" },
245 /* 0x45 */ { T30_FC_SID, "Sender Identification" },
246 /* 0x46 */ { T30_FC_TSA, "Transmitting Subscriber Internet address" },
247 /* 0x47 */ { T30_FC_IRA, "Internet Routing Address" },
248 /* 0x48 */ { T30_FC_CTC, "Continue To Correct" },
249 /* 0x53 */ { T30_FC_FNV, "Field Not Valid" },
250 /* 0x56 */ { T30_FC_TR, "Transmit ready" },
251 /* 0x57 */ { T30_FC_TNR, "Transmit not ready" },
252 /* 0x58 */ { T30_FC_CRP, "Command Repeat" },
253 /* 0x5F */ { T30_FC_DCN, "Disconnect" },
254 /* 0x60 */ { T30_FC_FCD, "Facsimile coded data" },
255 /* 0x61 */ { T30_FC_RCP, "Return to control for partial page" },
256 /* 0x71 */ { T30_FC_EOM, "End Of Message" },
257 /* 0x72 */ { T30_FC_MPS, "MultiPage Signal" },
258 /* 0x73 */ { T30_FC_EOR, "End Of Retransmission" },
259 /* 0x74 */ { T30_FC_EOP, "End Of Procedure" },
260 /* 0x76 */ { T30_FC_RR, "Receive Ready" },
261 /* 0x78 */ { T30_FC_PRI_EOP2, "Procedure Interrupt-End Of Procedure" },
262 /* 0x79 */ { T30_FC_PRI_EOM, "Procedure Interrupt-End Of Message" },
263 /* 0x7A */ { T30_FC_PRI_MPS, "Procedure Interrupt-MultiPage Signal" },
264 /* 0x7C */ { T30_FC_PRI_EOP, "Procedure Interrupt-End Of Procedure" },
265 /* 0x7D */ { T30_FC_PPS, "Partial Page Signal" },
266 /* 0x81 */ { T30_FC_DTC, "Digital Transmit Command" },
267 /* 0x82 */ { T30_FC_CIG, "Calling Subscriber Identification" },
268 /* 0x83 */ { T30_FC_PWD, "Password" },
269 /* 0x84 */ { T30_FC_NSC, "Non-Standard facilities Command" },
270 /* 0x85 */ { T30_FC_SEP, "Selective Polling" },
271 /* 0x86 */ { T30_FC_PSA, "Polled Subaddress" },
272 /* 0x87 */ { T30_FC_CIA, "Calling subscriber Internet Address" },
273 /* 0x88 */ { T30_FC_ISP, "Internet Selective Polling Address" },
274 { 0, NULL }
276 value_string_ext t30_facsimile_control_field_vals_ext =
277 VALUE_STRING_EXT_INIT(t30_facsimile_control_field_vals);
279 static const value_string t30_facsimile_control_field_vals_short[] = {
280 /* 0x01 */ { T30_FC_DIS, "DIS" },
281 /* 0x02 */ { T30_FC_CSI, "CSI" },
282 /* 0x04 */ { T30_FC_NSF, "NSF" },
283 /* 0x21 */ { T30_FC_CFR, "CFR" },
284 /* 0x22 */ { T30_FC_FTT, "FTT" },
285 /* 0x23 */ { T30_FC_CTR, "CTR" },
286 /* 0x24 */ { T30_FC_CSA, "CSA" },
287 /* 0x31 */ { T30_FC_MCF, "MCF" },
288 /* 0x32 */ { T30_FC_RTN, "RTN" },
289 /* 0x33 */ { T30_FC_RTP, "RTP" },
290 /* 0x34 */ { T30_FC_PIN, "PIN" },
291 /* 0x35 */ { T30_FC_PIP, "PIP" },
292 /* 0x36 */ { T30_FC_PID, "PID" },
293 /* 0x37 */ { T30_FC_RNR, "RNR" },
294 /* 0x38 */ { T30_FC_ERR, "ERR" },
295 /* 0x3D */ { T30_FC_PPR, "PPR" },
296 /* 0x3F */ { T30_FC_FDM, "FDM" },
297 /* 0x41 */ { T30_FC_DCS, "DCS" },
298 /* 0x42 */ { T30_FC_TSI, "TSI" },
299 /* 0x43 */ { T30_FC_SUB, "SUB" },
300 /* 0x44 */ { T30_FC_NSS, "NSS" },
301 /* 0x45 */ { T30_FC_SID, "SID" },
302 /* 0x46 */ { T30_FC_TSA, "TSA" },
303 /* 0x47 */ { T30_FC_IRA, "IRA" },
304 /* 0x48 */ { T30_FC_CTC, "CTC" },
305 /* 0x53 */ { T30_FC_FNV, "FNV" },
306 /* 0x56 */ { T30_FC_TR, "TR" },
307 /* 0x57 */ { T30_FC_TNR, "TNR" },
308 /* 0x58 */ { T30_FC_CRP, "CRP" },
309 /* 0x5F */ { T30_FC_DCN, "DCN" },
310 /* 0x60 */ { T30_FC_FCD, "FCD" },
311 /* 0x61 */ { T30_FC_RCP, "RCP" },
312 /* 0x71 */ { T30_FC_EOM, "EOM" },
313 /* 0x72 */ { T30_FC_MPS, "MPS" },
314 /* 0x73 */ { T30_FC_EOR, "EOR" },
315 /* 0x74 */ { T30_FC_EOP, "EOP" },
316 /* 0x76 */ { T30_FC_RR, "RR" },
317 /* 0x78 */ { T30_FC_PRI_EOP2, "EOP2" },
318 /* 0x79 */ { T30_FC_PRI_EOM, "PRI_EOM" },
319 /* 0x7A */ { T30_FC_PRI_MPS, "PRI_MPS" },
320 /* 0x7C */ { T30_FC_PRI_EOP, "EOP" },
321 /* 0x7D */ { T30_FC_PPS, "PPS" },
322 /* 0x81 */ { T30_FC_DTC, "DTC" },
323 /* 0x82 */ { T30_FC_CIG, "CIG" },
324 /* 0x83 */ { T30_FC_PWD, "PWD" },
325 /* 0x84 */ { T30_FC_NSC, "NSC" },
326 /* 0x85 */ { T30_FC_SEP, "SEP" },
327 /* 0x86 */ { T30_FC_PSA, "PSA" },
328 /* 0x87 */ { T30_FC_CIA, "CIA" },
329 /* 0x88 */ { T30_FC_ISP, "ISP" },
330 { 0, NULL }
332 value_string_ext t30_facsimile_control_field_vals_short_ext =
333 VALUE_STRING_EXT_INIT(t30_facsimile_control_field_vals_short);
335 static const value_string t30_data_signalling_rate_vals[] = {
336 { 0x00, "ITU-T V.27 ter fall-back mode" },
337 { 0x01, "Not used" },
338 { 0x02, "Not used" },
339 { 0x03, "Not used" },
340 { 0x04, "ITU-T V.27 ter" },
341 { 0x05, "Reserved" },
342 { 0x06, "Reserved" },
343 { 0x07, "Reserved" },
344 { 0x08, "ITU-T V.29" },
345 { 0x09, "Not used" },
346 { 0x0A, "Not used" },
347 { 0x0B, "Not used" },
348 { 0x0C, "ITU-T V.27 ter and V.29" },
349 { 0x0D, "ITU-T V.27 ter, V.29, and V.17" },
350 { 0x0E, "Invalid" },
351 { 0x0F, "Reserved" },
352 { 0, NULL }
354 static value_string_ext t30_data_signalling_rate_vals_ext =
355 VALUE_STRING_EXT_INIT(t30_data_signalling_rate_vals);
357 static const value_string t30_data_signalling_rate_dcs_vals[] = {
358 { 0x00, "2400 bit/s, ITU-T V.27 ter" },
359 { 0x01, "14 400 bit/s, ITU-T V.17" },
360 { 0x02, "Invalid" },
361 { 0x03, "Reserved" },
362 { 0x04, "4800 bit/s, ITU-T V.27 ter" },
363 { 0x05, "12 000 bit/s, ITU-T V.17" },
364 { 0x06, "Invalid" },
365 { 0x07, "Reserved" },
366 { 0x08, "9600 bit/s, ITU-T V.29" },
367 { 0x09, "9600 bit/s, ITU-T V.17" },
368 { 0x0A, "Reserved" },
369 { 0x0B, "Reserved" },
370 { 0x0C, "7200 bit/s, ITU-T V.29" },
371 { 0x0D, "7200 bit/s, ITU-T V.17" },
372 { 0x0E, "Reserved" },
373 { 0x0F, "Reserved" },
374 { 0, NULL }
376 static value_string_ext t30_data_signalling_rate_dcs_vals_ext =
377 VALUE_STRING_EXT_INIT(t30_data_signalling_rate_dcs_vals);
379 static const value_string t30_recording_width_capabilities_vals[] = {
380 { 0x00, "Scan line length 215 mm +- 1%" },
381 { 0x01, "Scan line length 215 mm +- 1% and Scan line length 255 mm +- 1% and Scan line length 303 mm +- 1%" },
382 { 0x02, "Scan line length 215 mm +- 1% and Scan line length 255 mm +- 1%" },
383 { 0x03, "Invalid" },
384 { 0, NULL }
387 static const value_string t30_recording_width_dcs_vals[] = {
388 { 0x00, "Scan line length 215 mm +- 1%" },
389 { 0x01, "Scan line length 303 mm +- 1%" },
390 { 0x02, "Scan line length 255 mm +- 1%" },
391 { 0x03, "Invalid" },
392 { 0, NULL }
395 static const value_string t30_recording_length_capability_vals[] = {
396 { 0x00, "A4 (297 mm)" },
397 { 0x01, "Unlimited" },
398 { 0x02, "A4 (297 mm) and B4 (364 mm)" },
399 { 0x03, "Invalid" },
400 { 0, NULL }
403 static const value_string t30_recording_length_dcs_vals[] = {
404 { 0x00, "A4 (297 mm)" },
405 { 0x01, "Unlimited" },
406 { 0x02, "B4 (364 mm)" },
407 { 0x03, "Invalid" },
408 { 0, NULL }
411 static const value_string t30_minimum_scan_line_time_rec_vals[] = {
412 { 0x00, "20 ms at 3.85 l/mm: T7.7 = T3.85" },
413 { 0x01, "40 ms at 3.85 l/mm: T7.7 = T3.85" },
414 { 0x02, "10 ms at 3.85 l/mm: T7.7 = T3.85" },
415 { 0x04, "05 ms at 3.85 l/mm: T7.7 = T3.85" },
416 { 0x03, "10 ms at 3.85 l/mm: T7.7 = 1/2 T3.85" },
417 { 0x06, "20 ms at 3.85 l/mm: T7.7 = 1/2 T3.85" },
418 { 0x05, "40 ms at 3.85 l/mm: T7.7 = 1/2 T3.85" },
419 { 0x07, "00 ms at 3.85 l/mm: T7.7 = T3.85" },
420 { 0, NULL }
423 static const value_string t30_partial_page_fcf2_vals[] = {
424 { 0x00, "NULL code which indicates the partial page boundary" },
425 { 0xF1, "EOM in optional T.4 error correction mode" },
426 { 0xF2, "MPS in optional T.4 error correction mode" },
427 { 0xF4, "EOP in optional T.4 error correction mode" },
428 { 0xF8, "EOS in optional T.4 error correction mode" },
429 { 0xF9, "PRI-EOM in optional T.4 error correction mode" },
430 { 0xFA, "PRI-MPS in optional T.4 error correction mode" },
431 { 0xFC, "PRI-EOP in optional T.4 error correction mode" },
432 { 0, NULL }
435 static const value_string t30_minimum_scan_line_time_dcs_vals[] = {
436 { 0x00, "20 ms" },
437 { 0x01, "40 ms" },
438 { 0x02, "10 ms" },
439 { 0x04, "05 ms" },
440 { 0x07, "00 ms" },
441 { 0, NULL }
444 static const value_string t30_SharedDataMemory_capacity_vals[] = {
445 { 0x00, "Not available" },
446 { 0x01, "Level 1 = 1.0 Mbytes" },
447 { 0x02, "Level 2 = 2.0 Mbytes" },
448 { 0x03, "Level 3 = unlimited (i.e. >= 32 Mbytes)" },
449 { 0, NULL }
452 static const true_false_string t30_octets_preferred_value = {
453 "64 octets preferred",
454 "256 octets preferred",
457 static const true_false_string t30_extension_ind_value = {
458 "information continues through the next octet",
459 "last octet",
462 static const true_false_string t30_compress_value = {
463 "Uncompressed mode",
464 "Compressed mode",
467 static const true_false_string t30_minimum_scan_value = {
468 "T15.4 = 1/2 T7.7",
469 "T15.4 = T7.7",
472 static const true_false_string t30_duplex_operation_value = {
473 "Duplex and half duplex operation",
474 "Half duplex operation only",
477 static const true_false_string t30_frame_size_dcs_value = {
478 "64 octets",
479 "256 octets",
482 static const true_false_string t30_res_type_sel_value = {
483 "inch based resolution",
484 "metric based resolution",
487 static uint8_t
488 reverse_byte(uint8_t val)
490 return ( ((val & 0x80)>>7) | ((val & 0x40)>>5) |
491 ((val & 0x20)>>3) | ((val & 0x10)>>1) |
492 ((val & 0x08)<<1) | ((val & 0x04)<<3) |
493 ((val & 0x02)<<5) | ((val & 0x01)<<7) );
496 #define LENGTH_T30_NUM 20
497 static char *
498 t30_get_string_numbers(wmem_allocator_t *pool, tvbuff_t *tvb, int offset, int len)
500 char buf[LENGTH_T30_NUM+1];
501 int i;
503 /* the length must be 20 bytes per T30 rec*/
504 if (len != LENGTH_T30_NUM)
505 return NULL;
507 for (i=0; i<LENGTH_T30_NUM; i++)
508 buf[LENGTH_T30_NUM-i-1] = reverse_byte(tvb_get_uint8(tvb, offset+i));
510 /* add end of string */
511 buf[LENGTH_T30_NUM] = '\0';
513 char *s = g_strstrip(buf);
514 return get_utf_8_string(pool, s, (int)strlen(s));
518 static void
519 dissect_t30_numbers(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree, t38_packet_info* t38)
521 char *str_num;
523 str_num = t30_get_string_numbers(pinfo->pool, tvb, offset, len);
524 if (str_num) {
525 proto_tree_add_string(tree, hf_t30_fif_number, tvb, offset, LENGTH_T30_NUM, str_num);
527 col_append_fstr(pinfo->cinfo, COL_INFO, " - Number:%s", str_num);
529 if (t38)
530 snprintf(t38->desc, MAX_T38_DESC, "Num: %s", str_num);
532 else {
533 proto_tree_add_expert_format(tree, pinfo, &ei_t30_bad_length, tvb, offset, -1,
534 "MALFORMED OR SHORT PACKET: number of digits must be 20");
536 col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET: number of digits must be 20]" );
540 static void
541 dissect_t30_facsimile_coded_data(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree, t38_packet_info* t38)
543 uint8_t octet;
545 if (len < 2) {
546 proto_tree_add_expert_format(tree, pinfo, &ei_t30_bad_length, tvb,
547 offset, tvb_reported_length_remaining(tvb, offset), "T30 FCD length must be at least 2 bytes");
548 col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET]");
549 return;
552 octet = tvb_get_uint8(tvb, offset);
553 proto_tree_add_uint(tree, hf_t30_t4_frame_num, tvb, offset, 1, reverse_byte(octet));
554 offset++;
556 col_append_fstr(pinfo->cinfo, COL_INFO, " - Frame num:%d", reverse_byte(octet));
558 if (t38)
559 snprintf(t38->desc, MAX_T38_DESC, "Frm num: %d", reverse_byte(octet));
561 proto_tree_add_item(tree, hf_t30_t4_data, tvb, offset, len-1, ENC_NA);
564 static void
565 dissect_t30_non_standard_cap(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree)
567 if (len < 2) {
568 proto_tree_add_expert_format(tree, pinfo, &ei_t30_bad_length, tvb,
569 offset, tvb_reported_length_remaining(tvb, offset),"T30 NSC length must be at least 2 bytes");
570 col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET]");
571 return;
574 proto_tree_add_item(tree, hf_t30_fif_country_code, tvb, offset, 1, ENC_BIG_ENDIAN);
575 offset++;
577 proto_tree_add_item(tree, hf_t30_fif_non_stand_bytes, tvb, offset, len-1, ENC_NA);
581 static void
582 dissect_t30_partial_page_signal(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree, t38_packet_info* t38)
584 uint8_t octet, page_count, block_count, frame_count;
586 if (len != 4) {
587 proto_tree_add_expert_format(tree, pinfo, &ei_t30_bad_length, tvb,
588 offset, tvb_reported_length_remaining(tvb, offset), "T30 PPS length must be 4 bytes");
589 col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET]");
590 return;
593 proto_tree_add_item(tree, hf_t30_partial_page_fcf2, tvb, offset, 1, ENC_BIG_ENDIAN);
594 offset += 1;
596 octet = tvb_get_uint8(tvb, offset);
597 page_count = reverse_byte(octet);
598 proto_tree_add_uint(tree, hf_t30_partial_page_i1, tvb, offset, 1, page_count);
599 offset++;
601 octet = tvb_get_uint8(tvb, offset);
602 block_count = reverse_byte(octet);
603 proto_tree_add_uint(tree, hf_t30_partial_page_i2, tvb, offset, 1, block_count);
604 offset++;
606 octet = tvb_get_uint8(tvb, offset);
607 frame_count = reverse_byte(octet);
608 proto_tree_add_uint(tree, hf_t30_partial_page_i3, tvb, offset, 1, frame_count);
609 offset++;
611 col_append_fstr(pinfo->cinfo, COL_INFO, " - PC:%d BC:%d FC:%d", page_count, block_count, frame_count);
613 if (t38)
614 snprintf(t38->desc, MAX_T38_DESC,
615 "PC:%d BC:%d FC:%d", page_count, block_count, frame_count);
619 static void
620 dissect_t30_partial_page_request(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree)
622 int start_offset;
623 int frame_count = 0;
624 int frame;
625 #define BUF_SIZE (10*1 + 90*2 + 156*3 + 256*2 + 1) /* 0..9 + 10..99 + 100..255 + 256*', ' + \0 */
626 char *buf = (char *)wmem_alloc(pinfo->pool, BUF_SIZE);
627 char *buf_top = buf;
629 if (len != 32) {
630 proto_tree_add_expert_format(tree, pinfo, &ei_t30_bad_length, tvb,
631 offset, tvb_reported_length_remaining(tvb, offset), "T30 PPR length must be 32 bytes");
632 col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET]");
633 return;
636 start_offset = offset;
637 for (frame=0; frame < 255; ) {
638 uint8_t octet = tvb_get_uint8(tvb, offset);
639 uint8_t bit = 1<<7;
641 for (;bit;) {
642 if (octet & bit) {
643 ++frame_count;
644 DISSECTOR_ASSERT((buf_top-buf) < BUF_SIZE);
645 buf_top += snprintf(buf_top, BUF_SIZE - (buf_top - buf), "%u, ", frame);
647 bit >>= 1;
648 ++frame;
650 ++offset;
652 proto_tree_add_uint(tree, hf_t30_partial_page_request_frame_count, tvb, offset, 1, frame_count);
653 if (buf_top > buf+1) {
654 buf_top[-2] = '\0';
655 proto_tree_add_string_format_value(tree, hf_t30_partial_page_request_frames, tvb, start_offset, offset - start_offset,
656 buf, "%s", buf);
659 col_append_fstr(pinfo->cinfo, COL_INFO, " - %d frames", frame_count);
662 static void
663 dissect_t30_dis_dtc(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree, bool dis_dtc, t38_packet_info* t38)
665 uint8_t octet;
667 if (len < 3) {
668 proto_tree_add_expert_format(tree, pinfo, &ei_t30_bad_length, tvb,
669 offset, tvb_reported_length_remaining(tvb, offset), "T30 DIS length must be at least 4 bytes");
670 col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET]");
671 return;
674 /* bits 1 to 8 */
675 proto_tree_add_item(tree, hf_t30_fif_sm, tvb, offset, 1, ENC_NA);
676 proto_tree_add_item(tree, hf_t30_fif_rtif, tvb, offset, 1, ENC_NA);
677 proto_tree_add_item(tree, hf_t30_fif_3gmn, tvb, offset, 1, ENC_NA);
678 if (dis_dtc) {
679 proto_tree_add_item(tree, hf_t30_fif_v8c, tvb, offset, 1, ENC_NA);
680 proto_tree_add_item(tree, hf_t30_fif_op, tvb, offset, 1, ENC_NA);
682 /* bits 9 to 16 */
683 offset += 1;
684 octet = tvb_get_uint8(tvb, offset);
686 if (dis_dtc)
687 proto_tree_add_item(tree, hf_t30_fif_rtfc, tvb, offset, 1, ENC_NA);
688 proto_tree_add_item(tree, hf_t30_fif_rfo, tvb, offset, 1, ENC_NA);
689 if (dis_dtc) {
690 proto_tree_add_item(tree, hf_t30_fif_dsr, tvb, offset, 1, ENC_BIG_ENDIAN);
692 col_append_fstr(pinfo->cinfo, COL_INFO, " - DSR:%s",
693 val_to_str_ext_const((octet&0x3C) >> 2, &t30_data_signalling_rate_vals_ext, "<unknown>"));
695 if (t38)
696 snprintf(t38->desc, MAX_T38_DESC,
697 "DSR:%s",
698 val_to_str_ext_const((octet&0x3C) >> 2, &t30_data_signalling_rate_vals_ext, "<unknown>"));
700 else {
701 proto_tree_add_item(tree, hf_t30_fif_dsr_dcs, tvb, offset, 1, ENC_BIG_ENDIAN);
703 col_append_fstr(pinfo->cinfo, COL_INFO, " - DSR:%s",
704 val_to_str_ext_const((octet&0x3C) >> 2, &t30_data_signalling_rate_dcs_vals_ext, "<unknown>"));
706 if (t38)
707 snprintf(t38->desc, MAX_T38_DESC,
708 "DSR:%s",
709 val_to_str_ext_const((octet&0x3C) >> 2, &t30_data_signalling_rate_dcs_vals_ext, "<unknown>"));
711 proto_tree_add_item(tree, hf_t30_fif_res, tvb, offset, 1, ENC_NA);
712 proto_tree_add_item(tree, hf_t30_fif_tdcc, tvb, offset, 1, ENC_NA);
714 /* bits 17 to 24 */
715 offset += 1;
716 octet = tvb_get_uint8(tvb, offset);
718 if (dis_dtc) {
719 proto_tree_add_item(tree, hf_t30_fif_rwc, tvb, offset, 1, ENC_BIG_ENDIAN);
720 proto_tree_add_item(tree, hf_t30_fif_rlc, tvb, offset, 1, ENC_BIG_ENDIAN);
721 proto_tree_add_item(tree, hf_t30_fif_msltcr, tvb, offset, 1, ENC_BIG_ENDIAN);
722 } else {
723 proto_tree_add_item(tree, hf_t30_fif_rw_dcs, tvb, offset, 1, ENC_BIG_ENDIAN);
724 proto_tree_add_item(tree, hf_t30_fif_rl_dcs, tvb, offset, 1, ENC_BIG_ENDIAN);
725 proto_tree_add_item(tree, hf_t30_fif_mslt_dcs, tvb, offset, 1, ENC_BIG_ENDIAN);
727 proto_tree_add_item(tree, hf_t30_fif_ext, tvb, offset, 1, ENC_NA);
729 if ( !(octet & 0x01) || (len < 4) )
730 return; /* no extension */
732 /* bits 25 to 32 */
733 offset += 1;
734 octet = tvb_get_uint8(tvb, offset);
736 proto_tree_add_item(tree, hf_t30_fif_cm, tvb, offset, 1, ENC_NA);
737 proto_tree_add_item(tree, hf_t30_fif_ecm, tvb, offset, 1, ENC_NA);
738 if (!dis_dtc)
739 proto_tree_add_item(tree, hf_t30_fif_fs_dcs, tvb, offset, 1, ENC_NA);
740 proto_tree_add_item(tree, hf_t30_fif_t6, tvb, offset, 1, ENC_NA);
741 proto_tree_add_item(tree, hf_t30_fif_ext, tvb, offset, 1, ENC_NA);
743 if ( !(octet & 0x01) || (len < 5) )
744 return; /* no extension */
746 /* bits 33 to 40 */
747 offset += 1;
748 octet = tvb_get_uint8(tvb, offset);
750 proto_tree_add_item(tree, hf_t30_fif_fvc, tvb, offset, 1, ENC_NA);
751 if (dis_dtc) {
752 proto_tree_add_item(tree, hf_t30_fif_mspc, tvb, offset, 1, ENC_NA);
753 proto_tree_add_item(tree, hf_t30_fif_ps, tvb, offset, 1, ENC_NA);
755 proto_tree_add_item(tree, hf_t30_fif_t43, tvb, offset, 1, ENC_NA);
756 proto_tree_add_item(tree, hf_t30_fif_pi, tvb, offset, 1, ENC_NA);
757 proto_tree_add_item(tree, hf_t30_fif_vc32k, tvb, offset, 1, ENC_NA);
758 proto_tree_add_item(tree, hf_t30_fif_ext, tvb, offset, 1, ENC_NA);
760 if ( !(octet & 0x01) || (len < 6) )
761 return; /* no extension */
763 /* bits 41 to 48 */
764 offset += 1;
765 octet = tvb_get_uint8(tvb, offset);
767 proto_tree_add_item(tree, hf_t30_fif_r8x15, tvb, offset, 1, ENC_NA);
768 proto_tree_add_item(tree, hf_t30_fif_300x300, tvb, offset, 1, ENC_NA);
769 proto_tree_add_item(tree, hf_t30_fif_r16x15, tvb, offset, 1, ENC_NA);
770 if (dis_dtc) {
771 proto_tree_add_item(tree, hf_t30_fif_ibrp, tvb, offset, 1, ENC_NA);
772 proto_tree_add_item(tree, hf_t30_fif_mbrp, tvb, offset, 1, ENC_NA);
773 proto_tree_add_item(tree, hf_t30_fif_msltchr, tvb, offset, 1, ENC_NA);
774 proto_tree_add_item(tree, hf_t30_fif_sp, tvb, offset, 1, ENC_NA);
775 } else {
776 proto_tree_add_item(tree, hf_t30_fif_rts, tvb, offset, 1, ENC_NA);
778 proto_tree_add_item(tree, hf_t30_fif_ext, tvb, offset, 1, ENC_NA);
780 if ( !(octet & 0x01) || (len < 7) )
781 return; /* no extension */
783 /* bits 49 to 56 */
784 offset += 1;
785 octet = tvb_get_uint8(tvb, offset);
787 proto_tree_add_item(tree, hf_t30_fif_sc, tvb, offset, 1, ENC_NA);
788 if (dis_dtc) {
789 proto_tree_add_item(tree, hf_t30_fif_passw, tvb, offset, 1, ENC_NA);
790 proto_tree_add_item(tree, hf_t30_fif_rttd, tvb, offset, 1, ENC_NA);
791 } else {
792 proto_tree_add_item(tree, hf_t30_fif_sit, tvb, offset, 1, ENC_NA);
794 proto_tree_add_item(tree, hf_t30_fif_bft, tvb, offset, 1, ENC_NA);
795 proto_tree_add_item(tree, hf_t30_fif_dtm, tvb, offset, 1, ENC_NA);
796 proto_tree_add_item(tree, hf_t30_fif_edi, tvb, offset, 1, ENC_NA);
797 proto_tree_add_item(tree, hf_t30_fif_ext, tvb, offset, 1, ENC_NA);
799 if ( !(octet & 0x01) || (len < 8) )
800 return; /* no extension */
802 /* bits 57 to 64 */
803 offset += 1;
804 octet = tvb_get_uint8(tvb, offset);
806 proto_tree_add_item(tree, hf_t30_fif_btm, tvb, offset, 1, ENC_NA);
807 if (dis_dtc)
808 proto_tree_add_item(tree, hf_t30_fif_rttcmmd, tvb, offset, 1, ENC_NA);
809 proto_tree_add_item(tree, hf_t30_fif_chrm, tvb, offset, 1, ENC_NA);
810 proto_tree_add_item(tree, hf_t30_fif_mm, tvb, offset, 1, ENC_NA);
811 proto_tree_add_item(tree, hf_t30_fif_ext, tvb, offset, 1, ENC_NA);
813 if ( !(octet & 0x01) || (len < 9) )
814 return; /* no extension */
816 /* bits 65 to 72 */
817 offset += 1;
818 octet = tvb_get_uint8(tvb, offset);
820 proto_tree_add_item(tree, hf_t30_fif_pm26, tvb, offset, 1, ENC_NA);
821 proto_tree_add_item(tree, hf_t30_fif_dnc, tvb, offset, 1, ENC_NA);
822 proto_tree_add_item(tree, hf_t30_fif_do, tvb, offset, 1, ENC_NA);
823 proto_tree_add_item(tree, hf_t30_fif_jpeg, tvb, offset, 1, ENC_NA);
824 proto_tree_add_item(tree, hf_t30_fif_fcm, tvb, offset, 1, ENC_NA);
825 if (!dis_dtc)
826 proto_tree_add_item(tree, hf_t30_fif_pht, tvb, offset, 1, ENC_NA);
827 proto_tree_add_item(tree, hf_t30_fif_12c, tvb, offset, 1, ENC_NA);
828 proto_tree_add_item(tree, hf_t30_fif_ext, tvb, offset, 1, ENC_NA);
830 if ( !(octet & 0x01) || (len < 10) )
831 return; /* no extension */
833 /* bits 73 to 80 */
834 offset += 1;
835 octet = tvb_get_uint8(tvb, offset);
837 proto_tree_add_item(tree, hf_t30_fif_ns, tvb, offset, 1, ENC_NA);
838 proto_tree_add_item(tree, hf_t30_fif_ci, tvb, offset, 1, ENC_NA);
839 proto_tree_add_item(tree, hf_t30_fif_cgr, tvb, offset, 1, ENC_NA);
840 proto_tree_add_item(tree, hf_t30_fif_nalet, tvb, offset, 1, ENC_NA);
841 proto_tree_add_item(tree, hf_t30_fif_naleg, tvb, offset, 1, ENC_NA);
842 proto_tree_add_item(tree, hf_t30_fif_spscb, tvb, offset, 1, ENC_NA);
843 proto_tree_add_item(tree, hf_t30_fif_spsco, tvb, offset, 1, ENC_NA);
844 proto_tree_add_item(tree, hf_t30_fif_ext, tvb, offset, 1, ENC_NA);
846 if ( !(octet & 0x01) || (len < 11) )
847 return; /* no extension */
849 /* bits 81 to 88 */
850 offset += 1;
851 octet = tvb_get_uint8(tvb, offset);
853 proto_tree_add_item(tree, hf_t30_fif_hkm, tvb, offset, 1, ENC_NA);
854 proto_tree_add_item(tree, hf_t30_fif_rsa, tvb, offset, 1, ENC_NA);
855 proto_tree_add_item(tree, hf_t30_fif_oc, tvb, offset, 1, ENC_NA);
856 proto_tree_add_item(tree, hf_t30_fif_hfx40, tvb, offset, 1, ENC_NA);
857 proto_tree_add_item(tree, hf_t30_fif_acn2c, tvb, offset, 1, ENC_NA);
858 proto_tree_add_item(tree, hf_t30_fif_acn3c, tvb, offset, 1, ENC_NA);
859 proto_tree_add_item(tree, hf_t30_fif_hfx40i, tvb, offset, 1, ENC_NA);
860 proto_tree_add_item(tree, hf_t30_fif_ext, tvb, offset, 1, ENC_NA);
862 if ( !(octet & 0x01) || (len < 12) )
863 return; /* no extension */
865 /* bits 89 to 96 */
866 offset += 1;
867 octet = tvb_get_uint8(tvb, offset);
869 proto_tree_add_item(tree, hf_t30_fif_ahsn2, tvb, offset, 1, ENC_NA);
870 proto_tree_add_item(tree, hf_t30_fif_ahsn3, tvb, offset, 1, ENC_NA);
871 proto_tree_add_item(tree, hf_t30_fif_t441, tvb, offset, 1, ENC_NA);
872 proto_tree_add_item(tree, hf_t30_fif_t442, tvb, offset, 1, ENC_NA);
873 proto_tree_add_item(tree, hf_t30_fif_t443, tvb, offset, 1, ENC_NA);
874 proto_tree_add_item(tree, hf_t30_fif_plmss, tvb, offset, 1, ENC_NA);
875 proto_tree_add_item(tree, hf_t30_fif_ext, tvb, offset, 1, ENC_NA);
877 if ( !(octet & 0x01) || (len < 13) )
878 return; /* no extension */
880 /* bits 97 to 104 */
881 offset += 1;
882 octet = tvb_get_uint8(tvb, offset);
884 proto_tree_add_item(tree, hf_t30_fif_cg300, tvb, offset, 1, ENC_NA);
885 proto_tree_add_item(tree, hf_t30_fif_100x100cg, tvb, offset, 1, ENC_NA);
886 proto_tree_add_item(tree, hf_t30_fif_spcbft, tvb, offset, 1, ENC_NA);
887 if (dis_dtc) {
888 proto_tree_add_item(tree, hf_t30_fif_ebft, tvb, offset, 1, ENC_NA);
889 proto_tree_add_item(tree, hf_t30_fif_isp, tvb, offset, 1, ENC_NA);
891 proto_tree_add_item(tree, hf_t30_fif_ira, tvb, offset, 1, ENC_NA);
892 proto_tree_add_item(tree, hf_t30_fif_ext, tvb, offset, 1, ENC_NA);
894 if ( !(octet & 0x01) || (len < 14) )
895 return; /* no extension */
897 /* bits 105 to 112 */
898 offset += 1;
899 octet = tvb_get_uint8(tvb, offset);
901 proto_tree_add_item(tree, hf_t30_fif_600x600, tvb, offset, 1, ENC_NA);
902 proto_tree_add_item(tree, hf_t30_fif_1200x1200, tvb, offset, 1, ENC_NA);
903 proto_tree_add_item(tree, hf_t30_fif_300x600, tvb, offset, 1, ENC_NA);
904 proto_tree_add_item(tree, hf_t30_fif_400x800, tvb, offset, 1, ENC_NA);
905 proto_tree_add_item(tree, hf_t30_fif_600x1200, tvb, offset, 1, ENC_NA);
906 proto_tree_add_item(tree, hf_t30_fif_cg600x600, tvb, offset, 1, ENC_NA);
907 proto_tree_add_item(tree, hf_t30_fif_cg1200x1200, tvb, offset, 1, ENC_NA);
908 proto_tree_add_item(tree, hf_t30_fif_ext, tvb, offset, 1, ENC_NA);
910 if ( !(octet & 0x01) || (len < 15) )
911 return; /* no extension */
913 /* bits 113 to 120 */
914 offset += 1;
915 octet = tvb_get_uint8(tvb, offset);
917 proto_tree_add_item(tree, hf_t30_fif_dspcam, tvb, offset, 1, ENC_NA);
918 proto_tree_add_item(tree, hf_t30_fif_dspccm, tvb, offset, 1, ENC_NA);
919 if (dis_dtc)
920 proto_tree_add_item(tree, hf_t30_fif_bwmrcp, tvb, offset, 1, ENC_NA);
921 proto_tree_add_item(tree, hf_t30_fif_t45, tvb, offset, 1, ENC_NA);
922 proto_tree_add_item(tree, hf_t30_fif_sdmc, tvb, offset, 1, ENC_BIG_ENDIAN);
923 proto_tree_add_item(tree, hf_t30_fif_ext, tvb, offset, 1, ENC_NA);
925 if ( !(octet & 0x01) )
926 return; /* no extension */
930 static int
931 dissect_t30_hdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
933 int offset = 0;
934 proto_item *it;
935 proto_tree *tr;
936 proto_tree *tr_fif;
937 proto_item *it_fcf;
938 uint8_t octet;
939 uint32_t frag_len;
940 proto_item *item;
941 t38_packet_info *t38 = (t38_packet_info*)data;
943 if (tvb_reported_length_remaining(tvb, offset) < 3) {
944 proto_tree_add_expert_format(tree, pinfo, &ei_t30_bad_length, tvb,
945 offset, tvb_reported_length_remaining(tvb, offset), "T30 length must be at least 4 bytes");
946 col_append_str(pinfo->cinfo, COL_INFO, " (HDLC Reassembled: [MALFORMED OR SHORT PACKET])");
947 return offset;
950 col_append_str(pinfo->cinfo, COL_INFO, " (HDLC Reassembled:");
952 it=proto_tree_add_protocol_format(tree, proto_t30, tvb, offset, -1,
953 "ITU-T Recommendation T.30");
954 tr=proto_item_add_subtree(it, ett_t30);
956 octet = tvb_get_uint8(tvb, offset);
957 item = proto_tree_add_item(tr, hf_t30_Address, tvb, offset, 1, ENC_BIG_ENDIAN);
958 if (octet != 0xFF)
959 expert_add_info(pinfo, item, &ei_t30_Address_FF);
960 offset += 1;
962 octet = tvb_get_uint8(tvb, offset);
963 item = proto_tree_add_item(tr, hf_t30_Control, tvb, offset, 1, ENC_BIG_ENDIAN);
964 if ((octet != 0xC0) && (octet != 0xC8))
965 expert_add_info(pinfo, item, &ei_t30_Control_C0C8);
966 offset += 1;
968 octet = tvb_get_uint8(tvb, offset);
969 it_fcf = proto_tree_add_item(tr, hf_t30_Facsimile_Control, tvb, offset, 1, ENC_BIG_ENDIAN);
970 offset += 1;
972 tr_fif = proto_item_add_subtree(it_fcf, ett_t30_fif);
974 frag_len = tvb_reported_length_remaining(tvb, offset);
975 if (t38)
976 t38->t30_Facsimile_Control = octet;
978 col_append_fstr(pinfo->cinfo, COL_INFO,
979 " %s - %s",
980 val_to_str_ext_const(octet & 0x7F, &t30_facsimile_control_field_vals_short_ext, "<unknown>"),
981 val_to_str_ext_const(octet & 0x7F, &t30_facsimile_control_field_vals_ext, "<unknown>") );
983 The T.30 spec has three groups of codes: 0000 XXXX, 1000 XXXX and X.......
984 bitmask here.
987 switch (octet) {
988 case T30_FC_DTC:
989 dissect_t30_dis_dtc(tvb, offset, pinfo, frag_len, tr_fif, true, t38);
990 break;
991 case T30_FC_CIG:
992 case T30_FC_PWD:
993 case T30_FC_SEP:
994 case T30_FC_PSA:
995 dissect_t30_numbers(tvb, offset, pinfo, frag_len, tr_fif, t38);
996 break;
997 case T30_FC_NSC:
998 dissect_t30_non_standard_cap(tvb, offset, pinfo, frag_len, tr_fif);
999 break;
1000 default:
1001 switch (octet & 0x7F) {
1002 case T30_FC_DIS:
1003 dissect_t30_dis_dtc(tvb, offset, pinfo, frag_len, tr_fif, true, t38);
1004 break;
1005 case T30_FC_DCS:
1006 dissect_t30_dis_dtc(tvb, offset, pinfo, frag_len, tr_fif, false, t38);
1007 break;
1008 case T30_FC_CSI:
1009 case T30_FC_TSI:
1010 case T30_FC_SUB:
1011 case T30_FC_SID:
1012 dissect_t30_numbers(tvb, offset, pinfo, frag_len, tr_fif, t38);
1013 break;
1014 case T30_FC_NSF:
1015 case T30_FC_NSS:
1016 dissect_t30_non_standard_cap(tvb, offset, pinfo, frag_len, tr_fif);
1017 break;
1018 case T30_FC_FCD:
1019 dissect_t30_facsimile_coded_data(tvb, offset, pinfo, frag_len, tr_fif, t38);
1020 break;
1021 case T30_FC_PPS:
1022 dissect_t30_partial_page_signal(tvb, offset, pinfo, frag_len, tr_fif, t38);
1023 break;
1024 case T30_FC_PPR:
1025 dissect_t30_partial_page_request(tvb, offset, pinfo, frag_len, tr_fif);
1026 break;
1030 col_append_str(pinfo->cinfo, COL_INFO, ")");
1032 return offset;
1035 /* Wireshark Protocol Registration */
1036 void
1037 proto_register_t30(void)
1039 static hf_register_info hf_t30[] =
1041 { &hf_t30_Address,
1042 { "Address", "t30.Address", FT_UINT8, BASE_HEX,
1043 NULL, 0, "Address Field", HFILL }},
1044 { &hf_t30_Control,
1045 { "Control", "t30.Control", FT_UINT8, BASE_HEX,
1046 VALS(t30_control_vals), 0, "Control Field", HFILL }},
1047 { &hf_t30_Facsimile_Control,
1048 { "Facsimile Control", "t30.FacsimileControl", FT_UINT8, BASE_DEC | BASE_EXT_STRING,
1049 &t30_facsimile_control_field_vals_ext, 0x7F, NULL, HFILL }},
1051 { &hf_t30_fif_sm,
1052 { "Store and forward Internet fax- Simple mode (ITU-T T.37)", "t30.fif.sm", FT_BOOLEAN, 8,
1053 TFS(&tfs_set_notset), 0x80, NULL, HFILL }},
1054 { &hf_t30_fif_rtif,
1055 { "Real-time Internet fax (ITU T T.38)", "t30.fif.rtif", FT_BOOLEAN, 8,
1056 TFS(&tfs_set_notset), 0x20, NULL, HFILL }},
1057 { &hf_t30_fif_3gmn,
1058 { "3rd Generation Mobile Network", "t30.fif.3gmn", FT_BOOLEAN, 8,
1059 TFS(&tfs_set_notset), 0x10, NULL, HFILL }},
1060 { &hf_t30_fif_v8c,
1061 { "V.8 capabilities", "t30.fif.v8c", FT_BOOLEAN, 8,
1062 TFS(&tfs_set_notset), 0x04, NULL, HFILL }},
1063 { &hf_t30_fif_op,
1064 { "Octets preferred", "t30.fif.op", FT_BOOLEAN, 8,
1065 TFS(&t30_octets_preferred_value), 0x02, NULL, HFILL }},
1066 { &hf_t30_fif_rtfc,
1067 { "Ready to transmit a facsimile document (polling)", "t30.fif.rtfc", FT_BOOLEAN, 8,
1068 TFS(&tfs_set_notset), 0x80, NULL, HFILL }},
1069 { &hf_t30_fif_rfo,
1070 { "Receiver fax operation", "t30.fif.rfo", FT_BOOLEAN, 8,
1071 TFS(&tfs_set_notset), 0x40, NULL, HFILL }},
1072 { &hf_t30_fif_dsr,
1073 { "Data signalling rate", "t30.fif.dsr", FT_UINT8, BASE_HEX | BASE_EXT_STRING,
1074 &t30_data_signalling_rate_vals_ext, 0x3C, NULL, HFILL }},
1075 { &hf_t30_fif_dsr_dcs,
1076 { "Data signalling rate", "t30.fif.dsr_dcs", FT_UINT8, BASE_HEX | BASE_EXT_STRING,
1077 &t30_data_signalling_rate_dcs_vals_ext, 0x3C, NULL, HFILL }},
1078 { &hf_t30_fif_res,
1079 { "R8x7.7 lines/mm and/or 200x200 pels/25.4 mm", "t30.fif.res", FT_BOOLEAN, 8,
1080 TFS(&tfs_set_notset), 0x02, NULL, HFILL }},
1081 { &hf_t30_fif_tdcc,
1082 { "Two dimensional coding capability", "t30.fif.tdcc", FT_BOOLEAN, 8,
1083 TFS(&tfs_set_notset), 0x01, NULL, HFILL }},
1084 { &hf_t30_fif_rwc,
1085 { "Recording width capabilities", "t30.fif.rwc", FT_UINT8, BASE_HEX,
1086 VALS(t30_recording_width_capabilities_vals), 0xC0, NULL, HFILL }},
1087 { &hf_t30_fif_rw_dcs,
1088 { "Recording width", "t30.fif.rw_dcs", FT_UINT8, BASE_HEX,
1089 VALS(t30_recording_width_dcs_vals), 0xC0, NULL, HFILL }},
1090 { &hf_t30_fif_rlc,
1091 { "Recording length capability", "t30.fif.rlc", FT_UINT8, BASE_HEX,
1092 VALS(t30_recording_length_capability_vals), 0x30, NULL, HFILL }},
1093 { &hf_t30_fif_rl_dcs,
1094 { "Recording length capability", "t30.fif.rl_dcs", FT_UINT8, BASE_HEX,
1095 VALS(t30_recording_length_dcs_vals), 0x30, NULL, HFILL }},
1096 { &hf_t30_fif_msltcr,
1097 { "Minimum scan line time capability at the receiver", "t30.fif.msltcr", FT_UINT8, BASE_HEX,
1098 VALS(t30_minimum_scan_line_time_rec_vals), 0x0E, NULL, HFILL }},
1099 { &hf_t30_fif_mslt_dcs,
1100 { "Minimum scan line time", "t30.fif.mslt_dcs", FT_UINT8, BASE_HEX,
1101 VALS(t30_minimum_scan_line_time_dcs_vals), 0x0E, NULL, HFILL }},
1102 { &hf_t30_fif_ext,
1103 { "Extension indicator", "t30.fif.ext", FT_BOOLEAN, 8,
1104 TFS(&t30_extension_ind_value), 0x01, NULL, HFILL }},
1106 { &hf_t30_fif_cm,
1107 { "Compress/Uncompress mode", "t30.fif.cm", FT_BOOLEAN, 8,
1108 TFS(&t30_compress_value), 0x40, NULL, HFILL }},
1109 { &hf_t30_fif_ecm,
1110 { "Error correction mode", "t30.fif.ecm", FT_BOOLEAN, 8,
1111 TFS(&tfs_set_notset), 0x20, NULL, HFILL }},
1112 { &hf_t30_fif_fs_dcs,
1113 { "Frame size", "t30.fif.fs_dcm", FT_BOOLEAN, 8,
1114 TFS(&t30_frame_size_dcs_value), 0x10, NULL, HFILL }},
1115 { &hf_t30_fif_t6,
1116 { "T.6 coding capability", "t30.fif.t6", FT_BOOLEAN, 8,
1117 TFS(&tfs_set_notset), 0x02, NULL, HFILL }},
1119 { &hf_t30_fif_fvc,
1120 { "Field valid capability", "t30.fif.fvc", FT_BOOLEAN, 8,
1121 TFS(&tfs_set_notset), 0x80, NULL, HFILL }},
1122 { &hf_t30_fif_mspc,
1123 { "Multiple selective polling capability", "t30.fif.mspc", FT_BOOLEAN, 8,
1124 TFS(&tfs_set_notset), 0x40, NULL, HFILL }},
1125 { &hf_t30_fif_ps,
1126 { "Polled Subaddress", "t30.fif.ps", FT_BOOLEAN, 8,
1127 TFS(&tfs_set_notset), 0x20, NULL, HFILL }},
1128 { &hf_t30_fif_t43,
1129 { "T.43 coding", "t30.fif.t43", FT_BOOLEAN, 8,
1130 TFS(&tfs_set_notset), 0x10, NULL, HFILL }},
1131 { &hf_t30_fif_pi,
1132 { "Plane interleave", "t30.fif.pi", FT_BOOLEAN, 8,
1133 TFS(&tfs_set_notset), 0x08, NULL, HFILL }},
1134 { &hf_t30_fif_vc32k,
1135 { "Voice coding with 32k ADPCM (ITU T G.726)", "t30.fif.vc32k", FT_BOOLEAN, 8,
1136 TFS(&tfs_set_notset), 0x04, NULL, HFILL }},
1138 { &hf_t30_fif_r8x15,
1139 { "R8x15.4 lines/mm", "t30.fif.r8x15", FT_BOOLEAN, 8,
1140 TFS(&tfs_set_notset), 0x80, NULL, HFILL }},
1141 { &hf_t30_fif_300x300,
1142 { "300x300 pels/25.4 mm", "t30.fif.300x300", FT_BOOLEAN, 8,
1143 TFS(&tfs_set_notset), 0x40, NULL, HFILL }},
1144 { &hf_t30_fif_r16x15,
1145 { "R16x15.4 lines/mm and/or 400x400 pels/25.4 mm", "t30.fif.r16x15", FT_BOOLEAN, 8,
1146 TFS(&tfs_set_notset), 0x20, NULL, HFILL }},
1147 { &hf_t30_fif_ibrp,
1148 { "Inch based resolution preferred", "t30.fif.ibrp", FT_BOOLEAN, 8,
1149 TFS(&tfs_set_notset), 0x10, NULL, HFILL }},
1150 { &hf_t30_fif_mbrp,
1151 { "Metric based resolution preferred", "t30.fif.mbrp", FT_BOOLEAN, 8,
1152 TFS(&tfs_set_notset), 0x08, NULL, HFILL }},
1153 { &hf_t30_fif_msltchr,
1154 { "Minimum scan line time capability for higher resolutions", "t30.fif.msltchr", FT_BOOLEAN, 8,
1155 TFS(&t30_minimum_scan_value), 0x04, NULL, HFILL }},
1156 { &hf_t30_fif_rts,
1157 { "Resolution type selection", "t30.fif.rts", FT_BOOLEAN, 8,
1158 TFS(&t30_res_type_sel_value), 0x10, NULL, HFILL }},
1159 { &hf_t30_fif_sp,
1160 { "Selective polling", "t30.fif.sp", FT_BOOLEAN, 8,
1161 TFS(&tfs_set_notset), 0x02, NULL, HFILL }},
1163 { &hf_t30_fif_sc,
1164 { "Subaddressing capability", "t30.fif.sc", FT_BOOLEAN, 8,
1165 TFS(&tfs_set_notset), 0x80, NULL, HFILL }},
1166 { &hf_t30_fif_passw,
1167 { "Password", "t30.fif.passw", FT_BOOLEAN, 8,
1168 TFS(&tfs_set_notset), 0x40, NULL, HFILL }},
1169 { &hf_t30_fif_sit,
1170 { "Sender Identification transmission", "t30.fif.sit", FT_BOOLEAN, 8,
1171 TFS(&tfs_set_notset), 0x40, NULL, HFILL }},
1172 { &hf_t30_fif_rttd,
1173 { "Ready to transmit a data file (polling)", "t30.fif.rttd", FT_BOOLEAN, 8,
1174 TFS(&tfs_set_notset), 0x20, NULL, HFILL }},
1175 { &hf_t30_fif_bft,
1176 { "Binary File Transfer (BFT)", "t30.fif.bft", FT_BOOLEAN, 8,
1177 TFS(&tfs_set_notset), 0x08, NULL, HFILL }},
1178 { &hf_t30_fif_dtm,
1179 { "Document Transfer Mode (DTM)", "t30.fif.dtm", FT_BOOLEAN, 8,
1180 TFS(&tfs_set_notset), 0x04, NULL, HFILL }},
1181 { &hf_t30_fif_edi,
1182 { "Electronic Data Interchange (EDI)", "t30.fif.edi", FT_BOOLEAN, 8,
1183 TFS(&tfs_set_notset), 0x02, NULL, HFILL }},
1185 { &hf_t30_fif_btm,
1186 { "Basic Transfer Mode (BTM)", "t30.fif.btm", FT_BOOLEAN, 8,
1187 TFS(&tfs_set_notset), 0x80, NULL, HFILL }},
1188 { &hf_t30_fif_rttcmmd,
1189 { "Ready to transmit a character or mixed mode document (polling)", "t30.fif.rttcmmd", FT_BOOLEAN, 8,
1190 TFS(&tfs_set_notset), 0x20, NULL, HFILL }},
1191 { &hf_t30_fif_chrm,
1192 { "Character mode", "t30.fif.chrm", FT_BOOLEAN, 8,
1193 TFS(&tfs_set_notset), 0x10, NULL, HFILL }},
1194 { &hf_t30_fif_mm,
1195 { "Mixed mode (Annex E/T.4)", "t30.fif.mm", FT_BOOLEAN, 8,
1196 TFS(&tfs_set_notset), 0x04, NULL, HFILL }},
1198 { &hf_t30_fif_pm26,
1199 { "Processable mode 26 (ITU T T.505)", "t30.fif.pm26", FT_BOOLEAN, 8,
1200 TFS(&tfs_set_notset), 0x80, NULL, HFILL }},
1201 { &hf_t30_fif_dnc,
1202 { "Digital network capability", "t30.fif.dnc", FT_BOOLEAN, 8,
1203 TFS(&tfs_set_notset), 0x40, NULL, HFILL }},
1204 { &hf_t30_fif_do,
1205 { "Duplex operation", "t30.fif.do", FT_BOOLEAN, 8,
1206 TFS(&t30_duplex_operation_value), 0x20, NULL, HFILL }},
1207 { &hf_t30_fif_jpeg,
1208 { "JPEG coding", "t30.fif.jpeg", FT_BOOLEAN, 8,
1209 TFS(&tfs_set_notset), 0x10, NULL, HFILL }},
1210 { &hf_t30_fif_fcm,
1211 { "Full colour mode", "t30.fif.fcm", FT_BOOLEAN, 8,
1212 TFS(&tfs_set_notset), 0x08, NULL, HFILL }},
1213 { &hf_t30_fif_pht,
1214 { "Preferred Huffman tables", "t30.fif.pht", FT_BOOLEAN, 8,
1215 TFS(&tfs_set_notset), 0x08, NULL, HFILL }},
1216 { &hf_t30_fif_12c,
1217 { "12 bits/pel component", "t30.fif.12c", FT_BOOLEAN, 8,
1218 TFS(&tfs_set_notset), 0x02, NULL, HFILL }},
1220 { &hf_t30_fif_ns,
1221 { "No subsampling (1:1:1)", "t30.fif.ns", FT_BOOLEAN, 8,
1222 TFS(&tfs_set_notset), 0x80, NULL, HFILL }},
1223 { &hf_t30_fif_ci,
1224 { "Custom illuminant", "t30.fif.ci", FT_BOOLEAN, 8,
1225 TFS(&tfs_set_notset), 0x40, NULL, HFILL }},
1226 { &hf_t30_fif_cgr,
1227 { "Custom gamut range", "t30.fif.cgr", FT_BOOLEAN, 8,
1228 TFS(&tfs_set_notset), 0x20, NULL, HFILL }},
1229 { &hf_t30_fif_nalet,
1230 { "North American Letter (215.9 x 279.4 mm) capability", "t30.fif.nalet", FT_BOOLEAN, 8,
1231 TFS(&tfs_set_notset), 0x10, NULL, HFILL }},
1232 { &hf_t30_fif_naleg,
1233 { "North American Legal (215.9 x 355.6 mm) capability", "t30.fif.naleg", FT_BOOLEAN, 8,
1234 TFS(&tfs_set_notset), 0x08, NULL, HFILL }},
1235 { &hf_t30_fif_spscb,
1236 { "Single-progression sequential coding (ITU-T T.85) basic capability", "t30.fif.spscb", FT_BOOLEAN, 8,
1237 TFS(&tfs_set_notset), 0x04, NULL, HFILL }},
1238 { &hf_t30_fif_spsco,
1239 { "Single-progression sequential coding (ITU-T T.85) optional L0 capability", "t30.fif.spsco", FT_BOOLEAN, 8,
1240 TFS(&tfs_set_notset), 0x02, NULL, HFILL }},
1242 { &hf_t30_fif_hkm,
1243 { "HKM key management capability", "t30.fif.hkm", FT_BOOLEAN, 8,
1244 TFS(&tfs_set_notset), 0x80, NULL, HFILL }},
1245 { &hf_t30_fif_rsa,
1246 { "RSA key management capability", "t30.fif.rsa", FT_BOOLEAN, 8,
1247 TFS(&tfs_set_notset), 0x40, NULL, HFILL }},
1248 { &hf_t30_fif_oc,
1249 { "Override capability", "t30.fif.oc", FT_BOOLEAN, 8,
1250 TFS(&tfs_set_notset), 0x20, NULL, HFILL }},
1251 { &hf_t30_fif_hfx40,
1252 { "HFX40 cipher capability", "t30.fif.hfx40", FT_BOOLEAN, 8,
1253 TFS(&tfs_set_notset), 0x10, NULL, HFILL }},
1254 { &hf_t30_fif_acn2c,
1255 { "Alternative cipher number 2 capability", "t30.fif.acn2c", FT_BOOLEAN, 8,
1256 TFS(&tfs_set_notset), 0x08, NULL, HFILL }},
1257 { &hf_t30_fif_acn3c,
1258 { "Alternative cipher number 3 capability", "t30.fif.acn3c", FT_BOOLEAN, 8,
1259 TFS(&tfs_set_notset), 0x04, NULL, HFILL }},
1260 { &hf_t30_fif_hfx40i,
1261 { "HFX40-I hashing capability", "t30.fif.hfx40i", FT_BOOLEAN, 8,
1262 TFS(&tfs_set_notset), 0x02, NULL, HFILL }},
1264 { &hf_t30_fif_ahsn2,
1265 { "Alternative hashing system number 2 capability", "t30.fif.ahsn2", FT_BOOLEAN, 8,
1266 TFS(&tfs_set_notset), 0x80, NULL, HFILL }},
1267 { &hf_t30_fif_ahsn3,
1268 { "Alternative hashing system number 3 capability", "t30.fif.ahsn3", FT_BOOLEAN, 8,
1269 TFS(&tfs_set_notset), 0x40, NULL, HFILL }},
1270 { &hf_t30_fif_t441,
1271 { "T.44 (Mixed Raster Content)", "t30.fif.t441", FT_BOOLEAN, 8,
1272 TFS(&tfs_set_notset), 0x10, NULL, HFILL }},
1273 { &hf_t30_fif_t442,
1274 { "T.44 (Mixed Raster Content)", "t30.fif.t442", FT_BOOLEAN, 8,
1275 TFS(&tfs_set_notset), 0x08, NULL, HFILL }},
1276 { &hf_t30_fif_t443,
1277 { "T.44 (Mixed Raster Content)", "t30.fif.t443", FT_BOOLEAN, 8,
1278 TFS(&tfs_set_notset), 0x04, NULL, HFILL }},
1279 { &hf_t30_fif_plmss,
1280 { "Page length maximum strip size for T.44 (Mixed Raster Content)", "t30.fif.plmss", FT_BOOLEAN, 8,
1281 TFS(&tfs_set_notset), 0x02, NULL, HFILL }},
1283 { &hf_t30_fif_cg300,
1284 { "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,
1285 TFS(&tfs_set_notset), 0x80, NULL, HFILL }},
1286 { &hf_t30_fif_100x100cg,
1287 { "100 pels/25.4 mm x 100 lines/25.4 mm for colour/gray scale", "t30.fif.100x100cg", FT_BOOLEAN, 8,
1288 TFS(&tfs_set_notset), 0x40, NULL, HFILL }},
1289 { &hf_t30_fif_spcbft,
1290 { "Simple Phase C BFT Negotiations capability", "t30.fif.spcbft", FT_BOOLEAN, 8,
1291 TFS(&tfs_set_notset), 0x20, NULL, HFILL }},
1292 { &hf_t30_fif_ebft,
1293 { "Extended BFT Negotiations capability", "t30.fif.ebft", FT_BOOLEAN, 8,
1294 TFS(&tfs_set_notset), 0x10, NULL, HFILL }},
1295 { &hf_t30_fif_isp,
1296 { "Internet Selective Polling Address (ISP)", "t30.fif.isp", FT_BOOLEAN, 8,
1297 TFS(&tfs_set_notset), 0x08, NULL, HFILL }},
1298 { &hf_t30_fif_ira,
1299 { "Internet Routing Address (IRA)", "t30.fif.ira", FT_BOOLEAN, 8,
1300 TFS(&tfs_set_notset), 0x04, NULL, HFILL }},
1302 { &hf_t30_fif_600x600,
1303 { "600 pels/25.4 mm x 600 lines/25.4 mm", "t30.fif.600x600", FT_BOOLEAN, 8,
1304 TFS(&tfs_set_notset), 0x80, NULL, HFILL }},
1305 { &hf_t30_fif_1200x1200,
1306 { "1200 pels/25.4 mm x 1200 lines/25.4 mm", "t30.fif.1200x1200", FT_BOOLEAN, 8,
1307 TFS(&tfs_set_notset), 0x40, NULL, HFILL }},
1308 { &hf_t30_fif_300x600,
1309 { "300 pels/25.4 mm x 600 lines/25.4 mm", "t30.fif.300x600", FT_BOOLEAN, 8,
1310 TFS(&tfs_set_notset), 0x20, NULL, HFILL }},
1311 { &hf_t30_fif_400x800,
1312 { "400 pels/25.4 mm x 800 lines/25.4 mm", "t30.fif.400x800", FT_BOOLEAN, 8,
1313 TFS(&tfs_set_notset), 0x10, NULL, HFILL }},
1314 { &hf_t30_fif_600x1200,
1315 { "600 pels/25.4 mm x 1200 lines/25.4 mm", "t30.fif.600x1200", FT_BOOLEAN, 8,
1316 TFS(&tfs_set_notset), 0x08, NULL, HFILL }},
1317 { &hf_t30_fif_cg600x600,
1318 { "Colour/gray scale 600 pels/25.4 mm x 600 lines/25.4 mm resolution", "t30.fif.cg600x600", FT_BOOLEAN, 8,
1319 TFS(&tfs_set_notset), 0x04, NULL, HFILL }},
1320 { &hf_t30_fif_cg1200x1200,
1321 { "Colour/gray scale 1200 pels/25.4 mm x 1200 lines/25.4 mm resolution", "t30.fif.cg1200x1200", FT_BOOLEAN, 8,
1322 TFS(&tfs_set_notset), 0x02, NULL, HFILL }},
1324 { &hf_t30_fif_dspcam,
1325 { "Double sided printing capability (alternate mode)", "t30.fif.dspcam", FT_BOOLEAN, 8,
1326 TFS(&tfs_set_notset), 0x80, NULL, HFILL }},
1327 { &hf_t30_fif_dspccm,
1328 { "Double sided printing capability (continuous mode)", "t30.fif.dspccm", FT_BOOLEAN, 8,
1329 TFS(&tfs_set_notset), 0x40, NULL, HFILL }},
1330 { &hf_t30_fif_bwmrcp,
1331 { "Black and white mixed raster content profile (MRCbw)", "t30.fif.bwmrcp", FT_BOOLEAN, 8,
1332 TFS(&tfs_set_notset), 0x20, NULL, HFILL }},
1333 { &hf_t30_fif_t45,
1334 { "T.45 (run length colour encoding)", "t30.fif.t45", FT_BOOLEAN, 8,
1335 TFS(&tfs_set_notset), 0x10, NULL, HFILL }},
1336 { &hf_t30_fif_sdmc,
1337 { "SharedDataMemory capacity", "t30.fif.sdmc", FT_UINT8, BASE_HEX,
1338 VALS(t30_SharedDataMemory_capacity_vals), 0x0C, NULL, HFILL }},
1340 { &hf_t30_fif_number,
1341 { "Number", "t30.fif.number", FT_STRING, BASE_NONE,
1342 NULL, 0x0, NULL, HFILL }},
1344 { &hf_t30_fif_country_code,
1345 { "ITU-T Country code", "t30.fif.country_code", FT_UINT8, BASE_DEC,
1346 NULL, 0, NULL, HFILL }},
1347 { &hf_t30_fif_non_stand_bytes,
1348 { "Non-standard capabilities", "t30.fif.non_standard_cap", FT_BYTES, BASE_NONE,
1349 NULL, 0, NULL, HFILL }},
1351 { &hf_t30_t4_frame_num,
1352 { "T.4 Frame number", "t30.t4.frame_num", FT_UINT8, BASE_DEC,
1353 NULL, 0, NULL, HFILL }},
1354 { &hf_t30_t4_data,
1355 { "T.4 Facsimile data field", "t30.t4.data", FT_BYTES, BASE_NONE,
1356 NULL, 0, NULL, HFILL }},
1358 { &hf_t30_partial_page_fcf2,
1359 { "Post-message command", "t30.pps.fcf2", FT_UINT8, BASE_DEC,
1360 VALS(t30_partial_page_fcf2_vals), 0, NULL, HFILL }},
1361 { &hf_t30_partial_page_i1,
1362 { "Page counter", "t30.t4.page_count", FT_UINT8, BASE_DEC,
1363 NULL, 0, NULL, HFILL }},
1364 { &hf_t30_partial_page_i2,
1365 { "Block counter", "t30.t4.block_count", FT_UINT8, BASE_DEC,
1366 NULL, 0, NULL, HFILL }},
1367 { &hf_t30_partial_page_i3,
1368 { "Frame counter", "t30.t4.frame_count", FT_UINT8, BASE_DEC,
1369 NULL, 0, NULL, HFILL }},
1371 { &hf_t30_partial_page_request_frame_count,
1372 { "Frame counter", "t30.ppr.frame_count", FT_UINT8, BASE_DEC,
1373 NULL, 0, NULL, HFILL }},
1374 { &hf_t30_partial_page_request_frames,
1375 { "Frames", "t30.ppr.frames", FT_STRING, BASE_NONE,
1376 NULL, 0x0, NULL, HFILL }},
1380 static int *t30_ett[] =
1382 &ett_t30,
1383 &ett_t30_fif,
1386 static ei_register_info ei[] = {
1387 { &ei_t30_bad_length, { "t30.bad_length", PI_MALFORMED, PI_ERROR, "Bad length", EXPFILL }},
1388 { &ei_t30_Address_FF, { "t30.Address.FF", PI_REASSEMBLE, PI_WARN, "T30 Address must be 0xFF", EXPFILL }},
1389 { &ei_t30_Control_C0C8, { "t30.Control.C0C8", PI_REASSEMBLE, PI_WARN, "T30 Control Field must be 0xC0 or 0xC8", EXPFILL }},
1392 expert_module_t* expert_t30;
1394 /* T30 */
1395 proto_t30 = proto_register_protocol("T.30", "T.30", "t30");
1396 proto_register_field_array(proto_t30, hf_t30, array_length(hf_t30));
1397 proto_register_subtree_array(t30_ett, array_length(t30_ett));
1398 expert_t30 = expert_register_protocol(proto_t30);
1399 expert_register_field_array(expert_t30, ei, array_length(ei));
1401 register_dissector("t30.hdlc", dissect_t30_hdlc, proto_t30);
1406 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1408 * Local variables:
1409 * c-basic-offset: 4
1410 * tab-width: 8
1411 * indent-tabs-mode: nil
1412 * End:
1414 * vi: set shiftwidth=4 tabstop=8 expandtab:
1415 * :indentSize=4:tabSize=8:noTabs=true: