Coverage Report

Created: 2026-08-14 06:45

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-stanag4607.c
Line
Count
Source
1
/* packet-stanag4607.c
2
 * Routines for STANAG 4607 dissection
3
 *
4
 * SPDX-License-Identifier: GPL-2.0-or-later
5
 */
6
#include "config.h"
7
8
#include <math.h>
9
#include <epan/packet.h>
10
#include <epan/expert.h>
11
12
#include <wiretap/stanag4607.h>
13
14
void proto_register_stanag4607(void);
15
void proto_reg_handoff_stanag4607(void);
16
17
static int proto_stanag4607;
18
19
static int hf_4607_version;
20
static int hf_4607_version_edition;
21
static int hf_4607_version_version;
22
static int hf_4607_packet_size;
23
static int hf_4607_nationality;
24
static int hf_4607_sec_class;
25
static int hf_4607_sec_system;
26
static int hf_4607_sec_code;
27
static int hf_4607_exercise_indicator;
28
static int hf_4607_platform_id;
29
static int hf_4607_mission_id;
30
static int hf_4607_job_id;
31
32
static int hf_4607_segment_type;
33
static int hf_4607_segment_size;
34
35
/* Mission Segment */
36
static int hf_4607_mission_plan;
37
static int hf_4607_mission_flight_plan;
38
static int hf_4607_mission_platform;
39
static int hf_4607_mission_platform_config;
40
static int hf_4607_mission_time_year;
41
static int hf_4607_mission_time_month;
42
static int hf_4607_mission_time_day;
43
44
/* Dwell Segment */
45
static int hf_4607_dwell_mask;
46
static int hf_4607_dwell_mask_7_7;
47
static int hf_4607_dwell_mask_7_6;
48
static int hf_4607_dwell_mask_7_5;
49
static int hf_4607_dwell_mask_7_4;
50
static int hf_4607_dwell_mask_7_3;
51
static int hf_4607_dwell_mask_7_2;
52
static int hf_4607_dwell_mask_7_1;
53
static int hf_4607_dwell_mask_7_0;
54
static int hf_4607_dwell_mask_6_7;
55
static int hf_4607_dwell_mask_6_6;
56
static int hf_4607_dwell_mask_6_5;
57
static int hf_4607_dwell_mask_6_4;
58
static int hf_4607_dwell_mask_6_3;
59
static int hf_4607_dwell_mask_6_2;
60
static int hf_4607_dwell_mask_6_1;
61
static int hf_4607_dwell_mask_6_0;
62
static int hf_4607_dwell_mask_5_7;
63
static int hf_4607_dwell_mask_5_6;
64
static int hf_4607_dwell_mask_5_5;
65
static int hf_4607_dwell_mask_5_4;
66
static int hf_4607_dwell_mask_5_3;
67
static int hf_4607_dwell_mask_5_2;
68
static int hf_4607_dwell_mask_5_1;
69
static int hf_4607_dwell_mask_5_0;
70
static int hf_4607_dwell_mask_4_7;
71
static int hf_4607_dwell_mask_4_6;
72
static int hf_4607_dwell_mask_4_5;
73
static int hf_4607_dwell_mask_4_4;
74
static int hf_4607_dwell_mask_4_3;
75
static int hf_4607_dwell_mask_4_2;
76
static int hf_4607_dwell_mask_4_1;
77
static int hf_4607_dwell_mask_4_0;
78
static int hf_4607_dwell_mask_3_7;
79
static int hf_4607_dwell_mask_3_6;
80
static int hf_4607_dwell_mask_3_5;
81
static int hf_4607_dwell_mask_3_4;
82
static int hf_4607_dwell_mask_3_3;
83
static int hf_4607_dwell_mask_3_2;
84
static int hf_4607_dwell_mask_3_1;
85
static int hf_4607_dwell_mask_3_0;
86
static int hf_4607_dwell_mask_2_7;
87
static int hf_4607_dwell_mask_2_6;
88
static int hf_4607_dwell_mask_2_5;
89
static int hf_4607_dwell_mask_2_4;
90
static int hf_4607_dwell_mask_2_3;
91
static int hf_4607_dwell_mask_2_2;
92
static int hf_4607_dwell_mask_2_1;
93
static int hf_4607_dwell_mask_2_0;
94
static int hf_4607_dwell_mask_spare;
95
96
static int hf_4607_dwell_revisit_index;
97
static int hf_4607_dwell_dwell_index;
98
static int hf_4607_dwell_last_dwell;
99
static int hf_4607_dwell_count;
100
static int hf_4607_dwell_time;
101
static int hf_4607_dwell_sensor_lat;
102
static int hf_4607_dwell_sensor_lon;
103
static int hf_4607_dwell_sensor_alt;
104
static int hf_4607_dwell_scale_lat;
105
static int hf_4607_dwell_scale_lon;
106
static int hf_4607_dwell_unc_along;
107
static int hf_4607_dwell_unc_cross;
108
static int hf_4607_dwell_unc_alt;
109
static int hf_4607_dwell_track;
110
static int hf_4607_dwell_speed;
111
static int hf_4607_dwell_vert_velocity;
112
static int hf_4607_dwell_track_unc;
113
static int hf_4607_dwell_speed_unc;
114
static int hf_4607_dwell_vv_unc;
115
116
static int hf_4607_dwell_plat_heading;
117
static int hf_4607_dwell_plat_pitch;
118
static int hf_4607_dwell_plat_roll;
119
static int hf_4607_dwell_da_lat;
120
static int hf_4607_dwell_da_lon;
121
static int hf_4607_dwell_da_range;
122
static int hf_4607_dwell_da_angle;
123
static int hf_4607_dwell_sensor_heading;
124
static int hf_4607_dwell_sensor_pitch;
125
static int hf_4607_dwell_sensor_roll;
126
static int hf_4607_dwell_mdv;
127
128
/* Target Report */
129
static int hf_4607_dwell_report_index;
130
static int hf_4607_dwell_report_lat;
131
static int hf_4607_dwell_report_lon;
132
static int hf_4607_dwell_report_delta_lat;
133
static int hf_4607_dwell_report_delta_lon;
134
static int hf_4607_dwell_report_height;
135
static int hf_4607_dwell_report_radial;
136
static int hf_4607_dwell_report_wrap;
137
static int hf_4607_dwell_report_snr;
138
static int hf_4607_dwell_report_class;
139
static int hf_4607_dwell_report_prob;
140
static int hf_4607_dwell_report_unc_slant;
141
static int hf_4607_dwell_report_unc_cross;
142
static int hf_4607_dwell_report_unc_height;
143
static int hf_4607_dwell_report_unc_radial;
144
static int hf_4607_dwell_report_tag_app;
145
static int hf_4607_dwell_report_tag_entity;
146
static int hf_4607_dwell_report_section;
147
148
/* Job Definition Segment */
149
static int hf_4607_jobdef_job_id;
150
static int hf_4607_jobdef_sensor_type;
151
static int hf_4607_jobdef_sensor_model;
152
static int hf_4607_jobdef_filter;
153
static int hf_4607_jobdef_priority;
154
static int hf_4607_jobdef_ba_lat_a;
155
static int hf_4607_jobdef_ba_lon_a;
156
static int hf_4607_jobdef_ba_lat_b;
157
static int hf_4607_jobdef_ba_lon_b;
158
static int hf_4607_jobdef_ba_lat_c;
159
static int hf_4607_jobdef_ba_lon_c;
160
static int hf_4607_jobdef_ba_lat_d;
161
static int hf_4607_jobdef_ba_lon_d;
162
static int hf_4607_jobdef_radar_mode;
163
static int hf_4607_jobdef_revisit_interval;
164
static int hf_4607_jobdef_unc_along;
165
static int hf_4607_jobdef_unc_cross;
166
static int hf_4607_jobdef_unc_alt;
167
static int hf_4607_jobdef_unc_heading;
168
static int hf_4607_jobdef_unc_speed;
169
static int hf_4607_jobdef_sense_slant;
170
static int hf_4607_jobdef_sense_cross;
171
static int hf_4607_jobdef_sense_vlos;
172
static int hf_4607_jobdef_sense_mdv;
173
static int hf_4607_jobdef_sense_prob;
174
static int hf_4607_jobdef_sense_alarm;
175
static int hf_4607_jobdef_terrain_model;
176
static int hf_4607_jobdef_geoid_model;
177
178
/* Platform Location Segment */
179
static int hf_4607_platloc_time;
180
static int hf_4607_platloc_latitude;
181
static int hf_4607_platloc_longitude;
182
static int hf_4607_platloc_altitude;
183
static int hf_4607_platloc_track;
184
static int hf_4607_platloc_speed;
185
static int hf_4607_platloc_vertical_velocity;
186
187
/* Subtree pointers */
188
static int ett_4607_hdr;
189
static int ett_4607_seg;
190
static int ett_4607_rpt;
191
static int ett_4607_mask;
192
static int ett_4607_ver;
193
194
/* Error pointers */
195
static expert_field ei_bad_length;
196
static expert_field ei_too_short;
197
static expert_field ei_bad_packet_size;
198
static expert_field ei_job_id_zero;
199
200
static dissector_handle_t stanag4607_handle;
201
202
203
static const value_string stanag4607_class_vals[] = {
204
  {   1, "TOP SECRET" },
205
  {   2, "SECRET" },
206
  {   3, "CONFIDENTIAL" },
207
  {   4, "RESTRICTED" },
208
  {   5, "UNCLASSIFIED" },
209
  { 0, NULL }
210
};
211
212
static const value_string stanag4607_security_codes_vals[] = {
213
  { 0x0000, "NONE (NO-STATEMENT VALUE)" },
214
  { 0x0001, "EU (Releasable To European Commission)" },
215
  { 0x0002, "EUFOR (Releasable To European Union Force)" },
216
  { 0x0004, "ISAF (Releasable To International Security Assistance Force)" },
217
  { 0x0008, "KFOR (Releasable To Kosovo Force)" },
218
  { 0x0010, "NATO RESPONSE FORCE (Releaseable to NRF)" },
219
  { 0x0020, "NMI (Releasable To NATO Mission Iraq)" },
220
  { 0x0040, "PFP (Releasable To Partnership for Peace)" },
221
  { 0x0080, "RESOLUTE SUPPORT (Releasable To RS)" },
222
  { 0x0100, "THE PUBLIC (Releasable To The Public)" },
223
  { 0x0200, "UNDEFINED. FOR FUTURE USE" },
224
  { 0x0400, "UNDEFINED. FOR FUTURE USE" },
225
  { 0x0800, "UNDEFINED. FOR FUTURE USE" },
226
  { 0x1000, "UNDEFINED. FOR FUTURE USE" },
227
  { 0x2000, "UNDEFINED. FOR FUTURE USE" },
228
  { 0x4000, "UNDEFINED. FOR FUTURE USE" },
229
  { 0x8000, "UNDEFINED. FOR FUTURE USE" },
230
  { 0, NULL }
231
};
232
233
static const value_string stanag4607_exind_vals[] = {
234
  {   0, "Operation, Real Data" },
235
  {   1, "Operation, Simulated Data" },
236
  {   2, "Operation, Synthesized Data" },
237
  {   128, "Exercise, Real Data" },
238
  {   129, "Exercise, Simulated Data" },
239
  {   130, "Exercise, Synthesized Data" },
240
  { 0, NULL }
241
};
242
243
0
#define MISSION_SEGMENT 1
244
0
#define DWELL_SEGMENT 2
245
0
#define JOB_DEFINITION_SEGMENT 5
246
0
#define PLATFORM_LOCATION_SEGMENT 13
247
248
static const value_string stanag4607_segment_vals[] = {
249
  {   1, "Mission Segment" },
250
  {   2, "Dwell Segment" },
251
  {   3, "HRR Segment" },
252
  {   5, "Job Definition Segment" },
253
  {   6, "Free Text Segment" },
254
  {   7, "Low Reflectivity Index Segment" },
255
  {   8, "Group Segment" },
256
  {   9, "Attached Target Segment" },
257
  {  10, "Test and Status Segment" },
258
  {  11, "System-Specific Segment" },
259
  {  12, "Processing History Segment" },
260
  {  13, "Platform Location Segment" },
261
  {  101, "Job Request Segment" },
262
  {  102, "Job Acknowledgment Segment" },
263
  { 0, NULL }
264
};
265
266
static const value_string stanag4607_sensor_vals[] = {
267
  {   0, "Unidentified" },
268
  {   1, "Other" },
269
  {   2, "HiSAR" },
270
  {   3, "ASTOR" },
271
  {   4, "Rotary Wing Radar" },
272
  {   5, "Global Hawk Sensor" },
273
  {   6, "HORIZON" },
274
  {   7, "APY-3" },
275
  {   8, "APY-6" },
276
  {   9, "APY-8 (Lynx I)" },
277
  {  10, "RADARSAT2" },
278
  {  11, "ASARS-2A" },
279
  {  12, "TESAR" },
280
  {  13, "MP-RTIP" },
281
  {  14, "APG-77" },
282
  {  15, "APG-79" },
283
  {  16, "APG-81" },
284
  {  17, "APY-6v1" },
285
  {  18, "SPY-I (Lynx II)" },
286
  {  19, "SIDM" },
287
  {  20, "LIMIT" },
288
  {  21, "TCAR (AGS A321)" },
289
  {  22, "LSRS Sensor" },
290
  {  23, "UGS Single Sensor" },
291
  {  24, "UGS Cluster Sensor" },
292
  {  25, "IMASTER GMTI" },
293
  {  26, "AN/ZPY-1 (STARLite)" },
294
  {  27, "VADER" },
295
  {  255, "No Statement" },
296
  { 0, NULL }
297
};
298
299
static const value_string stanag4607_radar_mode_vals[] = {
300
  {   0, "Unspecified Mode" },
301
  {   1, "MTI (Moving Target Indicator)" },
302
  {   2, "HRR (High Range Resolution)" },
303
  {   3, "UHRR (Ultra High Range Resolution)" },
304
  {   4, "HUR (High Update Rate)" },
305
  {   5, "FTI" },
306
  /* TODO: and many many more ... */
307
  { 0, NULL }
308
};
309
310
static const value_string stanag4607_terrain_vals[] = {
311
  {   0, "None Specified" },
312
  {   1, "DTED0 (Digital Terrain Elevation Data, Level 0)" },
313
  {   2, "DTED1 (Digital Terrain Elevation Data, Level 1)" },
314
  {   3, "DTED2 (Digital Terrain Elevation Data, Level 2)" },
315
  {   4, "DTED3 (Digital Terrain Elevation Data, Level 3)" },
316
  {   5, "DTED4 (Digital Terrain Elevation Data, Level 4)" },
317
  {   6, "DTED5 (Digital Terrain Elevation Data, Level 5)" },
318
  {   7, "SRTM1 (Shuttle Radar Topography Mission, Level 1)" },
319
  {   8, "SRTM2 (Shuttle Radar Topography Mission, Level 2)" },
320
  {   9, "DGM50 M745 (Digitales Gelandemodell 1:50 000)" },
321
  {   10, "DGM250 (Digitales Gelandemodell 1:250 000)" },
322
  {   11, "ITHD (Interferometric Terrain Data Height)" },
323
  {   12, "STHD (Stereometric Terrain Data Height)" },
324
  {   13, "SEDRIS (SEDRIS Reference Model ISO/IEC 18026)" },
325
  { 0, NULL }
326
};
327
328
static const value_string stanag4607_geoid_vals[] = {
329
  {   0, "None Specified" },
330
  {   1, "EGM96 (Earth Gravitational Model, Version 1996)" },
331
  {   2, "GEO96 (Geoid Gravitational Model, Version 1996)" },
332
  {   3, "Flat Earth" },
333
  { 0, NULL }
334
};
335
336
static const value_string stanag4607_target_vals[] = {
337
  {   0, "No Information, Live Target" },
338
  {   1, "Tracked Vehicle, Live Target" },
339
  {   2, "Wheeled Vehicle, Live Target" },
340
  {   3, "Rotary Wing Aircraft, Live Target" },
341
  {   4, "Fixed Wing Aircraft, Live Target" },
342
  {   5, "Stationary Rotator, Live Target" },
343
  {   6, "Maritime, Live Target" },
344
  {   7, "Beacon, Live Target" },
345
  {   8, "Amphibious, Live Target" },
346
  {   9, "Person, Live Target" },
347
  {   10, "Vehicle, Live Target" },
348
  {   11, "Animal, Live Target" },
349
  {   12, "Large Multiple-Return, Live Land Target" },
350
  {   13, "Large Multiple-Return, Live Maritime Target" },
351
352
  {   126, "Other, Live Target" },
353
  {   127, "Unknown, Live Target" },
354
  {   128, "No Information, Simulated Target" },
355
  {   129, "Tracked Vehicle, Simulated Target" },
356
  {   130, "Wheeled Vehicle, Simulated Target" },
357
  {   131, "Rotary Wing Aircraft, Simulated Target" },
358
  {   132, "Fixed Wing Aircraft, Simulated Target" },
359
  {   133, "Stationary Rotator, Simulated Target" },
360
  {   134, "Maritime, Simulated Target" },
361
  {   135, "Beacon, Simulated Target" },
362
  {   136, "Amphibious, Simulated Target" },
363
  {   137, "Person, Simulated Target" },
364
  {   138, "Vehicle, Simulated Target" },
365
  {   139, "Animal, Simulated Target" },
366
  {   140, "Large Multiple-Return, Simulated Land Target" },
367
  {   141, "Large Multiple-Return, Simulated Maritime Target" },
368
369
  {   143, "Tagging Device" },
370
371
  {   254, "Other, Simulated Target" },
372
  {   255, "Unknown, Simulated Target" },
373
  { 0, NULL }
374
};
375
376
static const value_string stanag4607_platform_vals[] = {
377
  {   0, "Unidentified" },
378
  {   1, "ACS" },
379
  {   2, "ARL-M" },
380
  {   3, "Sentinel" },
381
  {   4, "Rotary Wing Radar" },
382
  {   5, "Global Hawk-Navy" },
383
  {   6, "HORIZON" },
384
  {   7, "E-8C (Joint STARS)" },
385
  {   8, "P-3C" },
386
  {   9, "Predator" },
387
  {  10, "RADARSAT2" },
388
  {  11, "U-2" },
389
  {  12, "E-10" },
390
  {  13, "UGS - Single" },
391
  {  14, "UGS - Cluster" },
392
  {  15, "Ground Based" },
393
  {  16, "UAV-Army" },
394
  {  17, "UAV-Marines" },
395
  {  18, "UAV-Navy" },
396
  {  19, "UAV-Air Force" },
397
  {  20, "Global Hawk-Air Force" },
398
  {  21, "Global Hawk-Australia" },
399
  {  22, "Global Hawk-Germany" },
400
  {  23, "Paul Revere" },
401
  {  24, "Mariner UAV" },
402
  {  25, "BAC-111" },
403
  {  26, "Coyote" },
404
  {  27, "King Air" },
405
  {  28, "LIMIT" },
406
  {  29, "NRL NP-3B" },
407
  {  30, "SOSTAR-X" },
408
  {  31, "WatchKeeper" },
409
  {  32, "Alliance Ground Surveillance (AGS) (A321)" },
410
  {  33, "Stryker" },
411
  {  34, "AGS (HALE UAV)" },
412
  {  35, "SIDM" },
413
  {  36, "MQ-9 Reaper" },
414
  {  37, "Warrior A" },
415
  {  38, "Warrior" },
416
  {  39, "Twin Otter" },
417
  {  40, "LEMV" },
418
  {  41, "P8A Poseidon" },
419
  {  42, "A160" },
420
  {  43, "MQ-1C Gray Eagle" },
421
  {  44, "RQ-7C Shadow" },
422
  {  45, "PGSS" },
423
  {  46, "PTDS" },
424
  {  47, "LRAS 3" },
425
  {  48, "RAID Tower" },
426
  {  49, "Heron" },
427
  {  50, "Scan Eagle" },
428
  {  51, "Fire Scout" },
429
  {  52, "F35 Joint Strike Fighter" },
430
  {  53, "F-61 Sea King (SKASac)" },
431
  {  54, "Lynx Wildcat" },
432
  {  55, "Merlin" },
433
  {  56, "SDT (Système de Drone Tactique)" },
434
  {  255, "Other" },
435
  {  0, NULL }
436
};
437
438
static void
439
prt_sa32(char *buff, uint32_t val)
440
0
{
441
0
  double deg, min, sec;
442
0
  double x = (double) ((int32_t) val);
443
0
  x /= (double) (1UL<<30);
444
0
  x *= 45.0;
445
0
  deg = floor(x);
446
0
  min = floor(60.0 * (x - deg));
447
0
  sec = 60.0 * (60.0 * (x - deg) - min);
448
  /* checkAPI.pl doesn't like the unicode degree symbol, I don't know what to do... */
449
0
  snprintf(buff, ITEM_LABEL_LENGTH, "%.8f degrees (%.0f %.0f\' %.2f\")", x, deg, min, sec);
450
0
}
451
452
static void
453
prt_ba32(char *buff, uint32_t val)
454
0
{
455
0
  double deg, min, sec;
456
0
  double x = (double) val;
457
0
  x /= (double) (1UL<<30);
458
0
  x *= 90.0;
459
0
  deg = floor(x);
460
0
  min = floor(60.0 * (x - deg));
461
0
  sec = 60.0 * (60.0 * (x - deg) - min);
462
  /* checkAPI.pl doesn't like the unicode degree symbol, I don't know what to do... */
463
0
  snprintf(buff, ITEM_LABEL_LENGTH, "%.8f degrees (%.0f %.0f\' %.2f\")", x, deg, min, sec);
464
0
}
465
466
static void
467
prt_sa16(char *buff, uint32_t val)
468
0
{
469
0
  double x = (double) ((int32_t) val);
470
0
  x /= (double) (1<<14);
471
0
  x *= 90.0;
472
0
  snprintf(buff, ITEM_LABEL_LENGTH, "%.3f degrees", x);
473
0
}
474
475
static void
476
prt_ba16(char *buff, uint32_t val)
477
0
{
478
0
  double x = (double) val;
479
0
  x /= (double) (1<<14);
480
0
  x *= 90.0;
481
0
  snprintf(buff, ITEM_LABEL_LENGTH, "%.3f degrees", x);
482
0
}
483
484
static void
485
prt_ba16_none(char *buff, uint32_t val)
486
0
{
487
0
  double x = (double) val;
488
0
  x /= (double) (1<<14);
489
0
  x *= 90.0;
490
0
  if (val <= 65536)
491
0
    snprintf(buff, ITEM_LABEL_LENGTH, "No Statement");
492
0
  else
493
0
    snprintf(buff, ITEM_LABEL_LENGTH, "%.3f degrees", x);
494
0
}
495
496
static void
497
prt_kilo(char *buff, uint32_t val)
498
0
{
499
0
  double x = (double) ((int32_t) val);
500
0
  x /= 128.0;
501
0
  snprintf(buff, ITEM_LABEL_LENGTH, "%.2f kilometers", x);
502
0
}
503
504
static void
505
prt_meters(char *buff, uint32_t val)
506
0
{
507
0
  double x = (double) ((int32_t) val);
508
0
  snprintf(buff, ITEM_LABEL_LENGTH, "%.0f meters", x);
509
0
}
510
511
static void
512
prt_decimeters(char *buff, uint32_t val)
513
0
{
514
0
  double x = (double) ((int32_t) val);
515
0
  x /= 10.0;
516
0
  snprintf(buff, ITEM_LABEL_LENGTH, "%.1f meters", x);
517
0
}
518
519
static void
520
prt_centimeters(char *buff, uint32_t val)
521
0
{
522
0
  double x = (double) ((int32_t) val);
523
0
  x /= 100.0;
524
0
  snprintf(buff, ITEM_LABEL_LENGTH, "%.2f meters", x);
525
0
}
526
527
static void
528
prt_speed(char *buff, uint32_t val)
529
0
{
530
0
  double x = (double) val;
531
0
  x /= 1000.0;
532
0
  snprintf(buff, ITEM_LABEL_LENGTH, "%.3f meters/second", x);
533
0
}
534
535
static void
536
prt_speed_centi(char *buff, uint32_t val)
537
0
{
538
0
  double x = (double) ((int32_t) val);
539
0
  x /= 100.0;
540
0
  snprintf(buff, ITEM_LABEL_LENGTH, "%.2f meters/second", x);
541
0
}
542
543
static void
544
prt_speed_deci(char *buff, uint32_t val)
545
0
{
546
  /* Usually 8-bit, signed */
547
0
  double x = (double) ((int32_t) val);
548
0
  x /= 10.0;
549
0
  snprintf(buff, ITEM_LABEL_LENGTH, "%.1f meters/second", x);
550
0
}
551
552
static void
553
prt_millisec(char *buff, uint32_t val)
554
0
{
555
0
  double x = (double) val;
556
0
  x /= 1000.0;
557
0
  snprintf(buff, ITEM_LABEL_LENGTH, "%.3f seconds", x);
558
0
}
559
560
static void
561
prt_none8(char *buff, uint32_t val)
562
0
{
563
0
  if (0xff == val)
564
0
    snprintf(buff, ITEM_LABEL_LENGTH, "No Statement");
565
0
  else
566
0
    snprintf(buff, ITEM_LABEL_LENGTH, "%d", val);
567
0
}
568
569
static void
570
prt_none16(char *buff, uint32_t val)
571
0
{
572
0
  if (0xffff == val)
573
0
    snprintf(buff, ITEM_LABEL_LENGTH, "No Statement");
574
0
  else
575
0
    snprintf(buff, ITEM_LABEL_LENGTH, "%d", val);
576
0
}
577
578
579
static int
580
dissect_mission(tvbuff_t *tvb, proto_tree *seg_tree, int offset)
581
0
{
582
0
  proto_tree_add_item(seg_tree, hf_4607_mission_plan, tvb, offset, 12, ENC_ASCII);
583
0
  offset += 12;
584
0
  proto_tree_add_item(seg_tree, hf_4607_mission_flight_plan, tvb, offset, 12, ENC_ASCII);
585
0
  offset += 12;
586
0
  proto_tree_add_item(seg_tree, hf_4607_mission_platform, tvb, offset, 1, ENC_BIG_ENDIAN);
587
0
  offset += 1;
588
0
  proto_tree_add_item(seg_tree, hf_4607_mission_platform_config, tvb, offset, 10, ENC_ASCII);
589
0
  offset += 10;
590
0
  proto_tree_add_item(seg_tree, hf_4607_mission_time_year, tvb, offset, 2, ENC_BIG_ENDIAN);
591
0
  offset += 2;
592
0
  proto_tree_add_item(seg_tree, hf_4607_mission_time_month, tvb, offset, 1, ENC_BIG_ENDIAN);
593
0
  offset += 1;
594
0
  proto_tree_add_item(seg_tree, hf_4607_mission_time_day, tvb, offset, 1, ENC_BIG_ENDIAN);
595
0
  offset += 1;
596
597
0
  return offset;
598
0
}
599
600
/* Dwell Segment Existence Mask */
601
/* The Dxx fields are NOT bit locations! They are the field numbers
602
 * as specified in Table 2-4 Dwell Segment.  These field numbers DO NOT
603
 * count bit locations in the existence mask (even though they come
604
 * close to this).  The m and n values of the m*8+n offset below are
605
 * given in Figure 2-1 titled "Dwell Segment Existence Mask Mapping."
606
 */
