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>
40 #include "packet-t30.h"
43 static int proto_t30 = -1;
44 static int hf_t30_Address = -1;
45 static int hf_t30_Control = -1;
46 static int hf_t30_Facsimile_Control = -1;
47 static int hf_t30_fif_sm = -1;
48 static int hf_t30_fif_rtif = -1;
49 static int hf_t30_fif_3gmn = -1;
50 static int hf_t30_fif_v8c = -1;
51 static int hf_t30_fif_op = -1;
52 static int hf_t30_fif_rtfc = -1;
53 static int hf_t30_fif_rfo = -1;
54 static int hf_t30_fif_dsr = -1;
55 static int hf_t30_fif_dsr_dcs = -1;
56 static int hf_t30_fif_res = -1;
57 static int hf_t30_fif_tdcc = -1;
58 static int hf_t30_fif_rwc = -1;
59 static int hf_t30_fif_rw_dcs = -1;
60 static int hf_t30_fif_rlc = -1;
61 static int hf_t30_fif_rl_dcs = -1;
62 static int hf_t30_fif_msltcr = -1;
63 static int hf_t30_fif_mslt_dcs = -1;
64 static int hf_t30_fif_ext = -1;
65 static int hf_t30_fif_cm = -1;
66 static int hf_t30_fif_ecm = -1;
67 static int hf_t30_fif_fs_dcs = -1;
68 static int hf_t30_fif_t6 = -1;
69 static int hf_t30_fif_fvc = -1;
70 static int hf_t30_fif_mspc = -1;
71 static int hf_t30_fif_ps = -1;
72 static int hf_t30_fif_t43 = -1;
73 static int hf_t30_fif_pi = -1;
74 static int hf_t30_fif_vc32k = -1;
75 static int hf_t30_fif_r8x15 = -1;
76 static int hf_t30_fif_300x300 = -1;
77 static int hf_t30_fif_r16x15 = -1;
78 static int hf_t30_fif_ibrp = -1;
79 static int hf_t30_fif_mbrp = -1;
80 static int hf_t30_fif_msltchr = -1;
81 static int hf_t30_fif_rts = -1;
82 static int hf_t30_fif_sp = -1;
83 static int hf_t30_fif_sc = -1;
84 static int hf_t30_fif_passw = -1;
85 static int hf_t30_fif_sit = -1;
86 static int hf_t30_fif_rttd = -1;
87 static int hf_t30_fif_bft = -1;
88 static int hf_t30_fif_dtm = -1;
89 static int hf_t30_fif_edi = -1;
90 static int hf_t30_fif_btm = -1;
91 static int hf_t30_fif_rttcmmd = -1;
92 static int hf_t30_fif_chrm = -1;
93 static int hf_t30_fif_mm = -1;
94 static int hf_t30_fif_pm26 = -1;
95 static int hf_t30_fif_dnc = -1;
96 static int hf_t30_fif_do = -1;
97 static int hf_t30_fif_jpeg = -1;
98 static int hf_t30_fif_fcm = -1;
99 static int hf_t30_fif_pht = -1;
100 static int hf_t30_fif_12c = -1;
101 static int hf_t30_fif_ns = -1;
102 static int hf_t30_fif_ci = -1;
103 static int hf_t30_fif_cgr = -1;
104 static int hf_t30_fif_nalet = -1;
105 static int hf_t30_fif_naleg = -1;
106 static int hf_t30_fif_spscb = -1;
107 static int hf_t30_fif_spsco = -1;
108 static int hf_t30_fif_hkm = -1;
109 static int hf_t30_fif_rsa = -1;
110 static int hf_t30_fif_oc = -1;
111 static int hf_t30_fif_hfx40 = -1;
112 static int hf_t30_fif_acn2c = -1;
113 static int hf_t30_fif_acn3c = -1;
114 static int hf_t30_fif_hfx40i = -1;
115 static int hf_t30_fif_ahsn2 = -1;
116 static int hf_t30_fif_ahsn3 = -1;
117 static int hf_t30_fif_t441 = -1;
118 static int hf_t30_fif_t442 = -1;
119 static int hf_t30_fif_t443 = -1;
120 static int hf_t30_fif_plmss = -1;
121 static int hf_t30_fif_cg300 = -1;
122 static int hf_t30_fif_100x100cg = -1;
123 static int hf_t30_fif_spcbft = -1;
124 static int hf_t30_fif_ebft = -1;
125 static int hf_t30_fif_isp = -1;
126 static int hf_t30_fif_ira = -1;
127 static int hf_t30_fif_600x600 = -1;
128 static int hf_t30_fif_1200x1200 = -1;
129 static int hf_t30_fif_300x600 = -1;
130 static int hf_t30_fif_400x800 = -1;
131 static int hf_t30_fif_600x1200 = -1;
132 static int hf_t30_fif_cg600x600 = -1;
133 static int hf_t30_fif_cg1200x1200 = -1;
134 static int hf_t30_fif_dspcam = -1;
135 static int hf_t30_fif_dspccm = -1;
136 static int hf_t30_fif_bwmrcp = -1;
137 static int hf_t30_fif_t45 = -1;
138 static int hf_t30_fif_sdmc = -1;
139 static int hf_t30_fif_number = -1;
140 static int hf_t30_fif_country_code = -1;
141 static int hf_t30_fif_non_stand_bytes = -1;
142 static int hf_t30_t4_frame_num = -1;
143 static int hf_t30_t4_data = -1;
144 static int hf_t30_partial_page_fcf2 = -1;
145 static int hf_t30_partial_page_i1 = -1;
146 static int hf_t30_partial_page_i2 = -1;
147 static int hf_t30_partial_page_i3 = -1;
149 static gint ett_t30 = -1;
150 static gint ett_t30_fif = -1;
152 static const value_string t30_control_vals[] = {
153 { 0xC0, "non-final frames within the procedure" },
154 { 0xC8, "final frames within the procedure" },
158 #define T30_FC_DIS 0x01
159 #define T30_FC_CSI 0x02
160 #define T30_FC_NSF 0x04
161 #define T30_FC_DTC 0x81
162 #define T30_FC_CIG 0x82
163 #define T30_FC_NSC 0x84
164 #define T30_FC_PWD 0x83
165 #define T30_FC_SEP 0x85
166 #define T30_FC_PSA 0x86
167 #define T30_FC_CIA 0x87
168 #define T30_FC_ISP 0x88
169 #define T30_FC_DCS 0x41
170 #define T30_FC_TSI 0x42
171 #define T30_FC_NSS 0x44
172 #define T30_FC_SUB 0x43
173 #define T30_FC_SID 0x45
174 #define T30_FC_TSA 0x46
175 #define T30_FC_IRA 0x47
176 #define T30_FC_CFR 0x21
177 #define T30_FC_FTT 0x22
178 #define T30_FC_CSA 0x24
179 #define T30_FC_EOM 0x71
180 #define T30_FC_MPS 0x72
181 #define T30_FC_EOP 0x74
182 #define T30_FC_PRI_EOM 0x79
183 #define T30_FC_PRI_MPS 0x7A
184 #define T30_FC_PRI_EOP 0x7C
185 #define T30_FC_PRI_EOP2 0x78
186 #define T30_FC_MCF 0x31
187 #define T30_FC_RTP 0x33
188 #define T30_FC_RTN 0x32
189 #define T30_FC_PIP 0x35
190 #define T30_FC_PIN 0x34
191 #define T30_FC_FDM 0x3F
192 #define T30_FC_DCN 0x5F
193 #define T30_FC_CRP 0x58
194 #define T30_FC_FNV 0x53
195 #define T30_FC_TNR 0x57
196 #define T30_FC_TR 0x56
197 #define T30_FC_MCF 0x31
198 #define T30_FC_PID 0x36
199 #define T30_FC_PPR 0x3D
200 #define T30_FC_RNR 0x37
201 #define T30_FC_CRP 0x58
202 #define T30_FC_CTC 0x48
203 #define T30_FC_CTR 0x23
204 #define T30_FC_PPS 0x7D
205 #define T30_FC_EOR 0x73
206 #define T30_FC_RR 0x76
207 #define T30_FC_ERR 0x38
208 #define T30_FC_FCD 0x60
209 #define T30_FC_RCP 0x61
211 const value_string t30_facsimile_control_field_vals[] = {
212 { T30_FC_DIS, "Digital Identification Signal" },
213 { T30_FC_CSI, "Called Subscriber Identification" },
214 { T30_FC_NSF, "Non-Standard Facilities" },
215 { T30_FC_DTC, "Digital Transmit Command" },
216 { T30_FC_CIG, "Calling Subscriber Identification" },
217 { T30_FC_NSC, "Non-Standard facilities Command" },
218 { T30_FC_PWD, "Password" },
219 { T30_FC_SEP, "Selective Polling" },
220 { T30_FC_PSA, "Polled Subaddress" },
221 { T30_FC_CIA, "Calling subscriber Internet Address" },
222 { T30_FC_ISP, "Internet Selective Polling Address" },
223 { T30_FC_DCS, "Digital Command Signal" },
224 { T30_FC_TSI, "Transmitting Subscriber Identification" },
225 { T30_FC_NSS, "Non-Standard facilities Set-up" },
226 { T30_FC_SUB, "Subaddress" },
227 { T30_FC_SID, "Sender Identification" },
228 { T30_FC_TSA, "Transmitting Subscriber Internet address" },
229 { T30_FC_IRA, "Internet Routing Address" },
230 { T30_FC_CFR, "Confirmation To Receive" },
231 { T30_FC_FTT, "Failure To Train" },
232 { T30_FC_CSA, "Called Subscriber Internet Address" },
233 { T30_FC_EOM, "End Of Message" },
234 { T30_FC_MPS, "MultiPage Signal" },
235 { T30_FC_EOP, "End Of Procedure" },
236 { T30_FC_PRI_EOM, "Procedure Interrupt-End Of Message" },
237 { T30_FC_PRI_MPS, "Procedure Interrupt-MultiPage Signal" },
238 { T30_FC_PRI_EOP, "Procedure Interrupt-End Of Procedure" },
239 { T30_FC_PRI_EOP2, "Procedure Interrupt-End Of Procedure" },
240 { T30_FC_MCF, "Message Confirmation" },
241 { T30_FC_RTP, "Retrain Positive" },
242 { T30_FC_RTN, "Retrain Negative" },
243 { T30_FC_PIP, "Procedure Interrupt Positive" },
244 { T30_FC_PIN, "Procedure Interrupt Negative" },
245 { T30_FC_FDM, "File Diagnostics Message" },
246 { T30_FC_DCN, "Disconnect" },
247 { T30_FC_CRP, "Command Repeat" },
248 { T30_FC_FNV, "Field Not Valid" },
249 { T30_FC_TNR, "Transmit not ready" },
250 { T30_FC_TR, "Transmit ready" },
251 { T30_FC_MCF, "Message Confirmation" },
252 { T30_FC_PID, "Procedure Interrupt Disconnect" },
253 { T30_FC_PPR, "Partial Page Request" },
254 { T30_FC_RNR, "Receive Not Ready" },
255 { T30_FC_CRP, "Command Repeat" },
256 { T30_FC_CTC, "Continue To Correct" },
257 { T30_FC_CTR, "Response for Continue To Correct" },
258 { T30_FC_PPS, "Partial Page Signal" },
259 { T30_FC_EOR, "End Of Retransmission" },
260 { T30_FC_RR, "Receive Ready" },
261 { T30_FC_ERR, "Response for End of Retransmission" },
262 { T30_FC_FCD, "Facsimile coded data" },
263 { T30_FC_RCP, "Return to control for partial page" },
267 const value_string t30_facsimile_control_field_vals_short[] = {
268 { T30_FC_DIS, "DIS" },
269 { T30_FC_CSI, "CSI" },
270 { T30_FC_NSF, "NSF" },
271 { T30_FC_DTC, "DTC" },
272 { T30_FC_CIG, "CIG" },
273 { T30_FC_NSC, "NSC" },
274 { T30_FC_PWD, "PWD" },
275 { T30_FC_SEP, "SEP" },
276 { T30_FC_PSA, "PSA" },
277 { T30_FC_CIA, "CIA" },
278 { T30_FC_ISP, "ISP" },
279 { T30_FC_DCS, "DCS" },
280 { T30_FC_TSI, "TSI" },
281 { T30_FC_NSS, "NSS" },
282 { T30_FC_SUB, "SUB" },
283 { T30_FC_SID, "SID" },
284 { T30_FC_TSA, "TSA" },
285 { T30_FC_IRA, "IRA" },
286 { T30_FC_CFR, "CFR" },
287 { T30_FC_FTT, "FTT" },
288 { T30_FC_CSA, "CSA" },
289 { T30_FC_EOM, "EOM" },
290 { T30_FC_MPS, "MPS" },
291 { T30_FC_EOP, "EOP" },
292 { T30_FC_PRI_EOM, "PRI_EOM" },
293 { T30_FC_PRI_MPS, "PRI_MPS" },
294 { T30_FC_PRI_EOP, "EOP" },
295 { T30_FC_PRI_EOP2, "EOP2" },
296 { T30_FC_MCF, "MCF" },
297 { T30_FC_RTP, "RTP" },
298 { T30_FC_RTN, "RTN" },
299 { T30_FC_PIP, "PIP" },
300 { T30_FC_PIN, "PIN" },
301 { T30_FC_FDM, "FDM" },
302 { T30_FC_DCN, "DCN" },
303 { T30_FC_CRP, "CRP" },
304 { T30_FC_FNV, "FNV" },
305 { T30_FC_TNR, "TNR" },
307 { T30_FC_MCF, "MCF" },
308 { T30_FC_PID, "PID" },
309 { T30_FC_PPR, "PPR" },
310 { T30_FC_RNR, "RNR" },
311 { T30_FC_CRP, "CRP" },
312 { T30_FC_CTC, "CTC" },
313 { T30_FC_CTR, "CTR" },
314 { T30_FC_PPS, "PPS" },
315 { T30_FC_EOR, "EOR" },
317 { T30_FC_ERR, "ERR" },
318 { T30_FC_FCD, "FCD" },
319 { T30_FC_RCP, "RCP" },
323 static const value_string t30_data_signalling_rate_vals[] = {
324 { 0x00, "ITU-T V.27 ter fall-back mode" },
325 { 0x04, "ITU-T V.27 ter" },
326 { 0x08, "ITU-T V.29" },
327 { 0x0C, "ITU-T V.27 ter and V.29" },
328 { 0x02, "Not used" },
329 { 0x06, "Reserved" },
330 { 0x0A, "Not used" },
332 { 0x01, "Not used" },
333 { 0x05, "Reserved" },
334 { 0x09, "Not used" },
335 { 0x0D, "ITU-T V.27 ter, V.29, and V.17" },
336 { 0x03, "Not used" },
337 { 0x07, "Reserved" },
338 { 0x0B, "Not used" },
339 { 0x0F, "Reserved" },
343 static const value_string t30_data_signalling_rate_dcs_vals[] = {
344 { 0x00, "2400 bit/s, ITU-T V.27 ter" },
345 { 0x04, "4800 bit/s, ITU-T V.27 ter" },
346 { 0x08, "9600 bit/s, ITU-T V.29" },
347 { 0x0C, "7200 bit/s, ITU-T V.29" },
350 { 0x0A, "Reserved" },
351 { 0x0E, "Reserved" },
352 { 0x01, "14 400 bit/s, ITU-T V.17" },
353 { 0x05, "12 000 bit/s, ITU-T V.17" },
354 { 0x09, "9600 bit/s, ITU-T V.17" },
355 { 0x0D, "7200 bit/s, ITU-T V.17" },
356 { 0x03, "Reserved" },
357 { 0x07, "Reserved" },
358 { 0x0B, "Reserved" },
359 { 0x0F, "Reserved" },
363 static const value_string t30_recording_width_capabilities_vals[] = {
364 { 0x00, "Scan line length 215 mm +- 1%" },
365 { 0x01, "Scan line length 215 mm +- 1% and Scan line length 255 mm +- 1% and Scan line length 303 mm +- 1%" },
366 { 0x02, "Scan line length 215 mm +- 1% and Scan line length 255 mm +- 1%" },
371 static const value_string t30_recording_width_dcs_vals[] = {
372 { 0x00, "Scan line length 215 mm +- 1%" },
373 { 0x01, "Scan line length 303 mm +- 1%" },
374 { 0x02, "Scan line length 255 mm +- 1%" },
379 static const value_string t30_recording_length_capability_vals[] = {
380 { 0x00, "A4 (297 mm)" },
381 { 0x01, "Unlimited" },
382 { 0x02, "A4 (297 mm) and B4 (364 mm)" },
387 static const value_string t30_recording_length_dcs_vals[] = {
388 { 0x00, "A4 (297 mm)" },
389 { 0x01, "Unlimited" },
390 { 0x02, "B4 (364 mm)" },
395 static const value_string t30_minimum_scan_line_time_rec_vals[] = {
396 { 0x00, "20 ms at 3.85 l/mm: T7.7 = T3.85" },
397 { 0x01, "40 ms at 3.85 l/mm: T7.7 = T3.85" },
398 { 0x02, "10 ms at 3.85 l/mm: T7.7 = T3.85" },
399 { 0x04, "05 ms at 3.85 l/mm: T7.7 = T3.85" },
400 { 0x03, "10 ms at 3.85 l/mm: T7.7 = 1/2 T3.85" },
401 { 0x06, "20 ms at 3.85 l/mm: T7.7 = 1/2 T3.85" },
402 { 0x05, "40 ms at 3.85 l/mm: T7.7 = 1/2 T3.85" },
403 { 0x07, "00 ms at 3.85 l/mm: T7.7 = T3.85" },
407 static const value_string t30_partial_page_fcf2_vals[] = {
408 { 0x00, "NULL code which indicates the partial page boundary" },
409 { 0xF1, "EOM in optional T.4 error correction mode" },
410 { 0xF2, "MPS in optional T.4 error correction mode" },
411 { 0xF4, "EOP in optional T.4 error correction mode" },
412 { 0xF8, "EOS in optional T.4 error correction mode" },
413 { 0xF9, "PRI-EOM in optional T.4 error correction mode" },
414 { 0xFA, "PRI-MPS in optional T.4 error correction mode" },
415 { 0xFC, "PRI-EOP in optional T.4 error correction mode" },
419 static const value_string t30_minimum_scan_line_time_dcs_vals[] = {
428 static const value_string t30_SharedDataMemory_capacity_vals[] = {
429 { 0x00, "Not available" },
430 { 0x01, "Level 1 = 1.0 Mbytes" },
431 { 0x02, "Level 2 = 2.0 Mbytes" },
432 { 0x03, "Level 3 = unlimited (i.e. >= 32 Mbytes)" },
436 static const true_false_string t30_octets_preferred_value = {
437 "64 octets preferred",
438 "256 octets preferred",
441 static const true_false_string t30_extension_ind_value = {
442 "information continues through the next octet",
446 static const true_false_string t30_compress_value = {
451 static const true_false_string t30_minimum_scan_value = {
456 static const true_false_string t30_duplex_operation_value = {
457 "Duplex and half duplex operation",
458 "Half duplex operation only",
461 static const true_false_string t30_frame_size_dcs_value = {
466 static const true_false_string t30_res_type_sel_value = {
467 "inch based resolution",
468 "metric based resolution",
471 guint8 reverse_byte(guint8 val)
473 return ( ((val & 0x80)>>7) | ((val & 0x40)>>5) |
474 ((val & 0x20)>>3) | ((val & 0x10)>>1) |
475 ((val & 0x08)<<1) | ((val & 0x04)<<3) |
476 ((val & 0x02)<<5) | ((val & 0x01)<<7) );
479 #define LENGTH_T30_NUM 20
481 t30_get_string_numbers(tvbuff_t *tvb, int offset, int len)
486 /* the length must be 20 bytes per T30 rec*/
487 if (len != LENGTH_T30_NUM) return NULL;
489 buf=ep_alloc(LENGTH_T30_NUM+1);
491 for (i=0; i<LENGTH_T30_NUM; i++)
492 buf[LENGTH_T30_NUM-i-1] = reverse_byte(tvb_get_guint8(tvb, offset+i));
494 /* add end of string */
495 buf[LENGTH_T30_NUM] = '\0';
497 return g_strstrip(buf);
502 dissect_t30_numbers(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree)
506 str_num = t30_get_string_numbers(tvb, offset, len);
508 proto_tree_add_string_format(tree, hf_t30_fif_number, tvb, offset, LENGTH_T30_NUM, str_num, "Number: %s", str_num);
510 if (check_col(pinfo->cinfo, COL_INFO))
511 col_append_fstr(pinfo->cinfo, COL_INFO, " - Number:%s", str_num );
513 if (pinfo->private_data)
514 g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, "Num: %s", str_num);
517 proto_tree_add_text(tree, tvb, offset, tvb_reported_length_remaining(tvb, offset), "[MALFORMED OR SHORT PACKET: number of digits must be 20]");
519 if (check_col(pinfo->cinfo, COL_INFO))
520 col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET: number of digits must be 20]" );
525 dissect_t30_facsimile_coded_data(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree)
531 proto_tree_add_text(tree, tvb, offset, tvb_reported_length_remaining(tvb, offset), "[MALFORMED OR SHORT PACKET: FCD length must be at least 2 bytes]");
532 expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR, "T30 FCD length must be at least 2 bytes");
533 if (check_col(pinfo->cinfo, COL_INFO))
534 col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET]");
538 octet = tvb_get_guint8(tvb, offset);
539 proto_tree_add_uint(tree, hf_t30_t4_frame_num, tvb, offset, 1, reverse_byte(octet));
542 if (check_col(pinfo->cinfo, COL_INFO))
543 col_append_fstr(pinfo->cinfo, COL_INFO, " - Frame num:%d", reverse_byte(octet));
545 if (pinfo->private_data)
546 g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, "Frm num: %d", reverse_byte(octet));
548 t4_data = ep_alloc(len-1);
549 tvb_memcpy(tvb, t4_data, offset, len-1);
550 proto_tree_add_bytes(tree, hf_t30_t4_data, tvb, offset, len-1, t4_data);
554 dissect_t30_non_standard_cap(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree)
557 guint8 *non_standard_bytes;
560 proto_tree_add_text(tree, tvb, offset, tvb_reported_length_remaining(tvb, offset), "[MALFORMED OR SHORT PACKET: NSC length must be at least 2 bytes]");
561 expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR, "T30 NSC length must be at least 2 bytes");
562 if (check_col(pinfo->cinfo, COL_INFO))
563 col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET]");
567 octet = tvb_get_guint8(tvb, offset);
568 proto_tree_add_uint(tree, hf_t30_fif_country_code, tvb, offset, 1, octet);
571 non_standard_bytes = ep_alloc(len-1);
572 tvb_memcpy(tvb, non_standard_bytes, offset, len-1);
573 proto_tree_add_bytes(tree, hf_t30_fif_non_stand_bytes, tvb, offset, len-1, non_standard_bytes);
578 dissect_t30_partial_page_signal(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree)
580 guint8 octet, page_count, block_count, frame_count;
583 proto_tree_add_text(tree, tvb, offset, tvb_reported_length_remaining(tvb, offset), "[MALFORMED OR SHORT PACKET: PPS length must be 4 bytes]");
584 expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR, "T30 PPS length must be 4 bytes");
585 if (check_col(pinfo->cinfo, COL_INFO))
586 col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET]");
590 octet = tvb_get_guint8(tvb, offset);
591 proto_tree_add_uint(tree, hf_t30_partial_page_fcf2, tvb, offset, 1, octet);
594 octet = tvb_get_guint8(tvb, offset);
595 page_count = reverse_byte(octet);
596 proto_tree_add_uint(tree, hf_t30_partial_page_i1, tvb, offset, 1, page_count);
599 octet = tvb_get_guint8(tvb, offset);
600 block_count = reverse_byte(octet);
601 proto_tree_add_uint(tree, hf_t30_partial_page_i2, tvb, offset, 1, block_count);
604 octet = tvb_get_guint8(tvb, offset);
605 frame_count = reverse_byte(octet);
606 proto_tree_add_uint(tree, hf_t30_partial_page_i3, tvb, offset, 1, frame_count);
609 if (check_col(pinfo->cinfo, COL_INFO))
610 col_append_fstr(pinfo->cinfo, COL_INFO, " - PC:%d BC:%d FC:%d", page_count, block_count, frame_count);
612 if (pinfo->private_data)
613 g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, "PC:%d BC:%d FC:%d", page_count, block_count, frame_count);
618 dissect_t30_dis_dtc(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree, gboolean dis_dtc)
623 proto_tree_add_text(tree, tvb, offset, tvb_reported_length_remaining(tvb, offset), "[MALFORMED OR SHORT PACKET: DIS length must be at least 4 bytes]");
624 expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR, "T30 DIS length must be at least 4 bytes");
625 if (check_col(pinfo->cinfo, COL_INFO))
626 col_append_str(pinfo->cinfo, COL_INFO, " [MALFORMED OR SHORT PACKET]");
631 octet = tvb_get_guint8(tvb, offset);
633 proto_tree_add_boolean(tree, hf_t30_fif_sm, tvb, offset, 1, octet);
634 proto_tree_add_boolean(tree, hf_t30_fif_rtif, tvb, offset, 1, octet);
635 proto_tree_add_boolean(tree, hf_t30_fif_3gmn, tvb, offset, 1, octet);
637 proto_tree_add_boolean(tree, hf_t30_fif_v8c, tvb, offset, 1, octet);
638 proto_tree_add_boolean(tree, hf_t30_fif_op, tvb, offset, 1, octet);
642 octet = tvb_get_guint8(tvb, offset);
644 if (dis_dtc) proto_tree_add_boolean(tree, hf_t30_fif_rtfc, tvb, offset, 1, octet);
645 proto_tree_add_boolean(tree, hf_t30_fif_rfo, tvb, offset, 1, octet);
647 proto_tree_add_uint(tree, hf_t30_fif_dsr, tvb, offset, 1, octet);
649 if (check_col(pinfo->cinfo, COL_INFO))
650 col_append_fstr(pinfo->cinfo, COL_INFO, " - DSR:%s", val_to_str((octet&0x3C) >> 2, t30_data_signalling_rate_vals, "<unknown>"));
652 if (pinfo->private_data)
653 g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, "DSR:%s", val_to_str((octet&0x3C) >> 2, t30_data_signalling_rate_vals, "<unknown>"));
656 proto_tree_add_uint(tree, hf_t30_fif_dsr_dcs, tvb, offset, 1, octet);
658 if (check_col(pinfo->cinfo, COL_INFO))
659 col_append_fstr(pinfo->cinfo, COL_INFO, " - DSR:%s", val_to_str((octet&0x3C) >> 2, t30_data_signalling_rate_dcs_vals, "<unknown>"));
661 if (pinfo->private_data)
662 g_snprintf(((t38_packet_info*)pinfo->private_data)->desc, MAX_T38_DESC, "DSR:%s", val_to_str((octet&0x3C) >> 2, t30_data_signalling_rate_dcs_vals, "<unknown>"));
664 proto_tree_add_boolean(tree, hf_t30_fif_res, tvb, offset, 1, octet);
665 proto_tree_add_boolean(tree, hf_t30_fif_tdcc, tvb, offset, 1, octet);
669 octet = tvb_get_guint8(tvb, offset);
672 proto_tree_add_uint(tree, hf_t30_fif_rwc, tvb, offset, 1, octet);
673 proto_tree_add_uint(tree, hf_t30_fif_rlc, tvb, offset, 1, octet);
674 proto_tree_add_uint(tree, hf_t30_fif_msltcr, tvb, offset, 1, octet);
676 proto_tree_add_uint(tree, hf_t30_fif_rw_dcs, tvb, offset, 1, octet);
677 proto_tree_add_uint(tree, hf_t30_fif_rl_dcs, tvb, offset, 1, octet);
678 proto_tree_add_uint(tree, hf_t30_fif_mslt_dcs, tvb, offset, 1, octet);
680 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
682 if ( !(octet & 0x01) || (len < 4) ) return; /* no extension */
686 octet = tvb_get_guint8(tvb, offset);
688 proto_tree_add_boolean(tree, hf_t30_fif_cm, tvb, offset, 1, octet);
689 proto_tree_add_boolean(tree, hf_t30_fif_ecm, tvb, offset, 1, octet);
690 if (!dis_dtc) proto_tree_add_boolean(tree, hf_t30_fif_fs_dcs, tvb, offset, 1, octet);
691 proto_tree_add_boolean(tree, hf_t30_fif_t6, tvb, offset, 1, octet);
692 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
694 if ( !(octet & 0x01) || (len < 5) ) return; /* no extension */
698 octet = tvb_get_guint8(tvb, offset);
700 proto_tree_add_boolean(tree, hf_t30_fif_fvc, tvb, offset, 1, octet);
702 proto_tree_add_boolean(tree, hf_t30_fif_mspc, tvb, offset, 1, octet);
703 proto_tree_add_boolean(tree, hf_t30_fif_ps, tvb, offset, 1, octet);
705 proto_tree_add_boolean(tree, hf_t30_fif_t43, tvb, offset, 1, octet);
706 proto_tree_add_boolean(tree, hf_t30_fif_pi, tvb, offset, 1, octet);
707 proto_tree_add_boolean(tree, hf_t30_fif_vc32k, tvb, offset, 1, octet);
708 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
710 if ( !(octet & 0x01) || (len < 6) ) return; /* no extension */
714 octet = tvb_get_guint8(tvb, offset);
716 proto_tree_add_boolean(tree, hf_t30_fif_r8x15, tvb, offset, 1, octet);
717 proto_tree_add_boolean(tree, hf_t30_fif_300x300, tvb, offset, 1, octet);
718 proto_tree_add_boolean(tree, hf_t30_fif_r16x15, tvb, offset, 1, octet);
720 proto_tree_add_boolean(tree, hf_t30_fif_ibrp, tvb, offset, 1, octet);
721 proto_tree_add_boolean(tree, hf_t30_fif_mbrp, tvb, offset, 1, octet);
722 proto_tree_add_boolean(tree, hf_t30_fif_msltchr, tvb, offset, 1, octet);
723 proto_tree_add_boolean(tree, hf_t30_fif_sp, tvb, offset, 1, octet);
725 proto_tree_add_boolean(tree, hf_t30_fif_rts, tvb, offset, 1, octet);
727 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
729 if ( !(octet & 0x01) || (len < 7) ) return; /* no extension */
733 octet = tvb_get_guint8(tvb, offset);
735 proto_tree_add_boolean(tree, hf_t30_fif_sc, tvb, offset, 1, octet);
737 proto_tree_add_boolean(tree, hf_t30_fif_passw, tvb, offset, 1, octet);
738 proto_tree_add_boolean(tree, hf_t30_fif_rttd, tvb, offset, 1, octet);
740 proto_tree_add_boolean(tree, hf_t30_fif_sit, tvb, offset, 1, octet);
742 proto_tree_add_boolean(tree, hf_t30_fif_bft, tvb, offset, 1, octet);
743 proto_tree_add_boolean(tree, hf_t30_fif_dtm, tvb, offset, 1, octet);
744 proto_tree_add_boolean(tree, hf_t30_fif_edi, tvb, offset, 1, octet);
745 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
747 if ( !(octet & 0x01) || (len < 8) ) return; /* no extension */
751 octet = tvb_get_guint8(tvb, offset);
753 proto_tree_add_boolean(tree, hf_t30_fif_btm, tvb, offset, 1, octet);
754 if (dis_dtc) proto_tree_add_boolean(tree, hf_t30_fif_rttcmmd, tvb, offset, 1, octet);
755 proto_tree_add_boolean(tree, hf_t30_fif_chrm, tvb, offset, 1, octet);
756 proto_tree_add_boolean(tree, hf_t30_fif_mm, tvb, offset, 1, octet);
757 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
759 if ( !(octet & 0x01) || (len < 9) ) return; /* no extension */
763 octet = tvb_get_guint8(tvb, offset);
765 proto_tree_add_boolean(tree, hf_t30_fif_pm26, tvb, offset, 1, octet);
766 proto_tree_add_boolean(tree, hf_t30_fif_dnc, tvb, offset, 1, octet);
767 proto_tree_add_boolean(tree, hf_t30_fif_do, tvb, offset, 1, octet);
768 proto_tree_add_boolean(tree, hf_t30_fif_jpeg, tvb, offset, 1, octet);
769 proto_tree_add_boolean(tree, hf_t30_fif_fcm, tvb, offset, 1, octet);
770 if (!dis_dtc) proto_tree_add_boolean(tree, hf_t30_fif_pht, tvb, offset, 1, octet);
771 proto_tree_add_boolean(tree, hf_t30_fif_12c, tvb, offset, 1, octet);
772 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
774 if ( !(octet & 0x01) || (len < 10) ) return; /* no extension */
778 octet = tvb_get_guint8(tvb, offset);
780 proto_tree_add_boolean(tree, hf_t30_fif_ns, tvb, offset, 1, octet);
781 proto_tree_add_boolean(tree, hf_t30_fif_ci, tvb, offset, 1, octet);
782 proto_tree_add_boolean(tree, hf_t30_fif_cgr, tvb, offset, 1, octet);
783 proto_tree_add_boolean(tree, hf_t30_fif_nalet, tvb, offset, 1, octet);
784 proto_tree_add_boolean(tree, hf_t30_fif_naleg, tvb, offset, 1, octet);
785 proto_tree_add_boolean(tree, hf_t30_fif_spscb, tvb, offset, 1, octet);
786 proto_tree_add_boolean(tree, hf_t30_fif_spsco, tvb, offset, 1, octet);
787 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
789 if ( !(octet & 0x01) || (len < 11) ) return; /* no extension */
793 octet = tvb_get_guint8(tvb, offset);
795 proto_tree_add_boolean(tree, hf_t30_fif_hkm, tvb, offset, 1, octet);
796 proto_tree_add_boolean(tree, hf_t30_fif_rsa, tvb, offset, 1, octet);
797 proto_tree_add_boolean(tree, hf_t30_fif_oc, tvb, offset, 1, octet);
798 proto_tree_add_boolean(tree, hf_t30_fif_hfx40, tvb, offset, 1, octet);
799 proto_tree_add_boolean(tree, hf_t30_fif_acn2c, tvb, offset, 1, octet);
800 proto_tree_add_boolean(tree, hf_t30_fif_acn3c, tvb, offset, 1, octet);
801 proto_tree_add_boolean(tree, hf_t30_fif_hfx40i, tvb, offset, 1, octet);
802 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
804 if ( !(octet & 0x01) || (len < 12) ) return; /* no extension */
808 octet = tvb_get_guint8(tvb, offset);
810 proto_tree_add_boolean(tree, hf_t30_fif_ahsn2, tvb, offset, 1, octet);
811 proto_tree_add_boolean(tree, hf_t30_fif_ahsn3, tvb, offset, 1, octet);
812 proto_tree_add_boolean(tree, hf_t30_fif_t441, tvb, offset, 1, octet);
813 proto_tree_add_boolean(tree, hf_t30_fif_t442, tvb, offset, 1, octet);
814 proto_tree_add_boolean(tree, hf_t30_fif_t443, tvb, offset, 1, octet);
815 proto_tree_add_boolean(tree, hf_t30_fif_plmss, tvb, offset, 1, octet);
816 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
818 if ( !(octet & 0x01) || (len < 13) ) return; /* no extension */
822 octet = tvb_get_guint8(tvb, offset);
824 proto_tree_add_boolean(tree, hf_t30_fif_cg300, tvb, offset, 1, octet);
825 proto_tree_add_boolean(tree, hf_t30_fif_100x100cg, tvb, offset, 1, octet);
826 proto_tree_add_boolean(tree, hf_t30_fif_spcbft, tvb, offset, 1, octet);
828 proto_tree_add_boolean(tree, hf_t30_fif_ebft, tvb, offset, 1, octet);
829 proto_tree_add_boolean(tree, hf_t30_fif_isp, tvb, offset, 1, octet);
831 proto_tree_add_boolean(tree, hf_t30_fif_ira, tvb, offset, 1, octet);
832 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
834 if ( !(octet & 0x01) || (len < 14) ) return; /* no extension */
836 /* bits 105 to 112 */
838 octet = tvb_get_guint8(tvb, offset);
840 proto_tree_add_boolean(tree, hf_t30_fif_600x600, tvb, offset, 1, octet);
841 proto_tree_add_boolean(tree, hf_t30_fif_1200x1200, tvb, offset, 1, octet);
842 proto_tree_add_boolean(tree, hf_t30_fif_300x600, tvb, offset, 1, octet);
843 proto_tree_add_boolean(tree, hf_t30_fif_400x800, tvb, offset, 1, octet);
844 proto_tree_add_boolean(tree, hf_t30_fif_600x1200, tvb, offset, 1, octet);
845 proto_tree_add_boolean(tree, hf_t30_fif_cg600x600, tvb, offset, 1, octet);
846 proto_tree_add_boolean(tree, hf_t30_fif_cg1200x1200, tvb, offset, 1, octet);
847 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
849 if ( !(octet & 0x01) || (len < 15) ) return; /* no extension */
851 /* bits 113 to 120 */
853 octet = tvb_get_guint8(tvb, offset);
855 proto_tree_add_boolean(tree, hf_t30_fif_dspcam, tvb, offset, 1, octet);
856 proto_tree_add_boolean(tree, hf_t30_fif_dspccm, tvb, offset, 1, octet);
857 if (dis_dtc) proto_tree_add_boolean(tree, hf_t30_fif_bwmrcp, tvb, offset, 1, octet);
858 proto_tree_add_boolean(tree, hf_t30_fif_t45, tvb, offset, 1, octet);
859 proto_tree_add_uint(tree, hf_t30_fif_sdmc, tvb, offset, 1, octet);
860 proto_tree_add_boolean(tree, hf_t30_fif_ext, tvb, offset, 1, octet);
862 if ( !(octet & 0x01) ) return; /* no extension */
867 dissect_t30_hdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
878 if (tvb_reported_length_remaining(tvb, offset) < 3) {
879 proto_tree_add_text(tree, tvb, offset, tvb_reported_length_remaining(tvb, offset), "[MALFORMED OR SHORT PACKET: hdlc T30 length must be at least 4 bytes]");
880 expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR, "T30 length must be at least 4 bytes");
881 if (check_col(pinfo->cinfo, COL_INFO))
882 col_append_str(pinfo->cinfo, COL_INFO, " (HDLC Reassembled: [MALFORMED OR SHORT PACKET])");
888 if (check_col(pinfo->cinfo, COL_INFO))
889 col_append_str(pinfo->cinfo, COL_INFO, " (HDLC Reassembled:");
891 it=proto_tree_add_protocol_format(tree, proto_t30, tvb, offset, -1,
892 "ITU-T Recommendation T.30");
893 tr=proto_item_add_subtree(it, ett_t30);
895 octet = tvb_get_guint8(tvb, offset);
896 item = proto_tree_add_uint(tr, hf_t30_Address, tvb, offset, 1, octet);
897 if (octet != 0xFF) expert_add_info_format(pinfo, item, PI_REASSEMBLE, PI_WARN, "T30 Address must be 0xFF");
900 octet = tvb_get_guint8(tvb, offset);
901 item = proto_tree_add_uint(tr, hf_t30_Control, tvb, offset, 1, octet);
902 if ((octet != 0xC0) && (octet != 0xC8)) expert_add_info_format(pinfo, item, PI_REASSEMBLE, PI_WARN, "T30 Control Field must be 0xC0 or 0xC8");
905 octet = tvb_get_guint8(tvb, offset);
906 it_fcf = proto_tree_add_uint(tr, hf_t30_Facsimile_Control, tvb, offset, 1, octet & 0x7F);
909 tr_fif = proto_item_add_subtree(it_fcf, ett_t30_fif);
911 frag_len = tvb_length_remaining(tvb, offset);
912 if (pinfo->private_data) ((t38_packet_info*)pinfo->private_data)->t30_Facsimile_Control = octet;
914 if (check_col(pinfo->cinfo, COL_INFO))
915 col_append_fstr(pinfo->cinfo, COL_INFO, " %s - %s", val_to_str(octet & 0x7F, t30_facsimile_control_field_vals_short, "<unknown>"),
916 val_to_str(octet & 0x7F, t30_facsimile_control_field_vals, "<unknown>") );
918 switch (octet & 0x7F) {
921 dissect_t30_dis_dtc(tvb, offset, pinfo, frag_len, tr_fif, TRUE);
924 dissect_t30_dis_dtc(tvb, offset, pinfo, frag_len, tr_fif, FALSE);
934 dissect_t30_numbers(tvb, offset, pinfo, frag_len, tr_fif);
939 dissect_t30_non_standard_cap(tvb, offset, pinfo, frag_len, tr_fif);
942 dissect_t30_facsimile_coded_data(tvb, offset, pinfo, frag_len, tr_fif);
945 dissect_t30_partial_page_signal(tvb, offset, pinfo, frag_len, tr_fif);
949 if (check_col(pinfo->cinfo, COL_INFO))
950 col_append_str(pinfo->cinfo, COL_INFO, ")");
957 /* Wireshark Protocol Registration */
959 proto_register_t30(void)
961 static hf_register_info hf_t30[] =
964 { "Address", "t30.Address", FT_UINT8, BASE_HEX,
965 NULL, 0, "Address Field", HFILL }},
967 { "Control", "t30.Control", FT_UINT8, BASE_HEX,
968 VALS(t30_control_vals), 0, "Address Field", HFILL }},
969 { &hf_t30_Facsimile_Control,
970 { "Facsimile Control", "t30.FacsimileControl", FT_UINT8, BASE_DEC,
971 VALS(t30_facsimile_control_field_vals), 0, "Facsimile Control", HFILL }},
974 { "Store and forward Internet fax- Simple mode (ITU-T T.37)", "t30.fif.sm", FT_BOOLEAN, 8,
975 TFS(&flags_set_truth), 0x80, "", HFILL }},
977 { "Real-time Internet fax (ITU T T.38)", "t30.fif.rtif", FT_BOOLEAN, 8,
978 TFS(&flags_set_truth), 0x20, "", HFILL }},
980 { "3rd Generation Mobile Network", "t30.fif.3gmn", FT_BOOLEAN, 8,
981 TFS(&flags_set_truth), 0x10, "", HFILL }},
983 { "V.8 capabilities", "t30.fif.v8c", FT_BOOLEAN, 8,
984 TFS(&flags_set_truth), 0x04, "", HFILL }},
986 { "Octets preferred", "t30.fif.op", FT_BOOLEAN, 8,
987 TFS(&t30_octets_preferred_value), 0x02, "", HFILL }},
989 { "Ready to transmit a facsimile document (polling)", "t30.fif.rtfc", FT_BOOLEAN, 8,
990 TFS(&flags_set_truth), 0x80, "", HFILL }},
992 { "Receiver fax operation", "t30.fif.rfo", FT_BOOLEAN, 8,
993 TFS(&flags_set_truth), 0x40, "", HFILL }},
995 { "Data signalling rate", "t30.fif.dsr", FT_UINT8, BASE_HEX,
996 VALS(t30_data_signalling_rate_vals), 0x3C, "", HFILL }},
997 { &hf_t30_fif_dsr_dcs,
998 { "Data signalling rate", "t30.fif.dsr_dcs", FT_UINT8, BASE_HEX,
999 VALS(t30_data_signalling_rate_dcs_vals), 0x3C, "", HFILL }},
1001 { "R8x7.7 lines/mm and/or 200x200 pels/25.4 mm", "t30.fif.res", FT_BOOLEAN, 8,
1002 TFS(&flags_set_truth), 0x02, "", HFILL }},
1004 { "Two dimensional coding capability", "t30.fif.tdcc", FT_BOOLEAN, 8,
1005 TFS(&flags_set_truth), 0x01, "", HFILL }},
1007 { "Recording width capabilities", "t30.fif.rwc", FT_UINT8, BASE_HEX,
1008 VALS(t30_recording_width_capabilities_vals), 0xC0, "", HFILL }},
1009 { &hf_t30_fif_rw_dcs,
1010 { "Recording width", "t30.fif.rw_dcs", FT_UINT8, BASE_HEX,
1011 VALS(t30_recording_width_dcs_vals), 0xC0, "", HFILL }},
1013 { "Recording length capability", "t30.fif.rlc", FT_UINT8, BASE_HEX,
1014 VALS(t30_recording_length_capability_vals), 0x30, "", HFILL }},
1015 { &hf_t30_fif_rl_dcs,
1016 { "Recording length capability", "t30.fif.rl_dcs", FT_UINT8, BASE_HEX,
1017 VALS(t30_recording_length_dcs_vals), 0x30, "", HFILL }},
1018 { &hf_t30_fif_msltcr,
1019 { "Minimum scan line time capability at the receiver", "t30.fif.msltcr", FT_UINT8, BASE_HEX,
1020 VALS(t30_minimum_scan_line_time_rec_vals), 0x0E, "", HFILL }},
1021 { &hf_t30_fif_mslt_dcs,
1022 { "Minimum scan line time", "t30.fif.mslt_dcs", FT_UINT8, BASE_HEX,
1023 VALS(t30_minimum_scan_line_time_dcs_vals), 0x0E, "", HFILL }},
1025 { "Extension indicator", "t30.fif.ext", FT_BOOLEAN, 8,
1026 TFS(&t30_extension_ind_value), 0x01, "", HFILL }},
1029 { "Compress/Uncompress mode", "t30.fif.cm", FT_BOOLEAN, 8,
1030 TFS(&t30_compress_value), 0x40, "", HFILL }},
1032 { "Error correction mode", "t30.fif.ecm", FT_BOOLEAN, 8,
1033 TFS(&flags_set_truth), 0x20, "", HFILL }},
1034 { &hf_t30_fif_fs_dcs,
1035 { "Frame size", "t30.fif.fs_dcm", FT_BOOLEAN, 8,
1036 TFS(&t30_frame_size_dcs_value), 0x10, "", HFILL }},
1038 { "T.6 coding capability", "t30.fif.t6", FT_BOOLEAN, 8,
1039 TFS(&flags_set_truth), 0x02, "", HFILL }},
1042 { "Field valid capability", "t30.fif.fvc", FT_BOOLEAN, 8,
1043 TFS(&flags_set_truth), 0x80, "", HFILL }},
1045 { "Multiple selective polling capability", "t30.fif.mspc", FT_BOOLEAN, 8,
1046 TFS(&flags_set_truth), 0x40, "", HFILL }},
1048 { "Polled Subaddress", "t30.fif.ps", FT_BOOLEAN, 8,
1049 TFS(&flags_set_truth), 0x20, "", HFILL }},
1051 { "T.43 coding", "t30.fif.t43", FT_BOOLEAN, 8,
1052 TFS(&flags_set_truth), 0x10, "", HFILL }},
1054 { "Plane interleave", "t30.fif.pi", FT_BOOLEAN, 8,
1055 TFS(&flags_set_truth), 0x08, "", HFILL }},
1056 { &hf_t30_fif_vc32k,
1057 { "Voice coding with 32k ADPCM (ITU T G.726)", "t30.fif.vc32k", FT_BOOLEAN, 8,
1058 TFS(&flags_set_truth), 0x04, "", HFILL }},
1060 { &hf_t30_fif_r8x15,
1061 { "R8x15.4 lines/mm", "t30.fif.r8x15", FT_BOOLEAN, 8,
1062 TFS(&flags_set_truth), 0x80, "", HFILL }},
1063 { &hf_t30_fif_300x300,
1064 { "300x300 pels/25.4 mm", "t30.fif.300x300", FT_BOOLEAN, 8,
1065 TFS(&flags_set_truth), 0x40, "", HFILL }},
1066 { &hf_t30_fif_r16x15,
1067 { "R16x15.4 lines/mm and/or 400x400 pels/25.4 mm", "t30.fif.r16x15", FT_BOOLEAN, 8,
1068 TFS(&flags_set_truth), 0x20, "", HFILL }},
1070 { "Inch based resolution preferred", "t30.fif.ibrp", FT_BOOLEAN, 8,
1071 TFS(&flags_set_truth), 0x10, "", HFILL }},
1073 { "Metric based resolution preferred", "t30.fif.mbrp", FT_BOOLEAN, 8,
1074 TFS(&flags_set_truth), 0x08, "", HFILL }},
1075 { &hf_t30_fif_msltchr,
1076 { "Minimum scan line time capability for higher resolutions", "t30.fif.msltchr", FT_BOOLEAN, 8,
1077 TFS(&t30_minimum_scan_value), 0x04, "", HFILL }},
1079 { "Resolution type selection", "t30.fif.rts", FT_BOOLEAN, 8,
1080 TFS(&t30_res_type_sel_value), 0x10, "", HFILL }},
1082 { "Selective polling", "t30.fif.sp", FT_BOOLEAN, 8,
1083 TFS(&flags_set_truth), 0x02, "", HFILL }},
1086 { "Subaddressing capability", "t30.fif.sc", FT_BOOLEAN, 8,
1087 TFS(&flags_set_truth), 0x80, "", HFILL }},
1088 { &hf_t30_fif_passw,
1089 { "Password", "t30.fif.passw", FT_BOOLEAN, 8,
1090 TFS(&flags_set_truth), 0x40, "", HFILL }},
1092 { "Sender Identification transmission", "t30.fif.sit", FT_BOOLEAN, 8,
1093 TFS(&flags_set_truth), 0x40, "", HFILL }},
1095 { "Ready to transmit a data file (polling)", "t30.fif.rttd", FT_BOOLEAN, 8,
1096 TFS(&flags_set_truth), 0x20, "", HFILL }},
1098 { "Binary File Transfer (BFT)", "t30.fif.bft", FT_BOOLEAN, 8,
1099 TFS(&flags_set_truth), 0x08, "", HFILL }},
1101 { "Document Transfer Mode (DTM)", "t30.fif.dtm", FT_BOOLEAN, 8,
1102 TFS(&flags_set_truth), 0x04, "", HFILL }},
1104 { "Electronic Data Interchange (EDI)", "t30.fif.edi", FT_BOOLEAN, 8,
1105 TFS(&flags_set_truth), 0x02, "", HFILL }},
1108 { "Basic Transfer Mode (BTM)", "t30.fif.btm", FT_BOOLEAN, 8,
1109 TFS(&flags_set_truth), 0x80, "", HFILL }},
1110 { &hf_t30_fif_rttcmmd,
1111 { "Ready to transmit a character or mixed mode document (polling)", "t30.fif.rttcmmd", FT_BOOLEAN, 8,
1112 TFS(&flags_set_truth), 0x20, "", HFILL }},
1114 { "Character mode", "t30.fif.cm", FT_BOOLEAN, 8,
1115 TFS(&flags_set_truth), 0x10, "", HFILL }},
1117 { "Mixed mode (Annex E/T.4)", "t30.fif.mm", FT_BOOLEAN, 8,
1118 TFS(&flags_set_truth), 0x04, "", HFILL }},
1121 { "Processable mode 26 (ITU T T.505)", "t30.fif.pm26", FT_BOOLEAN, 8,
1122 TFS(&flags_set_truth), 0x80, "", HFILL }},
1124 { "Digital network capability", "t30.fif.dnc", FT_BOOLEAN, 8,
1125 TFS(&flags_set_truth), 0x40, "", HFILL }},
1127 { "Duplex operation", "t30.fif.do", FT_BOOLEAN, 8,
1128 TFS(&t30_duplex_operation_value), 0x20, "", HFILL }},
1130 { "JPEG coding", "t30.fif.jpeg", FT_BOOLEAN, 8,
1131 TFS(&flags_set_truth), 0x10, "", HFILL }},
1133 { "Full colour mode", "t30.fif.fcm", FT_BOOLEAN, 8,
1134 TFS(&flags_set_truth), 0x08, "", HFILL }},
1136 { "Preferred Huffman tables", "t30.fif.pht", FT_BOOLEAN, 8,
1137 TFS(&flags_set_truth), 0x08, "", HFILL }},
1139 { "12 bits/pel component", "t30.fif.12c", FT_BOOLEAN, 8,
1140 TFS(&flags_set_truth), 0x02, "", HFILL }},
1143 { "No subsampling (1:1:1)", "t30.fif.ns", FT_BOOLEAN, 8,
1144 TFS(&flags_set_truth), 0x80, "", HFILL }},
1146 { "Custom illuminant", "t30.fif.ci", FT_BOOLEAN, 8,
1147 TFS(&flags_set_truth), 0x40, "", HFILL }},
1149 { "Custom gamut range", "t30.fif.cgr", FT_BOOLEAN, 8,
1150 TFS(&flags_set_truth), 0x20, "", HFILL }},
1151 { &hf_t30_fif_nalet,
1152 { "North American Letter (215.9 x 279.4 mm) capability", "t30.fif.nalet", FT_BOOLEAN, 8,
1153 TFS(&flags_set_truth), 0x10, "", HFILL }},
1154 { &hf_t30_fif_naleg,
1155 { "North American Legal (215.9 x 355.6 mm) capability", "t30.fif.naleg", FT_BOOLEAN, 8,
1156 TFS(&flags_set_truth), 0x08, "", HFILL }},
1157 { &hf_t30_fif_spscb,
1158 { "Single-progression sequential coding (ITU-T T.85) basic capability", "t30.fif.spscb", FT_BOOLEAN, 8,
1159 TFS(&flags_set_truth), 0x04, "", HFILL }},
1160 { &hf_t30_fif_spsco,
1161 { "Single-progression sequential coding (ITU-T T.85) optional L0 capability", "t30.fif.spsco", FT_BOOLEAN, 8,
1162 TFS(&flags_set_truth), 0x02, "", HFILL }},
1165 { "HKM key management capability", "t30.fif.hkm", FT_BOOLEAN, 8,
1166 TFS(&flags_set_truth), 0x80, "", HFILL }},
1168 { "RSA key management capability", "t30.fif.rsa", FT_BOOLEAN, 8,
1169 TFS(&flags_set_truth), 0x40, "", HFILL }},
1171 { "Override capability", "t30.fif.oc", FT_BOOLEAN, 8,
1172 TFS(&flags_set_truth), 0x20, "", HFILL }},
1173 { &hf_t30_fif_hfx40,
1174 { "HFX40 cipher capability", "t30.fif.hfx40", FT_BOOLEAN, 8,
1175 TFS(&flags_set_truth), 0x10, "", HFILL }},
1176 { &hf_t30_fif_acn2c,
1177 { "Alternative cipher number 2 capability", "t30.fif.acn2c", FT_BOOLEAN, 8,
1178 TFS(&flags_set_truth), 0x08, "", HFILL }},
1179 { &hf_t30_fif_acn3c,
1180 { "Alternative cipher number 3 capability", "t30.fif.acn3c", FT_BOOLEAN, 8,
1181 TFS(&flags_set_truth), 0x04, "", HFILL }},
1182 { &hf_t30_fif_hfx40i,
1183 { "HFX40-I hashing capability", "t30.fif.hfx40i", FT_BOOLEAN, 8,
1184 TFS(&flags_set_truth), 0x02, "", HFILL }},
1186 { &hf_t30_fif_ahsn2,
1187 { "Alternative hashing system number 2 capability", "t30.fif.ahsn2", FT_BOOLEAN, 8,
1188 TFS(&flags_set_truth), 0x80, "", HFILL }},
1189 { &hf_t30_fif_ahsn3,
1190 { "Alternative hashing system number 3 capability", "t30.fif.ahsn3", FT_BOOLEAN, 8,
1191 TFS(&flags_set_truth), 0x40, "", HFILL }},
1193 { "T.44 (Mixed Raster Content)", "t30.fif.t441", FT_BOOLEAN, 8,
1194 TFS(&flags_set_truth), 0x10, "", HFILL }},
1196 { "T.44 (Mixed Raster Content)", "t30.fif.t442", FT_BOOLEAN, 8,
1197 TFS(&flags_set_truth), 0x08, "", HFILL }},
1199 { "T.44 (Mixed Raster Content)", "t30.fif.t443", FT_BOOLEAN, 8,
1200 TFS(&flags_set_truth), 0x04, "", HFILL }},
1201 { &hf_t30_fif_plmss,
1202 { "Page length maximum strip size for T.44 (Mixed Raster Content)", "t30.fif.plmss", FT_BOOLEAN, 8,
1203 TFS(&flags_set_truth), 0x02, "", HFILL }},
1205 { &hf_t30_fif_cg300,
1206 { "Colour/gray-scale 300 pels/25.4 mm x 300 lines/25.4 mm or 400 pels/25.4 mm x 400 lines/25.4 mm resolution", "t30.fif.cg300", FT_BOOLEAN, 8,
1207 TFS(&flags_set_truth), 0x80, "", HFILL }},
1208 { &hf_t30_fif_100x100cg,
1209 { "100 pels/25.4 mm x 100 lines/25.4 mm for colour/gray scale", "t30.fif.100x100cg", FT_BOOLEAN, 8,
1210 TFS(&flags_set_truth), 0x40, "", HFILL }},
1211 { &hf_t30_fif_spcbft,
1212 { "Simple Phase C BFT Negotiations capability", "t30.fif.spcbft", FT_BOOLEAN, 8,
1213 TFS(&flags_set_truth), 0x20, "", HFILL }},
1215 { "Extended BFT Negotiations capability", "t30.fif.ebft", FT_BOOLEAN, 8,
1216 TFS(&flags_set_truth), 0x10, "", HFILL }},
1218 { "Internet Selective Polling Address (ISP)", "t30.fif.isp", FT_BOOLEAN, 8,
1219 TFS(&flags_set_truth), 0x08, "", HFILL }},
1221 { "Internet Routing Address (IRA)", "t30.fif.ira", FT_BOOLEAN, 8,
1222 TFS(&flags_set_truth), 0x04, "", HFILL }},
1224 { &hf_t30_fif_600x600,
1225 { "600 pels/25.4 mm x 600 lines/25.4 mm", "t30.fif.600x600", FT_BOOLEAN, 8,
1226 TFS(&flags_set_truth), 0x80, "", HFILL }},
1227 { &hf_t30_fif_1200x1200,
1228 { "1200 pels/25.4 mm x 1200 lines/25.4 mm", "t30.fif.1200x1200", FT_BOOLEAN, 8,
1229 TFS(&flags_set_truth), 0x40, "", HFILL }},
1230 { &hf_t30_fif_300x600,
1231 { "300 pels/25.4 mm x 600 lines/25.4 mm", "t30.fif.300x600", FT_BOOLEAN, 8,
1232 TFS(&flags_set_truth), 0x20, "", HFILL }},
1233 { &hf_t30_fif_400x800,
1234 { "400 pels/25.4 mm x 800 lines/25.4 mm", "t30.fif.400x800", FT_BOOLEAN, 8,
1235 TFS(&flags_set_truth), 0x10, "", HFILL }},
1236 { &hf_t30_fif_600x1200,
1237 { "600 pels/25.4 mm x 1200 lines/25.4 mm", "t30.fif.600x1200", FT_BOOLEAN, 8,
1238 TFS(&flags_set_truth), 0x08, "", HFILL }},
1239 { &hf_t30_fif_cg600x600,
1240 { "Colour/gray scale 600 pels/25.4 mm x 600 lines/25.4 mm resolution", "t30.fif.cg600x600", FT_BOOLEAN, 8,
1241 TFS(&flags_set_truth), 0x04, "", HFILL }},
1242 { &hf_t30_fif_cg1200x1200,
1243 { "Colour/gray scale 1200 pels/25.4 mm x 1200 lines/25.4 mm resolution", "t30.fif.cg1200x1200", FT_BOOLEAN, 8,
1244 TFS(&flags_set_truth), 0x02, "", HFILL }},
1246 { &hf_t30_fif_dspcam,
1247 { "Double sided printing capability (alternate mode)", "t30.fif.dspcam", FT_BOOLEAN, 8,
1248 TFS(&flags_set_truth), 0x80, "", HFILL }},
1249 { &hf_t30_fif_dspccm,
1250 { "Double sided printing capability (continuous mode)", "t30.fif.dspccm", FT_BOOLEAN, 8,
1251 TFS(&flags_set_truth), 0x40, "", HFILL }},
1252 { &hf_t30_fif_bwmrcp,
1253 { "Black and white mixed raster content profile (MRCbw)", "t30.fif.bwmrcp", FT_BOOLEAN, 8,
1254 TFS(&flags_set_truth), 0x20, "", HFILL }},
1256 { "T.45 (run length colour encoding)", "t30.fif.t45", FT_BOOLEAN, 8,
1257 TFS(&flags_set_truth), 0x10, "", HFILL }},
1259 { "SharedDataMemory capacity", "t30.fif.sdmc", FT_UINT8, BASE_HEX,
1260 VALS(t30_SharedDataMemory_capacity_vals), 0x0C, "", HFILL }},
1262 { &hf_t30_fif_number,
1263 { "Number", "t30.fif.number", FT_STRING, BASE_NONE, NULL, 0x0,
1266 { &hf_t30_fif_country_code,
1267 { "ITU-T Country code", "t30.fif.country_code", FT_UINT8, BASE_DEC,
1268 NULL, 0, "ITU-T Country code", HFILL }},
1269 { &hf_t30_fif_non_stand_bytes,
1270 { "Non-standard capabilities", "t30.fif.non_standard_cap", FT_BYTES, BASE_HEX,
1271 NULL, 0, "Non-standard capabilities", HFILL }},
1273 { &hf_t30_t4_frame_num,
1274 { "T.4 Frame number", "t30.t4.frame_num", FT_UINT8, BASE_DEC,
1275 NULL, 0, "T.4 Frame number", HFILL }},
1277 { "T.4 Facsimile data field", "t30.t4.data", FT_BYTES, BASE_HEX,
1278 NULL, 0, "T.4 Facsimile data field", HFILL }},
1280 { &hf_t30_partial_page_fcf2,
1281 { "Post-message command", "t30.pps.fcf2", FT_UINT8, BASE_DEC,
1282 VALS(t30_partial_page_fcf2_vals), 0, "Post-message command", HFILL }},
1283 { &hf_t30_partial_page_i1,
1284 { "Page counter", "t30.t4.page_count", FT_UINT8, BASE_DEC,
1285 NULL, 0, "Page counter", HFILL }},
1286 { &hf_t30_partial_page_i2,
1287 { "Block counter", "t30.t4.block_count", FT_UINT8, BASE_DEC,
1288 NULL, 0, "Block counter", HFILL }},
1289 { &hf_t30_partial_page_i3,
1290 { "Frame counter", "t30.t4.frame_count", FT_UINT8, BASE_DEC,
1291 NULL, 0, "Frame counter", HFILL }},
1294 static gint *t30_ett[] =
1302 proto_t30 = proto_register_protocol("T.30", "T.30", "t30");
1303 proto_register_field_array(proto_t30, hf_t30, array_length(hf_t30));
1304 proto_register_subtree_array(t30_ett, array_length(t30_ett));
1306 new_register_dissector("t30.hdlc", dissect_t30_hdlc, proto_t30);
1311 proto_reg_handoff_t30(void)