/
Asx.Securities.Trade.Ouch.v3.6.Script.Dissector.lua
2637 lines (2034 loc) · 110 KB
/
Asx.Securities.Trade.Ouch.v3.6.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
-----------------------------------------------------------------------
-- Asx Securities Trade Ouch 3.6 Protocol
local asx_securities_trade_ouch_v3_6 = Proto("Asx.Securities.Trade.Ouch.v3.6.Lua", "Asx Securities Trade Ouch 3.6")
-- Component Tables
local show = {}
local format = {}
local asx_securities_trade_ouch_v3_6_display = {}
local asx_securities_trade_ouch_v3_6_dissect = {}
local asx_securities_trade_ouch_v3_6_size_of = {}
local verify = {}
local translate = {}
-----------------------------------------------------------------------
-- Declare Protocol Fields
-----------------------------------------------------------------------
-- Asx Securities Trade Ouch 3.6 Fields
asx_securities_trade_ouch_v3_6.fields.cancel_by_order_id_message = ProtoField.new("Cancel By Order Id Message", "asx.securities.trade.ouch.v3.6.cancelbyorderidmessage", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.cancel_order_message = ProtoField.new("Cancel Order Message", "asx.securities.trade.ouch.v3.6.cancelordermessage", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.clearing_participant = ProtoField.new("Clearing Participant", "asx.securities.trade.ouch.v3.6.clearingparticipant", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.client_account = ProtoField.new("Client Account", "asx.securities.trade.ouch.v3.6.clientaccount", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.crossing_key = ProtoField.new("Crossing Key", "asx.securities.trade.ouch.v3.6.crossingkey", ftypes.UINT32)
asx_securities_trade_ouch_v3_6.fields.customer_info = ProtoField.new("Customer Info", "asx.securities.trade.ouch.v3.6.customerinfo", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.deal_source = ProtoField.new("Deal Source", "asx.securities.trade.ouch.v3.6.dealsource", ftypes.UINT16)
asx_securities_trade_ouch_v3_6.fields.debug_packet = ProtoField.new("Debug Packet", "asx.securities.trade.ouch.v3.6.debugpacket", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.enter_order_message = ProtoField.new("Enter Order Message", "asx.securities.trade.ouch.v3.6.enterordermessage", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.exchange_info = ProtoField.new("Exchange Info", "asx.securities.trade.ouch.v3.6.exchangeinfo", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.existing_order_token = ProtoField.new("Existing Order Token", "asx.securities.trade.ouch.v3.6.existingordertoken", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.login_accepted_packet = ProtoField.new("Login Accepted Packet", "asx.securities.trade.ouch.v3.6.loginacceptedpacket", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.login_rejected_packet = ProtoField.new("Login Rejected Packet", "asx.securities.trade.ouch.v3.6.loginrejectedpacket", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.login_request_packet = ProtoField.new("Login Request Packet", "asx.securities.trade.ouch.v3.6.loginrequestpacket", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.match_id = ProtoField.new("Match Id", "asx.securities.trade.ouch.v3.6.matchid", ftypes.BYTES)
asx_securities_trade_ouch_v3_6.fields.minimum_acceptable_quantity = ProtoField.new("Minimum Acceptable Quantity", "asx.securities.trade.ouch.v3.6.minimumacceptablequantity", ftypes.UINT64)
asx_securities_trade_ouch_v3_6.fields.open_close = ProtoField.new("Open Close", "asx.securities.trade.ouch.v3.6.openclose", ftypes.UINT8)
asx_securities_trade_ouch_v3_6.fields.order_accepted_message = ProtoField.new("Order Accepted Message", "asx.securities.trade.ouch.v3.6.orderacceptedmessage", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.order_book_id = ProtoField.new("Order Book Id", "asx.securities.trade.ouch.v3.6.orderbookid", ftypes.UINT32)
asx_securities_trade_ouch_v3_6.fields.order_cancelled_message = ProtoField.new("Order Cancelled Message", "asx.securities.trade.ouch.v3.6.ordercancelledmessage", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.order_executed_message = ProtoField.new("Order Executed Message", "asx.securities.trade.ouch.v3.6.orderexecutedmessage", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.order_id = ProtoField.new("Order Id", "asx.securities.trade.ouch.v3.6.orderid", ftypes.UINT64)
asx_securities_trade_ouch_v3_6.fields.order_rejected_message = ProtoField.new("Order Rejected Message", "asx.securities.trade.ouch.v3.6.orderrejectedmessage", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.order_replaced_message = ProtoField.new("Order Replaced Message", "asx.securities.trade.ouch.v3.6.orderreplacedmessage", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.order_state = ProtoField.new("Order State", "asx.securities.trade.ouch.v3.6.orderstate", ftypes.UINT8)
asx_securities_trade_ouch_v3_6.fields.order_token = ProtoField.new("Order Token", "asx.securities.trade.ouch.v3.6.ordertoken", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.ouch_order_type = ProtoField.new("Ouch Order Type", "asx.securities.trade.ouch.v3.6.ouchordertype", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.packet = ProtoField.new("Packet", "asx.securities.trade.ouch.v3.6.packet", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.packet_header = ProtoField.new("Packet Header", "asx.securities.trade.ouch.v3.6.packetheader", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.packet_length = ProtoField.new("Packet Length", "asx.securities.trade.ouch.v3.6.packetlength", ftypes.UINT16)
asx_securities_trade_ouch_v3_6.fields.packet_type = ProtoField.new("Packet Type", "asx.securities.trade.ouch.v3.6.packettype", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.password = ProtoField.new("Password", "asx.securities.trade.ouch.v3.6.password", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.payload = ProtoField.new("Payload", "asx.securities.trade.ouch.v3.6.payload", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.previous_order_token = ProtoField.new("Previous Order Token", "asx.securities.trade.ouch.v3.6.previousordertoken", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.price = ProtoField.new("Price", "asx.securities.trade.ouch.v3.6.price", ftypes.DOUBLE)
asx_securities_trade_ouch_v3_6.fields.quantity = ProtoField.new("Quantity", "asx.securities.trade.ouch.v3.6.quantity", ftypes.UINT64)
asx_securities_trade_ouch_v3_6.fields.reason = ProtoField.new("Reason", "asx.securities.trade.ouch.v3.6.reason", ftypes.UINT8)
asx_securities_trade_ouch_v3_6.fields.reject_code = ProtoField.new("Reject Code", "asx.securities.trade.ouch.v3.6.rejectcode", ftypes.UINT32)
asx_securities_trade_ouch_v3_6.fields.reject_reason_code = ProtoField.new("Reject Reason Code", "asx.securities.trade.ouch.v3.6.rejectreasoncode", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.replace_order_message = ProtoField.new("Replace Order Message", "asx.securities.trade.ouch.v3.6.replaceordermessage", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.replacement_order_token = ProtoField.new("Replacement Order Token", "asx.securities.trade.ouch.v3.6.replacementordertoken", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.requested_sequence_number = ProtoField.new("Requested Sequence Number", "asx.securities.trade.ouch.v3.6.requestedsequencenumber", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.requested_session = ProtoField.new("Requested Session", "asx.securities.trade.ouch.v3.6.requestedsession", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.sequence_number = ProtoField.new("Sequence Number", "asx.securities.trade.ouch.v3.6.sequencenumber", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.sequenced_data_packet = ProtoField.new("Sequenced Data Packet", "asx.securities.trade.ouch.v3.6.sequenceddatapacket", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.sequenced_message = ProtoField.new("Sequenced Message", "asx.securities.trade.ouch.v3.6.sequencedmessage", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.sequenced_message_type = ProtoField.new("Sequenced Message Type", "asx.securities.trade.ouch.v3.6.sequencedmessagetype", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.session = ProtoField.new("Session", "asx.securities.trade.ouch.v3.6.session", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.short_sell_quantity = ProtoField.new("Short Sell Quantity", "asx.securities.trade.ouch.v3.6.shortsellquantity", ftypes.UINT64)
asx_securities_trade_ouch_v3_6.fields.side = ProtoField.new("Side", "asx.securities.trade.ouch.v3.6.side", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.soup_bin_tcp_packet = ProtoField.new("Soup Bin Tcp Packet", "asx.securities.trade.ouch.v3.6.soupbintcppacket", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.text = ProtoField.new("Text", "asx.securities.trade.ouch.v3.6.text", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.time_in_force = ProtoField.new("Time In Force", "asx.securities.trade.ouch.v3.6.timeinforce", ftypes.UINT8)
asx_securities_trade_ouch_v3_6.fields.timestamp_nanoseconds = ProtoField.new("Timestamp Nanoseconds", "asx.securities.trade.ouch.v3.6.timestampnanoseconds", ftypes.UINT64)
asx_securities_trade_ouch_v3_6.fields.trade_price = ProtoField.new("Trade Price", "asx.securities.trade.ouch.v3.6.tradeprice", ftypes.DOUBLE)
asx_securities_trade_ouch_v3_6.fields.traded_quantity = ProtoField.new("Traded Quantity", "asx.securities.trade.ouch.v3.6.tradedquantity", ftypes.UINT64)
asx_securities_trade_ouch_v3_6.fields.unsequenced_data_packet = ProtoField.new("Unsequenced Data Packet", "asx.securities.trade.ouch.v3.6.unsequenceddatapacket", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.unsequenced_message = ProtoField.new("Unsequenced Message", "asx.securities.trade.ouch.v3.6.unsequencedmessage", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.unsequenced_message_type = ProtoField.new("Unsequenced Message Type", "asx.securities.trade.ouch.v3.6.unsequencedmessagetype", ftypes.STRING)
asx_securities_trade_ouch_v3_6.fields.username = ProtoField.new("Username", "asx.securities.trade.ouch.v3.6.username", ftypes.STRING)
-----------------------------------------------------------------------
-- Declare Dissection Options
-----------------------------------------------------------------------
-- Asx Securities Trade Ouch 3.6 Element Dissection Options
show.cancel_by_order_id_message = true
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_cancelled_message = true
show.order_executed_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.unsequenced_data_packet = true
show.payload = false
show.sequenced_message = false
show.unsequenced_message = false
-- Register Asx Securities Trade Ouch 3.6 Show Options
asx_securities_trade_ouch_v3_6.prefs.show_cancel_by_order_id_message = Pref.bool("Show Cancel By Order Id Message", show.cancel_by_order_id_message, "Parse and add Cancel By Order Id Message to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_cancel_order_message = Pref.bool("Show Cancel Order Message", show.cancel_order_message, "Parse and add Cancel Order Message to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_debug_packet = Pref.bool("Show Debug Packet", show.debug_packet, "Parse and add Debug Packet to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_enter_order_message = Pref.bool("Show Enter Order Message", show.enter_order_message, "Parse and add Enter Order Message to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_login_accepted_packet = Pref.bool("Show Login Accepted Packet", show.login_accepted_packet, "Parse and add Login Accepted Packet to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_login_rejected_packet = Pref.bool("Show Login Rejected Packet", show.login_rejected_packet, "Parse and add Login Rejected Packet to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_login_request_packet = Pref.bool("Show Login Request Packet", show.login_request_packet, "Parse and add Login Request Packet to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_order_accepted_message = Pref.bool("Show Order Accepted Message", show.order_accepted_message, "Parse and add Order Accepted Message to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_order_cancelled_message = Pref.bool("Show Order Cancelled Message", show.order_cancelled_message, "Parse and add Order Cancelled Message to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_order_executed_message = Pref.bool("Show Order Executed Message", show.order_executed_message, "Parse and add Order Executed Message to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_order_rejected_message = Pref.bool("Show Order Rejected Message", show.order_rejected_message, "Parse and add Order Rejected Message to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_order_replaced_message = Pref.bool("Show Order Replaced Message", show.order_replaced_message, "Parse and add Order Replaced Message to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_packet = Pref.bool("Show Packet", show.packet, "Parse and add Packet to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_packet_header = Pref.bool("Show Packet Header", show.packet_header, "Parse and add Packet Header to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_replace_order_message = Pref.bool("Show Replace Order Message", show.replace_order_message, "Parse and add Replace Order Message to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_sequenced_data_packet = Pref.bool("Show Sequenced Data Packet", show.sequenced_data_packet, "Parse and add Sequenced Data Packet to protocol tree")
asx_securities_trade_ouch_v3_6.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")
asx_securities_trade_ouch_v3_6.prefs.show_unsequenced_data_packet = Pref.bool("Show Unsequenced Data Packet", show.unsequenced_data_packet, "Parse and add Unsequenced Data Packet to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_payload = Pref.bool("Show Payload", show.payload, "Parse and add Payload to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_sequenced_message = Pref.bool("Show Sequenced Message", show.sequenced_message, "Parse and add Sequenced Message to protocol tree")
asx_securities_trade_ouch_v3_6.prefs.show_unsequenced_message = Pref.bool("Show Unsequenced Message", show.unsequenced_message, "Parse and add Unsequenced Message to protocol tree")
-- Handle changed preferences
function asx_securities_trade_ouch_v3_6.prefs_changed()
local changed = false
-- Check if show options have changed
if show.cancel_by_order_id_message ~= asx_securities_trade_ouch_v3_6.prefs.show_cancel_by_order_id_message then
show.cancel_by_order_id_message = asx_securities_trade_ouch_v3_6.prefs.show_cancel_by_order_id_message
changed = true
end
if show.cancel_order_message ~= asx_securities_trade_ouch_v3_6.prefs.show_cancel_order_message then
show.cancel_order_message = asx_securities_trade_ouch_v3_6.prefs.show_cancel_order_message
changed = true
end
if show.debug_packet ~= asx_securities_trade_ouch_v3_6.prefs.show_debug_packet then
show.debug_packet = asx_securities_trade_ouch_v3_6.prefs.show_debug_packet
changed = true
end
if show.enter_order_message ~= asx_securities_trade_ouch_v3_6.prefs.show_enter_order_message then
show.enter_order_message = asx_securities_trade_ouch_v3_6.prefs.show_enter_order_message
changed = true
end
if show.login_accepted_packet ~= asx_securities_trade_ouch_v3_6.prefs.show_login_accepted_packet then
show.login_accepted_packet = asx_securities_trade_ouch_v3_6.prefs.show_login_accepted_packet
changed = true
end
if show.login_rejected_packet ~= asx_securities_trade_ouch_v3_6.prefs.show_login_rejected_packet then
show.login_rejected_packet = asx_securities_trade_ouch_v3_6.prefs.show_login_rejected_packet
changed = true
end
if show.login_request_packet ~= asx_securities_trade_ouch_v3_6.prefs.show_login_request_packet then
show.login_request_packet = asx_securities_trade_ouch_v3_6.prefs.show_login_request_packet
changed = true
end
if show.order_accepted_message ~= asx_securities_trade_ouch_v3_6.prefs.show_order_accepted_message then
show.order_accepted_message = asx_securities_trade_ouch_v3_6.prefs.show_order_accepted_message
changed = true
end
if show.order_cancelled_message ~= asx_securities_trade_ouch_v3_6.prefs.show_order_cancelled_message then
show.order_cancelled_message = asx_securities_trade_ouch_v3_6.prefs.show_order_cancelled_message
changed = true
end
if show.order_executed_message ~= asx_securities_trade_ouch_v3_6.prefs.show_order_executed_message then
show.order_executed_message = asx_securities_trade_ouch_v3_6.prefs.show_order_executed_message
changed = true
end
if show.order_rejected_message ~= asx_securities_trade_ouch_v3_6.prefs.show_order_rejected_message then
show.order_rejected_message = asx_securities_trade_ouch_v3_6.prefs.show_order_rejected_message
changed = true
end
if show.order_replaced_message ~= asx_securities_trade_ouch_v3_6.prefs.show_order_replaced_message then
show.order_replaced_message = asx_securities_trade_ouch_v3_6.prefs.show_order_replaced_message
changed = true
end
if show.packet ~= asx_securities_trade_ouch_v3_6.prefs.show_packet then
show.packet = asx_securities_trade_ouch_v3_6.prefs.show_packet
changed = true
end
if show.packet_header ~= asx_securities_trade_ouch_v3_6.prefs.show_packet_header then
show.packet_header = asx_securities_trade_ouch_v3_6.prefs.show_packet_header
changed = true
end
if show.replace_order_message ~= asx_securities_trade_ouch_v3_6.prefs.show_replace_order_message then
show.replace_order_message = asx_securities_trade_ouch_v3_6.prefs.show_replace_order_message
changed = true
end
if show.sequenced_data_packet ~= asx_securities_trade_ouch_v3_6.prefs.show_sequenced_data_packet then
show.sequenced_data_packet = asx_securities_trade_ouch_v3_6.prefs.show_sequenced_data_packet
changed = true
end
if show.soup_bin_tcp_packet ~= asx_securities_trade_ouch_v3_6.prefs.show_soup_bin_tcp_packet then
show.soup_bin_tcp_packet = asx_securities_trade_ouch_v3_6.prefs.show_soup_bin_tcp_packet
changed = true
end
if show.unsequenced_data_packet ~= asx_securities_trade_ouch_v3_6.prefs.show_unsequenced_data_packet then
show.unsequenced_data_packet = asx_securities_trade_ouch_v3_6.prefs.show_unsequenced_data_packet
changed = true
end
if show.payload ~= asx_securities_trade_ouch_v3_6.prefs.show_payload then
show.payload = asx_securities_trade_ouch_v3_6.prefs.show_payload
changed = true
end
if show.sequenced_message ~= asx_securities_trade_ouch_v3_6.prefs.show_sequenced_message then
show.sequenced_message = asx_securities_trade_ouch_v3_6.prefs.show_sequenced_message
changed = true
end
if show.unsequenced_message ~= asx_securities_trade_ouch_v3_6.prefs.show_unsequenced_message then
show.unsequenced_message = asx_securities_trade_ouch_v3_6.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 Asx Securities Trade Ouch 3.6
-----------------------------------------------------------------------
-- Size: Order Id
asx_securities_trade_ouch_v3_6_size_of.order_id = 8
-- Display: Order Id
asx_securities_trade_ouch_v3_6_display.order_id = function(value)
return "Order Id: "..value
end
-- Dissect: Order Id
asx_securities_trade_ouch_v3_6_dissect.order_id = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.order_id
local range = buffer(offset, length)
local value = range:uint64()
local display = asx_securities_trade_ouch_v3_6_display.order_id(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.order_id, range, value, display)
return offset + length, value
end
-- Size: Side
asx_securities_trade_ouch_v3_6_size_of.side = 1
-- Display: Side
asx_securities_trade_ouch_v3_6_display.side = function(value)
if value == "B" then
return "Side: Buy Order (B)"
end
if value == "S" then
return "Side: Sell Order (S)"
end
if value == "T" then
return "Side: Short Sell Order (T)"
end
if value == "C" then
return "Side: Combination Buy Order (C)"
end
return "Side: Unknown("..value..")"
end
-- Dissect: Side
asx_securities_trade_ouch_v3_6_dissect.side = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.side
local range = buffer(offset, length)
local value = range:string()
local display = asx_securities_trade_ouch_v3_6_display.side(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.side, range, value, display)
return offset + length, value
end
-- Size: Order Book Id
asx_securities_trade_ouch_v3_6_size_of.order_book_id = 4
-- Display: Order Book Id
asx_securities_trade_ouch_v3_6_display.order_book_id = function(value)
return "Order Book Id: "..value
end
-- Dissect: Order Book Id
asx_securities_trade_ouch_v3_6_dissect.order_book_id = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.order_book_id
local range = buffer(offset, length)
local value = range:uint()
local display = asx_securities_trade_ouch_v3_6_display.order_book_id(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.order_book_id, range, value, display)
return offset + length, value
end
-- Calculate size of: Cancel By Order Id Message
asx_securities_trade_ouch_v3_6_size_of.cancel_by_order_id_message = function(buffer, offset)
local index = 0
index = index + asx_securities_trade_ouch_v3_6_size_of.order_book_id
index = index + asx_securities_trade_ouch_v3_6_size_of.side
index = index + asx_securities_trade_ouch_v3_6_size_of.order_id
return index
end
-- Display: Cancel By Order Id Message
asx_securities_trade_ouch_v3_6_display.cancel_by_order_id_message = function(buffer, offset, size, packet, parent)
return ""
end
-- Dissect Fields: Cancel By Order Id Message
asx_securities_trade_ouch_v3_6_dissect.cancel_by_order_id_message_fields = function(buffer, offset, packet, parent)
local index = offset
-- Order Book Id: 4 Byte Unsigned Fixed Width Integer
index, order_book_id = asx_securities_trade_ouch_v3_6_dissect.order_book_id(buffer, index, packet, parent)
-- Side: 1 Byte Ascii String Enum with 4 values
index, side = asx_securities_trade_ouch_v3_6_dissect.side(buffer, index, packet, parent)
-- Order Id: 8 Byte Unsigned Fixed Width Integer
index, order_id = asx_securities_trade_ouch_v3_6_dissect.order_id(buffer, index, packet, parent)
return index
end
-- Dissect: Cancel By Order Id Message
asx_securities_trade_ouch_v3_6_dissect.cancel_by_order_id_message = function(buffer, offset, packet, parent)
-- Optionally add struct element to protocol tree
if show.cancel_by_order_id_message then
local length = asx_securities_trade_ouch_v3_6_size_of.cancel_by_order_id_message(buffer, offset)
local range = buffer(offset, length)
local display = asx_securities_trade_ouch_v3_6_display.cancel_by_order_id_message(buffer, packet, parent)
parent = parent:add(asx_securities_trade_ouch_v3_6.fields.cancel_by_order_id_message, range, display)
end
return asx_securities_trade_ouch_v3_6_dissect.cancel_by_order_id_message_fields(buffer, offset, packet, parent)
end
-- Size: Order Token
asx_securities_trade_ouch_v3_6_size_of.order_token = 14
-- Display: Order Token
asx_securities_trade_ouch_v3_6_display.order_token = function(value)
return "Order Token: "..value
end
-- Dissect: Order Token
asx_securities_trade_ouch_v3_6_dissect.order_token = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.order_token
local range = buffer(offset, length)
local value = trim_right_spaces(range:string())
local display = asx_securities_trade_ouch_v3_6_display.order_token(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.order_token, range, value, display)
return offset + length, value
end
-- Calculate size of: Cancel Order Message
asx_securities_trade_ouch_v3_6_size_of.cancel_order_message = function(buffer, offset)
local index = 0
index = index + asx_securities_trade_ouch_v3_6_size_of.order_token
return index
end
-- Display: Cancel Order Message
asx_securities_trade_ouch_v3_6_display.cancel_order_message = function(buffer, offset, size, packet, parent)
return ""
end
-- Dissect Fields: Cancel Order Message
asx_securities_trade_ouch_v3_6_dissect.cancel_order_message_fields = function(buffer, offset, packet, parent)
local index = offset
-- Order Token: 14 Byte Ascii String
index, order_token = asx_securities_trade_ouch_v3_6_dissect.order_token(buffer, index, packet, parent)
return index
end
-- Dissect: Cancel Order Message
asx_securities_trade_ouch_v3_6_dissect.cancel_order_message = function(buffer, offset, packet, parent)
-- Optionally add struct element to protocol tree
if show.cancel_order_message then
local length = asx_securities_trade_ouch_v3_6_size_of.cancel_order_message(buffer, offset)
local range = buffer(offset, length)
local display = asx_securities_trade_ouch_v3_6_display.cancel_order_message(buffer, packet, parent)
parent = parent:add(asx_securities_trade_ouch_v3_6.fields.cancel_order_message, range, display)
end
return asx_securities_trade_ouch_v3_6_dissect.cancel_order_message_fields(buffer, offset, packet, parent)
end
-- Size: Minimum Acceptable Quantity
asx_securities_trade_ouch_v3_6_size_of.minimum_acceptable_quantity = 8
-- Display: Minimum Acceptable Quantity
asx_securities_trade_ouch_v3_6_display.minimum_acceptable_quantity = function(value)
return "Minimum Acceptable Quantity: "..value
end
-- Dissect: Minimum Acceptable Quantity
asx_securities_trade_ouch_v3_6_dissect.minimum_acceptable_quantity = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.minimum_acceptable_quantity
local range = buffer(offset, length)
local value = range:uint64()
local display = asx_securities_trade_ouch_v3_6_display.minimum_acceptable_quantity(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.minimum_acceptable_quantity, range, value, display)
return offset + length, value
end
-- Size: Short Sell Quantity
asx_securities_trade_ouch_v3_6_size_of.short_sell_quantity = 8
-- Display: Short Sell Quantity
asx_securities_trade_ouch_v3_6_display.short_sell_quantity = function(value)
return "Short Sell Quantity: "..value
end
-- Dissect: Short Sell Quantity
asx_securities_trade_ouch_v3_6_dissect.short_sell_quantity = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.short_sell_quantity
local range = buffer(offset, length)
local value = range:uint64()
local display = asx_securities_trade_ouch_v3_6_display.short_sell_quantity(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.short_sell_quantity, range, value, display)
return offset + length, value
end
-- Size: Exchange Info
asx_securities_trade_ouch_v3_6_size_of.exchange_info = 32
-- Display: Exchange Info
asx_securities_trade_ouch_v3_6_display.exchange_info = function(value)
return "Exchange Info: "..value
end
-- Dissect: Exchange Info
asx_securities_trade_ouch_v3_6_dissect.exchange_info = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.exchange_info
local range = buffer(offset, length)
local value = trim_right_spaces(range:string())
local display = asx_securities_trade_ouch_v3_6_display.exchange_info(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.exchange_info, range, value, display)
return offset + length, value
end
-- Size: Customer Info
asx_securities_trade_ouch_v3_6_size_of.customer_info = 15
-- Display: Customer Info
asx_securities_trade_ouch_v3_6_display.customer_info = function(value)
return "Customer Info: "..value
end
-- Dissect: Customer Info
asx_securities_trade_ouch_v3_6_dissect.customer_info = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.customer_info
local range = buffer(offset, length)
local value = trim_right_spaces(range:string())
local display = asx_securities_trade_ouch_v3_6_display.customer_info(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.customer_info, range, value, display)
return offset + length, value
end
-- Size: Client Account
asx_securities_trade_ouch_v3_6_size_of.client_account = 10
-- Display: Client Account
asx_securities_trade_ouch_v3_6_display.client_account = function(value)
return "Client Account: "..value
end
-- Dissect: Client Account
asx_securities_trade_ouch_v3_6_dissect.client_account = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.client_account
local range = buffer(offset, length)
local value = trim_right_spaces(range:string())
local display = asx_securities_trade_ouch_v3_6_display.client_account(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.client_account, range, value, display)
return offset + length, value
end
-- Size: Open Close
asx_securities_trade_ouch_v3_6_size_of.open_close = 1
-- Display: Open Close
asx_securities_trade_ouch_v3_6_display.open_close = function(value)
return "Open Close: "..value
end
-- Dissect: Open Close
asx_securities_trade_ouch_v3_6_dissect.open_close = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.open_close
local range = buffer(offset, length)
local value = range:uint()
local display = asx_securities_trade_ouch_v3_6_display.open_close(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.open_close, range, value, display)
return offset + length, value
end
-- Size: Price
asx_securities_trade_ouch_v3_6_size_of.price = 4
-- Display: Price
asx_securities_trade_ouch_v3_6_display.price = function(value)
return "Price: "..value
end
-- Translate: Price
translate.price = function(raw)
return raw/100
end
-- Dissect: Price
asx_securities_trade_ouch_v3_6_dissect.price = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.price
local range = buffer(offset, length)
local raw = range:int()
local value = translate.price(raw)
local display = asx_securities_trade_ouch_v3_6_display.price(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.price, range, value, display)
return offset + length, value
end
-- Size: Quantity
asx_securities_trade_ouch_v3_6_size_of.quantity = 8
-- Display: Quantity
asx_securities_trade_ouch_v3_6_display.quantity = function(value)
return "Quantity: "..value
end
-- Dissect: Quantity
asx_securities_trade_ouch_v3_6_dissect.quantity = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.quantity
local range = buffer(offset, length)
local value = range:uint64()
local display = asx_securities_trade_ouch_v3_6_display.quantity(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.quantity, range, value, display)
return offset + length, value
end
-- Size: Replacement Order Token
asx_securities_trade_ouch_v3_6_size_of.replacement_order_token = 14
-- Display: Replacement Order Token
asx_securities_trade_ouch_v3_6_display.replacement_order_token = function(value)
return "Replacement Order Token: "..value
end
-- Dissect: Replacement Order Token
asx_securities_trade_ouch_v3_6_dissect.replacement_order_token = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.replacement_order_token
local range = buffer(offset, length)
local value = trim_right_spaces(range:string())
local display = asx_securities_trade_ouch_v3_6_display.replacement_order_token(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.replacement_order_token, range, value, display)
return offset + length, value
end
-- Size: Existing Order Token
asx_securities_trade_ouch_v3_6_size_of.existing_order_token = 14
-- Display: Existing Order Token
asx_securities_trade_ouch_v3_6_display.existing_order_token = function(value)
return "Existing Order Token: "..value
end
-- Dissect: Existing Order Token
asx_securities_trade_ouch_v3_6_dissect.existing_order_token = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.existing_order_token
local range = buffer(offset, length)
local value = trim_right_spaces(range:string())
local display = asx_securities_trade_ouch_v3_6_display.existing_order_token(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.existing_order_token, range, value, display)
return offset + length, value
end
-- Calculate size of: Replace Order Message
asx_securities_trade_ouch_v3_6_size_of.replace_order_message = function(buffer, offset)
local index = 0
index = index + asx_securities_trade_ouch_v3_6_size_of.existing_order_token
index = index + asx_securities_trade_ouch_v3_6_size_of.replacement_order_token
index = index + asx_securities_trade_ouch_v3_6_size_of.quantity
index = index + asx_securities_trade_ouch_v3_6_size_of.price
index = index + asx_securities_trade_ouch_v3_6_size_of.open_close
index = index + asx_securities_trade_ouch_v3_6_size_of.client_account
index = index + asx_securities_trade_ouch_v3_6_size_of.customer_info
index = index + asx_securities_trade_ouch_v3_6_size_of.exchange_info
index = index + asx_securities_trade_ouch_v3_6_size_of.regulatory_data
index = index + asx_securities_trade_ouch_v3_6_size_of.short_sell_quantity
index = index + asx_securities_trade_ouch_v3_6_size_of.minimum_acceptable_quantity
return index
end
-- Display: Replace Order Message
asx_securities_trade_ouch_v3_6_display.replace_order_message = function(buffer, offset, size, packet, parent)
return ""
end
-- Dissect Fields: Replace Order Message
asx_securities_trade_ouch_v3_6_dissect.replace_order_message_fields = function(buffer, offset, packet, parent)
local index = offset
-- Existing Order Token: 14 Byte Ascii String
index, existing_order_token = asx_securities_trade_ouch_v3_6_dissect.existing_order_token(buffer, index, packet, parent)
-- Replacement Order Token: 14 Byte Ascii String
index, replacement_order_token = asx_securities_trade_ouch_v3_6_dissect.replacement_order_token(buffer, index, packet, parent)
-- Quantity: 8 Byte Unsigned Fixed Width Integer
index, quantity = asx_securities_trade_ouch_v3_6_dissect.quantity(buffer, index, packet, parent)
-- Price: 4 Byte Signed Fixed Width Integer
index, price = asx_securities_trade_ouch_v3_6_dissect.price(buffer, index, packet, parent)
-- Open Close: 1 Byte Unsigned Fixed Width Integer
index, open_close = asx_securities_trade_ouch_v3_6_dissect.open_close(buffer, index, packet, parent)
-- Client Account: 10 Byte Ascii String
index, client_account = asx_securities_trade_ouch_v3_6_dissect.client_account(buffer, index, packet, parent)
-- Customer Info: 15 Byte Ascii String
index, customer_info = asx_securities_trade_ouch_v3_6_dissect.customer_info(buffer, index, packet, parent)
-- Exchange Info: 32 Byte Ascii String
index, exchange_info = asx_securities_trade_ouch_v3_6_dissect.exchange_info(buffer, index, packet, parent)
-- Regulatory Data
index, regulatory_data = asx_securities_trade_ouch_v3_6_dissect.regulatory_data(buffer, index, packet, parent)
-- Short Sell Quantity: 8 Byte Unsigned Fixed Width Integer
index, short_sell_quantity = asx_securities_trade_ouch_v3_6_dissect.short_sell_quantity(buffer, index, packet, parent)
-- Minimum Acceptable Quantity: 8 Byte Unsigned Fixed Width Integer
index, minimum_acceptable_quantity = asx_securities_trade_ouch_v3_6_dissect.minimum_acceptable_quantity(buffer, index, packet, parent)
return index
end
-- Dissect: Replace Order Message
asx_securities_trade_ouch_v3_6_dissect.replace_order_message = function(buffer, offset, packet, parent)
-- Optionally add struct element to protocol tree
if show.replace_order_message then
local length = asx_securities_trade_ouch_v3_6_size_of.replace_order_message(buffer, offset)
local range = buffer(offset, length)
local display = asx_securities_trade_ouch_v3_6_display.replace_order_message(buffer, packet, parent)
parent = parent:add(asx_securities_trade_ouch_v3_6.fields.replace_order_message, range, display)
end
return asx_securities_trade_ouch_v3_6_dissect.replace_order_message_fields(buffer, offset, packet, parent)
end
-- Size: Ouch Order Type
asx_securities_trade_ouch_v3_6_size_of.ouch_order_type = 1
-- Display: Ouch Order Type
asx_securities_trade_ouch_v3_6_display.ouch_order_type = function(value)
if value == "Y" then
return "Ouch Order Type: Limit Order (Y)"
end
if value == "N" then
return "Ouch Order Type: Centre Point Order (N)"
end
if value == "D" then
return "Ouch Order Type: Centre Point Order (D)"
end
if value == "S" then
return "Ouch Order Type: Sweep Order (S)"
end
if value == "P" then
return "Ouch Order Type: Dualposted Sweep Order (P)"
end
if value == "B" then
return "Ouch Order Type: Centre Point Block Order With Single Fill Maq (B)"
end
if value == "F" then
return "Ouch Order Type: Centre Point Order With Single Fill Maq (F)"
end
if value == "T = Limit Sweep order (can be dual-posted if entered price is at half-tick) with single fill MAQ" then
return "Ouch Order Type: Limit Sweep Order With Single Fill Maq (T = Limit Sweep order (can be dual-posted if entered price is at half-tick) with single fill MAQ)"
end
if value == "C" then
return "Ouch Order Type: Any Price Block Order (C)"
end
if value == "E" then
return "Ouch Order Type: Any Price Block Order With Single Fill Maq (E)"
end
return "Ouch Order Type: Unknown("..value..")"
end
-- Dissect: Ouch Order Type
asx_securities_trade_ouch_v3_6_dissect.ouch_order_type = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.ouch_order_type
local range = buffer(offset, length)
local value = range:string()
local display = asx_securities_trade_ouch_v3_6_display.ouch_order_type(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.ouch_order_type, range, value, display)
return offset + length, value
end
-- Size: Crossing Key
asx_securities_trade_ouch_v3_6_size_of.crossing_key = 4
-- Display: Crossing Key
asx_securities_trade_ouch_v3_6_display.crossing_key = function(value)
return "Crossing Key: "..value
end
-- Dissect: Crossing Key
asx_securities_trade_ouch_v3_6_dissect.crossing_key = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.crossing_key
local range = buffer(offset, length)
local value = range:uint()
local display = asx_securities_trade_ouch_v3_6_display.crossing_key(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.crossing_key, range, value, display)
return offset + length, value
end
-- Size: Clearing Participant
asx_securities_trade_ouch_v3_6_size_of.clearing_participant = 1
-- Display: Clearing Participant
asx_securities_trade_ouch_v3_6_display.clearing_participant = function(value)
return "Clearing Participant: "..value
end
-- Dissect: Clearing Participant
asx_securities_trade_ouch_v3_6_dissect.clearing_participant = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.clearing_participant
local range = buffer(offset, length)
local value = range:string()
local display = asx_securities_trade_ouch_v3_6_display.clearing_participant(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.clearing_participant, range, value, display)
return offset + length, value
end
-- Size: Time In Force
asx_securities_trade_ouch_v3_6_size_of.time_in_force = 1
-- Display: Time In Force
asx_securities_trade_ouch_v3_6_display.time_in_force = function(value)
if value == 0 then
return "Time In Force: Day (0)"
end
if value == 3 then
return "Time In Force: Fill And Kill (3)"
end
if value == 4 then
return "Time In Force: Fill Or Kill (4)"
end
return "Time In Force: Unknown("..value..")"
end
-- Dissect: Time In Force
asx_securities_trade_ouch_v3_6_dissect.time_in_force = function(buffer, offset, packet, parent)
local length = asx_securities_trade_ouch_v3_6_size_of.time_in_force
local range = buffer(offset, length)
local value = range:uint()
local display = asx_securities_trade_ouch_v3_6_display.time_in_force(value, buffer, offset, packet, parent)
parent:add(asx_securities_trade_ouch_v3_6.fields.time_in_force, range, value, display)
return offset + length, value
end
-- Calculate size of: Enter Order Message
asx_securities_trade_ouch_v3_6_size_of.enter_order_message = function(buffer, offset)
local index = 0
index = index + asx_securities_trade_ouch_v3_6_size_of.order_token
index = index + asx_securities_trade_ouch_v3_6_size_of.order_book_id
index = index + asx_securities_trade_ouch_v3_6_size_of.side
index = index + asx_securities_trade_ouch_v3_6_size_of.quantity
index = index + asx_securities_trade_ouch_v3_6_size_of.price
index = index + asx_securities_trade_ouch_v3_6_size_of.time_in_force
index = index + asx_securities_trade_ouch_v3_6_size_of.open_close
index = index + asx_securities_trade_ouch_v3_6_size_of.client_account
index = index + asx_securities_trade_ouch_v3_6_size_of.customer_info
index = index + asx_securities_trade_ouch_v3_6_size_of.exchange_info
index = index + asx_securities_trade_ouch_v3_6_size_of.clearing_participant
index = index + asx_securities_trade_ouch_v3_6_size_of.crossing_key
index = index + asx_securities_trade_ouch_v3_6_size_of.regulatory_data
index = index + asx_securities_trade_ouch_v3_6_size_of.ouch_order_type
index = index + asx_securities_trade_ouch_v3_6_size_of.short_sell_quantity
index = index + asx_securities_trade_ouch_v3_6_size_of.minimum_acceptable_quantity
return index
end
-- Display: Enter Order Message
asx_securities_trade_ouch_v3_6_display.enter_order_message = function(buffer, offset, size, packet, parent)
return ""
end
-- Dissect Fields: Enter Order Message
asx_securities_trade_ouch_v3_6_dissect.enter_order_message_fields = function(buffer, offset, packet, parent)
local index = offset
-- Order Token: 14 Byte Ascii String
index, order_token = asx_securities_trade_ouch_v3_6_dissect.order_token(buffer, index, packet, parent)
-- Order Book Id: 4 Byte Unsigned Fixed Width Integer
index, order_book_id = asx_securities_trade_ouch_v3_6_dissect.order_book_id(buffer, index, packet, parent)
-- Side: 1 Byte Ascii String Enum with 4 values
index, side = asx_securities_trade_ouch_v3_6_dissect.side(buffer, index, packet, parent)
-- Quantity: 8 Byte Unsigned Fixed Width Integer
index, quantity = asx_securities_trade_ouch_v3_6_dissect.quantity(buffer, index, packet, parent)
-- Price: 4 Byte Signed Fixed Width Integer
index, price = asx_securities_trade_ouch_v3_6_dissect.price(buffer, index, packet, parent)
-- Time In Force: 1 Byte Unsigned Fixed Width Integer Enum with 3 values
index, time_in_force = asx_securities_trade_ouch_v3_6_dissect.time_in_force(buffer, index, packet, parent)
-- Open Close: 1 Byte Unsigned Fixed Width Integer
index, open_close = asx_securities_trade_ouch_v3_6_dissect.open_close(buffer, index, packet, parent)
-- Client Account: 10 Byte Ascii String
index, client_account = asx_securities_trade_ouch_v3_6_dissect.client_account(buffer, index, packet, parent)
-- Customer Info: 15 Byte Ascii String
index, customer_info = asx_securities_trade_ouch_v3_6_dissect.customer_info(buffer, index, packet, parent)
-- Exchange Info: 32 Byte Ascii String
index, exchange_info = asx_securities_trade_ouch_v3_6_dissect.exchange_info(buffer, index, packet, parent)
-- Clearing Participant: 1 Byte Ascii String
index, clearing_participant = asx_securities_trade_ouch_v3_6_dissect.clearing_participant(buffer, index, packet, parent)
-- Crossing Key: 4 Byte Unsigned Fixed Width Integer
index, crossing_key = asx_securities_trade_ouch_v3_6_dissect.crossing_key(buffer, index, packet, parent)
-- Regulatory Data
index, regulatory_data = asx_securities_trade_ouch_v3_6_dissect.regulatory_data(buffer, index, packet, parent)
-- Ouch Order Type: 1 Byte Ascii String Enum with 10 values
index, ouch_order_type = asx_securities_trade_ouch_v3_6_dissect.ouch_order_type(buffer, index, packet, parent)
-- Short Sell Quantity: 8 Byte Unsigned Fixed Width Integer
index, short_sell_quantity = asx_securities_trade_ouch_v3_6_dissect.short_sell_quantity(buffer, index, packet, parent)
-- Minimum Acceptable Quantity: 8 Byte Unsigned Fixed Width Integer
index, minimum_acceptable_quantity = asx_securities_trade_ouch_v3_6_dissect.minimum_acceptable_quantity(buffer, index, packet, parent)
return index
end
-- Dissect: Enter Order Message
asx_securities_trade_ouch_v3_6_dissect.enter_order_message = function(buffer, offset, packet, parent)
-- Optionally add struct element to protocol tree
if show.enter_order_message then
local length = asx_securities_trade_ouch_v3_6_size_of.enter_order_message(buffer, offset)
local range = buffer(offset, length)
local display = asx_securities_trade_ouch_v3_6_display.enter_order_message(buffer, packet, parent)
parent = parent:add(asx_securities_trade_ouch_v3_6.fields.enter_order_message, range, display)
end
return asx_securities_trade_ouch_v3_6_dissect.enter_order_message_fields(buffer, offset, packet, parent)
end
-- Calculate runtime size of: Unsequenced Message
asx_securities_trade_ouch_v3_6_size_of.unsequenced_message = function(buffer, offset, unsequenced_message_type)
-- Size of Enter Order Message
if unsequenced_message_type == "O" then
return asx_securities_trade_ouch_v3_6_size_of.enter_order_message(buffer, offset)
end
-- Size of Replace Order Message
if unsequenced_message_type == "U" then
return asx_securities_trade_ouch_v3_6_size_of.replace_order_message(buffer, offset)
end
-- Size of Cancel Order Message
if unsequenced_message_type == "X" then
return asx_securities_trade_ouch_v3_6_size_of.cancel_order_message(buffer, offset)
end
-- Size of Cancel By Order Id Message
if unsequenced_message_type == "Y" then
return asx_securities_trade_ouch_v3_6_size_of.cancel_by_order_id_message(buffer, offset)
end
return 0
end
-- Display: Unsequenced Message
asx_securities_trade_ouch_v3_6_display.unsequenced_message = function(buffer, offset, packet, parent)
return ""
end
-- Dissect Branches: Unsequenced Message
asx_securities_trade_ouch_v3_6_dissect.unsequenced_message_branches = function(buffer, offset, packet, parent, unsequenced_message_type)
-- Dissect Enter Order Message
if unsequenced_message_type == "O" then
return asx_securities_trade_ouch_v3_6_dissect.enter_order_message(buffer, offset, packet, parent)
end
-- Dissect Replace Order Message
if unsequenced_message_type == "U" then
return asx_securities_trade_ouch_v3_6_dissect.replace_order_message(buffer, offset, packet, parent)
end
-- Dissect Cancel Order Message
if unsequenced_message_type == "X" then
return asx_securities_trade_ouch_v3_6_dissect.cancel_order_message(buffer, offset, packet, parent)
end
-- Dissect Cancel By Order Id Message
if unsequenced_message_type == "Y" then
return asx_securities_trade_ouch_v3_6_dissect.cancel_by_order_id_message(buffer, offset, packet, parent)