607
0
#define SET(MASK,OFF) (((MASK)>>(OFF)) & INT64_C(1))
608
#define D2      7*8+7
609
#define D3      7*8+6
610
#define D4      7*8+5
611
#define D5      7*8+4
612
#define D6      7*8+3
613
#define D7      7*8+2
614
#define D8      7*8+1
615
#define D9      7*8+0
616
#define D10     6*8+7
617
#define D11     6*8+6
618
#define D12     6*8+5
619
#define D13     6*8+4
620
#define D14     6*8+3
621
#define D15     6*8+2
622
#define D16     6*8+1
623
#define D17     6*8+0
624
#define D18     5*8+7
625
#define D19     5*8+6
626
#define D20     5*8+5
627
#define D21     5*8+4
628
#define D22     5*8+3
629
#define D23     5*8+2
630
#define D24     5*8+1
631
#define D25     5*8+0
632
#define D26     4*8+7
633
#define D27     4*8+6
634
#define D28     4*8+5
635
#define D29     4*8+4
636
#define D30     4*8+3
637
#define D31     4*8+2
638
#define D32_1   4*8+1
639
#define D32_2   4*8+0
640
#define D32_3   3*8+7
641
#define D32_4   3*8+6
642
#define D32_5   3*8+5
643
#define D32_6   3*8+4
644
#define D32_7   3*8+3
645
#define D32_8   3*8+2
646
#define D32_9   3*8+1
647
#define D32_10  3*8+0
648
#define D32_11  2*8+7
649
#define D32_12  2*8+6
650
#define D32_13  2*8+5
651
#define D32_14  2*8+4
652
#define D32_15  2*8+3
653
#define D32_16  2*8+2
654
#define D32_17  2*8+1
655
#define D32_18  2*8+0
656
657
/* Target Report */
658
static int
659
dissect_target(tvbuff_t *tvb, proto_tree *seg_tree, int offset, uint64_t mask)
660
0
{
661
0
  proto_item *rpt_item = NULL;
662
0
  proto_tree *rpt_tree = seg_tree;
663
664
0
  if (SET(mask, D32_1)) {
665
0
    rpt_item = proto_tree_add_item(rpt_tree, hf_4607_dwell_report_index, tvb, offset, 2, ENC_BIG_ENDIAN);
666
0
    offset += 2;
667
0
    rpt_tree = proto_item_add_subtree(rpt_item, ett_4607_rpt);
668
0
  }
669
670
0
  if (SET(mask, D32_2)) {
671
0
    rpt_item = proto_tree_add_item(rpt_tree, hf_4607_dwell_report_lat, tvb, offset, 4, ENC_BIG_ENDIAN);
672
0
    offset += 4;
673
0
  }
674
0
  if (SET(mask, D32_3)) {
675
0
    proto_tree_add_item(rpt_tree, hf_4607_dwell_report_lon, tvb, offset, 4, ENC_BIG_ENDIAN);
676
0
    offset += 4;
677
0
  }
678
0
  if (SET(mask, D32_4)) {
679
0
    rpt_item = proto_tree_add_item(rpt_tree, hf_4607_dwell_report_delta_lat, tvb, offset, 2, ENC_BIG_ENDIAN);
680
0
    offset += 2;
681
0
  }
682
0
  if (SET(mask, D32_5)) {
683
0
    proto_tree_add_item(rpt_tree, hf_4607_dwell_report_delta_lon, tvb, offset, 2, ENC_BIG_ENDIAN);
684
0
    offset += 2;
685
0
  }
686
687
  /* If the report index wasn't set, then no subtree yet */
688
0
  if (rpt_item && rpt_tree == seg_tree) {
689
0
    rpt_tree = proto_item_add_subtree(rpt_item, ett_4607_rpt);
690
0
  }
691
0
  if (SET(mask, D32_6)) {
692
0
    proto_tree_add_item(rpt_tree, hf_4607_dwell_report_height, tvb, offset, 2, ENC_BIG_ENDIAN);
693
0
    offset += 2;
694
0
  }
695
0
  if (SET(mask, D32_7)) {
696
0
    proto_tree_add_item(rpt_tree, hf_4607_dwell_report_radial, tvb, offset, 2, ENC_BIG_ENDIAN);
697
0
    offset += 2;
698
0
  }
699
0
  if (SET(mask, D32_8)) {
700
0
    proto_tree_add_item(rpt_tree, hf_4607_dwell_report_wrap, tvb, offset, 2, ENC_BIG_ENDIAN);
701
0
    offset += 2;
702
0
  }
703
0
  if (SET(mask, D32_9)) {
704
0
    proto_tree_add_item(rpt_tree, hf_4607_dwell_report_snr, tvb, offset, 1, ENC_BIG_ENDIAN);
705
0
    offset += 1;
706
0
  }
707
0
  if (SET(mask, D32_10)) {
708
0
    proto_tree_add_item(rpt_tree, hf_4607_dwell_report_class, tvb, offset, 1, ENC_BIG_ENDIAN);
709
0
    offset += 1;
710
0
  }
711
0
  if (SET(mask, D32_11)) {
712
0
    proto_tree_add_item(rpt_tree, hf_4607_dwell_report_prob, tvb, offset, 1, ENC_BIG_ENDIAN);
713
0
    offset += 1;
714
0
  }
715
0
  if (SET(mask, D32_12)) {
716
0
    proto_tree_add_item(rpt_tree, hf_4607_dwell_report_unc_slant, tvb, offset, 2, ENC_BIG_ENDIAN);
717
0
    offset += 2;
718
0
  }
719
0
  if (SET(mask, D32_13)) {
720
0
    proto_tree_add_item(rpt_tree, hf_4607_dwell_report_unc_cross, tvb, offset, 2, ENC_BIG_ENDIAN);
721
0
    offset += 2;
722
0
  }
723
0
  if (SET(mask, D32_14)) {
724
0
    proto_tree_add_item(rpt_tree, hf_4607_dwell_report_unc_height, tvb, offset, 1, ENC_BIG_ENDIAN);
725
0
    offset += 1;
726
0
  }
727
0
  if (SET(mask, D32_15)) {
728
0
    proto_tree_add_item(rpt_tree, hf_4607_dwell_report_unc_radial, tvb, offset, 2, ENC_BIG_ENDIAN);
729
0
    offset += 2;
730
0
  }
731
0
  if (SET(mask, D32_16)) {
732
0
    proto_tree_add_item(rpt_tree, hf_4607_dwell_report_tag_app, tvb, offset, 1, ENC_BIG_ENDIAN);
733
0
    offset += 1;
734
0
  }
735
0
  if (SET(mask, D32_17)) {
736
0
    proto_tree_add_item(rpt_tree, hf_4607_dwell_report_tag_entity, tvb, offset, 4, ENC_BIG_ENDIAN);
737
0
    offset += 4;
738
0
  }
739
0
  if (SET(mask, D32_18)) {
740
0
    proto_tree_add_item(rpt_tree, hf_4607_dwell_report_section, tvb, offset, 1, ENC_BIG_ENDIAN);
741
0
    offset += 1;
742
0
  }
743
744
0
  return offset;
745
0
}
746
747
/* Dwell Segment */
748
static int
749
dissect_dwell(tvbuff_t *tvb, proto_tree *seg_tree, int offset)
750
0
{
751
0
  uint64_t mask;
752
0
  uint32_t count;
753
754
0
  mask = tvb_get_ntoh64(tvb, offset);
755
756
0
  static int* const mask_bits[] = {
757
0
            &hf_4607_dwell_mask_7_7,
758
0
      &hf_4607_dwell_mask_7_6,
759
0
      &hf_4607_dwell_mask_7_5,
760
0
      &hf_4607_dwell_mask_7_4,
761
0
      &hf_4607_dwell_mask_7_3,
762
0
      &hf_4607_dwell_mask_7_2,
763
0
      &hf_4607_dwell_mask_7_1,
764
0
      &hf_4607_dwell_mask_7_0,
765
0
      &hf_4607_dwell_mask_6_7,
766
0
      &hf_4607_dwell_mask_6_6,
767
0
      &hf_4607_dwell_mask_6_5,
768
0
      &hf_4607_dwell_mask_6_4,
769
0
      &hf_4607_dwell_mask_6_3,
770
0
      &hf_4607_dwell_mask_6_2,
771
0
      &hf_4607_dwell_mask_6_1,
772
0
      &hf_4607_dwell_mask_6_0,
773
0
      &hf_4607_dwell_mask_5_7,
774
0
      &hf_4607_dwell_mask_5_6,
775
0
      &hf_4607_dwell_mask_5_5,
776
0
      &hf_4607_dwell_mask_5_4,
777
0
      &hf_4607_dwell_mask_5_3,
778
0
      &hf_4607_dwell_mask_5_2,
779
0
      &hf_4607_dwell_mask_5_1,
780
0
      &hf_4607_dwell_mask_5_0,
781
0
      &hf_4607_dwell_mask_4_7,
782
0
      &hf_4607_dwell_mask_4_6,
783
0
      &hf_4607_dwell_mask_4_5,
784
0
      &hf_4607_dwell_mask_4_4,
785
0
      &hf_4607_dwell_mask_4_3,
786
0
      &hf_4607_dwell_mask_4_2,
787
0
      &hf_4607_dwell_mask_4_1,
788
0
      &hf_4607_dwell_mask_4_0,
789
0
      &hf_4607_dwell_mask_3_7,
790
0
      &hf_4607_dwell_mask_3_6,
791
0
      &hf_4607_dwell_mask_3_5,
792
0
      &hf_4607_dwell_mask_3_4,
793
0
      &hf_4607_dwell_mask_3_3,
794
0
      &hf_4607_dwell_mask_3_2,
795
0
      &hf_4607_dwell_mask_3_1,
796
0
      &hf_4607_dwell_mask_3_0,
797
0
      &hf_4607_dwell_mask_2_7,
798
0
      &hf_4607_dwell_mask_2_6,
799
0
      &hf_4607_dwell_mask_2_5,
800
0
      &hf_4607_dwell_mask_2_4,
801
0
      &hf_4607_dwell_mask_2_3,
802
0
      &hf_4607_dwell_mask_2_2,
803
0
      &hf_4607_dwell_mask_2_1,
804
0
      &hf_4607_dwell_mask_2_0,
805
0
      &hf_4607_dwell_mask_spare,
806
0
            NULL
807
0
        };
808
0
  proto_tree_add_bitmask(seg_tree, tvb, offset, hf_4607_dwell_mask, ett_4607_mask, mask_bits, ENC_BIG_ENDIAN);
809
0
  offset += 8;
810
811
  /* Mandatory fields, existence mask irrelevant */
812
0
  proto_tree_add_item(seg_tree, hf_4607_dwell_revisit_index, tvb, offset, 2, ENC_BIG_ENDIAN);
813
0
  offset += 2;
814
815
0
  proto_tree_add_item(seg_tree, hf_4607_dwell_dwell_index, tvb, offset, 2, ENC_BIG_ENDIAN);
816
0
  offset += 2;
817
818
0
  proto_tree_add_item(seg_tree, hf_4607_dwell_last_dwell, tvb, offset, 1, ENC_BIG_ENDIAN);
819
0
  offset += 1;
820
821
  /* count of target reports */
822
0
  count = tvb_get_ntohs(tvb, offset);
823
0
  proto_tree_add_item(seg_tree, hf_4607_dwell_count, tvb, offset, 2, ENC_BIG_ENDIAN);
824
0
  offset += 2;
825
826
0
  proto_tree_add_item(seg_tree, hf_4607_dwell_time, tvb, offset, 4, ENC_BIG_ENDIAN);
827
0
  offset += 4;
828
829
0
  proto_tree_add_item(seg_tree, hf_4607_dwell_sensor_lat, tvb, offset, 4, ENC_BIG_ENDIAN);
830
0
  offset += 4;
831
832
0
  proto_tree_add_item(seg_tree, hf_4607_dwell_sensor_lon, tvb, offset, 4, ENC_BIG_ENDIAN);
833
0
  offset += 4;
834
835
0
  proto_tree_add_item(seg_tree, hf_4607_dwell_sensor_alt, tvb, offset, 4, ENC_BIG_ENDIAN);
836
0
  offset += 4;
837
838
  /* Optional or conditional fields, in accordance to presence mask */
839
0
  if (SET(mask, D10)) {
840
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_scale_lat, tvb, offset, 4, ENC_BIG_ENDIAN);
841
0
    offset += 4;
842
0
  }
