-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpacket-xplane.c
3346 lines (2869 loc) · 214 KB
/
packet-xplane.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-xplane.c
* Routines for X-Plane packet dissection
* Copyright 2020, Avacee
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GNU v3
*/
/*
A dissector for UDP packets for Laminar Research's X-Plane Flight Simulator
The structure of an X-Plane packet is:
4-bytes - ascii text header which is used to parse the data section.
1-byte - usually 0x00 but not always.
N-bytes - data section formatted based on the 4-byte header. There isn't always a trailing \0.
By default X-Plane receives user's packets on port 49000 and transmits on 49001. There is a preference to set these ports if they are changed within X-Plane.
X-Plane also transmits from port 49002 for the FLIR packets but this is obsolete in version 11.50 onwards. There is a preference for the FLIR Packet port.
*/
#include <config.h>
#if 0
/* "System" includes used only as needed */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
#endif
#include <epan/packet.h> /* Should be first Wireshark include (other than config.h) */
#include <epan/prefs.h>
#include <epan/unit_strings.h>
#include <epan/expert.h>
#include <epan/conversation.h>
#include <wsutil/plugins.h>
#include <wsutil/str_util.h>
#include <wsutil/wmem/wmem_strbuf.h>
/* Prototypes */
/* (Required to prevent [-Wmissing-prototypes] warnings */
void proto_reg_handoff_xplane(void);
void proto_register_xplane(void);
/* Initialize the protocol and registered fields */
static int proto_xplane = -1;
static expert_field ei_xplane = EI_INIT;
#define xplane_HEADER_LENGTH 5
#define xplane_MIN_PACKET_LENGTH 5
// ---------- ACFN Declarations ----------
#define xplane_ACFN_PACKET_LENGTH 165
static gint ett_xplane_acfn = -1;
static int hf_xplane_acfn_header = -1;
static int hf_xplane_acfn_index = -1;
static int hf_xplane_acfn_path = -1;
static int hf_xplane_acfn_padding = -1;
static int hf_xplane_acfn_livery = -1;
static int hf_xplane_acfn_header_0 = -1;
static expert_field ei_xplane_acfn = EI_INIT;
static expert_field ei_xplane_acfn_length = EI_INIT;
static expert_field ei_xplane_acfn_id = EI_INIT;
static expert_field ei_xplane_acfn_livery = EI_INIT;
static expert_field ei_xplane_acfn_path_seperator = EI_INIT;
// ---------- ACPR Declarations ----------
#define xplane_ACPR_PACKET_LENGTH 229
static gint ett_xplane_acpr = -1;
static int hf_xplane_acpr_header = -1;
static int hf_xplane_acpr_index = -1;
static int hf_xplane_acpr_path = -1;
static int hf_xplane_acpr_livery = -1;
static int hf_xplane_acpr_padding = -1;
static int hf_xplane_acpr_starttype = -1;
static int hf_xplane_acpr_aircraftindex = -1;
static int hf_xplane_acpr_ICAO = -1;
static int hf_xplane_acpr_runwayindex = -1;
static int hf_xplane_acpr_runwaydirection = -1;
static int hf_xplane_acpr_latitude = -1;
static int hf_xplane_acpr_longitude = -1;
static int hf_xplane_acpr_elevation = -1;
static int hf_xplane_acpr_trueheading = -1;
static int hf_xplane_acpr_speed = -1;
static expert_field ei_xplane_acpr_length = EI_INIT;
static expert_field ei_xplane_acpr_id = EI_INIT;
static expert_field ei_xplane_acpr_livery = EI_INIT;
static expert_field ei_xplane_acpr_path_seperator = EI_INIT;
static expert_field ei_xplane_acpr_runwaydirection = EI_INIT;
static expert_field ei_xplane_acpr_latitude = EI_INIT;
static expert_field ei_xplane_acpr_longitude = EI_INIT;
static expert_field ei_xplane_acpr_elevation = EI_INIT;
static expert_field ei_xplane_acpr_trueheading = EI_INIT;
static expert_field ei_xplane_acpr_speed = EI_INIT;
// ---------- ALRT Declarations ----------
#define xplane_ALRT_PACKET_LENGTH 965
static gint ett_xplane_alrt = -1;
static int hf_xplane_alrt_header = -1;
static int hf_xplane_alrt_line1 = -1;
static int hf_xplane_alrt_line2 = -1;
static int hf_xplane_alrt_line3 = -1;
static int hf_xplane_alrt_line4 = -1;
static expert_field ei_xplane_alrt_length = EI_INIT;
// ---------- BECN Declarations ----------
static gint ett_xplane_becn = -1;
static int hf_xplane_becn_header = -1;
static int hf_xplane_becn_major = -1;
static int hf_xplane_becn_minor = -1;
static int hf_xplane_becn_hostid = -1;
static int hf_xplane_becn_version = -1;
static int hf_xplane_becn_role = -1;
static int hf_xplane_becn_port = -1;
static int hf_xplane_becn_name = -1;
static int hf_xplane_becn_raknetport = -1;
// ---------- CMND Declarations ----------
static gint ett_xplane_cmnd = -1;
static int hf_xplane_cmnd_header = -1;
static int hf_xplane_cmnd_command = -1;
// ---------- DATA Declarations ----------
#define xplane_DATA_STRUCT_LENGTH 36
#define xplane_DATA_INDEX_LENGTH 4
static gint ett_xplane_data = -1;
static int hf_xplane_data_header = -1;
static int hf_xplane_data_index = -1;
static int hf_xplane_data_a = -1;
static int hf_xplane_data_b = -1;
static int hf_xplane_data_c = -1;
static int hf_xplane_data_d = -1;
static int hf_xplane_data_e = -1;
static int hf_xplane_data_f = -1;
static int hf_xplane_data_g = -1;
static int hf_xplane_data_h = -1;
static expert_field ei_xplane_data_length = EI_INIT;
static expert_field ei_xplane_data_invalid_index = EI_INIT;
// ---------- DCOC Declarations ----------
static gint ett_xplane_dcoc = -1;
static int hf_xplane_dcoc_header = -1;
static int hf_xplane_dcoc_id = -1;
static expert_field ei_xplane_dcoc_length = EI_INIT;
static expert_field ei_xplane_dcoc_id = EI_INIT;
// ---------- DREF Declarations ----------
#define xplane_DREF_PACKET_LENGTH 509
static gint ett_xplane_dref = -1;
static int hf_xplane_dref_header = -1;
static int hf_xplane_dref_value = -1;
static int hf_xplane_dref_dataref = -1;
static expert_field ei_xplane_dref_length = EI_INIT;
// ---------- DSEL Declarations ----------
static gint ett_xplane_dsel = -1;
static int hf_xplane_dsel_header = -1;
static int hf_xplane_dsel_id = -1;
static expert_field ei_xplane_dsel_id = EI_INIT;
static expert_field ei_xplane_dsel_length = EI_INIT;
// ---------- FAIL Declarations ----------
static gint ett_xplane_fail = -1;
static int hf_xplane_fail_header = -1;
static int hf_xplane_fail_id = -1;
// ---------- FLIR IN Declarations ----------
static gint ett_xplane_flir_in = -1;
static int hf_xplane_flir_in_header = -1;
static int hf_xplane_flir_in_framerate = -1;
// ---------- FLIR OUT Declarations ----------
static gint ett_xplane_flir_out = -1;
static int hf_xplane_flir_out_header = -1;
static int hf_xplane_flir_out_height = -1;
static int hf_xplane_flir_out_width = -1;
static int hf_xplane_flir_out_frameindex = -1;
static int hf_xplane_flir_out_framecount = -1;
static int hf_xplane_flir_out_imagedata = -1;
// ---------- ISE4 Declarations ----------
#define xplane_ISE4_PACKET_LENGTH 37
static gint ett_xplane_ise4 = -1;
static int hf_xplane_ise4_header = -1;
static int hf_xplane_ise4_machinetype = -1;
static int hf_xplane_ise4_address = -1;
static int hf_xplane_ise4_port = -1;
static int hf_xplane_ise4_enabled = -1;
static expert_field ei_xplane_ise4_length = EI_INIT;
// ---------- ISE6 Declarations ----------
#define xplane_ISE6_PACKET_LENGTH 85
static gint ett_xplane_ise6 = -1;
static int hf_xplane_ise6_header = -1;
static int hf_xplane_ise6_machinetype = -1;
static int hf_xplane_ise6_address = -1;
static int hf_xplane_ise6_port = -1;
static int hf_xplane_ise6_enabled = -1;
static expert_field ei_xplane_ise6_length = EI_INIT;
// ---------- LSND Declarations ----------
#define xplane_LSND_PACKET_LENGTH 517
static gint ett_xplane_lsnd = -1;
static int hf_xplane_lsnd_header = -1;
static int hf_xplane_lsnd_index = -1;
static int hf_xplane_lsnd_speed = -1;
static int hf_xplane_lsnd_volume = -1;
static int hf_xplane_lsnd_filename = -1;
static expert_field ei_xplane_lsnd_index = EI_INIT;
static expert_field ei_xplane_lsnd_frequency = EI_INIT;
static expert_field ei_xplane_lsnd_volume = EI_INIT;
static expert_field ei_xplane_lsnd_length = EI_INIT;
// ---------- NFAL Declarations ----------
static gint ett_xplane_nfal = -1;
static int hf_xplane_nfal_header = -1;
static int hf_xplane_nfal_navaidcode = -1;
static expert_field ei_xplane_nfal_length = EI_INIT;
// ---------- NREC Declarations ----------
static gint ett_xplane_nrec = -1;
static int hf_xplane_nrec_header = -1;
static int hf_xplane_nrec_navaidcode = -1;
static expert_field ei_xplane_nrec_length = EI_INIT;
// ---------- OBJL Declarations ----------
#define xplane_OBJL_PACKET_LENGTH 61
static gint ett_xplane_objl = -1;
static int hf_xplane_objl_header = -1;
static int hf_xplane_objl_index = -1;
static int hf_xplane_objl_padding1 = -1;
static int hf_xplane_objl_latitude = -1;
static int hf_xplane_objl_longitude = -1;
static int hf_xplane_objl_elevation = -1;
static int hf_xplane_objl_psi = -1;
static int hf_xplane_objl_theta = -1;
static int hf_xplane_objl_phi = -1;
static int hf_xplane_objl_onground = -1;
static int hf_xplane_objl_smokesize = -1;
static int hf_xplane_objl_padding2 = -1;
static expert_field ei_xplane_objl_length = EI_INIT;
static expert_field ei_xplane_objl_latitude = EI_INIT;
static expert_field ei_xplane_objl_longitude = EI_INIT;
static expert_field ei_xplane_objl_elevation = EI_INIT;
static expert_field ei_xplane_objl_psi = EI_INIT;
static expert_field ei_xplane_objl_theta = EI_INIT;
static expert_field ei_xplane_objl_phi = EI_INIT;
static expert_field ei_xplane_objl_onground = EI_INIT;
static expert_field ei_xplane_objl_smokesize = EI_INIT;
// ---------- OBJN Declarations ----------
#define xplane_OBJN_PACKET_LENGTH 509
static gint ett_xplane_objn = -1;
static int hf_xplane_objn_header = -1;
static int hf_xplane_objn_index = -1;
static int hf_xplane_objn_filename = -1;
static expert_field ei_xplane_objn_length = EI_INIT;
// ---------- PREL Declarations ----------
#define xplane_PREL_PACKET_LENGTH 69
static gint ett_xplane_prel = -1;
static int hf_xplane_prel_header = -1;
static int hf_xplane_prel_starttype = -1;
static int hf_xplane_prel_aircraftindex = -1;
static int hf_xplane_prel_ICAO = -1;
static int hf_xplane_prel_runwayindex = -1;
static int hf_xplane_prel_runwaydirection = -1;
static int hf_xplane_prel_latitude = -1;
static int hf_xplane_prel_longitude = -1;
static int hf_xplane_prel_elevation = -1;
static int hf_xplane_prel_trueheading = -1;
static int hf_xplane_prel_speed = -1;
static expert_field ei_xplane_prel_length = EI_INIT;
static expert_field ei_xplane_prel_id = EI_INIT;
//static expert_field ei_xplane_prel_livery = EI_INIT;
//static expert_field ei_xplane_acpr_path = EI_INIT;
static expert_field ei_xplane_prel_runwaydirection = EI_INIT;
static expert_field ei_xplane_prel_latitude = EI_INIT;
static expert_field ei_xplane_prel_longitude = EI_INIT;
static expert_field ei_xplane_prel_elevation = EI_INIT;
static expert_field ei_xplane_prel_trueheading = EI_INIT;
static expert_field ei_xplane_prel_speed = EI_INIT;
// ---------- QUIT Declarations ----------
#define xplane_QUIT_PACKET_LENGTH xplane_MIN_PACKET_LENGTH
static gint ett_xplane_quit = -1;
static int hf_xplane_quit_header = -1;
static expert_field ei_xplane_quit_length = EI_INIT;
// ---------- RADR IN Declarations ----------
static gint ett_xplane_radr_in = -1;
static int hf_xplane_radr_in_header = -1;
static int hf_xplane_radr_in_pointcount = -1;
// ---------- RADR OUT Declarations ----------
#define xplane_RADR_OUT_STRUCT_LENGTH 13
static gint ett_xplane_radr_out = -1;
static int hf_xplane_radr_out_header = -1;
static int hf_xplane_radr_out_longitude = -1;
static int hf_xplane_radr_out_latitude = -1;
static int hf_xplane_radr_out_precipitation = -1;
static int hf_xplane_radr_out_height = -1;
static expert_field ei_xplane_radr_out_length = EI_INIT;
// ---------- RECO Declarations ----------
static gint ett_xplane_reco = -1;
static int hf_xplane_reco_header = -1;
static int hf_xplane_reco_id = -1;
// ---------- RESE Declarations ----------
#define xplane_RESE_PACKET_LENGTH xplane_MIN_PACKET_LENGTH
static gint ett_xplane_rese = -1;
static int hf_xplane_rese_header = -1;
static expert_field ei_xplane_rese_length = EI_INIT;
// ---------- RPOS IN Declarations ----------
static gint ett_xplane_rpos_in = -1;
static int hf_xplane_rpos_in_header = -1;
static int hf_xplane_rpos_in_frequency = -1;
static expert_field ei_xplane_rpos_in_length = EI_INIT;
// ---------- RPOS OUT Declarations ----------
#define xplane_RPOS_OUT_PACKET_LENGTH 69
static gint ett_xplane_rpos_out = -1;
static int hf_xplane_rpos_out_header = -1;
static int hf_xplane_rpos_out_longitude = -1;
static int hf_xplane_rpos_out_latitude = -1;
static int hf_xplane_rpos_out_elevation = -1;
static int hf_xplane_rpos_out_height = -1;
static int hf_xplane_rpos_out_theta = -1;
static int hf_xplane_rpos_out_psi = -1;
static int hf_xplane_rpos_out_phi = -1;
static int hf_xplane_rpos_out_vx = -1;
static int hf_xplane_rpos_out_vy = -1;
static int hf_xplane_rpos_out_vz = -1;
static int hf_xplane_rpos_out_rollrate = -1;
static int hf_xplane_rpos_out_pitchrate = -1;
static int hf_xplane_rpos_out_yawrate = -1;
static expert_field ei_xplane_rpos_out_length = EI_INIT;
// ---------- RREF IN Declarations ----------
#define xplane_RREF_IN_PACKET_LENGTH 413
static gint ett_xplane_rref_in = -1;
static int hf_xplane_rref_in_header = -1;
static int hf_xplane_rref_in_frequency = -1;
static int hf_xplane_rref_in_id = -1;
static int hf_xplane_rref_in_dataref = -1;
// ---------- RREF OUT Declarations ----------
static gint ett_xplane_rref_out = -1;
static int hf_xplane_rref_out_header = -1;
static int hf_xplane_rref_out_id = -1;
static int hf_xplane_rref_out_value = -1;
static int hf_xplane_rref_out_idlink = -1;
// ---------- SHUT Declarations ----------
#define xplane_SHUT_PACKET_LENGTH xplane_MIN_PACKET_LENGTH
static gint ett_xplane_shut = -1;
static int hf_xplane_shut_header = -1;
static expert_field ei_xplane_shut_length = EI_INIT;
// ---------- SIMO Declarations ----------
static gint ett_xplane_simo = -1;
static int hf_xplane_simo_header = -1;
static int hf_xplane_simo_action = -1;
static int hf_xplane_simo_filename = -1;
static expert_field ei_xplane_simo_actionid = EI_INIT;
// ---------- SOUN Declarations ----------
#define xplane_SOUN_PACKET_LENGTH 513
static gint ett_xplane_soun = -1;
static int hf_xplane_soun_header = -1;
static int hf_xplane_soun_frequency = -1;
static int hf_xplane_soun_volume = -1;
static int hf_xplane_soun_filename = -1;
static expert_field ei_xplane_soun_frequency = EI_INIT;
static expert_field ei_xplane_soun_volume = EI_INIT;
static expert_field ei_xplane_soun_length = EI_INIT;
// ---------- SSND Declarations ----------
#define xplane_SSND_PACKET_LENGTH 517
static gint ett_xplane_ssnd = -1;
static int hf_xplane_ssnd_header = -1;
static int hf_xplane_ssnd_index = -1;
static int hf_xplane_ssnd_speed = -1;
static int hf_xplane_ssnd_volume = -1;
static int hf_xplane_ssnd_filename = -1;
static expert_field ei_xplane_ssnd_index = EI_INIT;
static expert_field ei_xplane_ssnd_frequency = EI_INIT;
static expert_field ei_xplane_ssnd_volume = EI_INIT;
static expert_field ei_xplane_ssnd_length = EI_INIT;
// ---------- UCOC Declarations ----------
static gint ett_xplane_ucoc = -1;
static int hf_xplane_ucoc_header = -1;
static int hf_xplane_ucoc_id = -1;
static expert_field ei_xplane_ucoc_length = EI_INIT;
static expert_field ei_xplane_ucoc_id = EI_INIT;
// ---------- USEL Declarations ----------
static gint ett_xplane_usel = -1;
static int hf_xplane_usel_header = -1;
static int hf_xplane_usel_id = -1;
static expert_field ei_xplane_usel_length = EI_INIT;
static expert_field ei_xplane_usel_id = EI_INIT;
// ---------- VEHX Declarations ----------
#define xplane_VEHX_PACKET_LENGTH 45
static gint ett_xplane_vehx = -1;
static int hf_xplane_vehx_header = -1;
static int hf_xplane_vehx_id = -1;
static int hf_xplane_vehx_latitude = -1;
static int hf_xplane_vehx_longitude = -1;
static int hf_xplane_vehx_elevation = -1;
static int hf_xplane_vehx_heading = -1;
static int hf_xplane_vehx_pitch = -1;
static int hf_xplane_vehx_roll = -1;
static expert_field ei_xplane_vehx_length = EI_INIT;
static expert_field ei_xplane_vehx_id = EI_INIT;
static expert_field ei_xplane_vehx_latitude = EI_INIT;
static expert_field ei_xplane_vehx_longitude = EI_INIT;
static expert_field ei_xplane_vehx_elevation = EI_INIT;
static expert_field ei_xplane_vehx_heading = EI_INIT;
static expert_field ei_xplane_vehx_pitch = EI_INIT;
static expert_field ei_xplane_vehx_roll = EI_INIT;
#define xplane_UDP_LISTENER_PORT 49000
#define xplane_UDP_SENDFROM_PORT 49001
#define xplane_UDP_EXTERNAL_APP_PORT 49005
#define xplane_BECN_PORT 49707
static guint xplane_pref_udp_listener_port = xplane_UDP_LISTENER_PORT;
static guint xplane_pref_udp_sender_port = xplane_UDP_SENDFROM_PORT;
static guint xplane_pref_udp_external_app_port = xplane_UDP_EXTERNAL_APP_PORT;
static guint xplane_pref_becn_port = xplane_BECN_PORT;
static const value_string xplane_vals_Becn_HostID[] = {
{ 1, "X-Plane" },
{ 2, "Plane Maker" },
{ 0, NULL }
};
static const value_string xplane_vals_MachineRole[] = {
{ 1, "Master" },
{ 2, "External Visual" },
{ 3, "IOS" },
{ 0, NULL }
};
static const value_string xplane_vals_StartType[] = {
{ 5 , "RepeatLast" },
{ 6 , "LatLong" },
{ 7 , "GeneralArea" },
{ 8 , "NearestAirport" },
{ 9 , "SnapshotLoad" },
{ 10 , "Ramp" },
{ 11 , "Runway" },
{ 12 , "RunwayVFR" },
{ 13 , "RunwayIFR" },
{ 14 , "GrassStrip" },
{ 15 , "DirtStrip" },
{ 16 , "GravelStrip" },
{ 17 , "WaterRunway" },
{ 18 , "Helipad" },
{ 19 , "CarrierCatapult" },
{ 20 , "GliderTowPlane" },
{ 21 , "GliderWinch" },
{ 22 , "FormationFlying" },
{ 23 , "RefuelBoom" },
{ 24 , "RefuelBasket" },
{ 25 , "B52Drop" },
{ 26 , "ShuttlePiggyBack" },
{ 27 , "CarrierApproach" },
{ 28 , "FrigateApproach" },
{ 29 , "SmallOilRigApproach" },
{ 30 , "LargeOilPlatformApproach" },
{ 31 , "ForestFireApproach" },
{ 32 , "Shuttle01" },
{ 33 , "Shuttle02" },
{ 34 , "Shuttle03" },
{ 35 , "Shuttle04" },
{ 36 , "ShuttleGlide" },
{ 0 , NULL }
};
static const value_string xplane_vals_ISEx_MachineType[] = {
{ 0, "Multiplayer1" },
{ 1, "Multiplayer2" },
{ 2, "Multiplayer3" },
{ 3, "Multiplayer4" },
{ 4, "Multiplayer5" },
{ 5, "Multiplayer6" },
{ 6, "Multiplayer7" },
{ 7, "Multiplayer8" },
{ 8, "Multiplayer9" },
{ 9, "Multiplayer10" },
{ 10, "Multiplayer11" },
{ 11, "Multiplayer12" },
{ 12, "Multiplayer13" },
{ 13, "Multiplayer14" },
{ 14, "Multiplayer15" },
{ 15, "Multiplayer16" },
{ 16, "Multiplayer17" },
{ 17, "Multiplayer18" },
{ 18, "Multiplayer19" },
{ 19, "ExternalVisual0" },
{ 20, "ExternalVisual1" },
{ 21, "ExternalVisual2" },
{ 22, "ExternalVisual3" },
{ 23, "ExternalVisual4" },
{ 24, "ExternalVisual5" },
{ 25, "ExternalVisual6" },
{ 26, "ExternalVisual7" },
{ 27, "ExternalVisual8" },
{ 28, "ExternalVisual9" },
{ 29, "ExternalVisual10" },
{ 30, "ExternalVisual11" },
{ 31, "ExternalVisual12" },
{ 32, "ExternalVisual13" },
{ 33, "ExternalVisual14" },
{ 34, "ExternalVisual15" },
{ 35, "ExternalVisual16" },
{ 36, "ExternalVisual17" },
{ 37, "ExternalVisual18" },
{ 38, "ExternalVisual19" },
{ 39, "ExternalVisualMaster8" },
{ 42, "IOSMasterThisIsIOS" },
{ 62, "IOSThisIsMaster" },
{ 64, "DataOutputTarget" },
{ 71, "Xavi1" },
{ 72, "Xavi2" },
{ 73, "Xavi3" },
{ 74, "Xavi4" },
{ 75, "ForeFlight" },
{ 76, "ForeFlightBroadcast" },
{ 77, "ControlPadForIOS" },
{ 0, NULL }
};
static const value_string xplane_vals_Simo_ActionID[] = {
{ 0, "Save Situation" },
{ 1, "Load Situation" },
{ 2, "Save Movie" },
{ 3, "Load Movie" },
{ 0, NULL }
};
#define xplane_MAX_DATA_INDEX 139
static wmem_strbuf_t* xplane_data_lookup_table[xplane_MAX_DATA_INDEX][9];
static gboolean xplane_data_lookup_table_is_populated = FALSE;
static void xplane_populate_data_lookup_table(void)
{
xplane_data_lookup_table[0][0] = wmem_strbuf_new(wmem_epan_scope(), "Frame Rate Info");
xplane_data_lookup_table[0][1] = wmem_strbuf_new(wmem_epan_scope(), "Actual Frame Rate");
xplane_data_lookup_table[0][2] = wmem_strbuf_new(wmem_epan_scope(), "Sim Frame Rate");
xplane_data_lookup_table[0][3] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[0][4] = wmem_strbuf_new(wmem_epan_scope(), "Frame Time (s) DataRef=sim/time/framerate_period");
xplane_data_lookup_table[0][5] = wmem_strbuf_new(wmem_epan_scope(), "CPU Time (s)");
xplane_data_lookup_table[0][6] = wmem_strbuf_new(wmem_epan_scope(), "GPU Time (s) DataRef=sim/time/gpu_time_per_frame_sec_approx");
xplane_data_lookup_table[0][7] = wmem_strbuf_new(wmem_epan_scope(), "grnd ratio");
xplane_data_lookup_table[0][8] = wmem_strbuf_new(wmem_epan_scope(), "flit ratio (Requested Simulator Speed multiple from ctrl-T DataRef=sim/time/sim_speed_actual");
xplane_data_lookup_table[1][0] = wmem_strbuf_new(wmem_epan_scope(), "Times");
xplane_data_lookup_table[1][1] = wmem_strbuf_new(wmem_epan_scope(), "Elapsed Sim Start (s)");
xplane_data_lookup_table[1][2] = wmem_strbuf_new(wmem_epan_scope(), "Elapsed Total Time (exc Start Screen) (s)");
xplane_data_lookup_table[1][3] = wmem_strbuf_new(wmem_epan_scope(), "Elapsed Mission Time (s)");
xplane_data_lookup_table[1][4] = wmem_strbuf_new(wmem_epan_scope(), "Elapsed Timer (s)");
xplane_data_lookup_table[1][5] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[1][6] = wmem_strbuf_new(wmem_epan_scope(), "Zulu Time DataRef=sim/time/zulu_time_sec");
xplane_data_lookup_table[1][7] = wmem_strbuf_new(wmem_epan_scope(), "Simulator Local Time");
xplane_data_lookup_table[1][8] = wmem_strbuf_new(wmem_epan_scope(), "Hobbs Time DataRef=sim/time/hobbs_time");
xplane_data_lookup_table[2][0] = wmem_strbuf_new(wmem_epan_scope(), "Sim Stats");
xplane_data_lookup_table[2][1] = wmem_strbuf_new(wmem_epan_scope(), "USE (puffs)");
xplane_data_lookup_table[2][2] = wmem_strbuf_new(wmem_epan_scope(), "TOT (puffs)");
xplane_data_lookup_table[2][3] = wmem_strbuf_new(wmem_epan_scope(), "Triangles Visible");
xplane_data_lookup_table[2][4] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[2][5] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[2][6] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[2][7] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[2][8] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[3][0] = wmem_strbuf_new(wmem_epan_scope(), "Speeds");
xplane_data_lookup_table[3][1] = wmem_strbuf_new(wmem_epan_scope(), "Knots Indicated Airspeed");
xplane_data_lookup_table[3][2] = wmem_strbuf_new(wmem_epan_scope(), "Knots Equivalent Airspeed");
xplane_data_lookup_table[3][3] = wmem_strbuf_new(wmem_epan_scope(), "Knots True Airspeed");
xplane_data_lookup_table[3][4] = wmem_strbuf_new(wmem_epan_scope(), "Knots Tree Ground Speed");
xplane_data_lookup_table[3][5] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[3][6] = wmem_strbuf_new(wmem_epan_scope(), "Indicated (mph)");
xplane_data_lookup_table[3][7] = wmem_strbuf_new(wmem_epan_scope(), "True Airspeed (mph)");
xplane_data_lookup_table[3][8] = wmem_strbuf_new(wmem_epan_scope(), "True Ground Speed (mph)");
xplane_data_lookup_table[4][0] = wmem_strbuf_new(wmem_epan_scope(), "Mach, VVI, g-load");
xplane_data_lookup_table[4][1] = wmem_strbuf_new(wmem_epan_scope(), "Current Mach");
xplane_data_lookup_table[4][2] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[4][3] = wmem_strbuf_new(wmem_epan_scope(), "Vertical Velocity (feet per minute)");
xplane_data_lookup_table[4][4] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[4][5] = wmem_strbuf_new(wmem_epan_scope(), "Gload (normal)");
xplane_data_lookup_table[4][6] = wmem_strbuf_new(wmem_epan_scope(), "GLoad (axial)");
xplane_data_lookup_table[4][7] = wmem_strbuf_new(wmem_epan_scope(), "Gload (side)");
xplane_data_lookup_table[4][8] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[5][0] = wmem_strbuf_new(wmem_epan_scope(), "Weather");
xplane_data_lookup_table[5][1] = wmem_strbuf_new(wmem_epan_scope(), "Sea Level Pressure (inHG)");
xplane_data_lookup_table[5][2] = wmem_strbuf_new(wmem_epan_scope(), "Sea Level Temperature (degC)");
xplane_data_lookup_table[5][3] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[5][4] = wmem_strbuf_new(wmem_epan_scope(), "Wind Speed (knots)");
xplane_data_lookup_table[5][5] = wmem_strbuf_new(wmem_epan_scope(), "Wind From Direction 0=N->S 270=West->East");
xplane_data_lookup_table[5][6] = wmem_strbuf_new(wmem_epan_scope(), "Local Turbulance (0->1)");
xplane_data_lookup_table[5][7] = wmem_strbuf_new(wmem_epan_scope(), "Local Precipitation (0->1)");
xplane_data_lookup_table[5][8] = wmem_strbuf_new(wmem_epan_scope(), "Local Hail (0->1)");
xplane_data_lookup_table[6][0] = wmem_strbuf_new(wmem_epan_scope(), "Aircraft atmosphere");
xplane_data_lookup_table[6][1] = wmem_strbuf_new(wmem_epan_scope(), "Atmospheric Pressure (inHG)");
xplane_data_lookup_table[6][2] = wmem_strbuf_new(wmem_epan_scope(), "Atmospheric Temperature (degC)");
xplane_data_lookup_table[6][3] = wmem_strbuf_new(wmem_epan_scope(), "LE temp (degC)");
xplane_data_lookup_table[6][4] = wmem_strbuf_new(wmem_epan_scope(), "Aircraft Density Ratio");
xplane_data_lookup_table[6][5] = wmem_strbuf_new(wmem_epan_scope(), "A (ktas)");
xplane_data_lookup_table[6][6] = wmem_strbuf_new(wmem_epan_scope(), "Q Dynamic pressue (lbs / ft^2)");
xplane_data_lookup_table[6][7] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[6][8] = wmem_strbuf_new(wmem_epan_scope(), "Gravitational Force (feet/s^2)");
xplane_data_lookup_table[7][0] = wmem_strbuf_new(wmem_epan_scope(), "System pressures");
xplane_data_lookup_table[7][1] = wmem_strbuf_new(wmem_epan_scope(), "Barometric pressure (inHG)");
xplane_data_lookup_table[7][2] = wmem_strbuf_new(wmem_epan_scope(), "edens (part)");
xplane_data_lookup_table[7][3] = wmem_strbuf_new(wmem_epan_scope(), "Vacuum ratio");
xplane_data_lookup_table[7][4] = wmem_strbuf_new(wmem_epan_scope(), "Vacuum ratio");
xplane_data_lookup_table[7][5] = wmem_strbuf_new(wmem_epan_scope(), "Elec ratio");
xplane_data_lookup_table[7][6] = wmem_strbuf_new(wmem_epan_scope(), "Elec ratio");
xplane_data_lookup_table[7][7] = wmem_strbuf_new(wmem_epan_scope(), "AHRS ratio");
xplane_data_lookup_table[7][8] = wmem_strbuf_new(wmem_epan_scope(), "AHRS ratio");
xplane_data_lookup_table[8][0] = wmem_strbuf_new(wmem_epan_scope(), "Joystick aileron/elevator/rudder");
xplane_data_lookup_table[8][1] = wmem_strbuf_new(wmem_epan_scope(), "Elevator Full down = -1 Full Up = +1");
xplane_data_lookup_table[8][2] = wmem_strbuf_new(wmem_epan_scope(), "Aileron Full Left = -1 Full Right = +1");
xplane_data_lookup_table[8][3] = wmem_strbuf_new(wmem_epan_scope(), "Rudder Full Left = -1 Full Right = +1");
xplane_data_lookup_table[8][4] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[8][5] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[8][6] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[8][7] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[8][8] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[9][0] = wmem_strbuf_new(wmem_epan_scope(), "Other Flight Controls");
xplane_data_lookup_table[9][1] = wmem_strbuf_new(wmem_epan_scope(), "Requested Thrust Vectoring");
xplane_data_lookup_table[9][2] = wmem_strbuf_new(wmem_epan_scope(), "Requested Wing Sweep");
xplane_data_lookup_table[9][3] = wmem_strbuf_new(wmem_epan_scope(), "Requested Wing Incidence");
xplane_data_lookup_table[9][4] = wmem_strbuf_new(wmem_epan_scope(), "Requested Wing Digedral");
xplane_data_lookup_table[9][5] = wmem_strbuf_new(wmem_epan_scope(), "Requested Wing Retration");
xplane_data_lookup_table[9][6] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[9][7] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[9][8] = wmem_strbuf_new(wmem_epan_scope(), "Water Jettisoned");
xplane_data_lookup_table[10][0] = wmem_strbuf_new(wmem_epan_scope(), "Artificial Stability Input");
xplane_data_lookup_table[10][1] = wmem_strbuf_new(wmem_epan_scope(), "Elevator Full down = -1 Full Up = +1");
xplane_data_lookup_table[10][2] = wmem_strbuf_new(wmem_epan_scope(), "Aileron Full Left = -1 Full Right = +1");
xplane_data_lookup_table[10][3] = wmem_strbuf_new(wmem_epan_scope(), "Rudder Full Left = -1 Full Right = +1");
xplane_data_lookup_table[10][4] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[10][5] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[10][6] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[10][7] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[10][8] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[11][0] = wmem_strbuf_new(wmem_epan_scope(), "Flight Control Deflections");
xplane_data_lookup_table[11][1] = wmem_strbuf_new(wmem_epan_scope(), "Elevator Full down = -1 Full Up = +1");
xplane_data_lookup_table[11][2] = wmem_strbuf_new(wmem_epan_scope(), "Aileron Full Left = -1 Full Right = +1");
xplane_data_lookup_table[11][3] = wmem_strbuf_new(wmem_epan_scope(), "Rudder Full Left = -1 Full Right = +1");
xplane_data_lookup_table[11][4] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[11][5] = wmem_strbuf_new(wmem_epan_scope(), "Nosewheel Degrees from forward. Negative = left, Positive = right");
xplane_data_lookup_table[11][6] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[11][7] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[11][8] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[12][0] = wmem_strbuf_new(wmem_epan_scope(), "Wing sweep and thrust vectoring");
xplane_data_lookup_table[12][1] = wmem_strbuf_new(wmem_epan_scope(), "Sweep 1 (degrees back from normal)");
xplane_data_lookup_table[12][2] = wmem_strbuf_new(wmem_epan_scope(), "Sweep 1 (degrees back from normal)");
xplane_data_lookup_table[12][3] = wmem_strbuf_new(wmem_epan_scope(), "Sweep (degrees back from normal)");
xplane_data_lookup_table[12][4] = wmem_strbuf_new(wmem_epan_scope(), "Vector Ratio");
xplane_data_lookup_table[12][5] = wmem_strbuf_new(wmem_epan_scope(), "Sweep ratio (to fully forward)");
xplane_data_lookup_table[12][6] = wmem_strbuf_new(wmem_epan_scope(), "Incidence ratio (to fully angled)");
xplane_data_lookup_table[12][7] = wmem_strbuf_new(wmem_epan_scope(), "Dihedral ratio (to fulyl angled)");
xplane_data_lookup_table[12][8] = wmem_strbuf_new(wmem_epan_scope(), "Retraction ratio (to fully angled)");
xplane_data_lookup_table[13][0] = wmem_strbuf_new(wmem_epan_scope(), "Trim / flaps / Slats / Speedbrakes");
xplane_data_lookup_table[13][1] = wmem_strbuf_new(wmem_epan_scope(), "Elevator trim");
xplane_data_lookup_table[13][2] = wmem_strbuf_new(wmem_epan_scope(), "Aileron trim");
xplane_data_lookup_table[13][3] = wmem_strbuf_new(wmem_epan_scope(), "Rudder trim");
xplane_data_lookup_table[13][4] = wmem_strbuf_new(wmem_epan_scope(), "Flap Requested (0->1)");
xplane_data_lookup_table[13][5] = wmem_strbuf_new(wmem_epan_scope(), "Flap Ratio (0->1)");
xplane_data_lookup_table[13][6] = wmem_strbuf_new(wmem_epan_scope(), "Slat Ratio");
xplane_data_lookup_table[13][7] = wmem_strbuf_new(wmem_epan_scope(), "Speedbrake Requested (0->1)");
xplane_data_lookup_table[13][8] = wmem_strbuf_new(wmem_epan_scope(), "Speedbrake Ratio (0->1)");
xplane_data_lookup_table[14][0] = wmem_strbuf_new(wmem_epan_scope(), "Gear and Brakes");
xplane_data_lookup_table[14][1] = wmem_strbuf_new(wmem_epan_scope(), "Gear Requested (0->1)");
xplane_data_lookup_table[14][2] = wmem_strbuf_new(wmem_epan_scope(), "wbrak, set");
xplane_data_lookup_table[14][3] = wmem_strbuf_new(wmem_epan_scope(), "Left Toe Brake requested");
xplane_data_lookup_table[14][4] = wmem_strbuf_new(wmem_epan_scope(), "Right Toe Brake requested");
xplane_data_lookup_table[14][5] = wmem_strbuf_new(wmem_epan_scope(), "wbrak, position");
xplane_data_lookup_table[14][6] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[14][7] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[14][8] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[15][0] = wmem_strbuf_new(wmem_epan_scope(), "Angular Moments");
xplane_data_lookup_table[15][1] = wmem_strbuf_new(wmem_epan_scope(), "M Roll Torque around X-axis (foot / lbs)");
xplane_data_lookup_table[15][2] = wmem_strbuf_new(wmem_epan_scope(), "L Roll Torque around Z-axis (foot / lbs)");
xplane_data_lookup_table[15][3] = wmem_strbuf_new(wmem_epan_scope(), "N Roll Torque around Y-axis (foot / lbs)");
xplane_data_lookup_table[15][4] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[15][5] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[15][6] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[15][7] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[15][8] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[16][0] = wmem_strbuf_new(wmem_epan_scope(), "Angular Velocities");
xplane_data_lookup_table[16][1] = wmem_strbuf_new(wmem_epan_scope(), "Q Pitch Rate (measued in Body-axes)");
xplane_data_lookup_table[16][2] = wmem_strbuf_new(wmem_epan_scope(), "P Roll Rate (measued in Body-axes)");
xplane_data_lookup_table[16][3] = wmem_strbuf_new(wmem_epan_scope(), "R Yaw Rate (measued in Body-axes)");
xplane_data_lookup_table[16][5] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[16][6] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[16][7] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[16][8] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[16][4] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[17][0] = wmem_strbuf_new(wmem_epan_scope(), "Pitch / Roll / Headings");
xplane_data_lookup_table[17][1] = wmem_strbuf_new(wmem_epan_scope(), "Pitch degrees (measured in body-axis Euler angles)");
xplane_data_lookup_table[17][2] = wmem_strbuf_new(wmem_epan_scope(), "Roll degrees (measured in body-axis Euler angles)");
xplane_data_lookup_table[17][3] = wmem_strbuf_new(wmem_epan_scope(), "True Heading (degrees)");
xplane_data_lookup_table[17][4] = wmem_strbuf_new(wmem_epan_scope(), "Magnetic Heading (degrees)");
xplane_data_lookup_table[17][5] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[17][6] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[17][7] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[17][8] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[18][0] = wmem_strbuf_new(wmem_epan_scope(), "Angle Of Attack, sideslip, paths");
xplane_data_lookup_table[18][1] = wmem_strbuf_new(wmem_epan_scope(), "Alpha - AoA (degrees)");
xplane_data_lookup_table[18][2] = wmem_strbuf_new(wmem_epan_scope(), "Beta slideslip (degrees)");
xplane_data_lookup_table[18][3] = wmem_strbuf_new(wmem_epan_scope(), "HPath (degrees)");
xplane_data_lookup_table[18][4] = wmem_strbuf_new(wmem_epan_scope(), "VPath (degrees)");
xplane_data_lookup_table[18][5] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[18][6] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[18][7] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[18][8] = wmem_strbuf_new(wmem_epan_scope(), "slip, degrees");
xplane_data_lookup_table[19][0] = wmem_strbuf_new(wmem_epan_scope(), "Magnetic Compass");
xplane_data_lookup_table[19][1] = wmem_strbuf_new(wmem_epan_scope(), "Magnetic Heading");
xplane_data_lookup_table[19][2] = wmem_strbuf_new(wmem_epan_scope(), "Magnetic Variation (from True)");
xplane_data_lookup_table[19][3] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[19][4] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[19][5] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[19][6] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[19][7] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[19][8] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[20][0] = wmem_strbuf_new(wmem_epan_scope(), "Global Position");
xplane_data_lookup_table[20][1] = wmem_strbuf_new(wmem_epan_scope(), "Latitude");
xplane_data_lookup_table[20][2] = wmem_strbuf_new(wmem_epan_scope(), "Longitude");
xplane_data_lookup_table[20][3] = wmem_strbuf_new(wmem_epan_scope(), "Altitude (ft above mean sea level)");
xplane_data_lookup_table[20][4] = wmem_strbuf_new(wmem_epan_scope(), "Altitude (ft above ground)");
xplane_data_lookup_table[20][5] = wmem_strbuf_new(wmem_epan_scope(), "Is On Runway?");
xplane_data_lookup_table[20][6] = wmem_strbuf_new(wmem_epan_scope(), "Indicated Altitude");
xplane_data_lookup_table[20][7] = wmem_strbuf_new(wmem_epan_scope(), "Latitude (bottom of containing Lat/Long scenery square)");
xplane_data_lookup_table[20][8] = wmem_strbuf_new(wmem_epan_scope(), "Longitude (left of containing Lat/Long scenery square)");
xplane_data_lookup_table[21][0] = wmem_strbuf_new(wmem_epan_scope(), "Distances Travelled");
xplane_data_lookup_table[21][1] = wmem_strbuf_new(wmem_epan_scope(), "X - relative to inertial axes");
xplane_data_lookup_table[21][2] = wmem_strbuf_new(wmem_epan_scope(), "Y - relative to inertial axes");
xplane_data_lookup_table[21][3] = wmem_strbuf_new(wmem_epan_scope(), "Z - relative to inertial axes");
xplane_data_lookup_table[21][4] = wmem_strbuf_new(wmem_epan_scope(), "vX (m/s) - relative to inertial axes");
xplane_data_lookup_table[21][5] = wmem_strbuf_new(wmem_epan_scope(), "vY (m/s) - relative to inertial axes");
xplane_data_lookup_table[21][6] = wmem_strbuf_new(wmem_epan_scope(), "vZ (m/s) - relative to inertial axes");
xplane_data_lookup_table[21][7] = wmem_strbuf_new(wmem_epan_scope(), "Distance (feet)");
xplane_data_lookup_table[21][8] = wmem_strbuf_new(wmem_epan_scope(), "Distance (nm)");
xplane_data_lookup_table[22][0] = wmem_strbuf_new(wmem_epan_scope(), "All Planes Latitude (A = User Aircraft)");
xplane_data_lookup_table[23][0] = wmem_strbuf_new(wmem_epan_scope(), "All Planes Longitude (A = User Aircraft)");
xplane_data_lookup_table[24][0] = wmem_strbuf_new(wmem_epan_scope(), "All Planes Altitude (feet above mean sea level) (A = User Aircraft)");
xplane_data_lookup_table[25][0] = wmem_strbuf_new(wmem_epan_scope(), "Throttle - Requested");
xplane_data_lookup_table[26][0] = wmem_strbuf_new(wmem_epan_scope(), "Throttle - Actual");
xplane_data_lookup_table[27][0] = wmem_strbuf_new(wmem_epan_scope(), "Engine Mode (0=Feather, 1=Normal, 2-Beta and 3=Reverse)");
xplane_data_lookup_table[28][0] = wmem_strbuf_new(wmem_epan_scope(), "Propeller setting");
xplane_data_lookup_table[29][0] = wmem_strbuf_new(wmem_epan_scope(), "Mixture setting");
xplane_data_lookup_table[30][0] = wmem_strbuf_new(wmem_epan_scope(), "Carb heat");
xplane_data_lookup_table[31][0] = wmem_strbuf_new(wmem_epan_scope(), "Cowl flaps");
xplane_data_lookup_table[32][0] = wmem_strbuf_new(wmem_epan_scope(), "Magnetos");
xplane_data_lookup_table[33][0] = wmem_strbuf_new(wmem_epan_scope(), "Starter timeout");
xplane_data_lookup_table[34][0] = wmem_strbuf_new(wmem_epan_scope(), "Engine power");
xplane_data_lookup_table[35][0] = wmem_strbuf_new(wmem_epan_scope(), "Engine thrust");
xplane_data_lookup_table[36][0] = wmem_strbuf_new(wmem_epan_scope(), "Engine torque");
xplane_data_lookup_table[37][0] = wmem_strbuf_new(wmem_epan_scope(), "Engine RPM");
xplane_data_lookup_table[38][0] = wmem_strbuf_new(wmem_epan_scope(), "Propeller RPM");
xplane_data_lookup_table[39][0] = wmem_strbuf_new(wmem_epan_scope(), "Propeller Pitch");
xplane_data_lookup_table[40][0] = wmem_strbuf_new(wmem_epan_scope(), "Engine Wash");
xplane_data_lookup_table[41][0] = wmem_strbuf_new(wmem_epan_scope(), "N1");
xplane_data_lookup_table[42][0] = wmem_strbuf_new(wmem_epan_scope(), "N2");
xplane_data_lookup_table[43][0] = wmem_strbuf_new(wmem_epan_scope(), "Manifold pressure");
xplane_data_lookup_table[44][0] = wmem_strbuf_new(wmem_epan_scope(), "EPR");
xplane_data_lookup_table[45][0] = wmem_strbuf_new(wmem_epan_scope(), "Fuel Flow");
xplane_data_lookup_table[46][0] = wmem_strbuf_new(wmem_epan_scope(), "ITT");
xplane_data_lookup_table[47][0] = wmem_strbuf_new(wmem_epan_scope(), "EGT");
xplane_data_lookup_table[48][0] = wmem_strbuf_new(wmem_epan_scope(), "CHT");
xplane_data_lookup_table[49][0] = wmem_strbuf_new(wmem_epan_scope(), "Oil pressure");
xplane_data_lookup_table[50][0] = wmem_strbuf_new(wmem_epan_scope(), "Oil temperature");
xplane_data_lookup_table[51][0] = wmem_strbuf_new(wmem_epan_scope(), "Fuel pressure");
xplane_data_lookup_table[52][0] = wmem_strbuf_new(wmem_epan_scope(), "Generator amps");
xplane_data_lookup_table[53][0] = wmem_strbuf_new(wmem_epan_scope(), "Battery amps");
xplane_data_lookup_table[54][0] = wmem_strbuf_new(wmem_epan_scope(), "Battery volts");
xplane_data_lookup_table[55][0] = wmem_strbuf_new(wmem_epan_scope(), "Electric fuel pump on/off");
xplane_data_lookup_table[56][0] = wmem_strbuf_new(wmem_epan_scope(), "Idle speed low/high");
xplane_data_lookup_table[57][0] = wmem_strbuf_new(wmem_epan_scope(), "Battery on/off");
xplane_data_lookup_table[58][0] = wmem_strbuf_new(wmem_epan_scope(), "Generator on/off");
xplane_data_lookup_table[59][0] = wmem_strbuf_new(wmem_epan_scope(), "Inverter on/off");
xplane_data_lookup_table[60][0] = wmem_strbuf_new(wmem_epan_scope(), "FADEC on/off");
xplane_data_lookup_table[61][0] = wmem_strbuf_new(wmem_epan_scope(), "Igniter on/off");
xplane_data_lookup_table[62][0] = wmem_strbuf_new(wmem_epan_scope(), "Fuel weights");
for (gint i = 22; i <= 62; i++)
{
for (gint j = 1; j <= 8; j++)
{
xplane_data_lookup_table[i][j] = wmem_strbuf_new(wmem_epan_scope(), "");
}
}
xplane_data_lookup_table[63][0] = wmem_strbuf_new(wmem_epan_scope(), "Aircraft Payload (lbs) and Centre of Gravity");
xplane_data_lookup_table[63][1] = wmem_strbuf_new(wmem_epan_scope(), "Weight Empty");
xplane_data_lookup_table[63][2] = wmem_strbuf_new(wmem_epan_scope(), "Weight Total");
xplane_data_lookup_table[63][3] = wmem_strbuf_new(wmem_epan_scope(), "Fuel Total");
xplane_data_lookup_table[63][4] = wmem_strbuf_new(wmem_epan_scope(), "Weight Jettisonable");
xplane_data_lookup_table[63][5] = wmem_strbuf_new(wmem_epan_scope(), "Weight Current");
xplane_data_lookup_table[63][6] = wmem_strbuf_new(wmem_epan_scope(), "Weight Maximum");
xplane_data_lookup_table[63][7] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[63][8] = wmem_strbuf_new(wmem_epan_scope(), "CoG (feet behind reference point)");
xplane_data_lookup_table[64][0] = wmem_strbuf_new(wmem_epan_scope(), "Aerodynamic Forces");
xplane_data_lookup_table[64][1] = wmem_strbuf_new(wmem_epan_scope(), "Lift (lbs)");
xplane_data_lookup_table[64][2] = wmem_strbuf_new(wmem_epan_scope(), "Drag (lbs)");
xplane_data_lookup_table[64][3] = wmem_strbuf_new(wmem_epan_scope(), "Side (lbs)");
xplane_data_lookup_table[64][4] = wmem_strbuf_new(wmem_epan_scope(), "L (ft / lbs)");
xplane_data_lookup_table[64][5] = wmem_strbuf_new(wmem_epan_scope(), "M (ft / lbs)");
xplane_data_lookup_table[64][6] = wmem_strbuf_new(wmem_epan_scope(), "N (ft / lbs)");
xplane_data_lookup_table[64][7] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[64][8] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[65][0] = wmem_strbuf_new(wmem_epan_scope(), "Engine Forces");
xplane_data_lookup_table[65][1] = wmem_strbuf_new(wmem_epan_scope(), "Normal (lbs)");
xplane_data_lookup_table[65][2] = wmem_strbuf_new(wmem_epan_scope(), "Axial (lbs)");
xplane_data_lookup_table[65][3] = wmem_strbuf_new(wmem_epan_scope(), "Side (lbs)");
xplane_data_lookup_table[65][4] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[65][5] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[65][6] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[65][7] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[65][8] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[66][0] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear Vertical Forces (lbs)");
xplane_data_lookup_table[66][1] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear 1 (typically nosewheel)");
xplane_data_lookup_table[66][2] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear 2");
xplane_data_lookup_table[66][3] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear 3");
xplane_data_lookup_table[66][4] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear 4");
xplane_data_lookup_table[66][5] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear 5");
xplane_data_lookup_table[66][6] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear 6");
xplane_data_lookup_table[66][7] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear 7");
xplane_data_lookup_table[66][8] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear 8");
xplane_data_lookup_table[67][0] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear Deployment Ratio (0=Up, 1=Down)");
xplane_data_lookup_table[67][1] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear 1 (typically nosewheel)");
xplane_data_lookup_table[67][2] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear 2");
xplane_data_lookup_table[67][3] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear 3");
xplane_data_lookup_table[67][4] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear 4");
xplane_data_lookup_table[67][5] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear 5");
xplane_data_lookup_table[67][6] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear 6");
xplane_data_lookup_table[67][7] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear 7");
xplane_data_lookup_table[67][8] = wmem_strbuf_new(wmem_epan_scope(), "Landing Gear 8");
xplane_data_lookup_table[68][0] = wmem_strbuf_new(wmem_epan_scope(), "Lift over drag and coefficients");
xplane_data_lookup_table[68][1] = wmem_strbuf_new(wmem_epan_scope(), "Lift/Drag Ratio");
xplane_data_lookup_table[68][2] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[68][3] = wmem_strbuf_new(wmem_epan_scope(), "cl, total");
xplane_data_lookup_table[68][4] = wmem_strbuf_new(wmem_epan_scope(), "cd, total");
xplane_data_lookup_table[68][5] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[68][6] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[68][7] = wmem_strbuf_new(wmem_epan_scope(), "");
xplane_data_lookup_table[68][8] = wmem_strbuf_new(wmem_epan_scope(), "Lift/Drag (*etaP)");
xplane_data_lookup_table[69][0] = wmem_strbuf_new(wmem_epan_scope(), "Propeller Efficiency");
for (gint i = 1; i <= 8; i++)
{
xplane_data_lookup_table[69][i] = wmem_strbuf_new(wmem_epan_scope(), "");
}
xplane_data_lookup_table[70][0] = wmem_strbuf_new(wmem_epan_scope(), "Aileron deflections 1");
xplane_data_lookup_table[71][0] = wmem_strbuf_new(wmem_epan_scope(), "Aileron deflections 2");
xplane_data_lookup_table[72][0] = wmem_strbuf_new(wmem_epan_scope(), "Roll spoiler deflections 1");
xplane_data_lookup_table[73][0] = wmem_strbuf_new(wmem_epan_scope(), "Roll spoiler deflections 2");
xplane_data_lookup_table[74][0] = wmem_strbuf_new(wmem_epan_scope(), "Elevator Deflections (degrees)");
xplane_data_lookup_table[75][0] = wmem_strbuf_new(wmem_epan_scope(), "Rudder deflections");
xplane_data_lookup_table[76][0] = wmem_strbuf_new(wmem_epan_scope(), "Yaw and brake deflections");
for (guint i = 1; i <= 7; i += 2)
{
xplane_data_lookup_table[70][i] = wmem_strbuf_new(wmem_epan_scope(), "Left Aileron");
wmem_strbuf_append_printf(xplane_data_lookup_table[70][i], " %u", i / 2);
xplane_data_lookup_table[71][i] = wmem_strbuf_new(wmem_epan_scope(), "Left Aileron");
wmem_strbuf_append_printf(xplane_data_lookup_table[71][i], " %u", (i / 2) + 4);
xplane_data_lookup_table[72][i] = wmem_strbuf_new(wmem_epan_scope(), "Left Roll spoiler ");
wmem_strbuf_append_printf(xplane_data_lookup_table[72][i], " %u", (i / 2));
xplane_data_lookup_table[73][i] = wmem_strbuf_new(wmem_epan_scope(), "Left Roll spoiler ");
wmem_strbuf_append_printf(xplane_data_lookup_table[73][i], " %u", (i / 2) + 4);
xplane_data_lookup_table[74][i] = wmem_strbuf_new(wmem_epan_scope(), "Left Elevator ");
wmem_strbuf_append_printf(xplane_data_lookup_table[74][i], " %u", (i / 2));
xplane_data_lookup_table[75][i] = wmem_strbuf_new(wmem_epan_scope(), "Left Rudder ");
wmem_strbuf_append_printf(xplane_data_lookup_table[75][i], " %u", (i / 2));
xplane_data_lookup_table[76][i] = wmem_strbuf_new(wmem_epan_scope(), "Left Yaw Brake ");
wmem_strbuf_append_printf(xplane_data_lookup_table[76][i], " %u", (i / 2));
}
for (guint i = 2; i <= 8; i += 2)