/
Jnx.Bonds.Pts.Ouch.v1.4.Script.Dissector.lua
2731 lines (2122 loc) · 108 KB
/
Jnx.Bonds.Pts.Ouch.v1.4.Script.Dissector.lua
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
-----------------------------------------------------------------------
-- Lua Script Wireshark Dissector
--
-- Please see end of file for rules and regulations
-----------------------------------------------------------------------
-- Jnx Bonds Pts Ouch 1.4 Protocol
local jnx_bonds_pts_ouch_v1_4 = Proto("Jnx.Bonds.Pts.Ouch.v1.4.Lua", "Jnx Bonds Pts Ouch 1.4")
-- Component Tables
local show = {}
local format = {}
local jnx_bonds_pts_ouch_v1_4_display = {}
local jnx_bonds_pts_ouch_v1_4_dissect = {}
local jnx_bonds_pts_ouch_v1_4_size_of = {}
local verify = {}
local translate = {}
-----------------------------------------------------------------------
-- Declare Protocol Fields
-----------------------------------------------------------------------
-- Jnx Bonds Pts Ouch 1.4 Fields
jnx_bonds_pts_ouch_v1_4.fields.buy_sell_indicator = ProtoField.new("Buy Sell Indicator", "jnx.bonds.pts.ouch.v1.4.buysellindicator", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.cancel_order_message = ProtoField.new("Cancel Order Message", "jnx.bonds.pts.ouch.v1.4.cancelordermessage", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.capacity = ProtoField.new("Capacity", "jnx.bonds.pts.ouch.v1.4.capacity", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.cash_margin_type = ProtoField.new("Cash Margin Type", "jnx.bonds.pts.ouch.v1.4.cashmargintype", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.client_reference = ProtoField.new("Client Reference", "jnx.bonds.pts.ouch.v1.4.clientreference", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.counter_party = ProtoField.new("Counter Party", "jnx.bonds.pts.ouch.v1.4.counterparty", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.debug_packet = ProtoField.new("Debug Packet", "jnx.bonds.pts.ouch.v1.4.debugpacket", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.decrement_quantity = ProtoField.new("Decrement Quantity", "jnx.bonds.pts.ouch.v1.4.decrementquantity", ftypes.UINT32)
jnx_bonds_pts_ouch_v1_4.fields.display = ProtoField.new("Display", "jnx.bonds.pts.ouch.v1.4.display", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.enter_order_message = ProtoField.new("Enter Order Message", "jnx.bonds.pts.ouch.v1.4.enterordermessage", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.executed_quantity = ProtoField.new("Executed Quantity", "jnx.bonds.pts.ouch.v1.4.executedquantity", ftypes.UINT32)
jnx_bonds_pts_ouch_v1_4.fields.execution_price = ProtoField.new("Execution Price", "jnx.bonds.pts.ouch.v1.4.executionprice", ftypes.DOUBLE)
jnx_bonds_pts_ouch_v1_4.fields.existing_order_token = ProtoField.new("Existing Order Token", "jnx.bonds.pts.ouch.v1.4.existingordertoken", ftypes.UINT32)
jnx_bonds_pts_ouch_v1_4.fields.firm_id = ProtoField.new("Firm Id", "jnx.bonds.pts.ouch.v1.4.firmid", ftypes.UINT32)
jnx_bonds_pts_ouch_v1_4.fields.group = ProtoField.new("Group", "jnx.bonds.pts.ouch.v1.4.group", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.liquidity_indicator = ProtoField.new("Liquidity Indicator", "jnx.bonds.pts.ouch.v1.4.liquidityindicator", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.login_accepted_packet = ProtoField.new("Login Accepted Packet", "jnx.bonds.pts.ouch.v1.4.loginacceptedpacket", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.login_rejected_packet = ProtoField.new("Login Rejected Packet", "jnx.bonds.pts.ouch.v1.4.loginrejectedpacket", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.login_request_packet = ProtoField.new("Login Request Packet", "jnx.bonds.pts.ouch.v1.4.loginrequestpacket", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.match_number = ProtoField.new("Match Number", "jnx.bonds.pts.ouch.v1.4.matchnumber", ftypes.UINT64)
jnx_bonds_pts_ouch_v1_4.fields.minimum_quantity = ProtoField.new("Minimum Quantity", "jnx.bonds.pts.ouch.v1.4.minimumquantity", ftypes.UINT32)
jnx_bonds_pts_ouch_v1_4.fields.order_accepted_message = ProtoField.new("Order Accepted Message", "jnx.bonds.pts.ouch.v1.4.orderacceptedmessage", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.order_aiq_canceled_message = ProtoField.new("Order Aiq Canceled Message", "jnx.bonds.pts.ouch.v1.4.orderaiqcanceledmessage", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.order_canceled_message = ProtoField.new("Order Canceled Message", "jnx.bonds.pts.ouch.v1.4.ordercanceledmessage", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.order_canceled_reason = ProtoField.new("Order Canceled Reason", "jnx.bonds.pts.ouch.v1.4.ordercanceledreason", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.order_classification = ProtoField.new("Order Classification", "jnx.bonds.pts.ouch.v1.4.orderclassification", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.order_executed_with_counter_party_message = ProtoField.new("Order Executed With Counter Party Message", "jnx.bonds.pts.ouch.v1.4.orderexecutedwithcounterpartymessage", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.order_number = ProtoField.new("Order Number", "jnx.bonds.pts.ouch.v1.4.ordernumber", ftypes.UINT64)
jnx_bonds_pts_ouch_v1_4.fields.order_rejected_message = ProtoField.new("Order Rejected Message", "jnx.bonds.pts.ouch.v1.4.orderrejectedmessage", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.order_rejected_reason = ProtoField.new("Order Rejected Reason", "jnx.bonds.pts.ouch.v1.4.orderrejectedreason", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.order_replaced_message = ProtoField.new("Order Replaced Message", "jnx.bonds.pts.ouch.v1.4.orderreplacedmessage", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.order_state = ProtoField.new("Order State", "jnx.bonds.pts.ouch.v1.4.orderstate", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.order_token = ProtoField.new("Order Token", "jnx.bonds.pts.ouch.v1.4.ordertoken", ftypes.UINT32)
jnx_bonds_pts_ouch_v1_4.fields.orderbook_id = ProtoField.new("Orderbook Id", "jnx.bonds.pts.ouch.v1.4.orderbookid", ftypes.UINT32)
jnx_bonds_pts_ouch_v1_4.fields.packet = ProtoField.new("Packet", "jnx.bonds.pts.ouch.v1.4.packet", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.packet_header = ProtoField.new("Packet Header", "jnx.bonds.pts.ouch.v1.4.packetheader", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.packet_length = ProtoField.new("Packet Length", "jnx.bonds.pts.ouch.v1.4.packetlength", ftypes.UINT16)
jnx_bonds_pts_ouch_v1_4.fields.packet_type = ProtoField.new("Packet Type", "jnx.bonds.pts.ouch.v1.4.packettype", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.password = ProtoField.new("Password", "jnx.bonds.pts.ouch.v1.4.password", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.payload = ProtoField.new("Payload", "jnx.bonds.pts.ouch.v1.4.payload", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.previous_order_token = ProtoField.new("Previous Order Token", "jnx.bonds.pts.ouch.v1.4.previousordertoken", ftypes.UINT32)
jnx_bonds_pts_ouch_v1_4.fields.price = ProtoField.new("Price", "jnx.bonds.pts.ouch.v1.4.price", ftypes.DOUBLE)
jnx_bonds_pts_ouch_v1_4.fields.quantity = ProtoField.new("Quantity", "jnx.bonds.pts.ouch.v1.4.quantity", ftypes.UINT32)
jnx_bonds_pts_ouch_v1_4.fields.quantity_prevented_from_trading = ProtoField.new("Quantity Prevented From Trading", "jnx.bonds.pts.ouch.v1.4.quantitypreventedfromtrading", ftypes.UINT32)
jnx_bonds_pts_ouch_v1_4.fields.reject_reason_code = ProtoField.new("Reject Reason Code", "jnx.bonds.pts.ouch.v1.4.rejectreasoncode", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.replace_order_message = ProtoField.new("Replace Order Message", "jnx.bonds.pts.ouch.v1.4.replaceordermessage", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.replacement_order_token = ProtoField.new("Replacement Order Token", "jnx.bonds.pts.ouch.v1.4.replacementordertoken", ftypes.UINT32)
jnx_bonds_pts_ouch_v1_4.fields.requested_sequence_number = ProtoField.new("Requested Sequence Number", "jnx.bonds.pts.ouch.v1.4.requestedsequencenumber", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.requested_session = ProtoField.new("Requested Session", "jnx.bonds.pts.ouch.v1.4.requestedsession", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.sequence_number = ProtoField.new("Sequence Number", "jnx.bonds.pts.ouch.v1.4.sequencenumber", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.sequenced_data_packet = ProtoField.new("Sequenced Data Packet", "jnx.bonds.pts.ouch.v1.4.sequenceddatapacket", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.sequenced_message = ProtoField.new("Sequenced Message", "jnx.bonds.pts.ouch.v1.4.sequencedmessage", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.sequenced_message_type = ProtoField.new("Sequenced Message Type", "jnx.bonds.pts.ouch.v1.4.sequencedmessagetype", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.session = ProtoField.new("Session", "jnx.bonds.pts.ouch.v1.4.session", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.soup_bin_tcp_packet = ProtoField.new("Soup Bin Tcp Packet", "jnx.bonds.pts.ouch.v1.4.soupbintcppacket", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.system_event = ProtoField.new("System Event", "jnx.bonds.pts.ouch.v1.4.systemevent", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.system_event_message = ProtoField.new("System Event Message", "jnx.bonds.pts.ouch.v1.4.systemeventmessage", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.text = ProtoField.new("Text", "jnx.bonds.pts.ouch.v1.4.text", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.time_in_force = ProtoField.new("Time In Force", "jnx.bonds.pts.ouch.v1.4.timeinforce", ftypes.UINT32)
jnx_bonds_pts_ouch_v1_4.fields.timestamp = ProtoField.new("Timestamp", "jnx.bonds.pts.ouch.v1.4.timestamp", ftypes.UINT64)
jnx_bonds_pts_ouch_v1_4.fields.unsequenced_data_packet = ProtoField.new("Unsequenced Data Packet", "jnx.bonds.pts.ouch.v1.4.unsequenceddatapacket", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.unsequenced_message = ProtoField.new("Unsequenced Message", "jnx.bonds.pts.ouch.v1.4.unsequencedmessage", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.unsequenced_message_type = ProtoField.new("Unsequenced Message Type", "jnx.bonds.pts.ouch.v1.4.unsequencedmessagetype", ftypes.STRING)
jnx_bonds_pts_ouch_v1_4.fields.username = ProtoField.new("Username", "jnx.bonds.pts.ouch.v1.4.username", ftypes.STRING)
-----------------------------------------------------------------------
-- Declare Dissection Options
-----------------------------------------------------------------------
-- Jnx Bonds Pts Ouch 1.4 Element Dissection Options
show.cancel_order_message = true
show.debug_packet = true
show.enter_order_message = true
show.login_accepted_packet = true
show.login_rejected_packet = true
show.login_request_packet = true
show.order_accepted_message = true
show.order_aiq_canceled_message = true
show.order_canceled_message = true
show.order_executed_with_counter_party_message = true
show.order_rejected_message = true
show.order_replaced_message = true
show.packet = true
show.packet_header = true
show.replace_order_message = true
show.sequenced_data_packet = true
show.soup_bin_tcp_packet = true
show.system_event_message = true
show.unsequenced_data_packet = true
show.payload = false
show.sequenced_message = false
show.unsequenced_message = false
-- Register Jnx Bonds Pts Ouch 1.4 Show Options
jnx_bonds_pts_ouch_v1_4.prefs.show_cancel_order_message = Pref.bool("Show Cancel Order Message", show.cancel_order_message, "Parse and add Cancel Order Message to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_debug_packet = Pref.bool("Show Debug Packet", show.debug_packet, "Parse and add Debug Packet to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_enter_order_message = Pref.bool("Show Enter Order Message", show.enter_order_message, "Parse and add Enter Order Message to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_login_accepted_packet = Pref.bool("Show Login Accepted Packet", show.login_accepted_packet, "Parse and add Login Accepted Packet to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_login_rejected_packet = Pref.bool("Show Login Rejected Packet", show.login_rejected_packet, "Parse and add Login Rejected Packet to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_login_request_packet = Pref.bool("Show Login Request Packet", show.login_request_packet, "Parse and add Login Request Packet to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_order_accepted_message = Pref.bool("Show Order Accepted Message", show.order_accepted_message, "Parse and add Order Accepted Message to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_order_aiq_canceled_message = Pref.bool("Show Order Aiq Canceled Message", show.order_aiq_canceled_message, "Parse and add Order Aiq Canceled Message to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_order_canceled_message = Pref.bool("Show Order Canceled Message", show.order_canceled_message, "Parse and add Order Canceled Message to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_order_executed_with_counter_party_message = Pref.bool("Show Order Executed With Counter Party Message", show.order_executed_with_counter_party_message, "Parse and add Order Executed With Counter Party Message to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_order_rejected_message = Pref.bool("Show Order Rejected Message", show.order_rejected_message, "Parse and add Order Rejected Message to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_order_replaced_message = Pref.bool("Show Order Replaced Message", show.order_replaced_message, "Parse and add Order Replaced Message to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_packet = Pref.bool("Show Packet", show.packet, "Parse and add Packet to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_packet_header = Pref.bool("Show Packet Header", show.packet_header, "Parse and add Packet Header to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_replace_order_message = Pref.bool("Show Replace Order Message", show.replace_order_message, "Parse and add Replace Order Message to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_sequenced_data_packet = Pref.bool("Show Sequenced Data Packet", show.sequenced_data_packet, "Parse and add Sequenced Data Packet to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_soup_bin_tcp_packet = Pref.bool("Show Soup Bin Tcp Packet", show.soup_bin_tcp_packet, "Parse and add Soup Bin Tcp Packet to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_system_event_message = Pref.bool("Show System Event Message", show.system_event_message, "Parse and add System Event Message to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_unsequenced_data_packet = Pref.bool("Show Unsequenced Data Packet", show.unsequenced_data_packet, "Parse and add Unsequenced Data Packet to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_payload = Pref.bool("Show Payload", show.payload, "Parse and add Payload to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_sequenced_message = Pref.bool("Show Sequenced Message", show.sequenced_message, "Parse and add Sequenced Message to protocol tree")
jnx_bonds_pts_ouch_v1_4.prefs.show_unsequenced_message = Pref.bool("Show Unsequenced Message", show.unsequenced_message, "Parse and add Unsequenced Message to protocol tree")
-- Handle changed preferences
function jnx_bonds_pts_ouch_v1_4.prefs_changed()
local changed = false
-- Check if show options have changed
if show.cancel_order_message ~= jnx_bonds_pts_ouch_v1_4.prefs.show_cancel_order_message then
show.cancel_order_message = jnx_bonds_pts_ouch_v1_4.prefs.show_cancel_order_message
changed = true
end
if show.debug_packet ~= jnx_bonds_pts_ouch_v1_4.prefs.show_debug_packet then
show.debug_packet = jnx_bonds_pts_ouch_v1_4.prefs.show_debug_packet
changed = true
end
if show.enter_order_message ~= jnx_bonds_pts_ouch_v1_4.prefs.show_enter_order_message then
show.enter_order_message = jnx_bonds_pts_ouch_v1_4.prefs.show_enter_order_message
changed = true
end
if show.login_accepted_packet ~= jnx_bonds_pts_ouch_v1_4.prefs.show_login_accepted_packet then
show.login_accepted_packet = jnx_bonds_pts_ouch_v1_4.prefs.show_login_accepted_packet
changed = true
end
if show.login_rejected_packet ~= jnx_bonds_pts_ouch_v1_4.prefs.show_login_rejected_packet then
show.login_rejected_packet = jnx_bonds_pts_ouch_v1_4.prefs.show_login_rejected_packet
changed = true
end
if show.login_request_packet ~= jnx_bonds_pts_ouch_v1_4.prefs.show_login_request_packet then
show.login_request_packet = jnx_bonds_pts_ouch_v1_4.prefs.show_login_request_packet
changed = true
end
if show.order_accepted_message ~= jnx_bonds_pts_ouch_v1_4.prefs.show_order_accepted_message then
show.order_accepted_message = jnx_bonds_pts_ouch_v1_4.prefs.show_order_accepted_message
changed = true
end
if show.order_aiq_canceled_message ~= jnx_bonds_pts_ouch_v1_4.prefs.show_order_aiq_canceled_message then
show.order_aiq_canceled_message = jnx_bonds_pts_ouch_v1_4.prefs.show_order_aiq_canceled_message
changed = true
end
if show.order_canceled_message ~= jnx_bonds_pts_ouch_v1_4.prefs.show_order_canceled_message then
show.order_canceled_message = jnx_bonds_pts_ouch_v1_4.prefs.show_order_canceled_message
changed = true
end
if show.order_executed_with_counter_party_message ~= jnx_bonds_pts_ouch_v1_4.prefs.show_order_executed_with_counter_party_message then
show.order_executed_with_counter_party_message = jnx_bonds_pts_ouch_v1_4.prefs.show_order_executed_with_counter_party_message
changed = true
end
if show.order_rejected_message ~= jnx_bonds_pts_ouch_v1_4.prefs.show_order_rejected_message then
show.order_rejected_message = jnx_bonds_pts_ouch_v1_4.prefs.show_order_rejected_message
changed = true
end
if show.order_replaced_message ~= jnx_bonds_pts_ouch_v1_4.prefs.show_order_replaced_message then
show.order_replaced_message = jnx_bonds_pts_ouch_v1_4.prefs.show_order_replaced_message
changed = true
end
if show.packet ~= jnx_bonds_pts_ouch_v1_4.prefs.show_packet then
show.packet = jnx_bonds_pts_ouch_v1_4.prefs.show_packet
changed = true
end
if show.packet_header ~= jnx_bonds_pts_ouch_v1_4.prefs.show_packet_header then
show.packet_header = jnx_bonds_pts_ouch_v1_4.prefs.show_packet_header
changed = true
end
if show.replace_order_message ~= jnx_bonds_pts_ouch_v1_4.prefs.show_replace_order_message then
show.replace_order_message = jnx_bonds_pts_ouch_v1_4.prefs.show_replace_order_message
changed = true
end
if show.sequenced_data_packet ~= jnx_bonds_pts_ouch_v1_4.prefs.show_sequenced_data_packet then
show.sequenced_data_packet = jnx_bonds_pts_ouch_v1_4.prefs.show_sequenced_data_packet
changed = true
end
if show.soup_bin_tcp_packet ~= jnx_bonds_pts_ouch_v1_4.prefs.show_soup_bin_tcp_packet then
show.soup_bin_tcp_packet = jnx_bonds_pts_ouch_v1_4.prefs.show_soup_bin_tcp_packet
changed = true
end
if show.system_event_message ~= jnx_bonds_pts_ouch_v1_4.prefs.show_system_event_message then
show.system_event_message = jnx_bonds_pts_ouch_v1_4.prefs.show_system_event_message
changed = true
end
if show.unsequenced_data_packet ~= jnx_bonds_pts_ouch_v1_4.prefs.show_unsequenced_data_packet then
show.unsequenced_data_packet = jnx_bonds_pts_ouch_v1_4.prefs.show_unsequenced_data_packet
changed = true
end
if show.payload ~= jnx_bonds_pts_ouch_v1_4.prefs.show_payload then
show.payload = jnx_bonds_pts_ouch_v1_4.prefs.show_payload
changed = true
end
if show.sequenced_message ~= jnx_bonds_pts_ouch_v1_4.prefs.show_sequenced_message then
show.sequenced_message = jnx_bonds_pts_ouch_v1_4.prefs.show_sequenced_message
changed = true
end
if show.unsequenced_message ~= jnx_bonds_pts_ouch_v1_4.prefs.show_unsequenced_message then
show.unsequenced_message = jnx_bonds_pts_ouch_v1_4.prefs.show_unsequenced_message
changed = true
end
-- Reload on changed preference
if changed then
reload()
end
end
-----------------------------------------------------------------------
-- Protocol Functions
-----------------------------------------------------------------------
-- trim trailing spaces
trim_right_spaces = function(str)
local finish = str:len()
for i = 1, finish do
if str:byte(i) == 0x20 then
return str:sub(1, i - 1)
end
end
return str
end
-----------------------------------------------------------------------
-- Dissect Jnx Bonds Pts Ouch 1.4
-----------------------------------------------------------------------
-- Size: Quantity
jnx_bonds_pts_ouch_v1_4_size_of.quantity = 4
-- Display: Quantity
jnx_bonds_pts_ouch_v1_4_display.quantity = function(value)
return "Quantity: "..value
end
-- Dissect: Quantity
jnx_bonds_pts_ouch_v1_4_dissect.quantity = function(buffer, offset, packet, parent)
local length = jnx_bonds_pts_ouch_v1_4_size_of.quantity
local range = buffer(offset, length)
local value = range:uint()
local display = jnx_bonds_pts_ouch_v1_4_display.quantity(value, buffer, offset, packet, parent)
parent:add(jnx_bonds_pts_ouch_v1_4.fields.quantity, range, value, display)
return offset + length, value
end
-- Size: Order Token
jnx_bonds_pts_ouch_v1_4_size_of.order_token = 4
-- Display: Order Token
jnx_bonds_pts_ouch_v1_4_display.order_token = function(value)
return "Order Token: "..value
end
-- Dissect: Order Token
jnx_bonds_pts_ouch_v1_4_dissect.order_token = function(buffer, offset, packet, parent)
local length = jnx_bonds_pts_ouch_v1_4_size_of.order_token
local range = buffer(offset, length)
local value = range:uint()
local display = jnx_bonds_pts_ouch_v1_4_display.order_token(value, buffer, offset, packet, parent)
parent:add(jnx_bonds_pts_ouch_v1_4.fields.order_token, range, value, display)
return offset + length, value
end
-- Calculate size of: Cancel Order Message
jnx_bonds_pts_ouch_v1_4_size_of.cancel_order_message = function(buffer, offset)
local index = 0
index = index + jnx_bonds_pts_ouch_v1_4_size_of.order_token
index = index + jnx_bonds_pts_ouch_v1_4_size_of.quantity
return index
end
-- Display: Cancel Order Message
jnx_bonds_pts_ouch_v1_4_display.cancel_order_message = function(buffer, offset, size, packet, parent)
return ""
end
-- Dissect Fields: Cancel Order Message
jnx_bonds_pts_ouch_v1_4_dissect.cancel_order_message_fields = function(buffer, offset, packet, parent)
local index = offset
-- Order Token: 4 Byte Unsigned Fixed Width Integer
index, order_token = jnx_bonds_pts_ouch_v1_4_dissect.order_token(buffer, index, packet, parent)
-- Quantity: 4 Byte Unsigned Fixed Width Integer
index, quantity = jnx_bonds_pts_ouch_v1_4_dissect.quantity(buffer, index, packet, parent)
return index
end
-- Dissect: Cancel Order Message
jnx_bonds_pts_ouch_v1_4_dissect.cancel_order_message = function(buffer, offset, packet, parent)
-- Optionally add struct element to protocol tree
if show.cancel_order_message then
local length = jnx_bonds_pts_ouch_v1_4_size_of.cancel_order_message(buffer, offset)
local range = buffer(offset, length)
local display = jnx_bonds_pts_ouch_v1_4_display.cancel_order_message(buffer, packet, parent)
parent = parent:add(jnx_bonds_pts_ouch_v1_4.fields.cancel_order_message, range, display)
end
return jnx_bonds_pts_ouch_v1_4_dissect.cancel_order_message_fields(buffer, offset, packet, parent)
end
-- Size: Minimum Quantity
jnx_bonds_pts_ouch_v1_4_size_of.minimum_quantity = 4
-- Display: Minimum Quantity
jnx_bonds_pts_ouch_v1_4_display.minimum_quantity = function(value)
return "Minimum Quantity: "..value
end
-- Dissect: Minimum Quantity
jnx_bonds_pts_ouch_v1_4_dissect.minimum_quantity = function(buffer, offset, packet, parent)
local length = jnx_bonds_pts_ouch_v1_4_size_of.minimum_quantity
local range = buffer(offset, length)
local value = range:uint()
local display = jnx_bonds_pts_ouch_v1_4_display.minimum_quantity(value, buffer, offset, packet, parent)
parent:add(jnx_bonds_pts_ouch_v1_4.fields.minimum_quantity, range, value, display)
return offset + length, value
end
-- Size: Display
jnx_bonds_pts_ouch_v1_4_size_of.display = 1
-- Display: Display
jnx_bonds_pts_ouch_v1_4_display.display = function(value)
if value == "P" then
return "Display: Postonly (P)"
end
return "Display: Unknown("..value..")"
end
-- Dissect: Display
jnx_bonds_pts_ouch_v1_4_dissect.display = function(buffer, offset, packet, parent)
local length = jnx_bonds_pts_ouch_v1_4_size_of.display
local range = buffer(offset, length)
local value = range:string()
local display = jnx_bonds_pts_ouch_v1_4_display.display(value, buffer, offset, packet, parent)
parent:add(jnx_bonds_pts_ouch_v1_4.fields.display, range, value, display)
return offset + length, value
end
-- Size: Time In Force
jnx_bonds_pts_ouch_v1_4_size_of.time_in_force = 4
-- Display: Time In Force
jnx_bonds_pts_ouch_v1_4_display.time_in_force = function(value)
if value == 0 then
return "Time In Force: Immediate (0)"
end
if value == 99999 then
return "Time In Force: Day (99999)"
end
return "Time In Force: Unknown("..value..")"
end
-- Dissect: Time In Force
jnx_bonds_pts_ouch_v1_4_dissect.time_in_force = function(buffer, offset, packet, parent)
local length = jnx_bonds_pts_ouch_v1_4_size_of.time_in_force
local range = buffer(offset, length)
local value = range:uint()
local display = jnx_bonds_pts_ouch_v1_4_display.time_in_force(value, buffer, offset, packet, parent)
parent:add(jnx_bonds_pts_ouch_v1_4.fields.time_in_force, range, value, display)
return offset + length, value
end
-- Size: Price
jnx_bonds_pts_ouch_v1_4_size_of.price = 4
-- Display: Price
jnx_bonds_pts_ouch_v1_4_display.price = function(value)
return "Price: "..value
end
-- Translate: Price
translate.price = function(raw)
return raw/1000
end
-- Dissect: Price
jnx_bonds_pts_ouch_v1_4_dissect.price = function(buffer, offset, packet, parent)
local length = jnx_bonds_pts_ouch_v1_4_size_of.price
local range = buffer(offset, length)
local raw = range:int()
local value = translate.price(raw)
local display = jnx_bonds_pts_ouch_v1_4_display.price(value, buffer, offset, packet, parent)
parent:add(jnx_bonds_pts_ouch_v1_4.fields.price, range, value, display)
return offset + length, value
end
-- Size: Replacement Order Token
jnx_bonds_pts_ouch_v1_4_size_of.replacement_order_token = 4
-- Display: Replacement Order Token
jnx_bonds_pts_ouch_v1_4_display.replacement_order_token = function(value)
return "Replacement Order Token: "..value
end
-- Dissect: Replacement Order Token
jnx_bonds_pts_ouch_v1_4_dissect.replacement_order_token = function(buffer, offset, packet, parent)
local length = jnx_bonds_pts_ouch_v1_4_size_of.replacement_order_token
local range = buffer(offset, length)
local value = range:uint()
local display = jnx_bonds_pts_ouch_v1_4_display.replacement_order_token(value, buffer, offset, packet, parent)
parent:add(jnx_bonds_pts_ouch_v1_4.fields.replacement_order_token, range, value, display)
return offset + length, value
end
-- Size: Existing Order Token
jnx_bonds_pts_ouch_v1_4_size_of.existing_order_token = 4
-- Display: Existing Order Token
jnx_bonds_pts_ouch_v1_4_display.existing_order_token = function(value)
return "Existing Order Token: "..value
end
-- Dissect: Existing Order Token
jnx_bonds_pts_ouch_v1_4_dissect.existing_order_token = function(buffer, offset, packet, parent)
local length = jnx_bonds_pts_ouch_v1_4_size_of.existing_order_token
local range = buffer(offset, length)
local value = range:uint()
local display = jnx_bonds_pts_ouch_v1_4_display.existing_order_token(value, buffer, offset, packet, parent)
parent:add(jnx_bonds_pts_ouch_v1_4.fields.existing_order_token, range, value, display)
return offset + length, value
end
-- Calculate size of: Replace Order Message
jnx_bonds_pts_ouch_v1_4_size_of.replace_order_message = function(buffer, offset)
local index = 0
index = index + jnx_bonds_pts_ouch_v1_4_size_of.existing_order_token
index = index + jnx_bonds_pts_ouch_v1_4_size_of.replacement_order_token
index = index + jnx_bonds_pts_ouch_v1_4_size_of.quantity
index = index + jnx_bonds_pts_ouch_v1_4_size_of.price
index = index + jnx_bonds_pts_ouch_v1_4_size_of.time_in_force
index = index + jnx_bonds_pts_ouch_v1_4_size_of.display
index = index + jnx_bonds_pts_ouch_v1_4_size_of.minimum_quantity
return index
end
-- Display: Replace Order Message
jnx_bonds_pts_ouch_v1_4_display.replace_order_message = function(buffer, offset, size, packet, parent)
return ""
end
-- Dissect Fields: Replace Order Message
jnx_bonds_pts_ouch_v1_4_dissect.replace_order_message_fields = function(buffer, offset, packet, parent)
local index = offset
-- Existing Order Token: 4 Byte Unsigned Fixed Width Integer
index, existing_order_token = jnx_bonds_pts_ouch_v1_4_dissect.existing_order_token(buffer, index, packet, parent)
-- Replacement Order Token: 4 Byte Unsigned Fixed Width Integer
index, replacement_order_token = jnx_bonds_pts_ouch_v1_4_dissect.replacement_order_token(buffer, index, packet, parent)
-- Quantity: 4 Byte Unsigned Fixed Width Integer
index, quantity = jnx_bonds_pts_ouch_v1_4_dissect.quantity(buffer, index, packet, parent)
-- Price: 4 Byte Signed Fixed Width Integer
index, price = jnx_bonds_pts_ouch_v1_4_dissect.price(buffer, index, packet, parent)
-- Time In Force: 4 Byte Unsigned Fixed Width Integer Enum with 2 values
index, time_in_force = jnx_bonds_pts_ouch_v1_4_dissect.time_in_force(buffer, index, packet, parent)
-- Display: 1 Byte Ascii String Enum with 1 values
index, display = jnx_bonds_pts_ouch_v1_4_dissect.display(buffer, index, packet, parent)
-- Minimum Quantity: 4 Byte Unsigned Fixed Width Integer
index, minimum_quantity = jnx_bonds_pts_ouch_v1_4_dissect.minimum_quantity(buffer, index, packet, parent)
return index
end
-- Dissect: Replace Order Message
jnx_bonds_pts_ouch_v1_4_dissect.replace_order_message = function(buffer, offset, packet, parent)
-- Optionally add struct element to protocol tree
if show.replace_order_message then
local length = jnx_bonds_pts_ouch_v1_4_size_of.replace_order_message(buffer, offset)
local range = buffer(offset, length)
local display = jnx_bonds_pts_ouch_v1_4_display.replace_order_message(buffer, packet, parent)
parent = parent:add(jnx_bonds_pts_ouch_v1_4.fields.replace_order_message, range, display)
end
return jnx_bonds_pts_ouch_v1_4_dissect.replace_order_message_fields(buffer, offset, packet, parent)
end
-- Size: Cash Margin Type
jnx_bonds_pts_ouch_v1_4_size_of.cash_margin_type = 1
-- Display: Cash Margin Type
jnx_bonds_pts_ouch_v1_4_display.cash_margin_type = function(value)
if value == "1" then
return "Cash Margin Type: Cash (1)"
end
return "Cash Margin Type: Unknown("..value..")"
end
-- Dissect: Cash Margin Type
jnx_bonds_pts_ouch_v1_4_dissect.cash_margin_type = function(buffer, offset, packet, parent)
local length = jnx_bonds_pts_ouch_v1_4_size_of.cash_margin_type
local range = buffer(offset, length)
local value = range:string()
local display = jnx_bonds_pts_ouch_v1_4_display.cash_margin_type(value, buffer, offset, packet, parent)
parent:add(jnx_bonds_pts_ouch_v1_4.fields.cash_margin_type, range, value, display)
return offset + length, value
end
-- Size: Order Classification
jnx_bonds_pts_ouch_v1_4_size_of.order_classification = 1
-- Display: Order Classification
jnx_bonds_pts_ouch_v1_4_display.order_classification = function(value)
if value == "1" then
return "Order Classification: Non Hft (1)"
end
if value == "3" then
return "Order Classification: Hft Market Making Strategy (3)"
end
if value == "4" then
return "Order Classification: Hft Arbitrage Strategy (4)"
end
if value == "5" then
return "Order Classification: Hft Directional Strategy (5)"
end
if value == "6" then
return "Order Classification: Hft Other Strategy (6)"
end
return "Order Classification: Unknown("..value..")"
end
-- Dissect: Order Classification
jnx_bonds_pts_ouch_v1_4_dissect.order_classification = function(buffer, offset, packet, parent)
local length = jnx_bonds_pts_ouch_v1_4_size_of.order_classification
local range = buffer(offset, length)
local value = range:string()
local display = jnx_bonds_pts_ouch_v1_4_display.order_classification(value, buffer, offset, packet, parent)
parent:add(jnx_bonds_pts_ouch_v1_4.fields.order_classification, range, value, display)
return offset + length, value
end
-- Size: Capacity
jnx_bonds_pts_ouch_v1_4_size_of.capacity = 1
-- Display: Capacity
jnx_bonds_pts_ouch_v1_4_display.capacity = function(value)
if value == "A" then
return "Capacity: Agency (A)"
end
if value == "P" then
return "Capacity: Principal (P)"
end
return "Capacity: Unknown("..value..")"
end
-- Dissect: Capacity
jnx_bonds_pts_ouch_v1_4_dissect.capacity = function(buffer, offset, packet, parent)
local length = jnx_bonds_pts_ouch_v1_4_size_of.capacity
local range = buffer(offset, length)
local value = range:string()
local display = jnx_bonds_pts_ouch_v1_4_display.capacity(value, buffer, offset, packet, parent)
parent:add(jnx_bonds_pts_ouch_v1_4.fields.capacity, range, value, display)
return offset + length, value
end
-- Size: Firm Id
jnx_bonds_pts_ouch_v1_4_size_of.firm_id = 4
-- Display: Firm Id
jnx_bonds_pts_ouch_v1_4_display.firm_id = function(value)
return "Firm Id: "..value
end
-- Dissect: Firm Id
jnx_bonds_pts_ouch_v1_4_dissect.firm_id = function(buffer, offset, packet, parent)
local length = jnx_bonds_pts_ouch_v1_4_size_of.firm_id
local range = buffer(offset, length)
local value = range:uint()
local display = jnx_bonds_pts_ouch_v1_4_display.firm_id(value, buffer, offset, packet, parent)
parent:add(jnx_bonds_pts_ouch_v1_4.fields.firm_id, range, value, display)
return offset + length, value
end
-- Size: Group
jnx_bonds_pts_ouch_v1_4_size_of.group = 4
-- Display: Group
jnx_bonds_pts_ouch_v1_4_display.group = function(value)
if value == "DJGB" then
return "Group: Jgb Market (DJGB)"
end
return "Group: Unknown("..value..")"
end
-- Dissect: Group
jnx_bonds_pts_ouch_v1_4_dissect.group = function(buffer, offset, packet, parent)
local length = jnx_bonds_pts_ouch_v1_4_size_of.group
local range = buffer(offset, length)
local value = trim_right_spaces(range:string())
local display = jnx_bonds_pts_ouch_v1_4_display.group(value, buffer, offset, packet, parent)
parent:add(jnx_bonds_pts_ouch_v1_4.fields.group, range, value, display)
return offset + length, value
end
-- Size: Orderbook Id
jnx_bonds_pts_ouch_v1_4_size_of.orderbook_id = 4
-- Display: Orderbook Id
jnx_bonds_pts_ouch_v1_4_display.orderbook_id = function(value)
return "Orderbook Id: "..value
end
-- Dissect: Orderbook Id
jnx_bonds_pts_ouch_v1_4_dissect.orderbook_id = function(buffer, offset, packet, parent)
local length = jnx_bonds_pts_ouch_v1_4_size_of.orderbook_id
local range = buffer(offset, length)
local value = range:uint()
local display = jnx_bonds_pts_ouch_v1_4_display.orderbook_id(value, buffer, offset, packet, parent)
parent:add(jnx_bonds_pts_ouch_v1_4.fields.orderbook_id, range, value, display)
return offset + length, value
end
-- Size: Buy Sell Indicator
jnx_bonds_pts_ouch_v1_4_size_of.buy_sell_indicator = 1
-- Display: Buy Sell Indicator
jnx_bonds_pts_ouch_v1_4_display.buy_sell_indicator = function(value)
if value == "B" then
return "Buy Sell Indicator: Buy (B)"
end
if value == "S" then
return "Buy Sell Indicator: Sell (S)"
end
if value == "T" then
return "Buy Sell Indicator: Sell Short (T)"
end
if value == "E" then
return "Buy Sell Indicator: Sell Short Exempt (E)"
end
return "Buy Sell Indicator: Unknown("..value..")"
end
-- Dissect: Buy Sell Indicator
jnx_bonds_pts_ouch_v1_4_dissect.buy_sell_indicator = function(buffer, offset, packet, parent)
local length = jnx_bonds_pts_ouch_v1_4_size_of.buy_sell_indicator
local range = buffer(offset, length)
local value = range:string()
local display = jnx_bonds_pts_ouch_v1_4_display.buy_sell_indicator(value, buffer, offset, packet, parent)
parent:add(jnx_bonds_pts_ouch_v1_4.fields.buy_sell_indicator, range, value, display)
return offset + length, value
end
-- Size: Client Reference
jnx_bonds_pts_ouch_v1_4_size_of.client_reference = 10
-- Display: Client Reference
jnx_bonds_pts_ouch_v1_4_display.client_reference = function(value)
return "Client Reference: "..value
end
-- Dissect: Client Reference
jnx_bonds_pts_ouch_v1_4_dissect.client_reference = function(buffer, offset, packet, parent)
local length = jnx_bonds_pts_ouch_v1_4_size_of.client_reference
local range = buffer(offset, length)
local value = trim_right_spaces(range:string())
local display = jnx_bonds_pts_ouch_v1_4_display.client_reference(value, buffer, offset, packet, parent)
parent:add(jnx_bonds_pts_ouch_v1_4.fields.client_reference, range, value, display)
return offset + length, value
end
-- Calculate size of: Enter Order Message
jnx_bonds_pts_ouch_v1_4_size_of.enter_order_message = function(buffer, offset)
local index = 0
index = index + jnx_bonds_pts_ouch_v1_4_size_of.order_token
index = index + jnx_bonds_pts_ouch_v1_4_size_of.client_reference
index = index + jnx_bonds_pts_ouch_v1_4_size_of.buy_sell_indicator
index = index + jnx_bonds_pts_ouch_v1_4_size_of.quantity
index = index + jnx_bonds_pts_ouch_v1_4_size_of.orderbook_id
index = index + jnx_bonds_pts_ouch_v1_4_size_of.group
index = index + jnx_bonds_pts_ouch_v1_4_size_of.price
index = index + jnx_bonds_pts_ouch_v1_4_size_of.time_in_force
index = index + jnx_bonds_pts_ouch_v1_4_size_of.firm_id
index = index + jnx_bonds_pts_ouch_v1_4_size_of.display
index = index + jnx_bonds_pts_ouch_v1_4_size_of.capacity
index = index + jnx_bonds_pts_ouch_v1_4_size_of.minimum_quantity
index = index + jnx_bonds_pts_ouch_v1_4_size_of.order_classification
index = index + jnx_bonds_pts_ouch_v1_4_size_of.cash_margin_type
return index
end
-- Display: Enter Order Message
jnx_bonds_pts_ouch_v1_4_display.enter_order_message = function(buffer, offset, size, packet, parent)
return ""
end
-- Dissect Fields: Enter Order Message
jnx_bonds_pts_ouch_v1_4_dissect.enter_order_message_fields = function(buffer, offset, packet, parent)
local index = offset
-- Order Token: 4 Byte Unsigned Fixed Width Integer
index, order_token = jnx_bonds_pts_ouch_v1_4_dissect.order_token(buffer, index, packet, parent)
-- Client Reference: 10 Byte Ascii String
index, client_reference = jnx_bonds_pts_ouch_v1_4_dissect.client_reference(buffer, index, packet, parent)
-- Buy Sell Indicator: 1 Byte Ascii String Enum with 4 values
index, buy_sell_indicator = jnx_bonds_pts_ouch_v1_4_dissect.buy_sell_indicator(buffer, index, packet, parent)
-- Quantity: 4 Byte Unsigned Fixed Width Integer
index, quantity = jnx_bonds_pts_ouch_v1_4_dissect.quantity(buffer, index, packet, parent)
-- Orderbook Id: 4 Byte Unsigned Fixed Width Integer
index, orderbook_id = jnx_bonds_pts_ouch_v1_4_dissect.orderbook_id(buffer, index, packet, parent)
-- Group: 4 Byte Ascii String Enum with 1 values
index, group = jnx_bonds_pts_ouch_v1_4_dissect.group(buffer, index, packet, parent)
-- Price: 4 Byte Signed Fixed Width Integer
index, price = jnx_bonds_pts_ouch_v1_4_dissect.price(buffer, index, packet, parent)
-- Time In Force: 4 Byte Unsigned Fixed Width Integer Enum with 2 values
index, time_in_force = jnx_bonds_pts_ouch_v1_4_dissect.time_in_force(buffer, index, packet, parent)
-- Firm Id: 4 Byte Unsigned Fixed Width Integer
index, firm_id = jnx_bonds_pts_ouch_v1_4_dissect.firm_id(buffer, index, packet, parent)
-- Display: 1 Byte Ascii String Enum with 1 values
index, display = jnx_bonds_pts_ouch_v1_4_dissect.display(buffer, index, packet, parent)
-- Capacity: 1 Byte Ascii String Enum with 2 values
index, capacity = jnx_bonds_pts_ouch_v1_4_dissect.capacity(buffer, index, packet, parent)
-- Minimum Quantity: 4 Byte Unsigned Fixed Width Integer
index, minimum_quantity = jnx_bonds_pts_ouch_v1_4_dissect.minimum_quantity(buffer, index, packet, parent)
-- Order Classification: 1 Byte Ascii String Enum with 5 values
index, order_classification = jnx_bonds_pts_ouch_v1_4_dissect.order_classification(buffer, index, packet, parent)
-- Cash Margin Type: 1 Byte Ascii String Enum with 1 values
index, cash_margin_type = jnx_bonds_pts_ouch_v1_4_dissect.cash_margin_type(buffer, index, packet, parent)
return index
end
-- Dissect: Enter Order Message
jnx_bonds_pts_ouch_v1_4_dissect.enter_order_message = function(buffer, offset, packet, parent)
-- Optionally add struct element to protocol tree
if show.enter_order_message then
local length = jnx_bonds_pts_ouch_v1_4_size_of.enter_order_message(buffer, offset)
local range = buffer(offset, length)
local display = jnx_bonds_pts_ouch_v1_4_display.enter_order_message(buffer, packet, parent)
parent = parent:add(jnx_bonds_pts_ouch_v1_4.fields.enter_order_message, range, display)
end
return jnx_bonds_pts_ouch_v1_4_dissect.enter_order_message_fields(buffer, offset, packet, parent)
end
-- Calculate runtime size of: Unsequenced Message
jnx_bonds_pts_ouch_v1_4_size_of.unsequenced_message = function(buffer, offset, unsequenced_message_type)
-- Size of Enter Order Message
if unsequenced_message_type == "O" then
return jnx_bonds_pts_ouch_v1_4_size_of.enter_order_message(buffer, offset)
end
-- Size of Replace Order Message
if unsequenced_message_type == "U" then
return jnx_bonds_pts_ouch_v1_4_size_of.replace_order_message(buffer, offset)
end
-- Size of Cancel Order Message
if unsequenced_message_type == "X" then
return jnx_bonds_pts_ouch_v1_4_size_of.cancel_order_message(buffer, offset)
end
return 0
end
-- Display: Unsequenced Message
jnx_bonds_pts_ouch_v1_4_display.unsequenced_message = function(buffer, offset, packet, parent)
return ""
end
-- Dissect Branches: Unsequenced Message
jnx_bonds_pts_ouch_v1_4_dissect.unsequenced_message_branches = function(buffer, offset, packet, parent, unsequenced_message_type)
-- Dissect Enter Order Message
if unsequenced_message_type == "O" then
return jnx_bonds_pts_ouch_v1_4_dissect.enter_order_message(buffer, offset, packet, parent)
end
-- Dissect Replace Order Message
if unsequenced_message_type == "U" then
return jnx_bonds_pts_ouch_v1_4_dissect.replace_order_message(buffer, offset, packet, parent)
end
-- Dissect Cancel Order Message
if unsequenced_message_type == "X" then
return jnx_bonds_pts_ouch_v1_4_dissect.cancel_order_message(buffer, offset, packet, parent)
end
return offset
end
-- Dissect: Unsequenced Message
jnx_bonds_pts_ouch_v1_4_dissect.unsequenced_message = function(buffer, offset, packet, parent, unsequenced_message_type)
if not show.unsequenced_message then
return jnx_bonds_pts_ouch_v1_4_dissect.unsequenced_message_branches(buffer, offset, packet, parent, unsequenced_message_type)
end
-- Calculate size and check that branch is not empty
local size = jnx_bonds_pts_ouch_v1_4_size_of.unsequenced_message(buffer, offset, unsequenced_message_type)
if size == 0 then
return offset
end
-- Dissect Element
local range = buffer(offset, size)
local display = jnx_bonds_pts_ouch_v1_4_display.unsequenced_message(buffer, packet, parent)
local element = parent:add(jnx_bonds_pts_ouch_v1_4.fields.unsequenced_message, range, display)
return jnx_bonds_pts_ouch_v1_4_dissect.unsequenced_message_branches(buffer, offset, packet, parent, unsequenced_message_type)
end
-- Size: Unsequenced Message Type
jnx_bonds_pts_ouch_v1_4_size_of.unsequenced_message_type = 1
-- Display: Unsequenced Message Type
jnx_bonds_pts_ouch_v1_4_display.unsequenced_message_type = function(value)
if value == "O" then
return "Unsequenced Message Type: Enter Order Message (O)"
end
if value == "U" then
return "Unsequenced Message Type: Replace Order Message (U)"
end
if value == "X" then
return "Unsequenced Message Type: Cancel Order Message (X)"
end
return "Unsequenced Message Type: Unknown("..value..")"
end
-- Dissect: Unsequenced Message Type
jnx_bonds_pts_ouch_v1_4_dissect.unsequenced_message_type = function(buffer, offset, packet, parent)
local length = jnx_bonds_pts_ouch_v1_4_size_of.unsequenced_message_type
local range = buffer(offset, length)
local value = range:string()
local display = jnx_bonds_pts_ouch_v1_4_display.unsequenced_message_type(value, buffer, offset, packet, parent)
parent:add(jnx_bonds_pts_ouch_v1_4.fields.unsequenced_message_type, range, value, display)
return offset + length, value
end
-- Read runtime size of: Unsequenced Data Packet
jnx_bonds_pts_ouch_v1_4_size_of.unsequenced_data_packet = function(buffer, offset)
local index = offset
-- Dependency element: Packet Length
local packet_length = buffer(offset - 3, 2):uint()
return packet_length - 1
end
-- Display: Unsequenced Data Packet
jnx_bonds_pts_ouch_v1_4_display.unsequenced_data_packet = function(buffer, offset, size, packet, parent)
return ""
end
-- Dissect Fields: Unsequenced Data Packet
jnx_bonds_pts_ouch_v1_4_dissect.unsequenced_data_packet_fields = function(buffer, offset, packet, parent, size_of_unsequenced_data_packet)
local index = offset
-- Unsequenced Message Type: 1 Byte Ascii String Enum with 3 values
index, unsequenced_message_type = jnx_bonds_pts_ouch_v1_4_dissect.unsequenced_message_type(buffer, index, packet, parent)
-- Unsequenced Message: Runtime Type with 3 branches
index = jnx_bonds_pts_ouch_v1_4_dissect.unsequenced_message(buffer, index, packet, parent, unsequenced_message_type)
return index
end
-- Dissect: Unsequenced Data Packet
jnx_bonds_pts_ouch_v1_4_dissect.unsequenced_data_packet = function(buffer, offset, packet, parent)
-- Parse runtime size
local size_of_unsequenced_data_packet = jnx_bonds_pts_ouch_v1_4_size_of.unsequenced_data_packet(buffer, offset)
-- Optionally add struct element to protocol tree
if show.unsequenced_data_packet then
local range = buffer(offset, size_of_unsequenced_data_packet)
local display = jnx_bonds_pts_ouch_v1_4_display.unsequenced_data_packet(buffer, packet, parent)
parent = parent:add(jnx_bonds_pts_ouch_v1_4.fields.unsequenced_data_packet, range, display)
end
jnx_bonds_pts_ouch_v1_4_dissect.unsequenced_data_packet_fields(buffer, offset, packet, parent, size_of_unsequenced_data_packet)
return offset + size_of_unsequenced_data_packet
end
-- Size: Requested Sequence Number
jnx_bonds_pts_ouch_v1_4_size_of.requested_sequence_number = 20
-- Display: Requested Sequence Number
jnx_bonds_pts_ouch_v1_4_display.requested_sequence_number = function(value)
return "Requested Sequence Number: "..value
end
-- Dissect: Requested Sequence Number