843
0
  if (SET(mask, D11)) {
844
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_scale_lon, tvb, offset, 4, ENC_BIG_ENDIAN);
845
0
    offset += 4;
846
0
  }
847
0
  if (SET(mask, D12)) {
848
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_unc_along, tvb, offset, 4, ENC_BIG_ENDIAN);
849
0
    offset += 4;
850
0
  }
851
0
  if (SET(mask, D13)) {
852
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_unc_cross, tvb, offset, 4, ENC_BIG_ENDIAN);
853
0
    offset += 4;
854
0
  }
855
0
  if (SET(mask, D14)) {
856
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_unc_alt, tvb, offset, 2, ENC_BIG_ENDIAN);
857
0
    offset += 2;
858
0
  }
859
0
  if (SET(mask, D15)) {
860
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_track, tvb, offset, 2, ENC_BIG_ENDIAN);
861
0
    offset += 2;
862
0
  }
863
0
  if (SET(mask, D16)) {
864
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_speed, tvb, offset, 4, ENC_BIG_ENDIAN);
865
0
    offset += 4;
866
0
  }
867
0
  if (SET(mask, D17)) {
868
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_vert_velocity, tvb, offset, 1, ENC_BIG_ENDIAN);
869
0
    offset += 1;
870
0
  }
871
0
  if (SET(mask, D18)) {
872
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_track_unc, tvb, offset, 1, ENC_BIG_ENDIAN);
873
0
    offset += 1;
874
0
  }
875
0
  if (SET(mask, D19)) {
876
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_speed_unc, tvb, offset, 2, ENC_BIG_ENDIAN);
877
0
    offset += 2;
878
0
  }
879
0
  if (SET(mask, D20)) {
880
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_vv_unc, tvb, offset, 2, ENC_BIG_ENDIAN);
881
0
    offset += 2;
