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