2 * Routines for T.30 packet dissection
3 * 2006 Alejandro Vaquero, add T30 reassemble and dissection
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
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.
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.
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.
31 #include <epan/packet.h>
32 #include <epan/expert.h>
36 #include "packet-t38.h"
37 #include <epan/prefs.h>
38 #include <epan/emem.h>
41 static int proto_t30 = -1;
42 static int hf_t30_Address = -1;
43 static int hf_t30_Control = -1;
44 static int hf_t30_Facsimile_Control = -1;
45 static int hf_t30_fif_sm = -1;
46 static int hf_t30_fif_rtif = -1;
47 static int hf_t30_fif_3gmn = -1;
48 static int hf_t30_fif_v8c = -1;
49 static int hf_t30_fif_op = -1;
50 static int hf_t30_fif_rtfc = -1;
51 static int hf_t30_fif_rfo = -1;
52 static int hf_t30_fif_dsr = -1;
53 static int hf_t30_fif_dsr_dcs = -1;
54 static int hf_t30_fif_res = -1;
55 static int hf_t30_fif_tdcc = -1;
56 static int hf_t30_fif_rwc = -1;
57 static int hf_t30_fif_rw_dcs = -1;
58 static int hf_t30_fif_rlc = -1;
59 static int hf_t30_fif_rl_dcs = -1;
60 static int hf_t30_fif_msltcr = -1;
61 static int hf_t30_fif_mslt_dcs = -1;
62 static int hf_t30_fif_ext = -1;
63 static int hf_t30_fif_cm = -1;
64 static int hf_t30_fif_ecm = -1;
65 static int hf_t30_fif_fs_dcs = -1;
66 static int hf_t30_fif_t6 = -1;
67 static int hf_t30_fif_fvc = -1;
68 static int hf_t30_fif_mspc = -1;
69 static int hf_t30_fif_ps = -1;
70 static int hf_t30_fif_t43 = -1;
71 static int hf_t30_fif_pi = -1;
72 static int hf_t30_fif_vc32k = -1;
73 static int hf_t30_fif_r8x15 = -1;
74 static int hf_t30_fif_300x300 = -1;
75 static int hf_t30_fif_r16x15 = -1;
76 static int hf_t30_fif_ibrp = -1;
77 static int hf_t30_fif_mbrp = -1;
78 static int hf_t30_fif_msltchr = -1;
79 static int hf_t30_fif_rts = -1;
80 static int hf_t30_fif_sp = -1;
81 static int hf_t30_fif_sc = -1;
82 static int hf_t30_fif_passw = -1;
83 static int hf_t30_fif_sit = -1;
84 static int hf_t30_fif_rttd = -1;
85 static int hf_t30_fif_bft = -1;
86 static int hf_t30_fif_dtm = -1;
87 static int hf_t30_fif_edi = -1;
88 static int hf_t30_fif_btm = -1;
89 static int hf_t30_fif_rttcmmd = -1;
90 static int hf_t30_fif_chrm = -1;
91 static int hf_t30_fif_mm = -1;
92 static int hf_t30_fif_pm26 = -1;
93 static int hf_t30_fif_dnc = -1;
94 static int hf_t30_fif_do = -1;
95 static int hf_t30_fif_jpeg = -1;
96 static int hf_t30_fif_fcm = -1;
97 static int hf_t30_fif_pht = -1;
98 static int hf_t30_fif_12c = -1;
99 static int hf_t30_fif_ns = -1;
100 static int hf_t30_fif_ci = -1;
101 static int hf_t30_fif_cgr = -1;
102 static int hf_t30_fif_nalet = -1;
103 static int hf_t30_fif_naleg = -1;
104 static int hf_t30_fif_spscb = -1;
105 static int hf_t30_fif_spsco = -1;
106 static int hf_t30_fif_hkm = -1;
107 static int hf_t30_fif_rsa = -1;
108 static int hf_t30_fif_oc = -1;
109 static int hf_t30_fif_hfx40 = -1;
110 static int hf_t30_fif_acn2c = -1;
111 static int hf_t30_fif_acn3c = -1;
112 static int hf_t30_fif_hfx40i = -1;
113 static int hf_t30_fif_ahsn2 = -1;
114 static int hf_t30_fif_ahsn3 = -1;
115 static int hf_t30_fif_t441 = -1;
116 static int hf_t30_fif_t442 = -1;
117 static int hf_t30_fif_t443 = -1;
118 static int hf_t30_fif_plmss = -1;
119 static int hf_t30_fif_cg300 = -1;
120 static int hf_t30_fif_100x100cg = -1;
121 static int hf_t30_fif_spcbft = -1;
122 static int hf_t30_fif_ebft = -1;
123 static int hf_t30_fif_isp = -1;
124 static int hf_t30_fif_ira = -1;
125 static int hf_t30_fif_600x600 = -1;
126 static int hf_t30_fif_1200x1200 = -1;
127 static int hf_t30_fif_300x600 = -1;
128 static int hf_t30_fif_400x800 = -1;
129 static int hf_t30_fif_600x1200 = -1;
130 static int hf_t30_fif_cg600x600 = -1;
131 static int hf_t30_fif_cg1200x1200 = -1;
132 static int hf_t30_fif_dspcam = -1;
133 static int hf_t30_fif_dspccm = -1;
134 static int hf_t30_fif_bwmrcp = -1;
135 static int hf_t30_fif_t45 = -1;
136 static int hf_t30_fif_sdmc = -1;
137 static int hf_t30_fif_number = -1;
138 static int hf_t30_fif_country_code = -1;
139 static int hf_t30_fif_non_stand_bytes = -1;
140 static int hf_t30_t4_frame_num = -1;
141 static int hf_t30_t4_data = -1;
142 static int hf_t30_partial_page_fcf2 = -1;
143 static int hf_t30_partial_page_i1 = -1;
144 static int hf_t30_partial_page_i2 = -1;
145 static int hf_t30_partial_page_i3 = -1;
147 static gint ett_t30 = -1;
148 static gint ett_t30_fif = -1;
150 static const value_string t30_control_vals[] = {
151 { 0xC0, "non-final frames within the procedure" },
152 { 0xC8, "final frames within the procedure" },
156 #define T30_FC_DIS 0x01
157 #define T30_FC_CSI 0x02
158 #define T30_FC_NSF 0x04
159 #define T30_FC_DTC 0x81
160 #define T30_FC_CIG 0x82
161 #define T30_FC_NSC 0x84
162 #define T30_FC_PWD 0x83
163 #define T30_FC_SEP 0x85
164 #define T30_FC_PSA 0x86
165 #define T30_FC_CIA 0x87
166 #define T30_FC_ISP 0x88
167 #define T30_FC_DCS 0x41
168 #define T30_FC_TSI 0x42
169 #define T30_FC_NSS 0x44
170 #define T30_FC_SUB 0x43
171 #define T30_FC_SID 0x45
172 #define T30_FC_TSA 0x46
173 #define T30_FC_IRA 0x47
174 #define T30_FC_CFR 0x21
175 #define T30_FC_FTT 0x22
176 #define T30_FC_CSA 0x24
177 #define T30_FC_EOM 0x71
178 #define T30_FC_MPS 0x72
179 #define T30_FC_EOP 0x74
180 #define T30_FC_PRI_EOM 0x79
181 #define T30_FC_PRI_MPS 0x7A
182 #define T30_FC_PRI_EOP 0x7C
183 #define T30_FC_PRI_EOP2 0x78
184 #define T30_FC_MCF 0x31
185 #define T30_FC_RTP 0x33
186 #define T30_FC_RTN 0x32
187 #define T30_FC_PIP 0x35
188 #define T30_FC_PIN 0x34
189 #define T30_FC_FDM 0x3F
190 #define T30_FC_DCN 0x5F
191 #define T30_FC_CRP 0x58
192 #define T30_FC_FNV 0x53
193 #define T30_FC_TNR 0x57
194 #define T30_FC_TR 0x56
195 #define T30_FC_MCF 0x31
196 #define T30_FC_PID 0x36
197 #define T30_FC_PPR 0x3D
198 #define T30_FC_RNR 0x37
199 #define T30_FC_CRP 0x58
200 #define T30_FC_CTC 0x48
201 #define T30_FC_CTR 0x23
202 #define T30_FC_PPS 0x7D
203 #define T30_FC_EOR 0x73
204 #define T30_FC_RR 0x76
205 #define T30_FC_ERR 0x38
206 #define T30_FC_FCD 0x60
207 #define T30_FC_RCP 0x61
209 const value_string t30_facsimile_control_field_vals[] = {
210 { T30_FC_DIS, "Digital Identification Signal" },
211 { T30_FC_CSI, "Called Subscriber Identification" },
212 { T30_FC_NSF, "Non-Standard Facilities" },
213 { T30_FC_DTC, "Digital Transmit Command" },
214 { T30_FC_CIG, "Calling Subscriber Identification" },
215 { T30_FC_NSC, "Non-Standard facilities Command" },
216 { T30_FC_PWD, "Password" },
217 { T30_FC_SEP, "Selective Polling" },
218 { T30_FC_PSA, "Polled Subaddress" },
219 { T30_FC_CIA, "Calling subscriber Internet Address" },
220 { T30_FC_ISP, "Internet Selective Polling Address" },
221 { T30_FC_DCS, "Digital Command Signal" },
222 { T30_FC_TSI, "Transmitting Subscriber Identification" },
223 { T30_FC_NSS, "Non-Standard facilities Set-up" },
224 { T30_FC_SUB, "Subaddress" },
225 { T30_FC_SID, "Sender Identification" },
226 { T30_FC_TSA, "Transmitting Subscriber Internet address" },
227 { T30_FC_IRA, "Internet Routing Address" },
228 { T30_FC_CFR, "Confirmation To Receive" },
229 { T30_FC_FTT, "Failure To Train" },
230 { T30_FC_CSA, "Called Subscriber Internet Address" },
231 { T30_FC_EOM, "End Of Message" },
232 { T30_FC_MPS, "MultiPage Signal" },
233 { T30_FC_EOP, "End Of Procedure" },
234 { T30_FC_PRI_EOM, "Procedure Interrupt-End Of Message" },
235 { T30_FC_PRI_MPS, "Procedure Interrupt-MultiPage Signal" },
236 { T30_FC_PRI_EOP, "Procedure Interrupt-End Of Procedure" },
237 { T30_FC_PRI_EOP2, "Procedure Interrupt-End Of Procedure" },
238 { T30_FC_MCF, "Message Confirmation" },
239 { T30_FC_RTP, "Retrain Positive" },
240 { T30_FC_RTN, "Retrain Negative" },
241 { T30_FC_PIP, "Procedure Interrupt Positive" },
242 { T30_FC_PIN, "Procedure Interrupt Negative" },
243 { T30_FC_FDM, "File Diagnostics Message" },
244 { T30_FC_DCN, "Disconnect" },
245 { T30_FC_CRP, "Command Repeat" },
246 { T30_FC_FNV, "Field Not Valid" },
247 { T30_FC_TNR, "Transmit not ready" },
248 { T30_FC_TR, "Transmit ready" },
249 { T30_FC_MCF, "Message Confirmation" },
250 { T30_FC_PID, "Procedure Interrupt Disconnect" },
251 { T30_FC_PPR, "Partial Page Request" },
252 { T30_FC_RNR, "Receive Not Ready" },
253 { T30_FC_CRP, "Command Repeat" },
254 { T30_FC_CTC, "Continue To Correct" },
255 { T30_FC_CTR, "Response for Continue To Correct" },
256 { T30_FC_PPS, "Partial Page Signal" },
257 { T30_FC_EOR, "End Of Retransmission" },
258 { T30_FC_RR, "Receive Ready" },
259 { T30_FC_ERR, "Response for End of Retransmission" },
260 { T30_FC_FCD, "Facsimile coded data" },
261 { T30_FC_RCP, "Return to control for partial page" },
265 const value_string t30_facsimile_control_field_vals_short[] = {
266 { T30_FC_DIS, "DIS" },
267 { T30_FC_CSI, "CSI" },
268 { T30_FC_NSF, "NSF" },
269 { T30_FC_DTC, "DTC" },
270 { T30_FC_CIG, "CIG" },
271 { T30_FC_NSC, "NSC" },
272 { T30_FC_PWD, "PWD" },
273 { T30_FC_SEP, "SEP" },
274 { T30_FC_PSA, "PSA" },
275 { T30_FC_CIA, "CIA" },
276 { T30_FC_ISP, "ISP" },
277 { T30_FC_DCS, "DCS" },
278 { T30_FC_TSI, "TSI" },
279 { T30_FC_NSS, "NSS" },
280 { T30_FC_SUB, "SUB" },
281 { T30_FC_SID, "SID" },
282 { T30_FC_TSA, "TSA" },
283 { T30_FC_IRA, "IRA" },
284 { T30_FC_CFR, "CFR" },
285 { T30_FC_FTT, "FTT" },
286 { T30_FC_CSA, "CSA" },
287 { T30_FC_EOM, "EOM" },
288 { T30_FC_MPS, "MPS" },
289 { T30_FC_EOP, "EOP" },
290 { T30_FC_PRI_EOM, "PRI_EOM" },
291 { T30_FC_PRI_MPS, "PRI_MPS" },
292 { T30_FC_PRI_EOP, "EOP" },
293 { T30_FC_PRI_EOP2, "EOP2" },
294 { T30_FC_MCF, "MCF" },
295 { T30_FC_RTP, "RTP" },
296 { T30_FC_RTN, "RTN" },
297 { T30_FC_PIP, "PIP" },
298 { T30_FC_PIN, "PIN" },
299 { T30_FC_FDM, "FDM" },
300 { T30_FC_DCN, "DCN" },
301 { T30_FC_CRP, "CRP" },
302 { T30_FC_FNV, "FNV" },
303 { T30_FC_TNR, "TNR" },
305 { T30_FC_MCF, "MCF" },
306 { T30_FC_PID, "PID" },
307 { T30_FC_PPR, "PPR" },
308 { T30_FC_RNR, "RNR" },
309 { T30_FC_CRP, "CRP" },
310 { T30_FC_CTC, "CTC" },
311 { T30_FC_CTR, "CTR" },
312 { T30_FC_PPS, "PPS" },
313 { T30_FC_EOR, "EOR" },
315 { T30_FC_ERR, "ERR" },
316 { T30_FC_FCD, "FCD" },
317 { T30_FC_RCP, "RCP" },
321 static const value_string t30_data_signalling_rate_vals[] = {
322 { 0x00, "ITU-T V.27 ter fall-back mode" },
323 { 0x04, "ITU-T V.27 ter" },
324 { 0x08, "ITU-T V.29" },
325 { 0x0C, "ITU-T V.27 ter and V.29" },
326 { 0x02, "Not used" },
327 { 0x06, "Reserved" },
328 { 0x0A, "Not used" },
330 { 0x01, "Not used" },
331 { 0x05, "Reserved" },
332 { 0x09, "Not used" },
333 { 0x0D, "ITU-T V.27 ter, V.29, and V.17" },
334 { 0x03, "Not used" },
335 { 0x07, "Reserved" },
336 { 0x0B, "Not used" },
337 { 0x0F, "Reserved" },
341 static const value_string t30_data_signalling_rate_dcs_vals[] = {
342 { 0x00, "2400 bit/s, ITU-T V.27 ter" },
343 { 0x04, "4800 bit/s, ITU-T V.27 ter" },
344 { 0x08, "9600 bit/s, ITU-T V.29" },
345 { 0x0C, "7200 bit/s, ITU-T V.29" },
348 { 0x0A, "Reserved" },
349 { 0x0E, "Reserved" },
350 { 0x01, "14 400 bit/s, ITU-T V.17" },
351 { 0x05, "12 000 bit/s, ITU-T V.17" },
352 { 0x09, "9600 bit/s, ITU-T V.17" },
353 { 0x0D, "7200 bit/s, ITU-T V.17" },
354 { 0x03, "Reserved" },
355 { 0x07, "Reserved" },
356 { 0x0B, "Reserved" },
357 { 0x0F, "Reserved" },
361 static const value_string t30_recording_width_capabilities_vals[] = {
362 { 0x00, "Scan line length 215 mm +- 1%" },
363 { 0x01, "Scan line length 215 mm +- 1% and Scan line length 255 mm +- 1% and Scan line length 303 mm +- 1%" },
364 { 0x02, "Scan line length 215 mm +- 1% and Scan line length 255 mm +- 1%" },
369 static const value_string t30_recording_width_dcs_vals[] = {
370 { 0x00, "Scan line length 215 mm +- 1%" },
371 { 0x01, "Scan line length 303 mm +- 1%" },
372 { 0x02, "Scan line length 255 mm +- 1%" },
377 static const value_string t30_recording_length_capability_vals[] = {
378 { 0x00, "A4 (297 mm)" },
379 { 0x01, "Unlimited" },
380 { 0x02, "A4 (297 mm) and B4 (364 mm)" },
385 static const value_string t30_recording_length_dcs_vals[] = {
386 { 0x00, "A4 (297 mm)" },
387 { 0x01, "Unlimited" },
388 { 0x02, "B4 (364 mm)" },
393 static const value_string t30_minimum_scan_line_time_rec_vals[] = {
394 { 0x00, "20 ms at 3.85 l/mm: T7.7 = T3.85" },
395 { 0x01, "40 ms at 3.85 l/mm: T7.7 = T3.85" },
396 { 0x02, "10 ms at 3.85 l/mm: T7.7 = T3.85" },
397 { 0x04, "05 ms at 3.85 l/mm: T7.7 = T3.85" },
398 { 0x03, "10 ms at 3.85 l/mm: T7.7 = 1/2 T3.85" },
399 { 0x06, "20 ms at 3.85 l/mm: T7.7 = 1/2 T3.85" },
400 { 0x05, "40 ms at 3.85 l/mm: T7.7 = 1/2 T3.85" },
401 { 0x07, "00 ms at 3.85 l/mm: T7.7 = T3.85" },
405 static const value_string t30_partial_page_fcf2_vals[] = {
406 { 0x00, "NULL code which indicates the partial page boundary" },
407 { 0xF1, "EOM in optional T.4 error correction mode" },
408 { 0xF2, "MPS in optional T.4 error correction mode" },
409 { 0xF4, "EOP in optional T.4 error correction mode" },
410 { 0xF8, "EOS in optional T.4 error correction mode" },
411 { 0xF9, "PRI-EOM in optional T.4 error correction mode" },
412 { 0xFA, "PRI-MPS in optional T.4 error correction mode" },
413 { 0xFC, "PRI-EOP in optional T.4 error correction mode" },
417 static const value_string t30_minimum_scan_line_time_dcs_vals[] = {
426 static const value_string t30_SharedDataMemory_capacity_vals[] = {
427 { 0x00, "Not available" },
428 { 0x01, "Level 1 = 1.0 Mbytes" },
429 { 0x02, "Level 2 = 2.0 Mbytes" },
430 { 0x03, "Level 3 = unlimited (i.e. >= 32 Mbytes)" },
434 static const true_false_string t30_octets_preferred_value = {
435 "64 octets preferred",
436 "256 octets preferred",
439 static const true_false_string t30_extension_ind_value = {
440 "information continues through the next octet",
444 static const true_false_string t30_compress_value = {
449 static const true_false_string t30_minimum_scan_value = {
454 static const true_false_string t30_duplex_operation_value = {
455 "Duplex and half duplex operation",
456 "Half duplex operation only",
459 static const true_false_string t30_frame_size_dcs_value = {
464 static const true_false_string t30_res_type_sel_value = {
465 "inch based resolution",
466 "metric based resolution",
469 guint8 reverse_byte(guint8 val)
471 return ( ((val & 0x80)>>7) | ((val & 0x40)>>5) |
472 ((val & 0x20)>>3) | ((val & 0x10)>>1) |
473 ((val & 0x08)<<1) | ((val & 0x04)<<3) |
474 ((val & 0x02)<<5) | ((val & 0x01)<<7) );
477 #define LENGTH_T30_NUM 20
479 t30_get_string_numbers(tvbuff_t *tvb, int offset, int len)
484 /* the lenght must be 20 bytes per T30 rec*/
485 if (len != LENGTH_T30_NUM) return NULL;
487 buf=ep_alloc(LENGTH_T30_NUM+1);
489 for (i=0; i<LENGTH_T30_NUM; i++)
490 buf[LENGTH_T30_NUM-i-1] = reverse_byte(tvb_get_guint8(tvb, offset+i));
492 /* add end of string */
493 buf[LENGTH_T30_NUM] = '\0';
495 return g_strstrip(buf);
500 dissect_t30_numbers(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree)
504 str_num = t30_get_string_numbers(tvb, offset, len);
506 proto_tree_add_string_format(tree, hf_t30_fif_number, tvb, offset, LENGTH_T30_NUM, str_num, "Number: %s", str_num);
508 if (check_col(pinfo->cinfo, COL_INFO))
509 col_append_fstr(pinfo->cinfo, COL_INFO, " - Number:%s", str_num );
511 if (pinfo->private_data)
512 g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, "Num: %s", str_num);
515 proto_tree_add_text(tree, tvb, offset, tvb_reported_length_remaining(tvb, offset), "[MALFORMED OR SHORT PACKET: number of digits must be 20]");
517 if (check_col(pinfo->cinfo, COL_INFO))
518 col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET: number of digits must be 20]" );
523 dissect_t30_facsimile_coded_data(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree)
529 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]");
530 expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR, "T30 FCD length must be at least 2 bytes");
531 if (check_col(pinfo->cinfo, COL_INFO))
532 col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET]");
536 octet = tvb_get_guint8(tvb, offset);
537 proto_tree_add_uint(tree, hf_t30_t4_frame_num, tvb, offset, 1, reverse_byte(octet));
540 if (check_col(pinfo->cinfo, COL_INFO))
541 col_append_fstr(pinfo->cinfo, COL_INFO, " - Frame num:%d", reverse_byte(octet));
543 if (pinfo->private_data)
544 g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, "Frm num: %d", reverse_byte(octet));
546 t4_data = ep_alloc(len-1);
547 tvb_memcpy(tvb, t4_data, offset, len-1);
548 proto_tree_add_bytes(tree, hf_t30_t4_data, tvb, offset, len-1, t4_data);
552 dissect_t30_non_standard_cap(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree)
555 guint8 *non_standard_bytes;
558 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]");
559 expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR, "T30 NSC length must be at least 2 bytes");
560 if (check_col(pinfo->cinfo, COL_INFO))
561 col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET]");
565 octet = tvb_get_guint8(tvb, offset);
566 proto_tree_add_uint(tree, hf_t30_fif_country_code, tvb, offset, 1, octet);
569 non_standard_bytes = ep_alloc(len-1);
570 tvb_memcpy(tvb, non_standard_bytes, offset, len-1);
571 proto_tree_add_bytes(tree, hf_t30_fif_non_stand_bytes, tvb, offset, len-1, non_standard_bytes);
576 dissect_t30_partial_page_signal(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree)
578 guint8 octet, page_count, block_count, frame_count;
581 proto_tree_add_text(tree, tvb, offset, tvb_reported_length_remaining(tvb, offset), "[MALFORMED OR SHORT PACKET: PPS length must be 4 bytes]");
582 expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR, "T30 PPS length must be 4 bytes");
583 if (check_col(pinfo->cinfo, COL_INFO))
584 col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET]");
588 octet = tvb_get_guint8(tvb, offset);
589 proto_tree_add_uint(tree, hf_t30_partial_page_fcf2, tvb, offset, 1, octet);
592 octet = tvb_get_guint8(tvb, offset);
593 page_count = reverse_byte(octet);
594 proto_tree_add_uint(tree, hf_t30_partial_page_i1, tvb, offset, 1, page_count);
597 octet = tvb_get_guint8(tvb, offset);
598 block_count = reverse_byte(octet);
599 proto_tree_add_uint(tree, hf_t30_partial_page_i2, tvb, offset, 1, block_count);
602 octet = tvb_get_guint8(tvb, offset);
603 frame_count = reverse_byte(octet);
604 proto_tree_add_uint(tree, hf_t30_partial_page_i3, tvb, offset, 1, frame_count);
607 if (check_col(pinfo->cinfo, COL_INFO))
608 col_append_fstr(pinfo->cinfo, COL_INFO, " - PC:%d BC:%d FC:%d", page_count, block_count, frame_count);
610 if (pinfo->private_data)
611 g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, "PC:%d BC:%d FC:%d", page_count, block_count, frame_count);
616 dissect_t30_dis_dtc(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree, gboolean dis_dtc)
621 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]");
622 expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR, "T30 DIS length must be at least 4 bytes");
623 if (check_col(pinfo->cinfo, COL_INFO))
624 col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET]");
629 octet = tvb_get_guint8(tvb, offset);
631 proto_tree_add_boolean(tree, hf_t30_fif_sm, tvb, offset, 1, octet);
632 proto_tree_add_boolean(tree, hf_t30_fif_rtif, tvb, offset, 1, octet);
633 proto_tree_add_boolean(tree, hf_t30_fif_3gmn, tvb, offset, 1, octet);
635 proto_tree_add_boolean(tree, hf_t30_fif_v8c, tvb, offset, 1, octet);
636 proto_tree_add_boolean(tree, hf_t30_fif_op, tvb, offset, 1, octet);
640 octet = tvb_get_guint8(tvb, offset);
642 if (dis_dtc) proto_tree_add_boolean(tree, hf_t30_fif_rtfc, tvb, offset, 1, octet);
643 proto_tree_add_boolean(tree, hf_t30_fif_rfo, tvb, offset, 1, octet);
645 proto_tree_add_uint(tree, hf_t30_fif_dsr, tvb, offset, 1, octet);
647 if (check_col(pinfo->cinfo, COL_INFO))
648 col_append_fstr(pinfo->cinfo, COL_INFO, " - DSR:%s", val_to_str((octet&0x3C) >> 2, t30_data_signalling_rate_vals, "<unknown>"));
650 if (pinfo->private_data)
651 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 proto_tree_add_uint(tree, hf_t30_fif_dsr_dcs, tvb, offset, 1, octet);
656 if (check_col(pinfo->cinfo, COL_INFO))
657 col_append_fstr(pinfo->cinfo, COL_INFO, " - DSR:%s", val_to_str((octet&0x3C) >> 2, t30_data_signalling_rate_dcs_vals, "<unknown>"));
659 if (pinfo->private_data)
660 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>"));
662 proto_tree_add_boolean(tree, hf_t30_fif_res, tvb, offset, 1, octet);
663 proto_tree_add_boolean(tree, hf_t30_fif_tdcc, tvb, offset, 1, octet);
667 octet = tvb_get_guint8(tvb, offset);
670 proto_tree_add_uint(tree, hf_t30_fif_rwc, tvb, offset, 1, octet);
671 proto_tree_add_uint(tree, hf_t30_fif_rlc, tvb, offset, 1, octet);
672 proto_tree_add_uint(tree, hf_t30_fif_msltcr, tvb, offset, 1, octet);
674 proto_tree_add_uint(tree, hf_t30_fif_rw_dcs, tvb, offset, 1, octet);
675 proto_tree_add_uint(tree, hf_t30_fif_rl_dcs, tvb, offset, 1, octet);
676 proto_tree_add_uint(tree, hf_t30_fif_mslt_dcs, tvb, offset, 1, octet);
678 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
680 if ( !(octet & 0x01) || (len < 4) ) return; /* no extension */
684 octet = tvb_get_guint8(tvb, offset);
686 proto_tree_add_boolean(tree, hf_t30_fif_cm, tvb, offset, 1, octet);
687 proto_tree_add_boolean(tree, hf_t30_fif_ecm, tvb, offset, 1, octet);
688 if (!dis_dtc) proto_tree_add_boolean(tree, hf_t30_fif_fs_dcs, tvb, offset, 1, octet);
689 proto_tree_add_boolean(tree, hf_t30_fif_t6, tvb, offset, 1, octet);
690 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
692 if ( !(octet & 0x01) || (len < 5) ) return; /* no extension */
696 octet = tvb_get_guint8(tvb, offset);
698 proto_tree_add_boolean(tree, hf_t30_fif_fvc, tvb, offset, 1, octet);
700 proto_tree_add_boolean(tree, hf_t30_fif_mspc, tvb, offset, 1, octet);
701 proto_tree_add_boolean(tree, hf_t30_fif_ps, tvb, offset, 1, octet);
703 proto_tree_add_boolean(tree, hf_t30_fif_t43, tvb, offset, 1, octet);
704 proto_tree_add_boolean(tree, hf_t30_fif_pi, tvb, offset, 1, octet);
705 proto_tree_add_boolean(tree, hf_t30_fif_vc32k, tvb, offset, 1, octet);
706 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
708 if ( !(octet & 0x01) || (len < 6) ) return; /* no extension */
712 octet = tvb_get_guint8(tvb, offset);
714 proto_tree_add_boolean(tree, hf_t30_fif_r8x15, tvb, offset, 1, octet);
715 proto_tree_add_boolean(tree, hf_t30_fif_300x300, tvb, offset, 1, octet);
716 proto_tree_add_boolean(tree, hf_t30_fif_r16x15, tvb, offset, 1, octet);
718 proto_tree_add_boolean(tree, hf_t30_fif_ibrp, tvb, offset, 1, octet);
719 proto_tree_add_boolean(tree, hf_t30_fif_mbrp, tvb, offset, 1, octet);
720 proto_tree_add_boolean(tree, hf_t30_fif_msltchr, tvb, offset, 1, octet);
721 proto_tree_add_boolean(tree, hf_t30_fif_sp, tvb, offset, 1, octet);
723 proto_tree_add_boolean(tree, hf_t30_fif_rts, tvb, offset, 1, octet);
725 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
727 if ( !(octet & 0x01) || (len < 7) ) return; /* no extension */
731 octet = tvb_get_guint8(tvb, offset);
733 proto_tree_add_boolean(tree, hf_t30_fif_sc, tvb, offset, 1, octet);
735 proto_tree_add_boolean(tree, hf_t30_fif_passw, tvb, offset, 1, octet);
736 proto_tree_add_boolean(tree, hf_t30_fif_rttd, tvb, offset, 1, octet);
738 proto_tree_add_boolean(tree, hf_t30_fif_sit, tvb, offset, 1, octet);
740 proto_tree_add_boolean(tree, hf_t30_fif_bft, tvb, offset, 1, octet);
741 proto_tree_add_boolean(tree, hf_t30_fif_dtm, tvb, offset, 1, octet);
742 proto_tree_add_boolean(tree, hf_t30_fif_edi, tvb, offset, 1, octet);
743 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
745 if ( !(octet & 0x01) || (len < 8) ) return; /* no extension */
749 octet = tvb_get_guint8(tvb, offset);
751 proto_tree_add_boolean(tree, hf_t30_fif_btm, tvb, offset, 1, octet);
752 if (dis_dtc) proto_tree_add_boolean(tree, hf_t30_fif_rttcmmd, tvb, offset, 1, octet);
753 proto_tree_add_boolean(tree, hf_t30_fif_chrm, tvb, offset, 1, octet);
754 proto_tree_add_boolean(tree, hf_t30_fif_mm, tvb, offset, 1, octet);
755 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
757 if ( !(octet & 0x01) || (len < 9) ) return; /* no extension */
761 octet = tvb_get_guint8(tvb, offset);
763 proto_tree_add_boolean(tree, hf_t30_fif_pm26, tvb, offset, 1, octet);
764 proto_tree_add_boolean(tree, hf_t30_fif_dnc, tvb, offset, 1, octet);
765 proto_tree_add_boolean(tree, hf_t30_fif_do, tvb, offset, 1, octet);
766 proto_tree_add_boolean(tree, hf_t30_fif_jpeg, tvb, offset, 1, octet);
767 proto_tree_add_boolean(tree, hf_t30_fif_fcm, tvb, offset, 1, octet);
768 if (!dis_dtc) proto_tree_add_boolean(tree, hf_t30_fif_pht, tvb, offset, 1, octet);
769 proto_tree_add_boolean(tree, hf_t30_fif_12c, tvb, offset, 1, octet);
770 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
772 if ( !(octet & 0x01) || (len < 10) ) return; /* no extension */
776 octet = tvb_get_guint8(tvb, offset);
778 proto_tree_add_boolean(tree, hf_t30_fif_ns, tvb, offset, 1, octet);
779 proto_tree_add_boolean(tree, hf_t30_fif_ci, tvb, offset, 1, octet);
780 proto_tree_add_boolean(tree, hf_t30_fif_cgr, tvb, offset, 1, octet);
781 proto_tree_add_boolean(tree, hf_t30_fif_nalet, tvb, offset, 1, octet);
782 proto_tree_add_boolean(tree, hf_t30_fif_naleg, tvb, offset, 1, octet);
783 proto_tree_add_boolean(tree, hf_t30_fif_spscb, tvb, offset, 1, octet);
784 proto_tree_add_boolean(tree, hf_t30_fif_spsco, tvb, offset, 1, octet);
785 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
787 if ( !(octet & 0x01) || (len < 11) ) return; /* no extension */
791 octet = tvb_get_guint8(tvb, offset);
793 proto_tree_add_boolean(tree, hf_t30_fif_hkm, tvb, offset, 1, octet);
794 proto_tree_add_boolean(tree, hf_t30_fif_rsa, tvb, offset, 1, octet);
795 proto_tree_add_boolean(tree, hf_t30_fif_oc, tvb, offset, 1, octet);
796 proto_tree_add_boolean(tree, hf_t30_fif_hfx40, tvb, offset, 1, octet);
797 proto_tree_add_boolean(tree, hf_t30_fif_acn2c, tvb, offset, 1, octet);
798 proto_tree_add_boolean(tree, hf_t30_fif_acn3c, tvb, offset, 1, octet);
799 proto_tree_add_boolean(tree, hf_t30_fif_hfx40i, tvb, offset, 1, octet);
800 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
802 if ( !(octet & 0x01) || (len < 12) ) return; /* no extension */
806 octet = tvb_get_guint8(tvb, offset);
808 proto_tree_add_boolean(tree, hf_t30_fif_ahsn2, tvb, offset, 1, octet);
809 proto_tree_add_boolean(tree, hf_t30_fif_ahsn3, tvb, offset, 1, octet);
810 proto_tree_add_boolean(tree, hf_t30_fif_t441, tvb, offset, 1, octet);
811 proto_tree_add_boolean(tree, hf_t30_fif_t442, tvb, offset, 1, octet);
812 proto_tree_add_boolean(tree, hf_t30_fif_t443, tvb, offset, 1, octet);
813 proto_tree_add_boolean(tree, hf_t30_fif_plmss, tvb, offset, 1, octet);
814 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
816 if ( !(octet & 0x01) || (len < 13) ) return; /* no extension */
820 octet = tvb_get_guint8(tvb, offset);
822 proto_tree_add_boolean(tree, hf_t30_fif_cg300, tvb, offset, 1, octet);
823 proto_tree_add_boolean(tree, hf_t30_fif_100x100cg, tvb, offset, 1, octet);
824 proto_tree_add_boolean(tree, hf_t30_fif_spcbft, tvb, offset, 1, octet);
826 proto_tree_add_boolean(tree, hf_t30_fif_ebft, tvb, offset, 1, octet);
827 proto_tree_add_boolean(tree, hf_t30_fif_isp, tvb, offset, 1, octet);
829 proto_tree_add_boolean(tree, hf_t30_fif_ira, tvb, offset, 1, octet);
830 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
832 if ( !(octet & 0x01) || (len < 14) ) return; /* no extension */
834 /* bits 105 to 112 */
836 octet = tvb_get_guint8(tvb, offset);
838 proto_tree_add_boolean(tree, hf_t30_fif_600x600, tvb, offset, 1, octet);
839 proto_tree_add_boolean(tree, hf_t30_fif_1200x1200, tvb, offset, 1, octet);
840 proto_tree_add_boolean(tree, hf_t30_fif_300x600, tvb, offset, 1, octet);
841 proto_tree_add_boolean(tree, hf_t30_fif_400x800, tvb, offset, 1, octet);
842 proto_tree_add_boolean(tree, hf_t30_fif_600x1200, tvb, offset, 1, octet);
843 proto_tree_add_boolean(tree, hf_t30_fif_cg600x600, tvb, offset, 1, octet);
844 proto_tree_add_boolean(tree, hf_t30_fif_cg1200x1200, tvb, offset, 1, octet);
845 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
847 if ( !(octet & 0x01) || (len < 15) ) return; /* no extension */
849 /* bits 113 to 120 */
851 octet = tvb_get_guint8(tvb, offset);
853 proto_tree_add_boolean(tree, hf_t30_fif_dspcam, tvb, offset, 1, octet);
854 proto_tree_add_boolean(tree, hf_t30_fif_dspccm, tvb, offset, 1, octet);
855 if (dis_dtc) proto_tree_add_boolean(tree, hf_t30_fif_bwmrcp, tvb, offset, 1, octet);
856 proto_tree_add_boolean(tree, hf_t30_fif_t45, tvb, offset, 1, octet);
857 proto_tree_add_uint(tree, hf_t30_fif_sdmc, tvb, offset, 1, octet);
858 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
860 if ( !(octet & 0x01) ) return; /* no extension */
865 dissect_t30_hdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
876 if (tvb_reported_length_remaining(tvb, offset) < 3) {
877 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]");
878 expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR, "T30 length must be at least 4 bytes");
879 if (check_col(pinfo->cinfo, COL_INFO))
880 col_append_str(pinfo->cinfo, COL_INFO, " (HDLC Reassembled: [MALFORMED OR SHORT PACKET])");
886 if (check_col(pinfo->cinfo, COL_INFO))
887 col_append_str(pinfo->cinfo, COL_INFO, " (HDLC Reassembled:");
889 it=proto_tree_add_protocol_format(tree, proto_t30, tvb, offset, -1,
890 "ITU-T Recommendation T.30");
891 tr=proto_item_add_subtree(it, ett_t30);
893 octet = tvb_get_guint8(tvb, offset);
894 item = proto_tree_add_uint(tr, hf_t30_Address, tvb, offset, 1, octet);
895 if (octet != 0xFF) expert_add_info_format(pinfo, item, PI_REASSEMBLE, PI_WARN, "T30 Address must be 0xFF");
898 octet = tvb_get_guint8(tvb, offset);
899 item = proto_tree_add_uint(tr, hf_t30_Control, tvb, offset, 1, octet);
900 if ((octet != 0xC0) && (octet != 0xC8)) expert_add_info_format(pinfo, item, PI_REASSEMBLE, PI_WARN, "T30 Control Field must be 0xC0 or 0xC8");
903 octet = tvb_get_guint8(tvb, offset);
904 it_fcf = proto_tree_add_uint(tr, hf_t30_Facsimile_Control, tvb, offset, 1, octet & 0x7F);
907 tr_fif = proto_item_add_subtree(it_fcf, ett_t30_fif);
909 frag_len = tvb_length_remaining(tvb, offset);
910 if (pinfo->private_data) ((t38_packet_info*)pinfo->private_data)->t30_Facsimile_Control = octet;
912 if (check_col(pinfo->cinfo, COL_INFO))
913 col_append_fstr(pinfo->cinfo, COL_INFO, " %s - %s", val_to_str(octet & 0x7F, t30_facsimile_control_field_vals_short, "<unknown>"),
914 val_to_str(octet & 0x7F, t30_facsimile_control_field_vals, "<unknown>") );
916 switch (octet & 0x7F) {
919 dissect_t30_dis_dtc(tvb, offset, pinfo, frag_len, tr_fif, TRUE);
922 dissect_t30_dis_dtc(tvb, offset, pinfo, frag_len, tr_fif, FALSE);
932 dissect_t30_numbers(tvb, offset, pinfo, frag_len, tr_fif);
937 dissect_t30_non_standard_cap(tvb, offset, pinfo, frag_len, tr_fif);
940 dissect_t30_facsimile_coded_data(tvb, offset, pinfo, frag_len, tr_fif);
943 dissect_t30_partial_page_signal(tvb, offset, pinfo, frag_len, tr_fif);
947 if (check_col(pinfo->cinfo, COL_INFO))
948 col_append_str(pinfo->cinfo, COL_INFO, ")");
955 /* Wireshark Protocol Registration */
957 proto_register_t30(void)
959 static hf_register_info hf_t30[] =
962 { "Address", "t30.Address", FT_UINT8, BASE_HEX,
963 NULL, 0, "Address Field", HFILL }},
965 { "Control", "t30.Control", FT_UINT8, BASE_HEX,
966 VALS(t30_control_vals), 0, "Address Field", HFILL }},
967 { &hf_t30_Facsimile_Control,
968 { "Facsimile Control", "t30.FacsimileControl", FT_UINT8, BASE_DEC,
969 VALS(t30_facsimile_control_field_vals), 0, "Facsimile Control", HFILL }},
972 { "Store and forward Internet fax- Simple mode (ITU-T T.37)", "t30.fif.sm", FT_BOOLEAN, 8,
973 TFS(&flags_set_truth), 0x80, "", HFILL }},
975 { "Real-time Internet fax (ITU T T.38)", "t30.fif.rtif", FT_BOOLEAN, 8,
976 TFS(&flags_set_truth), 0x20, "", HFILL }},
978 { "3rd Generation Mobile Network", "t30.fif.3gmn", FT_BOOLEAN, 8,
979 TFS(&flags_set_truth), 0x10, "", HFILL }},
981 { "V.8 capabilities", "t30.fif.v8c", FT_BOOLEAN, 8,
982 TFS(&flags_set_truth), 0x04, "", HFILL }},
984 { "Octets preferred", "t30.fif.op", FT_BOOLEAN, 8,
985 TFS(&t30_octets_preferred_value), 0x02, "", HFILL }},
987 { "Ready to transmit a facsimile document (polling)", "t30.fif.rtfc", FT_BOOLEAN, 8,
988 TFS(&flags_set_truth), 0x80, "", HFILL }},
990 { "Receiver fax operation", "t30.fif.rfo", FT_BOOLEAN, 8,
991 TFS(&flags_set_truth), 0x40, "", HFILL }},
993 { "Data signalling rate", "t30.fif.dsr", FT_UINT8, BASE_HEX,
994 VALS(t30_data_signalling_rate_vals), 0x3C, "", HFILL }},
995 { &hf_t30_fif_dsr_dcs,
996 { "Data signalling rate", "t30.fif.dsr_dcs", FT_UINT8, BASE_HEX,
997 VALS(t30_data_signalling_rate_dcs_vals), 0x3C, "", HFILL }},
999 { "R8x7.7 lines/mm and/or 200x200 pels/25.4 mm", "t30.fif.res", FT_BOOLEAN, 8,
1000 TFS(&flags_set_truth), 0x02, "", HFILL }},
1002 { "Two dimensional coding capability", "t30.fif.tdcc", FT_BOOLEAN, 8,
1003 TFS(&flags_set_truth), 0x01, "", HFILL }},
1005 { "Recording width capabilities", "t30.fif.rwc", FT_UINT8, BASE_HEX,
1006 VALS(t30_recording_width_capabilities_vals), 0xC0, "", HFILL }},
1007 { &hf_t30_fif_rw_dcs,
1008 { "Recording width", "t30.fif.rw_dcs", FT_UINT8, BASE_HEX,
1009 VALS(t30_recording_width_dcs_vals), 0xC0, "", HFILL }},
1011 { "Recording length capability", "t30.fif.rlc", FT_UINT8, BASE_HEX,
1012 VALS(t30_recording_length_capability_vals), 0x30, "", HFILL }},
1013 { &hf_t30_fif_rl_dcs,
1014 { "Recording length capability", "t30.fif.rl_dcs", FT_UINT8, BASE_HEX,
1015 VALS(t30_recording_length_dcs_vals), 0x30, "", HFILL }},
1016 { &hf_t30_fif_msltcr,
1017 { "Minimum scan line time capability at the receiver", "t30.fif.msltcr", FT_UINT8, BASE_HEX,
1018 VALS(t30_minimum_scan_line_time_rec_vals), 0x0E, "", HFILL }},
1019 { &hf_t30_fif_mslt_dcs,
1020 { "Minimum scan line time", "t30.fif.mslt_dcs", FT_UINT8, BASE_HEX,
1021 VALS(t30_minimum_scan_line_time_dcs_vals), 0x0E, "", HFILL }},
1023 { "Extension indicator", "t30.fif.ext", FT_BOOLEAN, 8,
1024 TFS(&t30_extension_ind_value), 0x01, "", HFILL }},
1027 { "Compress/Uncompress mode", "t30.fif.cm", FT_BOOLEAN, 8,
1028 TFS(&t30_compress_value), 0x40, "", HFILL }},
1030 { "Error correction mode", "t30.fif.ecm", FT_BOOLEAN, 8,
1031 TFS(&flags_set_truth), 0x20, "", HFILL }},
1032 { &hf_t30_fif_fs_dcs,
1033 { "Frame size", "t30.fif.fs_dcm", FT_BOOLEAN, 8,
1034 TFS(&t30_frame_size_dcs_value), 0x10, "", HFILL }},
1036 { "T.6 coding capability", "t30.fif.t6", FT_BOOLEAN, 8,
1037 TFS(&flags_set_truth), 0x02, "", HFILL }},
1040 { "Field valid capability", "t30.fif.fvc", FT_BOOLEAN, 8,
1041 TFS(&flags_set_truth), 0x80, "", HFILL }},
1043 { "Multiple selective polling capability", "t30.fif.mspc", FT_BOOLEAN, 8,
1044 TFS(&flags_set_truth), 0x40, "", HFILL }},
1046 { "Polled Subaddress", "t30.fif.ps", FT_BOOLEAN, 8,
1047 TFS(&flags_set_truth), 0x20, "", HFILL }},
1049 { "T.43 coding", "t30.fif.t43", FT_BOOLEAN, 8,
1050 TFS(&flags_set_truth), 0x10, "", HFILL }},
1052 { "Plane interleave", "t30.fif.pi", FT_BOOLEAN, 8,
1053 TFS(&flags_set_truth), 0x08, "", HFILL }},
1054 { &hf_t30_fif_vc32k,
1055 { "Voice coding with 32k ADPCM (ITU T G.726)", "t30.fif.vc32k", FT_BOOLEAN, 8,
1056 TFS(&flags_set_truth), 0x04, "", HFILL }},
1058 { &hf_t30_fif_r8x15,
1059 { "R8x15.4 lines/mm", "t30.fif.r8x15", FT_BOOLEAN, 8,
1060 TFS(&flags_set_truth), 0x80, "", HFILL }},
1061 { &hf_t30_fif_300x300,
1062 { "300x300 pels/25.4 mm", "t30.fif.300x300", FT_BOOLEAN, 8,
1063 TFS(&flags_set_truth), 0x40, "", HFILL }},
1064 { &hf_t30_fif_r16x15,
1065 { "R16x15.4 lines/mm and/or 400x400 pels/25.4 mm", "t30.fif.r16x15", FT_BOOLEAN, 8,
1066 TFS(&flags_set_truth), 0x20, "", HFILL }},
1068 { "Inch based resolution preferred", "t30.fif.ibrp", FT_BOOLEAN, 8,
1069 TFS(&flags_set_truth), 0x10, "", HFILL }},
1071 { "Metric based resolution preferred", "t30.fif.mbrp", FT_BOOLEAN, 8,
1072 TFS(&flags_set_truth), 0x08, "", HFILL }},
1073 { &hf_t30_fif_msltchr,
1074 { "Minimum scan line time capability for higher resolutions", "t30.fif.msltchr", FT_BOOLEAN, 8,
1075 TFS(&t30_minimum_scan_value), 0x04, "", HFILL }},
1077 { "Resolution type selection", "t30.fif.rts", FT_BOOLEAN, 8,
1078 TFS(&t30_res_type_sel_value), 0x10, "", HFILL }},
1080 { "Selective polling", "t30.fif.sp", FT_BOOLEAN, 8,
1081 TFS(&flags_set_truth), 0x02, "", HFILL }},
1084 { "Subaddressing capability", "t30.fif.sc", FT_BOOLEAN, 8,
1085 TFS(&flags_set_truth), 0x80, "", HFILL }},
1086 { &hf_t30_fif_passw,
1087 { "Password", "t30.fif.passw", FT_BOOLEAN, 8,
1088 TFS(&flags_set_truth), 0x40, "", HFILL }},
1090 { "Sender Identification transmission", "t30.fif.sit", FT_BOOLEAN, 8,
1091 TFS(&flags_set_truth), 0x40, "", HFILL }},
1093 { "Ready to transmit a data file (polling)", "t30.fif.rttd", FT_BOOLEAN, 8,
1094 TFS(&flags_set_truth), 0x20, "", HFILL }},
1096 { "Binary File Transfer (BFT)", "t30.fif.bft", FT_BOOLEAN, 8,
1097 TFS(&flags_set_truth), 0x08, "", HFILL }},
1099 { "Document Transfer Mode (DTM)", "t30.fif.dtm", FT_BOOLEAN, 8,
1100 TFS(&flags_set_truth), 0x04, "", HFILL }},
1102 { "Electronic Data Interchange (EDI)", "t30.fif.edi", FT_BOOLEAN, 8,
1103 TFS(&flags_set_truth), 0x02, "", HFILL }},
1106 { "Basic Transfer Mode (BTM)", "t30.fif.btm", FT_BOOLEAN, 8,
1107 TFS(&flags_set_truth), 0x80, "", HFILL }},
1108 { &hf_t30_fif_rttcmmd,
1109 { "Ready to transmit a character or mixed mode document (polling)", "t30.fif.rttcmmd", FT_BOOLEAN, 8,
1110 TFS(&flags_set_truth), 0x20, "", HFILL }},
1112 { "Character mode", "t30.fif.cm", FT_BOOLEAN, 8,
1113 TFS(&flags_set_truth), 0x10, "", HFILL }},
1115 { "Mixed mode (Annex E/T.4)", "t30.fif.mm", FT_BOOLEAN, 8,
1116 TFS(&flags_set_truth), 0x04, "", HFILL }},
1119 { "Processable mode 26 (ITU T T.505)", "t30.fif.pm26", FT_BOOLEAN, 8,
1120 TFS(&flags_set_truth), 0x80, "", HFILL }},
1122 { "Digital network capability", "t30.fif.dnc", FT_BOOLEAN, 8,
1123 TFS(&flags_set_truth), 0x40, "", HFILL }},
1125 { "Duplex operation", "t30.fif.do", FT_BOOLEAN, 8,
1126 TFS(&t30_duplex_operation_value), 0x20, "", HFILL }},
1128 { "JPEG coding", "t30.fif.jpeg", FT_BOOLEAN, 8,
1129 TFS(&flags_set_truth), 0x10, "", HFILL }},
1131 { "Full colour mode", "t30.fif.fcm", FT_BOOLEAN, 8,
1132 TFS(&flags_set_truth), 0x08, "", HFILL }},
1134 { "Preferred Huffman tables", "t30.fif.pht", FT_BOOLEAN, 8,
1135 TFS(&flags_set_truth), 0x08, "", HFILL }},
1137 { "12 bits/pel component", "t30.fif.12c", FT_BOOLEAN, 8,
1138 TFS(&flags_set_truth), 0x02, "", HFILL }},
1141 { "No subsampling (1:1:1)", "t30.fif.ns", FT_BOOLEAN, 8,
1142 TFS(&flags_set_truth), 0x80, "", HFILL }},
1144 { "Custom illuminant", "t30.fif.ci", FT_BOOLEAN, 8,
1145 TFS(&flags_set_truth), 0x40, "", HFILL }},
1147 { "Custom gamut range", "t30.fif.cgr", FT_BOOLEAN, 8,
1148 TFS(&flags_set_truth), 0x20, "", HFILL }},
1149 { &hf_t30_fif_nalet,
1150 { "North American Letter (215.9 x 279.4 mm) capability", "t30.fif.nalet", FT_BOOLEAN, 8,
1151 TFS(&flags_set_truth), 0x10, "", HFILL }},
1152 { &hf_t30_fif_naleg,
1153 { "North American Legal (215.9 x 355.6 mm) capability", "t30.fif.naleg", FT_BOOLEAN, 8,
1154 TFS(&flags_set_truth), 0x08, "", HFILL }},
1155 { &hf_t30_fif_spscb,
1156 { "Single-progression sequential coding (ITU-T T.85) basic capability", "t30.fif.spscb", FT_BOOLEAN, 8,
1157 TFS(&flags_set_truth), 0x04, "", HFILL }},
1158 { &hf_t30_fif_spsco,
1159 { "Single-progression sequential coding (ITU-T T.85) optional L0 capability", "t30.fif.spsco", FT_BOOLEAN, 8,
1160 TFS(&flags_set_truth), 0x02, "", HFILL }},
1163 { "HKM key management capability", "t30.fif.hkm", FT_BOOLEAN, 8,
1164 TFS(&flags_set_truth), 0x80, "", HFILL }},
1166 { "RSA key management capability", "t30.fif.rsa", FT_BOOLEAN, 8,
1167 TFS(&flags_set_truth), 0x40, "", HFILL }},
1169 { "Override capability", "t30.fif.oc", FT_BOOLEAN, 8,
1170 TFS(&flags_set_truth), 0x20, "", HFILL }},
1171 { &hf_t30_fif_hfx40,
1172 { "HFX40 cipher capability", "t30.fif.hfx40", FT_BOOLEAN, 8,
1173 TFS(&flags_set_truth), 0x10, "", HFILL }},
1174 { &hf_t30_fif_acn2c,
1175 { "Alternative cipher number 2 capability", "t30.fif.acn2c", FT_BOOLEAN, 8,
1176 TFS(&flags_set_truth), 0x08, "", HFILL }},
1177 { &hf_t30_fif_acn3c,
1178 { "Alternative cipher number 3 capability", "t30.fif.acn3c", FT_BOOLEAN, 8,
1179 TFS(&flags_set_truth), 0x04, "", HFILL }},
1180 { &hf_t30_fif_hfx40i,
1181 { "HFX40-I hashing capability", "t30.fif.hfx40i", FT_BOOLEAN, 8,
1182 TFS(&flags_set_truth), 0x02, "", HFILL }},
1184 { &hf_t30_fif_ahsn2,
1185 { "Alternative hashing system number 2 capability", "t30.fif.ahsn2", FT_BOOLEAN, 8,
1186 TFS(&flags_set_truth), 0x80, "", HFILL }},
1187 { &hf_t30_fif_ahsn3,
1188 { "Alternative hashing system number 3 capability", "t30.fif.ahsn3", FT_BOOLEAN, 8,
1189 TFS(&flags_set_truth), 0x40, "", HFILL }},
1191 { "T.44 (Mixed Raster Content)", "t30.fif.t441", FT_BOOLEAN, 8,
1192 TFS(&flags_set_truth), 0x10, "", HFILL }},
1194 { "T.44 (Mixed Raster Content)", "t30.fif.t442", FT_BOOLEAN, 8,
1195 TFS(&flags_set_truth), 0x08, "", HFILL }},
1197 { "T.44 (Mixed Raster Content)", "t30.fif.t443", FT_BOOLEAN, 8,
1198 TFS(&flags_set_truth), 0x04, "", HFILL }},
1199 { &hf_t30_fif_plmss,
1200 { "Page length maximum strip size for T.44 (Mixed Raster Content)", "t30.fif.plmss", FT_BOOLEAN, 8,
1201 TFS(&flags_set_truth), 0x02, "", HFILL }},
1203 { &hf_t30_fif_cg300,
1204 { "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,
1205 TFS(&flags_set_truth), 0x80, "", HFILL }},
1206 { &hf_t30_fif_100x100cg,
1207 { "100 pels/25.4 mm x 100 lines/25.4 mm for colour/gray scale", "t30.fif.100x100cg", FT_BOOLEAN, 8,
1208 TFS(&flags_set_truth), 0x40, "", HFILL }},
1209 { &hf_t30_fif_spcbft,
1210 { "Simple Phase C BFT Negotiations capability", "t30.fif.spcbft", FT_BOOLEAN, 8,
1211 TFS(&flags_set_truth), 0x20, "", HFILL }},
1213 { "Extended BFT Negotiations capability", "t30.fif.ebft", FT_BOOLEAN, 8,
1214 TFS(&flags_set_truth), 0x10, "", HFILL }},
1216 { "Internet Selective Polling Address (ISP)", "t30.fif.isp", FT_BOOLEAN, 8,
1217 TFS(&flags_set_truth), 0x08, "", HFILL }},
1219 { "Internet Routing Address (IRA)", "t30.fif.ira", FT_BOOLEAN, 8,
1220 TFS(&flags_set_truth), 0x04, "", HFILL }},
1222 { &hf_t30_fif_600x600,
1223 { "600 pels/25.4 mm x 600 lines/25.4 mm", "t30.fif.600x600", FT_BOOLEAN, 8,
1224 TFS(&flags_set_truth), 0x80, "", HFILL }},
1225 { &hf_t30_fif_1200x1200,
1226 { "1200 pels/25.4 mm x 1200 lines/25.4 mm", "t30.fif.1200x1200", FT_BOOLEAN, 8,
1227 TFS(&flags_set_truth), 0x40, "", HFILL }},
1228 { &hf_t30_fif_300x600,
1229 { "300 pels/25.4 mm x 600 lines/25.4 mm", "t30.fif.300x600", FT_BOOLEAN, 8,
1230 TFS(&flags_set_truth), 0x20, "", HFILL }},
1231 { &hf_t30_fif_400x800,
1232 { "400 pels/25.4 mm x 800 lines/25.4 mm", "t30.fif.400x800", FT_BOOLEAN, 8,
1233 TFS(&flags_set_truth), 0x10, "", HFILL }},
1234 { &hf_t30_fif_600x1200,
1235 { "600 pels/25.4 mm x 1200 lines/25.4 mm", "t30.fif.600x1200", FT_BOOLEAN, 8,
1236 TFS(&flags_set_truth), 0x08, "", HFILL }},
1237 { &hf_t30_fif_cg600x600,
1238 { "Colour/gray scale 600 pels/25.4 mm x 600 lines/25.4 mm resolution", "t30.fif.cg600x600", FT_BOOLEAN, 8,
1239 TFS(&flags_set_truth), 0x04, "", HFILL }},
1240 { &hf_t30_fif_cg1200x1200,
1241 { "Colour/gray scale 1200 pels/25.4 mm x 1200 lines/25.4 mm resolution", "t30.fif.cg1200x1200", FT_BOOLEAN, 8,
1242 TFS(&flags_set_truth), 0x02, "", HFILL }},
1244 { &hf_t30_fif_dspcam,
1245 { "Double sided printing capability (alternate mode)", "t30.fif.dspcam", FT_BOOLEAN, 8,
1246 TFS(&flags_set_truth), 0x80, "", HFILL }},
1247 { &hf_t30_fif_dspccm,
1248 { "Double sided printing capability (continuous mode)", "t30.fif.dspccm", FT_BOOLEAN, 8,
1249 TFS(&flags_set_truth), 0x40, "", HFILL }},
1250 { &hf_t30_fif_bwmrcp,
1251 { "Black and white mixed raster content profile (MRCbw)", "t30.fif.bwmrcp", FT_BOOLEAN, 8,
1252 TFS(&flags_set_truth), 0x20, "", HFILL }},
1254 { "T.45 (run length colour encoding)", "t30.fif.t45", FT_BOOLEAN, 8,
1255 TFS(&flags_set_truth), 0x10, "", HFILL }},
1257 { "SharedDataMemory capacity", "t30.fif.sdmc", FT_UINT8, BASE_HEX,
1258 VALS(t30_SharedDataMemory_capacity_vals), 0x0C, "", HFILL }},
1260 { &hf_t30_fif_number,
1261 { "Number", "t30.fif.number", FT_STRING, BASE_NONE, NULL, 0x0,
1264 { &hf_t30_fif_country_code,
1265 { "ITU-T Country code", "t30.fif.country_code", FT_UINT8, BASE_DEC,
1266 NULL, 0, "ITU-T Country code", HFILL }},
1267 { &hf_t30_fif_non_stand_bytes,
1268 { "Non-standard capabilities", "t30.fif.non_standard_cap", FT_BYTES, BASE_HEX,
1269 NULL, 0, "Non-standard capabilities", HFILL }},
1271 { &hf_t30_t4_frame_num,
1272 { "T.4 Frame number", "t30.t4.frame_num", FT_UINT8, BASE_DEC,
1273 NULL, 0, "T.4 Frame number", HFILL }},
1275 { "T.4 Facsimile data field", "t30.t4.data", FT_BYTES, BASE_HEX,
1276 NULL, 0, "T.4 Facsimile data field", HFILL }},
1278 { &hf_t30_partial_page_fcf2,
1279 { "Post-message command", "t30.pps.fcf2", FT_UINT8, BASE_DEC,
1280 VALS(t30_partial_page_fcf2_vals), 0, "Post-message command", HFILL }},
1281 { &hf_t30_partial_page_i1,
1282 { "Page counter", "t30.t4.page_count", FT_UINT8, BASE_DEC,
1283 NULL, 0, "Page counter", HFILL }},
1284 { &hf_t30_partial_page_i2,
1285 { "Block counter", "t30.t4.block_count", FT_UINT8, BASE_DEC,
1286 NULL, 0, "Block counter", HFILL }},
1287 { &hf_t30_partial_page_i3,
1288 { "Frame counter", "t30.t4.frame_count", FT_UINT8, BASE_DEC,
1289 NULL, 0, "Frame counter", HFILL }},
1292 static gint *t30_ett[] =
1300 proto_t30 = proto_register_protocol("T.30", "T.30", "t30");
1301 proto_register_field_array(proto_t30, hf_t30, array_length(hf_t30));
1302 proto_register_subtree_array(t30_ett, array_length(t30_ett));
1304 new_register_dissector("t30.hdlc", dissect_t30_hdlc, proto_t30);
1309 proto_reg_handoff_t30(void)