882
0
  }
883
0
  if (SET(mask, D21)) {
884
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_plat_heading, tvb, offset, 2, ENC_BIG_ENDIAN);
885
0
    offset += 2;
886
0
  }
887
0
  if (SET(mask, D22)) {
888
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_plat_pitch, tvb, offset, 2, ENC_BIG_ENDIAN);
889
0
    offset += 2;
890
0
  }
891
0
  if (SET(mask, D23)) {
892
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_plat_roll, tvb, offset, 2, ENC_BIG_ENDIAN);
893
0
    offset += 2;
894
0
  }
895
896
  /* Dwell Area */
897
  /* Mandatory fields, existence mask irrelevant */
898
0
  proto_tree_add_item(seg_tree, hf_4607_dwell_da_lat, tvb, offset, 4, ENC_BIG_ENDIAN);
899
0
  offset += 4;
900
901
0
  proto_tree_add_item(seg_tree, hf_4607_dwell_da_lon, tvb, offset, 4, ENC_BIG_ENDIAN);
902
0
  offset += 4;
903
904
0
  proto_tree_add_item(seg_tree, hf_4607_dwell_da_range, tvb, offset, 2, ENC_BIG_ENDIAN);
905
0
  offset += 2;
906
907
0
  proto_tree_add_item(seg_tree, hf_4607_dwell_da_angle, tvb, offset, 2, ENC_BIG_ENDIAN);
908
0
  offset += 2;
909
910
  /* Optional or conditional fields, in accordance to presence mask */
911
0
  if (SET(mask, D28)) {
912
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_sensor_heading, tvb, offset, 2, ENC_BIG_ENDIAN);
913
0
    offset += 2;
914
0
  }
915
0
  if (SET(mask, D29)) {
916
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_sensor_pitch, tvb, offset, 2, ENC_BIG_ENDIAN);
917
0
    offset += 2;
918
0
  }
919
0
  if (SET(mask, D30)) {
920
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_sensor_roll, tvb, offset, 2, ENC_BIG_ENDIAN);
921
0
    offset += 2;
922
0
  }
923
0
  if (SET(mask, D31)) {
924
0
    proto_tree_add_item(seg_tree, hf_4607_dwell_mdv, tvb, offset, 1, ENC_BIG_ENDIAN);
925
0
    offset += 1;
926
0
  }
927
928
0
  while (count--) {
929
0
    offset = dissect_target(tvb, seg_tree, offset, mask);
930
0
  }
931
932
0
  return offset;
933
0
}
934
935
/* Job Definition */
936
static int
937
dissect_jobdef(tvbuff_t *tvb, proto_tree *seg_tree, int offset)
938
0
{
939
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_job_id, tvb, offset, 4, ENC_BIG_ENDIAN);
940
0
  offset += 4;
941
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_sensor_type, tvb, offset, 1, ENC_BIG_ENDIAN);
942
0
  offset += 1;
943
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_sensor_model, tvb, offset, 6, ENC_ASCII);
944
0
  offset += 6;
945
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_filter, tvb, offset, 1, ENC_BIG_ENDIAN);
946
0
  offset += 1;
947
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_priority, tvb, offset, 1, ENC_BIG_ENDIAN);
948
0
  offset += 1;
949
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_ba_lat_a, tvb, offset, 4, ENC_BIG_ENDIAN);
950
0
  offset += 4;
951
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_ba_lon_a, tvb, offset, 4, ENC_BIG_ENDIAN);
952
0
  offset += 4;
953
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_ba_lat_b, tvb, offset, 4, ENC_BIG_ENDIAN);
954
0
  offset += 4;
955
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_ba_lon_b, tvb, offset, 4, ENC_BIG_ENDIAN);
956
0
  offset += 4;
957
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_ba_lat_c, tvb, offset, 4, ENC_BIG_ENDIAN);
958
0
  offset += 4;
959
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_ba_lon_c, tvb, offset, 4, ENC_BIG_ENDIAN);
960
0
  offset += 4;
961
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_ba_lat_d, tvb, offset, 4, ENC_BIG_ENDIAN);
962
0
  offset += 4;
963
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_ba_lon_d, tvb, offset, 4, ENC_BIG_ENDIAN);
964
0
  offset += 4;
965
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_radar_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
966
0
  offset += 1;
967
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_revisit_interval, tvb, offset, 2, ENC_BIG_ENDIAN);
968
0
  offset += 2;
969
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_unc_along, tvb, offset, 2, ENC_BIG_ENDIAN);
970
0
  offset += 2;
971
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_unc_cross, tvb, offset, 2, ENC_BIG_ENDIAN);
972
0
  offset += 2;
973
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_unc_alt, tvb, offset, 2, ENC_BIG_ENDIAN);
974
0
  offset += 2;
975
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_unc_heading, tvb, offset, 1, ENC_BIG_ENDIAN);
976
0
  offset += 1;
977
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_unc_speed, tvb, offset, 2, ENC_BIG_ENDIAN);
978
0
  offset += 2;
979
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_sense_slant, tvb, offset, 2, ENC_BIG_ENDIAN);
980
0
  offset += 2;
981
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_sense_cross, tvb, offset, 2, ENC_BIG_ENDIAN);
982
0
  offset += 2;
983
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_sense_vlos, tvb, offset, 2, ENC_BIG_ENDIAN);
984
0
  offset += 2;
985
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_sense_mdv, tvb, offset, 1, ENC_BIG_ENDIAN);
986
0
  offset += 1;
987
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_sense_prob, tvb, offset, 1, ENC_BIG_ENDIAN);
988
0
  offset += 1;
989
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_sense_alarm, tvb, offset, 1, ENC_BIG_ENDIAN);
990
0
  offset += 1;
991
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_terrain_model, tvb, offset, 1, ENC_BIG_ENDIAN);
992
0
  offset += 1;
993
0
  proto_tree_add_item(seg_tree, hf_4607_jobdef_geoid_model, tvb, offset, 1, ENC_BIG_ENDIAN);
994
0
  offset += 1;
995
996
0
  return offset;
997
0
}
998
999
static int
1000
dissect_platform_location(tvbuff_t *tvb, proto_tree *seg_tree, int offset)
1001
0
{
1002
0
  proto_tree_add_item(seg_tree, hf_4607_platloc_time, tvb, offset, 4, ENC_BIG_ENDIAN);
1003
0
  offset += 4;
1004
0
  proto_tree_add_item(seg_tree, hf_4607_platloc_latitude, tvb, offset, 4, ENC_BIG_ENDIAN);
1005
0
  offset += 4;
1006
0
  proto_tree_add_item(seg_tree, hf_4607_platloc_longitude, tvb, offset, 4, ENC_BIG_ENDIAN);
1007
0
  offset += 4;
1008
0
  proto_tree_add_item(seg_tree, hf_4607_platloc_altitude, tvb, offset, 4, ENC_BIG_ENDIAN);
1009
0
  offset += 4;
1010
0
  proto_tree_add_item(seg_tree, hf_4607_platloc_track, tvb, offset, 2, ENC_BIG_ENDIAN);
1011
0
  offset += 2;
1012
0
  proto_tree_add_item(seg_tree, hf_4607_platloc_speed, tvb, offset, 4, ENC_BIG_ENDIAN);
1013
0
  offset += 4;
1014
0
  proto_tree_add_item(seg_tree, hf_4607_platloc_vertical_velocity, tvb, offset, 1, ENC_BIG_ENDIAN);
1015
0
  offset += 1;
1016
0
  return offset;
1017
0
}
1018
1019
/* 32 == packet header, 5 == segment type and length */
1020
0
#define STANAG4607_MIN_LENGTH (32+5)
1021
1022
0
#define MINIMUM_SEGMENT_SIZE 14
1023
0
#define MISSION_SEGMENT_SIZE 44
1024
0
#define JOB_DEFINITION_SEGMENT_SIZE 73
1025
0
#define PLATFORM_LOCATION_SEGMENT_SIZE 28
1026
1027
/* Provide a basic sanity check on segment sizes; the fixed-length
1028
 * ones should be what they claim to be.
1029
 */
1030
#define CHK_SIZE(SEG_TYPE) \
1031
0
  if (SEG_TYPE##_SIZE != seg_size) { \
1032
0
    col_append_str(pinfo->cinfo, COL_INFO, ", Error: Invalid segment size "); \
1033
0
    expert_add_info(pinfo, pi, &ei_bad_length); \
1034
0
  }
