-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpacket-ipsc.c
1227 lines (1108 loc) · 44.6 KB
/
packet-ipsc.c
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
/* packet-ipsc.c
* Routines for MotoTrbo IPSC packet disassembly
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* By Bogdan Diaconescu <[email protected]>
* Copyright 2013 Bogdan Diaconescu
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "config.h"
#include <string.h>
#include <glib.h>
#include <epan/packet.h>
#include <epan/strutil.h>
#include <epan/arptypes.h>
#include <epan/addr_resolv.h>
#include <epan/emem.h>
#include "packet-arp.h"
#include <epan/etypes.h>
#include <epan/arcnet_pids.h>
#include <epan/ax25_pids.h>
#include <epan/prefs.h>
#include <epan/expert.h>
/*
* TODO: Isolate L3 from L2 by making each
* as a function call.
*/
static int proto_ipsc = -1;
static int hf_ipsc_type = -1;
static int hf_ipsc_rpt_id = -1;
static int hf_ipsc_linking_id = -1;
static int hf_ipsc_linking_peer_op_id = -1;
static int hf_ipsc_linking_peer_mode_id = -1;
static int hf_ipsc_linking_ipsc_slot1_id = -1;
static int hf_ipsc_linking_ipsc_slot2_id = -1;
static int hf_ipsc_service_flags_id = -1;
static int hf_ipsc_service_flags_byte1_id = -1;
static int hf_ipsc_service_flags_byte2_id = -1;
static int hf_ipsc_service_flags_byte3_id = -1;
static int hf_ipsc_service_flags_byte3_rdac_id = -1;
static int hf_ipsc_service_flags_byte3_unk1_id = -1;
static int hf_ipsc_service_flags_byte3_3rdpy_id = -1;
static int hf_ipsc_service_flags_byte3_unk2_id = -1;
static int hf_ipsc_service_flags_byte4_id = -1;
static int hf_ipsc_service_flags_byte4_xnl_conn_id = -1;
static int hf_ipsc_service_flags_byte4_xnl_master_id = -1;
static int hf_ipsc_service_flags_byte4_xnl_slave_id = -1;
static int hf_ipsc_service_flags_byte4_auth_id = -1;
static int hf_ipsc_service_flags_byte4_data_id = -1;
static int hf_ipsc_service_flags_byte4_voice_id = -1;
static int hf_ipsc_service_flags_byte4_unk2_id = -1;
static int hf_ipsc_service_flags_byte4_master_id = -1;
static int hf_ipsc_version_id = -1;
static int hf_ipsc_seq_no_id = -1;
static int hf_ipsc_src_id = -1;
static int hf_ipsc_dst_id = -1;
static int hf_ipsc_prio_v_d_id = -1;
static int hf_ipsc_call_ctrl_id = -1;
static int hf_ipsc_call_ctrl_info_id = -1;
static int hf_ipsc_call_ctrl_src_id = -1;
static int hf_ipsc_payload_type_id = -1;
static int hf_ipsc_call_seq_no_id = -1;
static int hf_ipsc_timestamp_id = -1;
static int hf_ipsc_sync_src_id = -1;
static int hf_ipsc_data_type_voice_hdr_id = -1;
static int hf_ipsc_rssi_threshold_and_parity_id = -1;
static int hf_ipsc_length_to_follow_id = -1;
static int hf_ipsc_length_to_follow2_id = -1;
static int hf_ipsc_rssi_status_id = -1;
static int hf_ipsc_slot_type_sync_id = -1;
static int hf_ipsc_data_size_id = -1;
static int hf_ipsc_data_id = -1;
/* Data Header */
/* Byte 1 */
static int hf_ipsc_data_hdr_byte1_id = -1;
static int hf_ipsc_data_hdr_byte1_gi_id = -1;
static int hf_ipsc_data_hdr_byte1_a_id = -1;
static int hf_ipsc_data_hdr_byte1_hc_id = -1;
static int hf_ipsc_data_hdr_byte1_pocmsb_id = -1;
static int hf_ipsc_data_hdr_byte1_sap_id = -1;
static int hf_ipsc_data_hdr_byte1_dpf_id = -1;
static int hf_ipsc_data_hdr_byte1_ab_id = -1;
/* Byte 2 */
static int hf_ipsc_data_hdr_byte2_id = -1;
static int hf_ipsc_data_hdr_byte2_sap_id = -1;
static int hf_ipsc_data_hdr_byte2_poc_id = -1;
static int hf_ipsc_data_hdr_byte2_udt_format_id = -1;
/* Src and Dst */
static int hf_ipsc_data_hdr_dst_id = -1;
static int hf_ipsc_data_hdr_src_id = -1;
/* Byte 8 */
static int hf_ipsc_data_hdr_byte8_id = -1;
static int hf_ipsc_data_hdr_byte8_f_id = -1;
static int hf_ipsc_data_hdr_byte8_btf_id = -1;
static int hf_ipsc_data_hdr_byte8_sp_id = -1;
static int hf_ipsc_data_hdr_byte8_dp_id = -1;
static int hf_ipsc_data_hdr_byte8_dd_format_id = -1;
static int hf_ipsc_data_hdr_byte8_s_id = -1;
static int hf_ipsc_data_hdr_byte8_pad_nibble_id = -1;
static int hf_ipsc_data_hdr_byte8_uab_id = -1;
/* Byte 9 */
static int hf_ipsc_data_hdr_byte9_id = -1;
static int hf_ipsc_data_hdr_byte9_class_id = -1;
static int hf_ipsc_data_hdr_byte9_type_id = -1;
static int hf_ipsc_data_hdr_byte9_status_id = -1;
static int hf_ipsc_data_hdr_byte9_s_id = -1;
static int hf_ipsc_data_hdr_byte9_ns_id = -1;
static int hf_ipsc_data_hdr_byte9_fsn_id = -1;
static int hf_ipsc_data_hdr_byte9_status_precoded_id = -1;
static int hf_ipsc_data_hdr_byte9_bit_padding_id = -1;
static int hf_ipsc_data_hdr_byte9_sf_id = -1;
static int hf_ipsc_data_hdr_byte9_pf_id = -1;
static int hf_ipsc_data_hdr_byte9_udto_id = -1;
static int hf_ipsc_data_hdr_byte9_nibble1_id = -1;
/* CRC */
static int hf_ipsc_data_hdr_crc_id = -1;
/* CSBK Header */
static int hf_ipsc_csbk_hdr_byte1_id = -1;
static int hf_ipsc_csbk_hdr_fid_id = -1;
static int hf_ipsc_csbk_hdr_byte3_id = -1;
static int hf_ipsc_csbk_hdr_byte4_id = -1;
static int hf_ipsc_csbk_hdr_dst_id = -1;
static int hf_ipsc_csbk_hdr_src_id = -1;
static int hf_ipsc_csbk_hdr_crc_id = -1;
/* Full LC*/
static int hf_ipsc_full_lc_byte1_id = -1;
static int hf_ipsc_full_lc_fid_id = -1;
/* L3 Voice PDU */
static int hf_ipsc_voice_pdu_service_options_id = -1;
static int hf_ipsc_voice_pdu_dst_id = -1;
static int hf_ipsc_voice_pdu_src_id = -1;
static int hf_ipsc_digest_id = -1;
/* XCMP/XNL */
static int hf_ipsc_xcmp_xnl_length_id = -1;
static int hf_ipsc_xcmp_xnl_data_id = -1;
static int hf_ipsc_unk1_id = -1;
static gint ett_ipsc = -1;
void proto_register_ipsc(void);
void proto_reg_handoff_ipsc(void);
void
dissect_short_messages(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *ipsc_item = NULL;
proto_tree *ipsc_tree = NULL;
ipsc_item = proto_tree_add_item(tree, proto_ipsc, tvb, 0, -1, ENC_NA);
ipsc_tree = proto_item_add_subtree(ipsc_item, ett_ipsc);
/* Type */
proto_tree_add_item(ipsc_tree, hf_ipsc_type, tvb, 0, 1, ENC_BIG_ENDIAN);
/* SRC_ID */
proto_tree_add_item(ipsc_tree, hf_ipsc_rpt_id, tvb, 1, 4, ENC_BIG_ENDIAN);
/* Auth Digest */
proto_tree_add_item(ipsc_tree, hf_ipsc_digest_id, tvb, 14, 10, ENC_BIG_ENDIAN);
}
void
dissect_CALL_CTL_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *ipsc_item = NULL;
proto_tree *ipsc_tree = NULL;
ipsc_item = proto_tree_add_item(tree, proto_ipsc, tvb, 0, -1, ENC_NA);
ipsc_tree = proto_item_add_subtree(ipsc_item, ett_ipsc);
/* Type */
proto_tree_add_item(ipsc_tree, hf_ipsc_type, tvb, 0, 1, ENC_BIG_ENDIAN);
/* SRC_ID */
proto_tree_add_item(ipsc_tree, hf_ipsc_rpt_id, tvb, 1, 4, ENC_BIG_ENDIAN);
/* SRC_ID */
proto_tree_add_item(ipsc_tree, hf_ipsc_rpt_id, tvb, 5, 4, ENC_BIG_ENDIAN);
/* Unk_17_Byte */
proto_tree_add_item(ipsc_tree, hf_ipsc_unk1_id, tvb, 9, 17, ENC_BIG_ENDIAN);
/* Auth Digest */
proto_tree_add_item(ipsc_tree, hf_ipsc_digest_id, tvb, 26, 10, ENC_BIG_ENDIAN);
}
void
dissect_CALL_CTL_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *ipsc_item = NULL;
proto_tree *ipsc_tree = NULL;
ipsc_item = proto_tree_add_item(tree, proto_ipsc, tvb, 0, -1, ENC_NA);
ipsc_tree = proto_item_add_subtree(ipsc_item, ett_ipsc);
/* Type */
proto_tree_add_item(ipsc_tree, hf_ipsc_type, tvb, 0, 1, ENC_BIG_ENDIAN);
/* SRC_ID */
proto_tree_add_item(ipsc_tree, hf_ipsc_rpt_id, tvb, 1, 4, ENC_BIG_ENDIAN);
/* Unk_2_Byte */
proto_tree_add_item(ipsc_tree, hf_ipsc_unk1_id, tvb, 5, 2, ENC_BIG_ENDIAN);
/* Auth Digest */
proto_tree_add_item(ipsc_tree, hf_ipsc_digest_id, tvb, 7, 10, ENC_BIG_ENDIAN);
}
void
dissect_CALL_CTL_3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *ipsc_item = NULL;
proto_tree *ipsc_tree = NULL;
ipsc_item = proto_tree_add_item(tree, proto_ipsc, tvb, 0, -1, ENC_NA);
ipsc_tree = proto_item_add_subtree(ipsc_item, ett_ipsc);
/* Type */
proto_tree_add_item(ipsc_tree, hf_ipsc_type, tvb, 0, 1, ENC_BIG_ENDIAN);
/* SRC_ID */
proto_tree_add_item(ipsc_tree, hf_ipsc_rpt_id, tvb, 1, 4, ENC_BIG_ENDIAN);
/* Unk 1 Byte */
proto_tree_add_item(ipsc_tree, hf_ipsc_unk1_id, tvb, 5, 1, ENC_BIG_ENDIAN);
/* Auth Digest */
proto_tree_add_item(ipsc_tree, hf_ipsc_digest_id, tvb, 6, 10, ENC_BIG_ENDIAN);
}
void
dissect_PVT_DATA(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *ipsc_item = NULL;
proto_tree *ipsc_tree = NULL;
guint16 length_to_follow = 0;
ipsc_item = proto_tree_add_item(tree, proto_ipsc, tvb, 0, -1, ENC_NA);
ipsc_tree = proto_item_add_subtree(ipsc_item, ett_ipsc);
/* Type */
proto_tree_add_item(ipsc_tree, hf_ipsc_type, tvb, 0, 1, ENC_BIG_ENDIAN);
/* RPT_ID */
proto_tree_add_item(ipsc_tree, hf_ipsc_rpt_id, tvb, 1, 4, ENC_BIG_ENDIAN);
/* SEQ NO */
proto_tree_add_item(ipsc_tree, hf_ipsc_seq_no_id, tvb, 5, 1, ENC_BIG_ENDIAN);
/* Src Id */
proto_tree_add_item(ipsc_tree, hf_ipsc_src_id, tvb, 6, 3, ENC_BIG_ENDIAN);
/* Dst Id */
proto_tree_add_item(ipsc_tree, hf_ipsc_dst_id, tvb, 9, 3, ENC_BIG_ENDIAN);
/* Prio V/D */
proto_tree_add_item(ipsc_tree, hf_ipsc_prio_v_d_id, tvb, 12, 1, ENC_BIG_ENDIAN);
/* Call Ctrl */
proto_tree_add_item(ipsc_tree, hf_ipsc_call_ctrl_id, tvb, 13, 4, ENC_BIG_ENDIAN);
/* Call Ctrl Info */
proto_tree_add_item(ipsc_tree, hf_ipsc_call_ctrl_info_id, tvb, 17, 1, ENC_BIG_ENDIAN);
/* Call Ctrl Src */
proto_tree_add_item(ipsc_tree, hf_ipsc_call_ctrl_src_id, tvb, 18, 1, ENC_BIG_ENDIAN);
/* Payload Type */
proto_tree_add_item(ipsc_tree, hf_ipsc_payload_type_id, tvb, 19, 1, ENC_BIG_ENDIAN);
/* Call Seq No */
proto_tree_add_item(ipsc_tree, hf_ipsc_call_seq_no_id, tvb, 20, 2, ENC_BIG_ENDIAN);
/* Timestamp */
proto_tree_add_item(ipsc_tree, hf_ipsc_timestamp_id, tvb, 22, 4, ENC_BIG_ENDIAN);
/* Sync Src Id */
proto_tree_add_item(ipsc_tree, hf_ipsc_sync_src_id, tvb, 26, 4, ENC_BIG_ENDIAN);
/* Data Type Voice Hdr */
proto_tree_add_item(ipsc_tree, hf_ipsc_data_type_voice_hdr_id, tvb, 30, 1, ENC_BIG_ENDIAN);
/* RSSI Threshold and Parity */
proto_tree_add_item(ipsc_tree, hf_ipsc_rssi_threshold_and_parity_id, tvb, 31, 1, ENC_BIG_ENDIAN);
/* Length to Follow */
proto_tree_add_item(ipsc_tree, hf_ipsc_length_to_follow_id, tvb, 32, 2, ENC_BIG_ENDIAN);
/*
* Decide how the rest of data looks like
* based on length_to_follow
*/
if ((length_to_follow = tvb_get_ntohs(tvb, 32)) != 0)
{
proto_item *ipsc_data_item = NULL;
proto_tree *ipsc_data_tree = NULL;
guint data_type = 0;
/* RSSI Status */
proto_tree_add_item(ipsc_tree, hf_ipsc_rssi_status_id, tvb, 34, 1, ENC_BIG_ENDIAN);
/* Slot Type Sync */
proto_tree_add_item(ipsc_tree, hf_ipsc_slot_type_sync_id, tvb, 35, 1, ENC_BIG_ENDIAN);
/* Data Size - in words of 2bytes*/
proto_tree_add_item(ipsc_tree, hf_ipsc_data_size_id, tvb, 36, 2, ENC_BIG_ENDIAN);
/* Data */
ipsc_data_item = proto_tree_add_item(ipsc_tree, hf_ipsc_data_id, tvb, 38, 2 * length_to_follow - 4, ENC_BIG_ENDIAN);
/* Get Data Type */
data_type = tvb_get_guint8(tvb, 30) & 0x0f;
/* Header based on Data Type */
switch (data_type)
{
/* Data Type is CSBK header */
case 0x03:
{
ipsc_data_tree = proto_item_add_subtree(ipsc_data_item, ett_ipsc);
/* CSBK Hdr Byte 1 */
proto_tree_add_item(ipsc_data_tree, hf_ipsc_csbk_hdr_byte1_id, tvb, 38, 1, ENC_BIG_ENDIAN);
/* CSBK Hdr FID */
proto_tree_add_item(ipsc_data_tree, hf_ipsc_csbk_hdr_fid_id, tvb, 39, 1, ENC_BIG_ENDIAN);
/* CSBK Byte 3 */
proto_tree_add_item(ipsc_data_tree, hf_ipsc_csbk_hdr_byte3_id, tvb, 40, 1, ENC_BIG_ENDIAN);
/* CSBK Byte 4 */
proto_tree_add_item(ipsc_data_tree, hf_ipsc_csbk_hdr_byte4_id, tvb, 41, 1, ENC_BIG_ENDIAN);
/* CSBK Dst */
proto_tree_add_item(ipsc_data_tree, hf_ipsc_csbk_hdr_dst_id, tvb, 42, 3, ENC_BIG_ENDIAN);
/* CSBK Src */
proto_tree_add_item(ipsc_data_tree, hf_ipsc_csbk_hdr_src_id, tvb, 45, 3, ENC_BIG_ENDIAN);
/* TODO - whatis the rest of the data to CRC? */
/* CSBK CRC */
proto_tree_add_item(ipsc_data_tree, hf_ipsc_csbk_hdr_crc_id, tvb, 48, 2, ENC_BIG_ENDIAN);
}; break;
/* If Data Type is Data Header */
case 0x06:
{
proto_item *byte1_item = NULL;
proto_tree *byte1_tree = NULL;
proto_item *byte2_item = NULL;
proto_tree *byte2_tree = NULL;
proto_item *byte8_item = NULL;
proto_tree *byte8_tree = NULL;
proto_item *byte9_item = NULL;
proto_tree *byte9_tree = NULL;
/* Add subtree for Data Header */
ipsc_data_tree = proto_item_add_subtree(ipsc_data_item, ett_ipsc);
/* Data Hdr Byte 1 */
byte1_item = proto_tree_add_item(ipsc_data_tree, hf_ipsc_data_hdr_byte1_id, tvb, 38, 1, ENC_BIG_ENDIAN);
/* Add subtree for Byte 1 */
byte1_tree = proto_item_add_subtree(byte1_item, ett_ipsc);
/* Byte 1 G/I */
proto_tree_add_item(byte1_tree, hf_ipsc_data_hdr_byte1_gi_id, tvb, 38, 1, ENC_BIG_ENDIAN);
/* Byte 1 A */
proto_tree_add_item(byte1_tree, hf_ipsc_data_hdr_byte1_a_id, tvb, 38, 1, ENC_BIG_ENDIAN);
/* Byte 1 HC */
proto_tree_add_item(byte1_tree, hf_ipsc_data_hdr_byte1_hc_id, tvb, 38, 1, ENC_BIG_ENDIAN);
/* Byte 1 POCMSB */
proto_tree_add_item(byte1_tree, hf_ipsc_data_hdr_byte1_pocmsb_id, tvb, 38, 1, ENC_BIG_ENDIAN);
/* Byte 1 DPF */
proto_tree_add_item(byte1_tree, hf_ipsc_data_hdr_byte1_dpf_id, tvb, 38, 1, ENC_BIG_ENDIAN);
/* Data Hdr Byte 2 */
byte2_item = proto_tree_add_item(ipsc_data_tree, hf_ipsc_data_hdr_byte2_id, tvb, 39, 1, ENC_BIG_ENDIAN);
/* Add subtree for Byte 2 */
byte2_tree = proto_item_add_subtree(byte2_item, ett_ipsc);
/* Byte 2 SAP */
proto_tree_add_item(byte2_tree, hf_ipsc_data_hdr_byte2_sap_id, tvb, 39, 1, ENC_BIG_ENDIAN);
/* Byte 2 POC */
proto_tree_add_item(byte2_tree, hf_ipsc_data_hdr_byte2_poc_id, tvb, 39, 1, ENC_BIG_ENDIAN);
/* Data Hdr Dst */
proto_tree_add_item(ipsc_data_tree, hf_ipsc_data_hdr_dst_id, tvb, 40, 3, ENC_BIG_ENDIAN);
/* Data Hdr Src */
proto_tree_add_item(ipsc_data_tree, hf_ipsc_data_hdr_src_id, tvb, 43, 3, ENC_BIG_ENDIAN);
/* Data Hdr Byte 8 */
byte8_item = proto_tree_add_item(ipsc_data_tree, hf_ipsc_data_hdr_byte8_id, tvb, 46, 1, ENC_BIG_ENDIAN);
/* Add tree for Byte 8 */
byte8_tree = proto_item_add_subtree(byte8_item, ett_ipsc);
/* Byte 8 F */
proto_tree_add_item(byte8_tree, hf_ipsc_data_hdr_byte8_f_id, tvb, 46, 1, ENC_BIG_ENDIAN);
/* Byte 8 BTF */
proto_tree_add_item(byte8_tree, hf_ipsc_data_hdr_byte8_btf_id, tvb, 46, 1, ENC_BIG_ENDIAN);
/* Data Hdr Byte 9 */
byte9_item = proto_tree_add_item(ipsc_data_tree, hf_ipsc_data_hdr_byte9_id, tvb, 47, 1, ENC_BIG_ENDIAN);
/* Add tree for Byte 9 */
byte9_tree = proto_item_add_subtree(byte9_item, ett_ipsc);
/* If Confirmed header */
if (tvb_get_guint8(tvb, 38) & 0x40)
{
/* Byte 9 S */
proto_tree_add_item(byte9_tree, hf_ipsc_data_hdr_byte9_s_id, tvb, 47, 1, ENC_BIG_ENDIAN);
/* Byte 9 N(S) */
proto_tree_add_item(byte9_tree, hf_ipsc_data_hdr_byte9_ns_id, tvb, 47, 1, ENC_BIG_ENDIAN);
}
else
{
/* Add data in the first nibble */
proto_tree_add_item(byte9_tree, hf_ipsc_data_hdr_byte9_nibble1_id, tvb, 47, 1, ENC_BIG_ENDIAN);
}
/* Byte 9 FSN */
proto_tree_add_item(byte9_tree, hf_ipsc_data_hdr_byte9_fsn_id, tvb, 47, 1, ENC_BIG_ENDIAN);
/* Data Hdr CRC */
proto_tree_add_item(ipsc_data_tree, hf_ipsc_data_hdr_crc_id, tvb, 48, 2, ENC_BIG_ENDIAN);
/* TODO - what is the rest of the bytes (Data?) */
}; break;
default:
break;
}
/* Auth Digest */
proto_tree_add_item(ipsc_tree, hf_ipsc_digest_id, tvb, 38 + (2 * length_to_follow - 4), 10, ENC_BIG_ENDIAN);
}
else
{
/* Auth Digest */
proto_tree_add_item(ipsc_tree, hf_ipsc_digest_id, tvb, 34, 10, ENC_BIG_ENDIAN);
}
}
void
dissect_GROUP_VOICE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *ipsc_item = NULL;
proto_tree *ipsc_tree = NULL;
guint16 length_to_follow = 0;
guint data_type = 0;
ipsc_item = proto_tree_add_item(tree, proto_ipsc, tvb, 0, -1, ENC_NA);
ipsc_tree = proto_item_add_subtree(ipsc_item, ett_ipsc);
/* Type */
proto_tree_add_item(ipsc_tree, hf_ipsc_type, tvb, 0, 1, ENC_BIG_ENDIAN);
/* RPT_ID */
proto_tree_add_item(ipsc_tree, hf_ipsc_rpt_id, tvb, 1, 4, ENC_BIG_ENDIAN);
/* SEQ NO */
proto_tree_add_item(ipsc_tree, hf_ipsc_seq_no_id, tvb, 5, 1, ENC_BIG_ENDIAN);
/* Src Id */
proto_tree_add_item(ipsc_tree, hf_ipsc_src_id, tvb, 6, 3, ENC_BIG_ENDIAN);
/* Dst Id */
proto_tree_add_item(ipsc_tree, hf_ipsc_dst_id, tvb, 9, 3, ENC_BIG_ENDIAN);
/* Prio Video/Data */
proto_tree_add_item(ipsc_tree, hf_ipsc_prio_v_d_id, tvb, 12, 1, ENC_BIG_ENDIAN);
/* Call Ctrl */
proto_tree_add_item(ipsc_tree, hf_ipsc_call_ctrl_id, tvb, 13, 4, ENC_BIG_ENDIAN);
/* Call Ctrl Info */
proto_tree_add_item(ipsc_tree, hf_ipsc_call_ctrl_info_id, tvb, 17, 1, ENC_BIG_ENDIAN);
/* Call Ctrl Src */
proto_tree_add_item(ipsc_tree, hf_ipsc_call_ctrl_src_id, tvb, 18, 1, ENC_BIG_ENDIAN);
/* Payload Type */
proto_tree_add_item(ipsc_tree, hf_ipsc_payload_type_id, tvb, 19, 1, ENC_BIG_ENDIAN);
/* Call Seq No */
proto_tree_add_item(ipsc_tree, hf_ipsc_call_seq_no_id, tvb, 20, 2, ENC_BIG_ENDIAN);
/* Timestamp */
proto_tree_add_item(ipsc_tree, hf_ipsc_timestamp_id, tvb, 22, 4, ENC_BIG_ENDIAN);
/* Sync Src Id */
proto_tree_add_item(ipsc_tree, hf_ipsc_sync_src_id, tvb, 26, 4, ENC_BIG_ENDIAN);
/* Data Type Voice Hdr */
proto_tree_add_item(ipsc_tree, hf_ipsc_data_type_voice_hdr_id, tvb, 30, 1, ENC_BIG_ENDIAN);
/* Get Data Type */
data_type = tvb_get_guint8(tvb, 30) & 0xf;
switch (data_type)
{
case 0x01:
/* Voice LC Header */
case 0x02:
{
/* Voice LC Termination Header */
/* RSSI Threshold and Parity */
proto_tree_add_item(ipsc_tree, hf_ipsc_rssi_threshold_and_parity_id, tvb, 31, 1, ENC_BIG_ENDIAN);
/* Length to Follow */
proto_tree_add_item(ipsc_tree, hf_ipsc_length_to_follow_id, tvb, 32, 2, ENC_BIG_ENDIAN);
/*
* Decide how the rest of data looks like
* based on length_to_follow (words of 2 bytes each)
*/
if ((length_to_follow = tvb_get_ntohs(tvb, 32)) != 0)
{
proto_item *ipsc_voice_item = NULL;
proto_tree *ipsc_voice_tree = NULL;
/* RSSI Status */
proto_tree_add_item(ipsc_tree, hf_ipsc_rssi_status_id, tvb, 34, 1, ENC_BIG_ENDIAN);
/* Slot Type Sync */
proto_tree_add_item(ipsc_tree, hf_ipsc_slot_type_sync_id, tvb, 35, 1, ENC_BIG_ENDIAN);
/* Data Size - in words of 2bytes */
proto_tree_add_item(ipsc_tree, hf_ipsc_data_size_id, tvb, 36, 2, ENC_BIG_ENDIAN);
/* Full LC / Voice PDU */
ipsc_voice_item = proto_tree_add_item(ipsc_tree, hf_ipsc_data_id, tvb, 38, 2 * length_to_follow - 4, ENC_BIG_ENDIAN);
ipsc_voice_tree = proto_item_add_subtree(ipsc_voice_item, ett_ipsc);
/* Voice PDU Byte 1 */
proto_tree_add_item(ipsc_voice_tree, hf_ipsc_full_lc_byte1_id, tvb, 38, 1, ENC_BIG_ENDIAN);
/* Voice PDU FID */
proto_tree_add_item(ipsc_voice_tree, hf_ipsc_full_lc_fid_id, tvb, 39, 1, ENC_BIG_ENDIAN);
/* Voice PDU Service Options */
proto_tree_add_item(ipsc_voice_tree, hf_ipsc_voice_pdu_service_options_id, tvb, 40, 1, ENC_BIG_ENDIAN);
/* Voice PDU Dst */
proto_tree_add_item(ipsc_voice_tree, hf_ipsc_voice_pdu_dst_id, tvb, 41, 3, ENC_BIG_ENDIAN);
/* Voice PDU Rst */
proto_tree_add_item(ipsc_voice_tree, hf_ipsc_voice_pdu_src_id, tvb, 44, 3, ENC_BIG_ENDIAN);
/* TODO - Add rest of bytes - Data? */
/* Auth Digest */
proto_tree_add_item(ipsc_tree, hf_ipsc_digest_id, tvb, 38 + (2 * length_to_follow - 4), 10, ENC_BIG_ENDIAN);
}
}; break;
case 0x0a:
{
/* Rate 1 data */
/* length to folow is in bytes */
length_to_follow = tvb_get_guint8(tvb, 31);
/* Length to Follow */
proto_tree_add_item(ipsc_tree, hf_ipsc_length_to_follow2_id, tvb, 31, 1, ENC_BIG_ENDIAN);
/* Data */
proto_tree_add_item(ipsc_tree, hf_ipsc_data_id, tvb, 32, length_to_follow, ENC_BIG_ENDIAN);
/* Auth Digest */
proto_tree_add_item(ipsc_tree, hf_ipsc_digest_id, tvb, 32 + length_to_follow, 10, ENC_BIG_ENDIAN);
}; break;
default:
{
/* Auth Digest */
proto_tree_add_item(ipsc_tree, hf_ipsc_digest_id, tvb, 30, 10, ENC_BIG_ENDIAN);
}
}
}
void
dissect_XCMP_XNL(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *ipsc_item = NULL;
proto_tree *ipsc_tree = NULL;
guint16 data_len = NULL;
ipsc_item = proto_tree_add_item(tree, proto_ipsc, tvb, 0, -1, ENC_NA);
ipsc_tree = proto_item_add_subtree(ipsc_item, ett_ipsc);
/* Type */
proto_tree_add_item(ipsc_tree, hf_ipsc_type, tvb, 0, 1, ENC_BIG_ENDIAN);
/* SRC_ID */
proto_tree_add_item(ipsc_tree, hf_ipsc_rpt_id, tvb, 1, 4, ENC_BIG_ENDIAN);
/* XCMP/XNL Length */
proto_tree_add_item(ipsc_tree, hf_ipsc_xcmp_xnl_length_id, tvb, 5, 2, ENC_BIG_ENDIAN);
/* Keep Data Len */
data_len = tvb_get_ntohs(tvb, 5);
/* XCMP/XNL Data */
proto_tree_add_item(ipsc_tree, hf_ipsc_xcmp_xnl_data_id, tvb, 7, data_len, ENC_BIG_ENDIAN);
/* Auth Digest */
proto_tree_add_item(ipsc_tree, hf_ipsc_digest_id, tvb, 7 + data_len, 10, ENC_BIG_ENDIAN);
}
void
dissect_RPT_WAKE_UP(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *ipsc_item = NULL;
proto_tree *ipsc_tree = NULL;
ipsc_item = proto_tree_add_item(tree, proto_ipsc, tvb, 0, -1, ENC_NA);
ipsc_tree = proto_item_add_subtree(ipsc_item, ett_ipsc);
/* Type */
proto_tree_add_item(ipsc_tree, hf_ipsc_type, tvb, 0, 1, ENC_BIG_ENDIAN);
/* SRC_ID */
proto_tree_add_item(ipsc_tree, hf_ipsc_rpt_id, tvb, 1, 4, ENC_BIG_ENDIAN);
/* Auth Digest */
//proto_tree_add_item(ipsc_tree, hf_ipsc_digest_id, tvb, 14, 10, ENC_BIG_ENDIAN);
}
void
dissect_long_messages(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *ipsc_item = NULL;
proto_tree *ipsc_tree = NULL;
proto_item *ipsc_linking_item = NULL;
proto_tree *ipsc_linking_tree = NULL;
proto_item *ipsc_service_flags_item = NULL;
proto_tree *ipsc_service_flags_tree = NULL;
proto_item *ipsc_service_flags_byte3_item = NULL;
proto_tree *ipsc_service_flags_byte3_tree = NULL;
proto_item *ipsc_service_flags_byte4_item = NULL;
proto_tree *ipsc_service_flags_byte4_tree = NULL;
ipsc_item = proto_tree_add_item(tree, proto_ipsc, tvb, 0, -1, ENC_NA);
ipsc_tree = proto_item_add_subtree(ipsc_item, ett_ipsc);
/* Type */
proto_tree_add_item(ipsc_tree, hf_ipsc_type, tvb, 0, 1, ENC_BIG_ENDIAN);
/* SRC_ID */
proto_tree_add_item(ipsc_tree, hf_ipsc_rpt_id, tvb, 1, 4, ENC_BIG_ENDIAN);
/* Linking */
ipsc_linking_item = proto_tree_add_item(ipsc_tree, hf_ipsc_linking_id, tvb, 5, 1, ENC_BIG_ENDIAN);
ipsc_linking_tree = proto_item_add_subtree(ipsc_linking_item, ett_ipsc);
/* Peer Opperation */
proto_tree_add_item(ipsc_linking_tree, hf_ipsc_linking_peer_op_id, tvb, 5, 1, ENC_BIG_ENDIAN);
/* Peer Mode */
proto_tree_add_item(ipsc_linking_tree, hf_ipsc_linking_peer_mode_id, tvb, 5, 1, ENC_BIG_ENDIAN);
/* IPSC Slot 1 */
proto_tree_add_item(ipsc_linking_tree, hf_ipsc_linking_ipsc_slot1_id, tvb, 5, 1, ENC_BIG_ENDIAN);
/* IPSC Slot 2 */
proto_tree_add_item(ipsc_linking_tree, hf_ipsc_linking_ipsc_slot2_id, tvb, 5, 1, ENC_BIG_ENDIAN);
/* Service FLAGS */
ipsc_service_flags_item = proto_tree_add_item(ipsc_tree, hf_ipsc_service_flags_id, tvb, 6, 4, ENC_BIG_ENDIAN);
ipsc_service_flags_tree = proto_item_add_subtree(ipsc_service_flags_item, ett_ipsc);
/* Service FLAGS Byte 1 */
proto_tree_add_item(ipsc_service_flags_tree, hf_ipsc_service_flags_byte1_id, tvb, 6, 1, ENC_BIG_ENDIAN);
/* Service FLAGS Byte 2 */
proto_tree_add_item(ipsc_service_flags_tree, hf_ipsc_service_flags_byte2_id, tvb, 7, 1, ENC_BIG_ENDIAN);
/* Service FLAGS Byte 3 */
ipsc_service_flags_byte3_item = proto_tree_add_item(ipsc_service_flags_tree, hf_ipsc_service_flags_byte3_id, tvb, 8, 1, ENC_BIG_ENDIAN);
ipsc_service_flags_byte3_tree = proto_item_add_subtree(ipsc_service_flags_byte3_item, ett_ipsc);
/* Service FLAGS Byte 3 - RDAC bit */
proto_tree_add_item(ipsc_service_flags_byte3_tree, hf_ipsc_service_flags_byte3_rdac_id, tvb, 8, 1, ENC_BIG_ENDIAN);
/* Service FLAGS Byte 3 - Unknown bit */
proto_tree_add_item(ipsc_service_flags_byte3_tree, hf_ipsc_service_flags_byte3_unk1_id, tvb, 8, 1, ENC_BIG_ENDIAN);
/* Service FLAGS Byte 3 - 3rd Party App */
proto_tree_add_item(ipsc_service_flags_byte3_tree, hf_ipsc_service_flags_byte3_3rdpy_id, tvb, 8, 1, ENC_BIG_ENDIAN);
/* Service FLAGS Byte 3 - Unk2 */
proto_tree_add_item(ipsc_service_flags_byte3_tree, hf_ipsc_service_flags_byte3_unk2_id, tvb, 8, 1, ENC_BIG_ENDIAN);
/* Service FLAGS Byte 4 */
ipsc_service_flags_byte4_item = proto_tree_add_item(ipsc_service_flags_tree, hf_ipsc_service_flags_byte4_id, tvb, 9, 1, ENC_BIG_ENDIAN);
ipsc_service_flags_byte4_tree = proto_item_add_subtree(ipsc_service_flags_byte4_item, ett_ipsc);
/* Service FLAGS Byte 4 - XNL Connected */
proto_tree_add_item(ipsc_service_flags_byte4_tree, hf_ipsc_service_flags_byte4_xnl_conn_id, tvb, 9, 1, ENC_BIG_ENDIAN);
/* Service FLAGS Byte 4 - XNL Master Device */
proto_tree_add_item(ipsc_service_flags_byte4_tree, hf_ipsc_service_flags_byte4_xnl_master_id, tvb, 9, 1, ENC_BIG_ENDIAN);
/* Service FLAGS Byte 4 - XNL Slave Device */
proto_tree_add_item(ipsc_service_flags_byte4_tree, hf_ipsc_service_flags_byte4_xnl_slave_id, tvb, 9, 1, ENC_BIG_ENDIAN);
/* Service FLAGS Byte 4 - Authenticated packets */
proto_tree_add_item(ipsc_service_flags_byte4_tree, hf_ipsc_service_flags_byte4_auth_id, tvb, 9, 1, ENC_BIG_ENDIAN);
/* Service FLAGS Byte 4 - Voice calls supported */
proto_tree_add_item(ipsc_service_flags_byte4_tree, hf_ipsc_service_flags_byte4_voice_id, tvb, 9, 1, ENC_BIG_ENDIAN);
/* Service FLAGS Byte 4 - Data calls supported */
proto_tree_add_item(ipsc_service_flags_byte4_tree, hf_ipsc_service_flags_byte4_data_id, tvb, 9, 1, ENC_BIG_ENDIAN);
/* Service FLAGS Byte 4 - Unk2 */
proto_tree_add_item(ipsc_service_flags_byte4_tree, hf_ipsc_service_flags_byte4_unk2_id, tvb, 9, 1, ENC_BIG_ENDIAN);
/* Service FLAGS Byte 4 - Master */
proto_tree_add_item(ipsc_service_flags_byte4_tree, hf_ipsc_service_flags_byte4_master_id, tvb, 9, 1, ENC_BIG_ENDIAN);
/* Version */
proto_tree_add_item(ipsc_tree, hf_ipsc_version_id, tvb, 10, 4, ENC_BIG_ENDIAN);
/* Auth Digest */
proto_tree_add_item(ipsc_tree, hf_ipsc_digest_id, tvb, 14, 10, ENC_BIG_ENDIAN);
}
static void
dissect_ipsc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
/*
Clear the Info column so that, if we throw an exception, it
shows up as a short or malformed ARP frame. */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPSC");
col_clear(pinfo->cinfo, COL_INFO);
if (tree) {
int val;
switch (val = tvb_get_guint8(tvb, 0))
{
case 0x61:
dissect_CALL_CTL_1(tvb, pinfo, tree);
break;
case 0x62:
dissect_CALL_CTL_2(tvb, pinfo, tree);
break;
case 0x63:
dissect_CALL_CTL_3(tvb, pinfo, tree);
break;
case 0x70:
dissect_XCMP_XNL(tvb, pinfo, tree);
break;
case 0x80:
dissect_GROUP_VOICE(tvb, pinfo, tree);
break;
case 0x84:
dissect_PVT_DATA(tvb, pinfo, tree);
break;
case 0x85:
dissect_RPT_WAKE_UP(tvb, pinfo, tree);
break;
case 0x90:
case 0x91:
case 0x94:
case 0x95:
case 0x96:
case 0x97:
case 0x98:
case 0x99:
dissect_long_messages(tvb, pinfo, tree);
break;
case 0x92:
dissect_short_messages(tvb, pinfo, tree);
break;
default:
;
}
}
}
void
proto_register_ipsc(void)
{
static const value_string valstring_type[] = {
{ 0x61, "CALL_CTL_1" },
{ 0x62, "CALL_CTL_2" },
{ 0x63, "CALL_CTL_3" },
{ 0x70, "XCMP_XNL" },
{ 0x80, "GROUP_VOICE" },
{ 0x83, "GROUP_DATA" },
{ 0x84, "PVT_DATA" },
{ 0x85, "RPT_WAKE_UP" },
{ 0x90, "MASTER_REG_REQ" },
{ 0x91, "MASTER_REG_REPLY"},
{ 0x92, "PEER_LIST_REQ"},
{ 0x91, "PEER_LIST_REPLY"},
{ 0x94, "PEER_REG_REQ"},
{ 0x96, "MASTER_ALIVE_REQ"},
{ 0x97, "MASTER_ALIVE_REPLY"},
{ 0x98, "PEER_ALIVE_REQ"},
{ 0x99, "PEER_ALIVE_REPLY"},
{ 0x9a, "DE_REG_REQ"},
{ 0x9b, "DE_REG_REPLY"},
{ 0, "NULL"}
};
static const value_string valstring_linking_peer_op[] = {
{ 0x00, "Unknown" },
{ 0x01, "Peer Operational" },
{ 0x02, "Unknown" },
{ 0x03, "Unknown" },
{ 0, NULL },
};
static const value_string valstring_linking_peer_mode[] = {
{ 0x00, "No Radio" },
{ 0x01, "Analog Radio" },
{ 0x02, "Digital Radio" },
{ 0x03, "Unknown" },
{ 0, NULL },
};
static const value_string valstring_linking_ipsc_slot[] = {
{ 0x00, "Unknown" },
{ 0x01, "OFF" },
{ 0x02, "ON" },
{ 0x03, "Unknown" },
{ 0, NULL },
};
static const true_false_string valstring_service_flags_rdac = {
"RDAC call",
"Not a RDAC call"
};
static const true_false_string valstring_service_flags_rpt_call_mon = {
"1",
"0"
};
static const true_false_string valstring_one_zero = {
"1",
"0"
};
static const true_false_string valstring_service_flags_3rdpy = {
"3rd Party Console App",
"Not a 3rd Party Console App"
};
static const true_false_string valstring_service_flags_auth = {
"Yes",
"No"
};
static const true_false_string valstring_service_flags_voice = {
"Yes",
"No"
};
static const true_false_string valstring_service_flags_data = {
"Yes",
"No"
};
static const true_false_string valstring_service_flags_unk2 = {
"Yes",
"No"
};
static const true_false_string valstring_service_flags_master = {
"Yes",
"No"
};
static const value_string valstring_data_type[] = {
{ 0x00, "PI header" },
{ 0x01, "Voice LC Header" },
{ 0x02, "Terminator with LC" },
{ 0x03, "CSBK" },
{ 0x04, "MBC Header" },
{ 0x05, "MBC Continuation" },
{ 0x06, "Data Header" },
{ 0x07, "Rate 1/2 Data" },
{ 0x08, "Rate 3/4 Data" },
{ 0x09, "Idle" },
{ 0x0a, "Rate 1 Data" },
{ 0x0b, "Reserved" },
{ 0x0c, "Reserved" },
{ 0x0d, "Reserved" },
{ 0x0e, "Reserved" },
{ 0x0f, "Reserved" },
{ 0, NULL },
};
static const value_string valstring_data_packet_format[] = {
{ 0x0, "Unified Data Transport (UTD)" },
{ 0x1, "Response Packet" },
{ 0x2, "Data packet with unconfirmed delivery" },
{ 0x3, "Data packet with confirmed delivery" },
{ 0xd, "Short Data: Defined" },
{ 0xe, "Short Data: Raw or Status/Precoded " },
{ 0xf, "Proprietary Data Packet" },
{ 0, NULL },
};
static const value_string valstring_service_access_point[] = {
{ 0x0, "Unified Data Transport (UDT)" },
{ 0x1, "Reserved" },
{ 0x2, "TCP/IP header compression" },
{ 0x3, "UDP/IP header compression" },
{ 0x4, "IP based Packet data" },
{ 0x5, "Address Resolution Protocol (ARP)" },
{ 0x6, "Reserved" },
{ 0x7, "Reserved" },
{ 0x8, "Reserved" },
{ 0x9, "Proprietary Packet data" },
{ 0xa, "Short Data" },
{ 0xb, "Reserved" },
{ 0xc, "Reserved" },
{ 0xd, "Reserved" },
{ 0xe, "Reserved" },
{ 0xf, "Reserved" },
{ 0x0, NULL}
};
static hf_register_info hf[] = {
{ &hf_ipsc_type,
{ "Type", "ipsc.type", FT_UINT8, BASE_HEX, VALS(valstring_type), 0x0, NULL, HFILL }
}
,
{ &hf_ipsc_rpt_id,
{ "Rpt Id", "ipsc.src_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }
}
,
{ &hf_ipsc_linking_id,
{ "Linking", "ipsc.linking", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }
}
,
{ &hf_ipsc_linking_peer_op_id,
{ "Peer Op", "ipsc.linking.peer_op", FT_UINT8, BASE_HEX, VALS(valstring_linking_peer_op), 0xc0, NULL, HFILL }
}
,
{ &hf_ipsc_linking_peer_mode_id,
{ "Peer Mode", "ipsc.linking.peer_mode", FT_UINT8, BASE_HEX, VALS(valstring_linking_peer_mode), 0x30, NULL, HFILL }
}
,
{ &hf_ipsc_linking_ipsc_slot1_id,
{ "IPSC Slot 1", "ipsc.linking.ipsc_slot1", FT_UINT8, BASE_HEX, VALS(valstring_linking_ipsc_slot), 0x0c, NULL, HFILL }
}
,
{ &hf_ipsc_linking_ipsc_slot2_id,
{ "IPSC Slot 2", "ipsc.linking.ipsc_slot2", FT_UINT8, BASE_HEX, VALS(valstring_linking_ipsc_slot), 0x03, NULL, HFILL }
}
,
{ &hf_ipsc_service_flags_id,
{ "Service FLAGS", "ipsc.service_flags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }
}
,
{ &hf_ipsc_service_flags_byte1_id,
{ "BYTE 1", "ipsc.service_flags.byte1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }
}
,
{ &hf_ipsc_service_flags_byte2_id,
{ "BYTE 2", "ipsc.service_flags.byte2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }
}
,
{ &hf_ipsc_service_flags_byte3_id,
{ "BYTE 3", "ipsc.service_flags.byte3", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }
}
,
{ &hf_ipsc_service_flags_byte3_rdac_id,
{ "CSBK message", "ipsc.service_flags.byte3.csbk", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }
}
,
{ &hf_ipsc_service_flags_byte3_unk1_id,
{ "Repeater call monitoring", "ipsc.service_flags.byte3.rpt_call_mon", FT_BOOLEAN, 8, TFS(&valstring_service_flags_rpt_call_mon), 0x40, NULL, HFILL }
}
,
{ &hf_ipsc_service_flags_byte3_3rdpy_id,
{ "3rd Party", "ipsc.service_flags.byte3.3rdpy", FT_BOOLEAN, 8, TFS(&valstring_service_flags_3rdpy), 0x20, NULL, HFILL }
}
,
{ &hf_ipsc_service_flags_byte3_unk2_id,
{ "Unk2", "ipsc.service_flags.byte3.3rdpy", FT_UINT8, BASE_HEX, NULL, 0x1f, NULL, HFILL }
}
,
{ &hf_ipsc_service_flags_byte4_id,
{ "BYTE 4", "ipsc.service_flags.byte4", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }
}
,
{ &hf_ipsc_service_flags_byte4_xnl_conn_id,
{ "XNL connected", "ipsc.service_flags.byte4.xnl_conn", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }
}
,
{ &hf_ipsc_service_flags_byte4_xnl_master_id,
{ "XNL Master Device", "ipsc.service_flags.byte4.xnl_master", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }
}
,
{ &hf_ipsc_service_flags_byte4_xnl_slave_id,
{ "XNL Slave Device", "ipsc.service_flags.byte4.xnl_slave", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }
}
,
{ &hf_ipsc_service_flags_byte4_auth_id,
{ "Authenticated packets", "ipsc.service_flags.byte4.auth", FT_BOOLEAN, 8, TFS(&valstring_service_flags_auth), 0x10, NULL, HFILL }
}
,
{ &hf_ipsc_service_flags_byte4_voice_id,
{ "Voice enabled", "ipsc.service_flags.byte4.voice", FT_BOOLEAN, 8, TFS(&valstring_service_flags_voice), 0x08, NULL, HFILL }
}
,
{ &hf_ipsc_service_flags_byte4_data_id,
{ "Data enabled", "ipsc.service_flags.byte4.data", FT_BOOLEAN, 8, TFS(&valstring_service_flags_data), 0x04, NULL, HFILL }
}
,
{ &hf_ipsc_service_flags_byte4_unk2_id,
{ "Unk 2", "ipsc.service_flags.byte4.unk2", FT_BOOLEAN, 8, TFS(&valstring_service_flags_unk2), 0x02, NULL, HFILL }
}
,
{ &hf_ipsc_service_flags_byte4_master_id,
{ "Master", "ipsc.service_flags.byte4.master", FT_BOOLEAN, 8, TFS(&valstring_service_flags_master), 0x01, NULL, HFILL }
}
,
{ &hf_ipsc_version_id,
{ "Version", "ipsc.version", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }
}
,
{ &hf_ipsc_seq_no_id,
{ "Seq No", "ipsc.seq_no", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }
}
,
{ &hf_ipsc_src_id,
{ "Src Id", "ipsc.src_id", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }
}
,
{ &hf_ipsc_dst_id,
{ "Dst Id", "ipsc.dst_id", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }
}
,
{ &hf_ipsc_prio_v_d_id,
{ "Priority Voice/Data", "ipsc.prio_v_d", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }
}
,