1035
1036
static int
1037
dissect_stanag4607(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1038
0
{
1039
0
  uint32_t offset = 0;
1040
0
  int8_t first_segment;
1041
1042
0
  uint32_t pkt_size = 0, job_id;
1043
0
  proto_item *ti, *seg_type, *pver, *pedition;
1044
0
  proto_tree *hdr_tree, *seg_tree, *ver_tree;
1045
0
  uint8_t seg_id = 0;
1046
1047
  /* Basic length check */
1048
0
  if (tvb_captured_length(tvb) < STANAG4607_MIN_LENGTH)
1049
0
    return 0;
1050
1051
0
  col_set_str(pinfo->cinfo, COL_PROTOCOL, "S4607");
1052
  /* Clear out stuff in the info column */
1053
0
  col_clear(pinfo->cinfo, COL_INFO);
1054
1055
  /* Put type of first segment in the info column */
1056
0
  first_segment = tvb_get_uint8(tvb, 32);
1057
0
  col_add_str(pinfo->cinfo, COL_INFO,
1058
0
      val_to_str(pinfo->pool, first_segment, stanag4607_segment_vals, "Unknown (0x%02x)"));
1059
1060
  /* Put the timestamp, if available in the time column */
1061
0
  if (PLATFORM_LOCATION_SEGMENT == first_segment) {
1062
0
    uint32_t millisecs;
1063
0
    nstime_t ts;
1064
0
    millisecs = tvb_get_ntohl(tvb, 37);
1065
0
    ts.secs = millisecs / 1000;
1066
0
    ts.nsecs = (int)((millisecs - 1000 * ts.secs) * 1000000);
1067
0
    col_set_time(pinfo->cinfo, COL_REL_TIME, &ts, "s4607.ploc.time");
1068
0
  }
1069
1070
  /* The generic packet header */
1071
0
  ti = proto_tree_add_item(tree, proto_stanag4607, tvb, 0, -1, ENC_NA);
1072
0
  hdr_tree = proto_item_add_subtree(ti, ett_4607_hdr);
1073
1074
  /* Version is in format mn (ASCII) where m reflects edition and n version
1075
1076
     m="4" equates to A, m="5" equates to B, and so on
1077
     n is the direct alphanumeric representation
1078
1079
     Note: STANAG 4607 has numbers up to 3 (Edition 3 Rev. 0 => "30").
1080
     This changed with the transition to AEDP-4607.
1081
  */
1082
0
  pver = proto_tree_add_item(hdr_tree, hf_4607_version, tvb, 0, 2, ENC_ASCII);
1083
0
  ver_tree = proto_item_add_subtree(pver, ett_4607_ver);
1084
0
  pedition = proto_tree_add_item(ver_tree, hf_4607_version_edition, tvb, 0, 1, ENC_ASCII);
1085
0
  uint8_t edition = tvb_get_uint8(tvb, 0);
1086
0
  if(edition >= 48 && edition <= 51) {
1087
    /* ASCII char 48-51 (0-3) */
1088
0
    proto_item_append_text(pedition, " (STANAG 4607 Edition %c)", edition);
1089
0
  } else if(edition >= 52 && edition <= 57) {
1090
    /* ASCII char 52-57 (0-9) -> ASCII table offset 13 -> 52 (4) + 13 = 65 (A) */
1091
0
    proto_item_append_text(pedition, " (AEDP-4607 Edition %c)", edition + 13);
1092
0
  }
1093
0
  proto_tree_add_item(ver_tree, hf_4607_version_version, tvb, 1, 1, ENC_ASCII);
1094
1095
0
  ti = proto_tree_add_item(hdr_tree, hf_4607_packet_size, tvb, 2, 4, ENC_BIG_ENDIAN);
1096
0
  proto_tree_add_item(hdr_tree, hf_4607_nationality, tvb, 6, 2, ENC_ASCII);
1097
0
  proto_tree_add_item(hdr_tree, hf_4607_sec_class, tvb, 8, 1, ENC_BIG_ENDIAN);
1098
0
  proto_tree_add_item(hdr_tree, hf_4607_sec_system, tvb, 9, 2, ENC_ASCII);
1099
0
  proto_tree_add_item(hdr_tree, hf_4607_sec_code, tvb, 11, 2, ENC_BIG_ENDIAN);
1100
0
  proto_tree_add_item(hdr_tree, hf_4607_exercise_indicator, tvb, 13, 1, ENC_BIG_ENDIAN);
1101
0
  proto_tree_add_item(hdr_tree, hf_4607_platform_id, tvb, 14, 10, ENC_ASCII);
1102
0
  proto_tree_add_item(hdr_tree, hf_4607_mission_id, tvb, 24, 4, ENC_BIG_ENDIAN);
1103
0
  proto_tree_add_item(hdr_tree, hf_4607_job_id, tvb, 28, 4, ENC_BIG_ENDIAN);
1104
0
  job_id = tvb_get_uint32(tvb, 28, ENC_BIG_ENDIAN);
1105
0
  offset = 32;
1106
1107
0
  pkt_size = tvb_get_ntohl(tvb, 2);
1108
1109
  /* Ruh ro. These should be equal... */
1110
0
  if (tvb_reported_length(tvb) != pkt_size) {
1111
0
    expert_add_info(pinfo, ti, &ei_bad_packet_size);
1112
0
    pkt_size = tvb_reported_length(tvb);
1113
0
  }
1114
1115
  /* Loop over all segments in the packet */
1116
0
  while (offset < pkt_size) {
1117
0
    uint32_t seg_size = 0;
1118
0
    uint32_t saved_offset = offset;
1119
1120
0
    proto_item * pi;
1121
    /* Segment header */
1122
0
    seg_type = proto_tree_add_item(hdr_tree, hf_4607_segment_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1123
0
    seg_id = tvb_get_uint8(tvb, offset);
1124
0
    offset += 1;
1125
1126
0
    seg_tree = proto_item_add_subtree(seg_type, ett_4607_seg);
1127
0
    pi = proto_tree_add_item(seg_tree, hf_4607_segment_size, tvb, offset, 4, ENC_BIG_ENDIAN);
1128
0
    seg_size = tvb_get_ntohl(tvb, offset);
1129
0
    offset += 4;
1130
0
    if (seg_size < MINIMUM_SEGMENT_SIZE) {
1131
0
      seg_size = MINIMUM_SEGMENT_SIZE;
1132
0
      col_append_str(pinfo->cinfo, COL_INFO, ", Error: Invalid segment size ");
1133
0
      expert_add_info(pinfo, pi, &ei_too_short);
1134
0
    }
1135
1136
0
    switch (seg_id) {
1137
0
      case MISSION_SEGMENT:
1138
0
        CHK_SIZE(MISSION_SEGMENT);
1139
0
        offset = dissect_mission(tvb, seg_tree, offset);
1140
0
        break;
1141
0
      case DWELL_SEGMENT:
1142
0
        if(job_id == 0)
1143
0
          proto_tree_add_expert(seg_tree, pinfo, &ei_job_id_zero, tvb, 0, 0);
1144
0
        offset = dissect_dwell(tvb, seg_tree, offset);
1145
0
        break;
1146
0
      case JOB_DEFINITION_SEGMENT:
1147
0
        CHK_SIZE(JOB_DEFINITION_SEGMENT);
1148
0
        offset = dissect_jobdef(tvb, seg_tree, offset);
1149
0
        break;
1150
0
      case PLATFORM_LOCATION_SEGMENT:
1151
0
        CHK_SIZE(PLATFORM_LOCATION_SEGMENT);
1152
0
        offset = dissect_platform_location(tvb, seg_tree, offset);
1153
0
        break;
1154
0
      default:
1155
0
        offset += seg_size - 5;
1156
0
        break;
1157
0
    }
1158
1159
0
    if (offset < saved_offset) {
1160
      /* overflow */
1161
0
      break;
1162
0
    }
1163
0
  }
1164
0
  return tvb_captured_length(tvb);
1165
0
}
1166
1167
void
1168
proto_register_stanag4607(void)
1169
16
{
1170
16
  static hf_register_info hf[] = {
1171
    /* ========================================== */
1172
    /* Packet header */
1173
16
    { &hf_4607_version,
1174
16
      { "Version ID", "s4607.version",
1175
16
      FT_STRING, BASE_NONE,
1176
16
      NULL, 0x0,
1177
16
      NULL, HFILL }
1178
16
    },
1179
16
    { &hf_4607_version_edition,
1180
16
      { "Edition", "s4607.version.edition",
1181
16
      FT_STRING, BASE_NONE,
1182
16
      NULL, 0x0,
1183
16
      NULL, HFILL }
1184
16
    },
1185
16
    { &hf_4607_version_version,
1186
16
      { "Version", "s4607.version.version",
1187
16
      FT_STRING, BASE_NONE,
1188
16
      NULL, 0x0,
1189
16
      NULL, HFILL }
1190
16
    },
1191
16
    { &hf_4607_packet_size,
1192
16
      { "Packet Size", "s4607.size",
1193
16
      FT_UINT32, BASE_DEC,
1194
16
      NULL, 0x0,
1195
16
      NULL, HFILL }
1196
16
    },
1197
16
    { &hf_4607_nationality,
1198
16
      { "Nationality", "s4607.nationality",
1199
16
      FT_STRING, BASE_NONE,
1200
16
      NULL, 0x0,
1201
16
      NULL, HFILL }
1202
16
    },
1203
16
    { &hf_4607_sec_class,
1204
16
      { "Security Classification", "s4607.sec.class",
1205
16
      FT_UINT8, BASE_DEC,
1206
16
      VALS(stanag4607_class_vals), 0x0,
1207
16
      NULL, HFILL }
1208
16
    },
1209
16
    { &hf_4607_sec_system,
1210
16
      { "Security System", "s4607.sec.system",
1211
16
      FT_STRING, BASE_NONE,
1212
16
      NULL, 0x0,
1213
16
      NULL, HFILL }
1214
16
    },
1215
16
    { &hf_4607_sec_code,
1216
16
      { "Security Codes", "s4607.sec.codes",
1217
16
      FT_UINT16, BASE_HEX,
1218
16
      VALS(stanag4607_security_codes_vals), 0x0,
1219
16
      NULL, HFILL }
1220
16
    },
1221
16
    { &hf_4607_exercise_indicator,
1222
16
      { "Exercise Indicator", "s4607.exind",
1223
16
      FT_UINT8, BASE_DEC,
1224
16
      VALS(stanag4607_exind_vals), 0x0,
1225
16
      NULL, HFILL }
1226
16
    },
1227
16
    { &hf_4607_platform_id,
1228
16
      { "Platform ID", "s4607.platform",
1229
16
      FT_STRING, BASE_NONE,
1230
16
      NULL, 0x0,
1231
16
      NULL, HFILL }
1232
16
    },
1233
16
    { &hf_4607_mission_id,
1234
16
      { "Mission ID", "s4607.mission",
1235
16
      FT_UINT32, BASE_DEC,
1236
16
      NULL, 0x0,
1237
16
      NULL, HFILL }
1238
16
    },
1239
16
    { &hf_4607_job_id,
1240
16
      { "Job ID", "s4607.job",
1241
16
      FT_UINT32, BASE_DEC,
1242
16
      NULL, 0x0,
1243
16
      NULL, HFILL }
1244
16
    },
1245
1246
    /* ========================================== */
1247
    /* Segment header */
1248
16
    { &hf_4607_segment_type,
1249
16
      { "Segment Type", "s4607.seg.type",
1250
16
      FT_UINT8, BASE_DEC,
1251
16
      VALS(stanag4607_segment_vals), 0x0,
1252
16
      NULL, HFILL }
1253
16
    },
1254
16
    { &hf_4607_segment_size,
1255
16
      { "Segment Size", "s4607.seg.size",
1256
16
      FT_UINT32, BASE_DEC,
1257
16
      NULL, 0x0,
1258
16
      NULL, HFILL }
1259
16
    },
1260
1261
    /* ========================================== */
1262
    /* Dwell Segment */
1263
16
    { &hf_4607_dwell_mask,
1264
16
      { "Existence Mask", "s4607.dwell.mask",
1265
16
      FT_UINT64, BASE_HEX,
1266
16
      NULL, 0x0,
1267
16
      NULL, HFILL }
1268
16
    },
1269
16
    { &hf_4607_dwell_mask_7_7,
1270
16
      { "Revisit Index (D2)", "s4607.dwell.mask.d2",
1271
16
      FT_BOOLEAN, 64,
1272
16
      NULL, 0x8000000000000000,
1273
16
      NULL, HFILL }
1274
16
    },
1275
16
    { &hf_4607_dwell_mask_7_6,
1276
16
      { "Dwell Index (D3)", "s4607.dwell.mask.d3",
1277
16
      FT_BOOLEAN, 64,
1278
16
      NULL, 0x4000000000000000,
1279
16
      NULL, HFILL }
1280
16
    },
1281
16
    { &hf_4607_dwell_mask_7_5,
1282
16
      { "Last Dwell of Revisit (D4)", "s4607.dwell.mask.d4",
1283
16
      FT_BOOLEAN, 64,
1284
16
      NULL, 0x2000000000000000,
1285
16
      NULL, HFILL }
1286
16
    },
1287
16
    { &hf_4607_dwell_mask_7_4,
1288
16
      { "Target Report Count (D5)", "s4607.dwell.mask.d5",
1289
16
      FT_BOOLEAN, 64,
1290
16
      NULL, 0x1000000000000000,
1291
16
      NULL, HFILL }
1292
16
    },
1293
16
    { &hf_4607_dwell_mask_7_3,
1294
16
      { "Dwell Time (D6)", "s4607.dwell.mask.d6",
1295
16
      FT_BOOLEAN, 64,
1296
16
      NULL, 0x0800000000000000,
1297
16
      NULL, HFILL }
1298
16
    },
1299
16
    { &hf_4607_dwell_mask_7_2,
1300
16
      { "Sensor Position (Latitude) (D7)", "s4607.dwell.mask.d7",
1301
16
      FT_BOOLEAN, 64,
1302
16
      NULL, 0x0400000000000000,
1303
16
      NULL, HFILL }
1304
16
    },
1305
16
    { &hf_4607_dwell_mask_7_1,
1306
16
      { "Sensor Position (Longitude) (D8)", "s4607.dwell.mask.d8",
1307
16
      FT_BOOLEAN, 64,
1308
16
      NULL, 0x0200000000000000,
1309
16
      NULL, HFILL }
1310
16
    },
1311
16
    { &hf_4607_dwell_mask_7_0,
1312
16
      { "Sensor Position (Altitude) (D9)", "s4607.dwell.mask.d9",
1313
16
      FT_BOOLEAN, 64,
1314
16
      NULL, 0x0100000000000000,
1315
16
      NULL, HFILL }
1316
16
    },
1317
16
    { &hf_4607_dwell_mask_6_7,
1318
16
      { "Scale Factor (Latitude Scale) (D10)", "s4607.dwell.mask.d10",
1319
16
      FT_BOOLEAN, 64,
1320
16
      NULL, 0x0080000000000000,
1321
16
      NULL, HFILL }
1322
16
    },
1323
16
    { &hf_4607_dwell_mask_6_6,
1324
16
      { "Scale Factor (Longitude Scale) (D11)", "s4607.dwell.mask.d11",
1325
16
      FT_BOOLEAN, 64,
1326
16
      NULL, 0x0040000000000000,
1327
16
      NULL, HFILL }
1328
16
    },
1329
16
    { &hf_4607_dwell_mask_6_5,
1330
16
      { "Sensor Position Uncertainty (Along Track) (D12)", "s4607.dwell.mask.d12",
1331
16
      FT_BOOLEAN, 64,
1332
16
      NULL, 0x0020000000000000,
1333
16
      NULL, HFILL }
1334
16
    },
1335
16
    { &hf_4607_dwell_mask_6_4,
1336
16
      { "Sensor Position Uncertainty (Cross-Track) (D13)", "s4607.dwell.mask.d13",
1337
16
      FT_BOOLEAN, 64,
1338
16
      NULL, 0x0010000000000000,
1339
16
      NULL, HFILL }
1340
16
    },
1341
16
    { &hf_4607_dwell_mask_6_3,
1342
16
      { "Sensor Position Uncertainty (Altitude) (D14)", "s4607.dwell.mask.d14",
1343
16
      FT_BOOLEAN, 64,
1344
16
      NULL, 0x0008000000000000,
1345
16
      NULL, HFILL }
1346
16
    },
1347
16
    { &hf_4607_dwell_mask_6_2,
1348
16
      { "Sensor Track (D15)", "s4607.dwell.mask.d15",
1349
16
      FT_BOOLEAN, 64,
1350
16
      NULL, 0x0004000000000000,
1351
16
      NULL, HFILL }
1352
16
    },
1353
16
    { &hf_4607_dwell_mask_6_1,
1354
16
      { "Sensor Speed (D16)", "s4607.dwell.mask.d16",
1355
16
      FT_BOOLEAN, 64,
1356
16
      NULL, 0x0002000000000000,
1357
16
      NULL, HFILL }
1358
16
    },
1359
16
    { &hf_4607_dwell_mask_6_0,
1360
16
      { "Sensor Vertical Velocity (D17)", "s4607.dwell.mask.d17",
1361
16
      FT_BOOLEAN, 64,
1362
16
      NULL, 0x0001000000000000,
1363
16
      NULL, HFILL }
1364
16
    },
1365
16
    { &hf_4607_dwell_mask_5_7,
1366
16
      { "Sensor Track Uncertainty (D18)", "s4607.dwell.mask.d18",
1367
16
      FT_BOOLEAN, 64,
1368
16
      NULL, 0x0000800000000000,
1369
16
      NULL, HFILL }
1370
16
    },
1371
16
    { &hf_4607_dwell_mask_5_6,
1372
16
      { "Sensor Speed Uncertainty (D19)", "s4607.dwell.mask.d19",
1373
16
      FT_BOOLEAN, 64,
1374
16
      NULL, 0x0000400000000000,
1375
16
      NULL, HFILL }
1376
16
    },
1377
16
    { &hf_4607_dwell_mask_5_5,
1378
16
      { "Sensor Vertical Velocity Uncertainty (D20)", "s4607.dwell.mask.d20",
1379
16
      FT_BOOLEAN, 64,
1380
16
      NULL, 0x0000200000000000,
1381
16
      NULL, HFILL }
1382
16
    },
1383
16
    { &hf_4607_dwell_mask_5_4,
1384
16
      { "Platform Orientation (Heading) (D21)", "s4607.dwell.mask.d21",
1385
16
      FT_BOOLEAN, 64,
1386
16
      NULL, 0x0000100000000000,
1387
16
      NULL, HFILL }
1388
16
    },
1389
16
    { &hf_4607_dwell_mask_5_3,
1390
16
      { "Platform Orientation (Pitch) (D22)", "s4607.dwell.mask.d22",
1391
16
      FT_BOOLEAN, 64,
1392
16
      NULL, 0x0000080000000000,
1393
16
      NULL, HFILL }
1394
16
    },
1395
16
    { &hf_4607_dwell_mask_5_2,
1396
16
      { "Platform Orientation (Roll) (D23)", "s4607.dwell.mask.d23",
1397
16
      FT_BOOLEAN, 64,
1398
16
      NULL, 0x0000040000000000,
1399
16
      NULL, HFILL }
1400
16
    },
1401
16
    { &hf_4607_dwell_mask_5_1,
1402
16
      { "Dwell Area (Center Latitude) (D24)", "s4607.dwell.mask.d24",
1403
16
      FT_BOOLEAN, 64,
1404
16
      NULL, 0x0000020000000000,
1405
16
      NULL, HFILL }
1406
16
    },
1407
16
    { &hf_4607_dwell_mask_5_0,
1408
16
      { "Dwell Area (Center Longitude) (D25)", "s4607.dwell.mask.d25",
1409
16
      FT_BOOLEAN, 64,
1410
16
      NULL, 0x0000010000000000,
1411
16
      NULL, HFILL }
1412
16
    },
1413
16
    { &hf_4607_dwell_mask_4_7,
1414
16
      { "Dwell Area (Range Half Extent) (D26)", "s4607.dwell.mask.d26",
1415
16
      FT_BOOLEAN, 64,
1416
16
      NULL, 0x0000008000000000,
1417
16
      NULL, HFILL }
1418
16
    },
1419
16
    { &hf_4607_dwell_mask_4_6,
1420
16
      { "Dwell Area (Dwell Angle Half Extent) (D27)", "s4607.dwell.mask.d27",
1421
16
      FT_BOOLEAN, 64,
1422
16
      NULL, 0x0000004000000000,
1423
16
      NULL, HFILL }
1424
16
    },
1425
16
    { &hf_4607_dwell_mask_4_5,
1426
16
      { "Sensor Orientation (Heading) (D28)", "s4607.dwell.mask.d28",
1427
16
      FT_BOOLEAN, 64,
1428
16
      NULL, 0x0000002000000000,
1429
16
      NULL, HFILL }
1430
16
    },
1431
16
    { &hf_4607_dwell_mask_4_4,
1432
16
      { "Sensor Orientation (Pitch) (D29)", "s4607.dwell.mask.d29",
1433
16
      FT_BOOLEAN, 64,
1434
16
      NULL, 0x0000001000000000,
1435
16
      NULL, HFILL }
1436
16
    },
1437
16
    { &hf_4607_dwell_mask_4_3,
1438
16
      { "Sensor Orientation (Roll) (D30)", "s4607.dwell.mask.d30",
1439
16
      FT_BOOLEAN, 64,
1440
16
      NULL, 0x0000000800000000,
1441
16
      NULL, HFILL }
1442
16
    },
1443
16
    { &hf_4607_dwell_mask_4_2,
1444
16
      { "Minimum Detectable Velocity, MDV (D31)", "s4607.dwell.mask.d31",
1445
16
      FT_BOOLEAN, 64,
1446
16
      NULL, 0x0000000400000000,
1447
16
      NULL, HFILL }
1448
16
    },
1449
16
    { &hf_4607_dwell_mask_4_1,
1450
16
      { "MTI Report Index (D32.1)", "s4607.dwell.mask.d32_1",
1451
16
      FT_BOOLEAN, 64,
1452
16
      NULL, 0x0000000200000000,
1453
16
      NULL, HFILL }
1454
16
    },
1455
16
    { &hf_4607_dwell_mask_4_0,
1456
16
      { "Target Location (Hi-Res Latitude) (D32.2)", "s4607.dwell.mask.d32_2",
1457
16
      FT_BOOLEAN, 64,
1458
16
      NULL, 0x0000000100000000,
1459
16
      NULL, HFILL }
1460
16
    },
1461
16
    { &hf_4607_dwell_mask_3_7,
1462
16
      { "Target Location (Hi-Res Longitude) (D32.3)", "s4607.dwell.mask.d32_3",
1463
16
      FT_BOOLEAN, 64,
1464
16
      NULL, 0x0000000080000000,
1465
16
      NULL, HFILL }
1466
16
    },
1467
16
    { &hf_4607_dwell_mask_3_6,
1468
16
      { "Target Location (Delta Latitude) (D32.4)", "s4607.dwell.mask.d32_4",
1469
16
      FT_BOOLEAN, 64,
1470
16
      NULL, 0x0000000040000000,
1471
16
      NULL, HFILL }
1472
16
    },
1473
16
    { &hf_4607_dwell_mask_3_5,
1474
16
      { "Target Location (Delta Longitude) (D32.5)", "s4607.dwell.mask.d32_5",
1475
16
      FT_BOOLEAN, 64,
1476
16
      NULL, 0x0000000020000000,
1477
16
      NULL, HFILL }
1478
16
    },
1479
16
    { &hf_4607_dwell_mask_3_4,
1480
16
      { "Target Location (Geodetic Height) (D32.6)", "s4607.dwell.mask.d32_6",
1481
16
      FT_BOOLEAN, 64,
1482
16
      NULL, 0x0000000010000000,
1483
16
      NULL, HFILL }
1484
16
    },
1485
16
    { &hf_4607_dwell_mask_3_3,
1486
16
      { "Target Velocity Line-of-Sight Component (D32.7)", "s4607.dwell.mask.d32_7",
1487
16
      FT_BOOLEAN, 64,
1488
16
      NULL, 0x0000000008000000,
1489
16
      NULL, HFILL }
1490
16
    },
1491
16
    { &hf_4607_dwell_mask_3_2,
1492
16
      { "Target Wrap Velocity (D32.8)", "s4607.dwell.mask.d32_8",
1493
16
      FT_BOOLEAN, 64,
1494
16
      NULL, 0x0000000004000000,
1495
16
      NULL, HFILL }
1496
16
    },
1497
16
    { &hf_4607_dwell_mask_3_1,
1498
16
      { "Target SNR (D32.9)", "s4607.dwell.mask.d32_9",
1499
16
      FT_BOOLEAN, 64,
1500
16
      NULL, 0x0000000002000000,
1501
16
      NULL, HFILL }
1502
16
    },
1503
16
    { &hf_4607_dwell_mask_3_0,
1504
16
      { "Target Classification (D32.10)", "s4607.dwell.mask.d32_10",
1505
16
      FT_BOOLEAN, 64,
1506
16
      NULL, 0x0000000001000000,
1507
16
      NULL, HFILL }
1508
16
    },
1509
16
    { &hf_4607_dwell_mask_2_7,
1510
16
      { "Target Class. Probability (D32.11)", "s4607.dwell.mask.d32_11",
1511
16
      FT_BOOLEAN, 64,
1512
16
      NULL, 0x0000000000800000,
1513
16
      NULL, HFILL }
1514
16
    },
1515
16
    { &hf_4607_dwell_mask_2_6,
1516
16
      { "Target Measurement Uncertainty (Slant Range) (D32.12)", "s4607.dwell.mask.d32_12",
1517
16
      FT_BOOLEAN, 64,
1518
16
      NULL, 0x0000000000400000,
1519
16
      NULL, HFILL }
1520
16
    },
1521
16
    { &hf_4607_dwell_mask_2_5,
1522
16
      { "Target Measurement Uncertainty (Cross Range) (D32.13)", "s4607.dwell.mask.d32_13",
1523
16
      FT_BOOLEAN, 64,
1524
16
      NULL, 0x0000000000200000,
1525
16
      NULL, HFILL }
1526
16
    },
1527
16
    { &hf_4607_dwell_mask_2_4,
1528
16
      { "Target Measurement Uncertainty (Height) (D32.14)", "s4607.dwell.mask.d32_14",
1529
16
      FT_BOOLEAN, 64,
1530
16
      NULL, 0x0000000000100000,
1531
16
      NULL, HFILL }
1532
16
    },
1533
16
    { &hf_4607_dwell_mask_2_3,
1534
16
      { "Target Measurement Uncertainty (Target Radial Velocity) (D32.15)", "s4607.dwell.mask.d32_15",
1535
16
      FT_BOOLEAN, 64,
1536
16
      NULL, 0x0000000000080000,
1537
16
      NULL, HFILL }
1538
16
    },
1539
16
    { &hf_4607_dwell_mask_2_2,
1540
16
      { "Truth Tag (Application) (D32.16)", "s4607.dwell.mask.d32_16",
1541
16
      FT_BOOLEAN, 64,
1542
16
      NULL, 0x0000000000040000,
1543
16
      NULL, HFILL }
1544
16
    },
1545
16
    { &hf_4607_dwell_mask_2_1,
1546
16
      { "Truth Tag (Entity) (D32.17)", "s4607.dwell.mask.d32_17",
1547
16
      FT_BOOLEAN, 64,
1548
16
      NULL, 0x0000000000020000,
1549
16
      NULL, HFILL }
1550
16
    },
1551
16
    { &hf_4607_dwell_mask_2_0,
1552
16
      { "Target Radar Cross Section (D32.18)", "s4607.dwell.mask.d32_18",
1553
16
      FT_BOOLEAN, 64,
1554
16
      NULL, 0x0000000000010000,
1555
16
      NULL, HFILL }
1556
16
    },
1557
16
    { &hf_4607_dwell_mask_spare,
1558
16
      { "Spare", "s4607.dwell.mask.spare",
1559
16
      FT_UINT64, BASE_HEX,
1560
16
      NULL, 0x000000000000FFFF,
1561
16
      NULL, HFILL }
1562
16
    },
1563
16
    { &hf_4607_dwell_revisit_index,
1564
16
      { "Revisit Index", "s4607.dwell.revisit",
1565
16
      FT_UINT16, BASE_DEC,
1566
16
      NULL, 0x0,
1567
16
      NULL, HFILL }
1568
16
    },
1569
16
    { &hf_4607_dwell_dwell_index,
1570
16
      { "Dwell Index", "s4607.dwell.dwell",
1571
16
      FT_UINT16, BASE_DEC,
1572
16
      NULL, 0x0,
1573
16
      NULL, HFILL }
1574
16
    },
1575
16
    { &hf_4607_dwell_last_dwell,
1576
16
      { "Last Dwell of Revisit", "s4607.dwell.last",
1577
16
      FT_UINT8, BASE_DEC,
1578
16
      NULL, 0x0,
1579
16
      NULL, HFILL }
1580
16
    },
1581
16
    { &hf_4607_dwell_count,
1582
16
      { "Target Report Count", "s4607.dwell.count",
1583
16
      FT_UINT16, BASE_DEC,
1584
16
      NULL, 0x0,
1585
16
      NULL, HFILL }
1586
16
    },
1587
16
    { &hf_4607_dwell_time,
1588
16
      { "Dwell Time", "s4607.dwell.time",
1589
16
      FT_UINT32, BASE_CUSTOM,
1590
16
      CF_FUNC(prt_millisec), 0x0,
1591
16
      NULL, HFILL }
1592
16
    },
1593
16
    { &hf_4607_dwell_sensor_lat,
1594
16
      { "Sensor Position Latitude", "s4607.dwell.sensor.lat",
1595
16
      FT_INT32, BASE_CUSTOM,
1596
16
      CF_FUNC(prt_sa32), 0x0,
1597
16
      NULL, HFILL }
1598
16
    },
1599
16
    { &hf_4607_dwell_sensor_lon,
1600
16
      { "Sensor Position Longitude", "s4607.dwell.sensor.lon",
1601
16
      FT_UINT32, BASE_CUSTOM,
1602
16
      CF_FUNC(prt_ba32), 0x0,
1603
16
      NULL, HFILL }
1604
16
    },
1605
16
    { &hf_4607_dwell_sensor_alt,
1606
16
      { "Sensor Position Altitude", "s4607.dwell.sensor.alt",
1607
16
      FT_INT32, BASE_CUSTOM,
1608
16
      CF_FUNC(prt_centimeters), 0x0,
1609
16
      NULL, HFILL }
1610
16
    },
1611
    /* D10 */
1612
16
    { &hf_4607_dwell_scale_lat,
1613
16
      { "Scale Factor, Latitude", "s4607.dwell.scale.lat",
1614
16
      FT_INT32, BASE_CUSTOM,
1615
16
      CF_FUNC(prt_sa32), 0x0,
1616
16
      NULL, HFILL }
1617
16
    },
1618
16
    { &hf_4607_dwell_scale_lon,
1619
16
      { "Scale Factor, Longitude", "s4607.dwell.scale.lon",
1620
16
      FT_UINT32, BASE_CUSTOM,
1621
16
      CF_FUNC(prt_ba32), 0x0,
1622
16
      NULL, HFILL }
1623
16
    },
1624
1625
    /* D12 */
1626
16
    { &hf_4607_dwell_unc_along,
1627
16
      { "Sensor Position Uncertainty Along Track", "s4607.dwell.unc.along",
1628
16
      FT_UINT32, BASE_CUSTOM,
1629
16
      CF_FUNC(prt_centimeters), 0x0,
1630
16
      NULL, HFILL }
1631
16
    },
1632
16
    { &hf_4607_dwell_unc_cross,
1633
16
      { "Sensor Position Uncertainty Cross Track", "s4607.dwell.unc.cross",
1634
16
      FT_UINT32, BASE_CUSTOM,
1635
16
      CF_FUNC(prt_centimeters), 0x0,
1636
16
      NULL, HFILL }
1637
16
    },
1638
16
    { &hf_4607_dwell_unc_alt,
1639
16
      { "Sensor Position Uncertainty Altitude", "s4607.dwell.unc.alt",
1640
16
      FT_UINT16, BASE_CUSTOM,
1641
16
      CF_FUNC(prt_centimeters), 0x0,
1642
16
      NULL, HFILL }
1643
16
    },
1644
1645
    /* D15 */
1646
16
    { &hf_4607_dwell_track,
1647
16
      { "Sensor Track", "s4607.dwell.track",
1648
16
      FT_UINT16, BASE_CUSTOM,
1649
16
      CF_FUNC(prt_ba16), 0x0,
1650
16
      NULL, HFILL }
1651
16
    },
1652
16
    { &hf_4607_dwell_speed,
1653
16
      { "Sensor Speed", "s4607.dwell.speed",
1654
16
      FT_UINT32, BASE_CUSTOM,
1655
16
      CF_FUNC(prt_speed), 0x0,
1656
16
      NULL, HFILL }
1657
16
    },
1658
16
    { &hf_4607_dwell_vert_velocity,
1659
16
      { "Sensor Vertical Velocity", "s4607.dwell.vvel",
1660
16
      FT_INT8, BASE_CUSTOM,
1661
16
      CF_FUNC(prt_speed_deci), 0x0,
1662
16
      NULL, HFILL }
1663
16
    },
1664
16
    { &hf_4607_dwell_track_unc,
1665
16
      { "Sensor Track Uncertainty", "s4607.dwell.track.unc",
1666
16
      FT_UINT8, BASE_DEC,
1667
16
      NULL, 0x0,
1668
16
      NULL, HFILL }
1669
16
    },
1670
16
    { &hf_4607_dwell_speed_unc,
1671
16
      { "Sensor Speed Uncertainty", "s4607.dwell.speed.unc",
1672
16
      FT_UINT16, BASE_CUSTOM,
1673
16
      CF_FUNC(prt_speed), 0x0,
1674
16
      NULL, HFILL }
1675
16
    },
1676
16
    { &hf_4607_dwell_vv_unc,
1677
16
      { "Sensor Vertical Velocity Uncertainty", "s4607.dwell.vvel.unc",
1678
16
      FT_UINT16, BASE_CUSTOM,
1679
16
      CF_FUNC(prt_speed_centi), 0x0,
1680
16
      NULL, HFILL }
1681
16
    },
1682
1683
    /* D21 */
1684
16
    { &hf_4607_dwell_plat_heading,
1685
16
      { "Platform Orientation Heading", "s4607.dwell.plat.heading",
1686
16
      FT_UINT16, BASE_CUSTOM,
1687
16
      CF_FUNC(prt_ba16), 0x0,
1688
16
      NULL, HFILL }
1689
16
    },
1690
16
    { &hf_4607_dwell_plat_pitch,
1691
16
      { "Platform Orientation Pitch", "s4607.dwell.plat.pitch",
1692
16
      FT_INT16, BASE_CUSTOM,
1693
16
      CF_FUNC(prt_sa16), 0x0,
1694
16
      NULL, HFILL }
1695
16
    },
1696
16
    { &hf_4607_dwell_plat_roll,
1697
16
      { "Platform Orientation Roll (Bank Angle)", "s4607.dwell.plat.roll",
1698
16
      FT_INT16, BASE_CUSTOM,
1699
16
      CF_FUNC(prt_sa16), 0x0,
1700
16
      NULL, HFILL }
1701
16
    },
1702
1703
    /* D24 */
1704
16
    { &hf_4607_dwell_da_lat,
1705
16
      { "Dwell Area Center Latitude", "s4607.dwell.da.lat",
1706
16
      FT_INT32, BASE_CUSTOM,
1707
16
      CF_FUNC(prt_sa32), 0x0,
1708
16
      NULL, HFILL }
1709
16
    },
1710
16
    { &hf_4607_dwell_da_lon,
1711
16
      { "Dwell Area Center Longitude", "s4607.dwell.da.lon",
1712
16
      FT_UINT32, BASE_CUSTOM,
1713
16
      CF_FUNC(prt_ba32), 0x0,
1714
16
      NULL, HFILL }
1715
16
    },
1716
16
    { &hf_4607_dwell_da_range,
1717
16
      { "Dwell Area Range Half Extent", "s4607.dwell.da.range",
1718
16
      FT_UINT16, BASE_CUSTOM,
1719
16
      CF_FUNC(prt_kilo), 0x0,
1720
16
      NULL, HFILL }
1721
16
    },
1722
16
    { &hf_4607_dwell_da_angle,
1723
16
      { "Dwell Area Dwell Angle Half Extent", "s4607.dwell.da.angle",
1724
16
      FT_UINT16, BASE_CUSTOM,
1725
16
      CF_FUNC(prt_ba16), 0x0,
1726
16
      NULL, HFILL }
1727
16
    },
1728
1729
    /* D28 */
1730
16
    { &hf_4607_dwell_sensor_heading,
1731
16
      { "Sensor Orientation Heading", "s4607.dwell.sensor.heading",
1732
16
      FT_UINT16, BASE_CUSTOM,
1733
16
      CF_FUNC(prt_ba16), 0x0,
1734
16
      NULL, HFILL }
1735
16
    },
1736
16
    { &hf_4607_dwell_sensor_pitch,
1737
16
      { "Sensor Orientation Pitch", "s4607.dwell.sensor.pitch",
1738
16
      FT_INT16, BASE_CUSTOM,
1739
16
      CF_FUNC(prt_sa16), 0x0,
1740
16
      NULL, HFILL }
1741
16
    },
1742
16
    { &hf_4607_dwell_sensor_roll,
1743
16
      { "Sensor Orientation Roll (Bank Angle)", "s4607.dwell.sensor.roll",
1744
16
      FT_INT16, BASE_CUSTOM,
1745
16
      CF_FUNC(prt_sa16), 0x0,
1746
16
      NULL, HFILL }
1747
16
    },
1748
16
    { &hf_4607_dwell_mdv,
1749
16
      { "Minimum Detectable Velocity (MDV)", "s4607.dwell.mdv",
1750
16
      FT_UINT8, BASE_CUSTOM,
1751
16
      CF_FUNC(prt_speed_deci), 0x0,
1752
16
      NULL, HFILL }
1753
16
    },
1754
1755
    /* ========================================== */
1756
    /* Target Report */
1757
16
    { &hf_4607_dwell_report_index,
1758
16
      { "MTI Report Index", "s4607.dwell.rpt.idx",
1759
16
      FT_UINT16, BASE_DEC,
1760
16
      NULL, 0x0,
1761
16
      NULL, HFILL }
1762
16
    },
1763
1764
    /* D32.2 */
1765
16
    { &hf_4607_dwell_report_lat,
1766
16
      { "Target Location Hi-Res Latitude", "s4607.dwell.rpt.lat",
1767
16
      FT_INT32, BASE_CUSTOM,
1768
16
      CF_FUNC(prt_sa32), 0x0,
1769
16
      NULL, HFILL }
1770
16
    },
1771
16
    { &hf_4607_dwell_report_lon,
1772
16
      { "Target Location Hi-Res Longitude", "s4607.dwell.rpt.lon",
1773
16
      FT_UINT32, BASE_CUSTOM,
1774
16
      CF_FUNC(prt_ba32), 0x0,
1775
16
      NULL, HFILL }
1776
16
    },
1777
1778
    /* D32.4 */
1779
16
    { &hf_4607_dwell_report_delta_lat,
1780
16
      { "Target Location Delta Latitude", "s4607.dwell.rpt.delta.lat",
1781
16
      FT_INT16, BASE_DEC,
1782
16
      NULL, 0x0,
1783
16
      NULL, HFILL }
1784
16
    },
1785
16
    { &hf_4607_dwell_report_delta_lon,
1786
16
      { "Target Location Delta Longitude", "s4607.dwell.rpt.delta.lon",
1787
16
      FT_INT16, BASE_DEC,
1788
16
      NULL, 0x0,
1789
16
      NULL, HFILL }
1790
16
    },
1791
1792
    /* D32.6 */
1793
16
    { &hf_4607_dwell_report_height,
1794
16
      { "Target Location Geodetic Height", "s4607.dwell.rpt.height",
1795
16
      FT_INT16, BASE_CUSTOM,
1796
16
      CF_FUNC(prt_meters), 0x0,
1797
16
      NULL, HFILL }
1798
16
    },
1799
1800
    /* D32.7 */
1801
16
    { &hf_4607_dwell_report_radial,
1802
16
      { "Target Velocity Line of Sight Component", "s4607.dwell.rpt.radial",
1803
16
      FT_INT16, BASE_CUSTOM,
1804
16
      CF_FUNC(prt_speed_centi), 0x0,
1805
16
      NULL, HFILL }
1806
16
    },
1807
16
    { &hf_4607_dwell_report_wrap,
1808
16
      { "Target Wrap Velocity", "s4607.dwell.rpt.wrap",
1809
16
      FT_UINT16, BASE_CUSTOM,
1810
16
      CF_FUNC(prt_speed_centi), 0x0,
1811
16
      NULL, HFILL }
1812
16
    },
1813
16
    { &hf_4607_dwell_report_snr,
1814
16
      { "Target SNR", "s4607.dwell.rpt.snr",
1815
16
      FT_INT8, BASE_DEC,
1816
16
      NULL, 0x0,
1817
16
      NULL, HFILL }
1818
16
    },
1819
16
    { &hf_4607_dwell_report_class,
1820
16
      { "Target Classification", "s4607.dwell.rpt.class",
1821
16
      FT_UINT8, BASE_DEC,
1822
16
      VALS(stanag4607_target_vals), 0x0,
1823
16
      NULL, HFILL }
1824
16
    },
1825
16
    { &hf_4607_dwell_report_prob,
1826
16
      { "Target Class Probability", "s4607.dwell.rpt.prob",
1827
16
      FT_UINT8, BASE_DEC,
1828
16
      NULL, 0x0,
1829
16
      NULL, HFILL }
1830
16
    },
1831
1832
    /* D32.12 */
1833
16
    { &hf_4607_dwell_report_unc_slant,
1834
16
      { "Target Measurement Uncertainty Slant Range", "s4607.dwell.rpt.unc.slant",
1835
16
      FT_UINT16, BASE_CUSTOM,
1836
16
      CF_FUNC(prt_centimeters), 0x0,
1837
16
      NULL, HFILL }
1838
16
    },
1839
16
    { &hf_4607_dwell_report_unc_cross,
1840
16
      { "Target Measurement Uncertainty Cross Range", "s4607.dwell.rpt.unc.cross",
1841
16
      FT_UINT16, BASE_CUSTOM,
1842
16
      CF_FUNC(prt_decimeters), 0x0,
1843
16
      NULL, HFILL }
1844
16
    },
1845
16
    { &hf_4607_dwell_report_unc_height,
1846
16
      { "Target Measurement Uncertainty Height", "s4607.dwell.rpt.unc.height",
1847
16
      FT_UINT8, BASE_CUSTOM,
1848
16
      CF_FUNC(prt_meters), 0x0,
1849
16
      NULL, HFILL }
1850
16
    },
1851
16
    { &hf_4607_dwell_report_unc_radial,
1852
16
      { "Target Measurement Uncertainty Radial Velocity", "s4607.dwell.rpt.unc.radial",
1853
16
      FT_UINT16, BASE_CUSTOM,
1854
16
      CF_FUNC(prt_speed_centi), 0x0,
1855
16
      NULL, HFILL }
1856
16
    },
1857
1858
    /* D32.16 */
1859
16
    { &hf_4607_dwell_report_tag_app,
1860
16
      { "Truth Tag Application", "s4607.dwell.rpt.tag.app",
1861
16
      FT_UINT8, BASE_DEC,
1862
16
      NULL, 0x0,
1863
16
      NULL, HFILL }
1864
16
    },
1865
16
    { &hf_4607_dwell_report_tag_entity,
1866
16
      { "Truth Tag Entity", "s4607.dwell.rpt.tag.entity",
1867
16
      FT_UINT32, BASE_DEC,
1868
16
      NULL, 0x0,
1869
16
      NULL, HFILL }
1870
16
    },
1871
16
    { &hf_4607_dwell_report_section,
1872
16
      { "Radar Cross Section", "s4607.dwell.rpt.section",
1873
16
      FT_INT8, BASE_DEC,
1874
16
      NULL, 0x0,
1875
16
      NULL, HFILL }
1876
16
    },
1877
1878
1879
    /* ========================================== */
1880
    /* Job Definition Segment */
1881
16
    { &hf_4607_jobdef_job_id,
1882
16
      { "Job ID", "s4607.job.id",
1883
16
      FT_UINT32, BASE_DEC,
1884
16
      NULL, 0x0,
1885
16
      NULL, HFILL }
1886
16
    },
1887
16
    { &hf_4607_jobdef_sensor_type,
1888
16
      { "Sensor Type", "s4607.job.type",
1889
16
      FT_UINT8, BASE_DEC,
1890
16
      VALS(stanag4607_sensor_vals), 0x0,
1891
16
      NULL, HFILL }
1892
16
    },
1893
16
    { &hf_4607_jobdef_sensor_model,
1894
16
      { "Sensor Model", "s4607.job.model",
1895
16
      FT_STRING, BASE_NONE,
1896
16
      NULL, 0x0,
1897
16
      NULL, HFILL }
1898
16
    },
1899
16
    { &hf_4607_jobdef_filter,
1900
16
      { "Target Filtering Flag", "s4607.job.filter",
1901
16
      FT_UINT8, BASE_DEC,
1902
16
      NULL, 0x0,
1903
16
      NULL, HFILL }
1904
16
    },
1905
16
    { &hf_4607_jobdef_priority,
1906
16
      { "Radar Priority", "s4607.job.priority",
1907
16
      FT_UINT8, BASE_DEC,
1908
16
      NULL, 0x0,
1909
16
      NULL, HFILL }
1910
16
    },
1911
1912
16
    { &hf_4607_jobdef_ba_lat_a,
1913
16
      { "Bounding Area Point A Latitude", "s4607.job.ba.lat.a",
1914
16
      FT_INT32, BASE_CUSTOM,
1915
16
      CF_FUNC(prt_sa32), 0x0,
1916
16
      NULL, HFILL }
1917
16
    },
1918
16
    { &hf_4607_jobdef_ba_lon_a,
1919
16
      { "Bounding Area Point A Longitude", "s4607.job.ba.lon.a",
1920
16
      FT_UINT32, BASE_CUSTOM,
1921
16
      CF_FUNC(prt_ba32), 0x0,
1922
16
      NULL, HFILL }
1923
16
    },
1924
1925
16
    { &hf_4607_jobdef_ba_lat_b,
1926
16
      { "Bounding Area Point B Latitude", "s4607.job.ba.lat.b",
1927
16
      FT_INT32, BASE_CUSTOM,
1928
16
      CF_FUNC(prt_sa32), 0x0,
1929
16
      NULL, HFILL }
1930
16
    },
1931
16
    { &hf_4607_jobdef_ba_lon_b,
1932
16
      { "Bounding Area Point B Longitude", "s4607.job.ba.lon.b",
1933
16
      FT_UINT32, BASE_CUSTOM,
1934
16
      CF_FUNC(prt_ba32), 0x0,
1935
16
      NULL, HFILL }
1936
16
    },
1937
16
    { &hf_4607_jobdef_ba_lat_c,
1938
16
      { "Bounding Area Point C Latitude", "s4607.job.ba.lat.c",
1939
16
      FT_INT32, BASE_CUSTOM,
1940
16
      CF_FUNC(prt_sa32), 0x0,
1941
16
      NULL, HFILL }
1942
16
    },
1943
16
    { &hf_4607_jobdef_ba_lon_c,
1944
16
      { "Bounding Area Point C Longitude", "s4607.job.ba.lon.c",
1945
16
      FT_UINT32, BASE_CUSTOM,
1946
16
      CF_FUNC(prt_ba32), 0x0,
1947
16
      NULL, HFILL }
1948
16
    },
1949
16
    { &hf_4607_jobdef_ba_lat_d,
1950
16
      { "Bounding Area Point D Latitude", "s4607.job.ba.lat.d",
1951
16
      FT_INT32, BASE_CUSTOM,
1952
16
      CF_FUNC(prt_sa32), 0x0,
1953
16
      NULL, HFILL }
1954
16
    },
1955
16
    { &hf_4607_jobdef_ba_lon_d,
1956
16
      { "Bounding Area Point D Longitude", "s4607.job.ba.lon.d",
1957
16
      FT_UINT32, BASE_CUSTOM,
1958
16
      CF_FUNC(prt_ba32), 0x0,
1959
16
      NULL, HFILL }
1960
16
    },
1961
1962
16
    { &hf_4607_jobdef_radar_mode,
1963
16
      { "Radar Mode", "s4607.job.mode",
1964
16
      FT_UINT8, BASE_DEC,
1965
16
      VALS(stanag4607_radar_mode_vals), 0x0,
1966
16
      NULL, HFILL }
1967
16
    },
1968
1969
16
    { &hf_4607_jobdef_revisit_interval,
1970
16
      { "Nominal Revisit Interval", "s4607.job.revisit",
1971
16
      FT_UINT16, BASE_DEC,
1972
16
      NULL, 0x0,
1973
16
      NULL, HFILL }
1974
16
    },
1975
16
    { &hf_4607_jobdef_unc_along,
1976
16
      { "Nominal Sensor Position Uncertainty Along Track", "s4607.job.unc.track",
1977
16
      FT_UINT16, BASE_CUSTOM,
1978
16
      CF_FUNC(prt_none16), 0x0,
1979
16
      NULL, HFILL }
1980
16
    },
1981
16
    { &hf_4607_jobdef_unc_cross,
1982
16
      { "Nominal Sensor Position Uncertainty Cross Track", "s4607.job.unc.cross",
1983
16
      FT_UINT16, BASE_CUSTOM,
1984
16
      CF_FUNC(prt_none16), 0x0,
1985
16
      NULL, HFILL }
1986
16
    },
1987
16
    { &hf_4607_jobdef_unc_alt,
1988
16
      { "Nominal Sensor Position Uncertainty Altitude", "s4607.job.unc.alt",
1989
16
      FT_UINT16, BASE_CUSTOM,
1990
16
      CF_FUNC(prt_none16), 0x0,
1991
16
      NULL, HFILL }
1992
16
    },
1993
16
    { &hf_4607_jobdef_unc_heading,
1994
16
      { "Nominal Sensor Position Uncertainty Track Heading", "s4607.job.unc.heading",
1995
16
      FT_UINT8, BASE_CUSTOM,
1996
16
      CF_FUNC(prt_none8), 0x0,
1997
16
      NULL, HFILL }
1998
16
    },
1999
16
    { &hf_4607_jobdef_unc_speed,
2000
16
      { "Nominal Sensor Position Uncertainty Speed", "s4607.job.unc.speed",
2001
16
      FT_UINT16, BASE_CUSTOM,
2002
16
      CF_FUNC(prt_none16), 0x0,
2003
16
      NULL, HFILL }
2004
16
    },
2005
2006
16
    { &hf_4607_jobdef_sense_slant,
2007
16
      { "Nominal Sensor Slant Range Standard Deviation", "s4607.job.sense.slant",
2008
16
      FT_UINT16, BASE_CUSTOM,
2009
16
      CF_FUNC(prt_none16), 0x0,
2010
16
      NULL, HFILL }
2011
16
    },
2012
16
    { &hf_4607_jobdef_sense_cross,
2013
16
      { "Nominal Sensor Cross Range Standard Deviation", "s4607.job.sense.cross",
2014
16
      FT_UINT16, BASE_CUSTOM,
2015
16
      CF_FUNC(prt_ba16_none), 0x0,
2016
16
      NULL, HFILL }
2017
16
    },
2018
16
    { &hf_4607_jobdef_sense_vlos,
2019
16
      { "Nominal Sensor Velocity Line-Of-Sight Std. Dev", "s4607.job.sense.vlos",
2020
16
      FT_UINT16, BASE_CUSTOM,
2021
16
      CF_FUNC(prt_none16), 0x0,
2022
16
      NULL, HFILL }
2023
16
    },
2024
16
    { &hf_4607_jobdef_sense_mdv,
2025
16
      { "Nominal Sensor Minimum Detectable Velocity (MDV)", "s4607.job.sense.mdv",
2026
16
      FT_UINT8, BASE_CUSTOM,
2027
16
      CF_FUNC(prt_none8), 0x0,
2028
16
      NULL, HFILL }
2029
16
    },
2030
16
    { &hf_4607_jobdef_sense_prob,
2031
16
      { "Nominal Sensor Detection Probability", "s4607.job.sense.prob",
2032
16
      FT_UINT8, BASE_CUSTOM,
2033
16
      CF_FUNC(prt_none8), 0x0,
2034
16
      NULL, HFILL }
2035
16
    },
2036
16
    { &hf_4607_jobdef_sense_alarm,
2037
16
      { "Nominal Sensor False Alarm Density", "s4607.job.sense.alarm",
2038
16
      FT_UINT8, BASE_CUSTOM,
2039
16
      CF_FUNC(prt_none8), 0x0,
2040
16
      NULL, HFILL }
2041
16
    },
2042
16
    { &hf_4607_jobdef_terrain_model,
2043
16
      { "Terrain Elevation Model Used", "s4607.job.terrain",
2044
16
      FT_UINT8, BASE_DEC,
2045
16
      VALS(stanag4607_terrain_vals), 0x0,
2046
16
      NULL, HFILL }
2047
16
    },
2048
16
    { &hf_4607_jobdef_geoid_model,
2049
16
      { "Geoid Model Used", "s4607.job.geoid",
2050
16
      FT_UINT8, BASE_DEC,
2051
16
      VALS(stanag4607_geoid_vals), 0x0,
2052
16
      NULL, HFILL }
2053
16
    },
2054
2055
2056
    /* ========================================== */
2057
    /* Mission segment */
2058
16
    { &hf_4607_mission_plan,
2059
16
      { "Mission Plan", "s4607.mission.plan",
2060
16
      FT_STRING, BASE_NONE,
2061
16
      NULL, 0x0,
2062
16
      NULL, HFILL }
2063
16
    },
2064
16
    { &hf_4607_mission_flight_plan,
2065
16
      { "Mission Flight Plan", "s4607.mission.flight",
2066
16
      FT_STRING, BASE_NONE,
2067
16
      NULL, 0x0,
2068
16
      NULL, HFILL }
2069
16
    },
2070
16
    { &hf_4607_mission_platform,
2071
16
      { "Mission Platform Type", "s4607.mission.platform",
2072
16
      FT_UINT8, BASE_DEC,
2073
16
      VALS(stanag4607_platform_vals), 0x0,
2074
16
      NULL, HFILL }
2075
16
    },
2076
16
    { &hf_4607_mission_platform_config,
2077
16
      { "Mission Platform Configuration", "s4607.mission.config",
2078
16
      FT_STRING, BASE_NONE,
2079
16
      NULL, 0x0,
2080
16
      NULL, HFILL }
2081
16
    },
2082
16
    { &hf_4607_mission_time_year,
2083
16
      { "Mission Reference Time Year", "s4607.mission.year",
2084
16
      FT_UINT16, BASE_DEC,
2085
16
      NULL, 0x0,
2086
16
      NULL, HFILL }
2087
16
    },
2088
16
    { &hf_4607_mission_time_month,
2089
16
      { "Mission Reference Time Month", "s4607.mission.month",
2090
16
      FT_UINT8, BASE_DEC,
2091
16
      NULL, 0x0,
2092
16
      NULL, HFILL }
2093
16
    },
2094
16
    { &hf_4607_mission_time_day,
2095
16
      { "Mission Reference Time Day", "s4607.mission.day",
2096
16
      FT_UINT8, BASE_DEC,
2097
16
      NULL, 0x0,
2098
16
      NULL, HFILL }
2099
16
    },
2100
    /* ========================================== */
2101
16
    { &hf_4607_platloc_time,
2102
16
      { "Platform Location Time", "s4607.ploc.time",
2103
16
      FT_UINT32, BASE_CUSTOM,
2104
16
      CF_FUNC(prt_millisec), 0x0,
2105
16
      NULL, HFILL }
2106
16
    },
2107
16
    { &hf_4607_platloc_latitude,
2108
16
      { "Platform Position Latitude", "s4607.ploc.lat",
2109
16
      FT_INT32, BASE_CUSTOM,
2110
16
      CF_FUNC(prt_sa32), 0x0,
2111
16
      NULL, HFILL }
2112
16
    },
2113
16
    { &hf_4607_platloc_longitude,
2114
16
      { "Platform Position Longitude", "s4607.ploc.lon",
2115
16
      FT_UINT32, BASE_CUSTOM,
2116
16
      CF_FUNC(prt_ba32), 0x0,
2117
16
      NULL, HFILL }
2118
16
    },
2119
16
    { &hf_4607_platloc_altitude,
2120
16
      { "Platform Position Altitude", "s4607.ploc.alt",
2121
16
      FT_INT32, BASE_CUSTOM,
2122
16
      CF_FUNC(prt_centimeters), 0x0,
2123
16
      NULL, HFILL }
2124
16
    },
2125
16
    { &hf_4607_platloc_track,
2126
16
      { "Platform Track", "s4607.ploc.track",
2127
16
      FT_UINT16, BASE_CUSTOM,
2128
16
      CF_FUNC(prt_ba16), 0x0,
2129
16
      NULL, HFILL }
2130
16
    },
2131
16
    { &hf_4607_platloc_speed,
2132
16
      { "Platform Speed", "s4607.ploc.speed",
2133
16
      FT_UINT32, BASE_CUSTOM,
2134
16
      CF_FUNC(prt_speed), 0x0,
2135
16
      NULL, HFILL }
2136
16
    },
2137
16
    { &hf_4607_platloc_vertical_velocity,
2138
16
      { "Platform Vertical Velocity", "s4607.ploc.velocity",
2139
16
      FT_INT8, BASE_CUSTOM,
2140
16
      CF_FUNC(prt_speed_deci), 0x0,
2141
16
      NULL, HFILL }
2142
16
    },
2143
2144
16
  };
2145
2146
  /* Setup protocol subtree array */
2147
16
  static int *ett[] = {
2148
16
    &ett_4607_hdr,
2149
16
    &ett_4607_seg,
2150
16
    &ett_4607_rpt,
2151
16
    &ett_4607_mask,
2152
16
    &ett_4607_ver,
2153
16
  };
2154
2155
16
  static ei_register_info ei[] = {
2156
16
    { &ei_too_short,
2157
16
      { "s4607.segment_too_short", PI_MALFORMED, PI_ERROR,
2158
16
        "Segment size too small", EXPFILL }},
2159
16
    { &ei_bad_length,
2160
16
      { "s4607.segment_bad_length", PI_MALFORMED, PI_ERROR,
2161
16
        "Bad segment size", EXPFILL }},
2162
16
    { &ei_bad_packet_size,
2163
16
      { "s4607.bad_packet_size", PI_MALFORMED, PI_ERROR,
2164
16
        "Bad packet size field", EXPFILL }},
2165
16
    { &ei_job_id_zero,
2166
16
      { "s4607.job_id_zero", PI_MALFORMED, PI_WARN,
2167
16
        "Segment present without valid Job ID", EXPFILL }}
2168
16
  };
2169
2170
16
  expert_module_t* expert_4607;
2171
2172
16
  proto_stanag4607 = proto_register_protocol ("STANAG 4607 (GMTI Format)", "STANAG 4607", "s4607");
2173
2174
16
  proto_register_field_array(proto_stanag4607, hf, array_length(hf));
2175
16
  proto_register_subtree_array(ett, array_length(ett));
2176
16
  expert_4607 = expert_register_protocol(proto_stanag4607);
2177
16
  expert_register_field_array(expert_4607, ei, array_length(ei));
2178
2179
16
  stanag4607_handle = register_dissector("stanag4607", dissect_stanag4607, proto_stanag4607);
2180
  /* prefs_register_protocol(proto_stanag4607, proto_reg_handoff_stanag4607); */
2181
16
}
2182
2183
void
2184
proto_reg_handoff_stanag4607(void)
2185
16
{
2186
16
  dissector_add_for_decode_as("tcp.port", stanag4607_handle);
2187
16
  dissector_add_for_decode_as("udp.port", stanag4607_handle);
2188
16
  dissector_add_uint("wtap_encap", WTAP_ENCAP_STANAG_4607, stanag4607_handle);
2189
16
}
2190
2191
/*
2192
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
2193
 *
2194
 * Local variables:
2195
 * c-basic-offset: 8
2196
 * tab-width: 8
2197
 * indent-tabs-mode: t
2198
 * End:
2199
 *
2200
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
2201
 * :indentSize=8:tabSize=8:noTabs=false:
2202
 */