/
Siac.Opra.Recipient.Obi.v6.2.Script.Dissector.lua
3815 lines (2989 loc) · 156 KB
/
Siac.Opra.Recipient.Obi.v6.2.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
-----------------------------------------------------------------------
-- Siac Opra Recipient Obi 6.2 Protocol
local siac_opra_recipient_obi_v6_2 = Proto("Siac.Opra.Recipient.Obi.v6.2.Lua", "Siac Opra Recipient Obi 6.2")
-- Component Tables
local show = {}
local format = {}
local siac_opra_recipient_obi_v6_2_display = {}
local siac_opra_recipient_obi_v6_2_dissect = {}
local siac_opra_recipient_obi_v6_2_size_of = {}
local verify = {}
-----------------------------------------------------------------------
-- Declare Protocol Fields
-----------------------------------------------------------------------
-- Siac Opra Recipient Obi 6.2 Fields
siac_opra_recipient_obi_v6_2.fields.administrative_message = ProtoField.new("Administrative Message", "siac.opra.recipient.obi.v6.2.administrativemessage", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.bbo_indicator = ProtoField.new("Bbo Indicator", "siac.opra.recipient.obi.v6.2.bboindicator", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.best_bid_and_offer_appendage = ProtoField.new("Best Bid And Offer Appendage", "siac.opra.recipient.obi.v6.2.bestbidandofferappendage", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.best_bid_appendage = ProtoField.new("Best Bid Appendage", "siac.opra.recipient.obi.v6.2.bestbidappendage", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.best_bid_denominator_code = ProtoField.new("Best Bid Denominator Code", "siac.opra.recipient.obi.v6.2.bestbiddenominatorcode", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.best_bid_participant_id = ProtoField.new("Best Bid Participant Id", "siac.opra.recipient.obi.v6.2.bestbidparticipantid", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.best_bid_price = ProtoField.new("Best Bid Price", "siac.opra.recipient.obi.v6.2.bestbidprice", ftypes.INT32)
siac_opra_recipient_obi_v6_2.fields.best_bid_size = ProtoField.new("Best Bid Size", "siac.opra.recipient.obi.v6.2.bestbidsize", ftypes.UINT32)
siac_opra_recipient_obi_v6_2.fields.best_offer_appendage = ProtoField.new("Best Offer Appendage", "siac.opra.recipient.obi.v6.2.bestofferappendage", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.best_offer_denominator_code = ProtoField.new("Best Offer Denominator Code", "siac.opra.recipient.obi.v6.2.bestofferdenominatorcode", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.best_offer_participant_id = ProtoField.new("Best Offer Participant Id", "siac.opra.recipient.obi.v6.2.bestofferparticipantid", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.best_offer_price = ProtoField.new("Best Offer Price", "siac.opra.recipient.obi.v6.2.bestofferprice", ftypes.INT32)
siac_opra_recipient_obi_v6_2.fields.best_offer_size = ProtoField.new("Best Offer Size", "siac.opra.recipient.obi.v6.2.bestoffersize", ftypes.UINT32)
siac_opra_recipient_obi_v6_2.fields.bid_index_value = ProtoField.new("Bid Index Value", "siac.opra.recipient.obi.v6.2.bidindexvalue", ftypes.INT32)
siac_opra_recipient_obi_v6_2.fields.bid_price = ProtoField.new("Bid Price", "siac.opra.recipient.obi.v6.2.bidprice", ftypes.INT32)
siac_opra_recipient_obi_v6_2.fields.bid_price_short = ProtoField.new("Bid Price Short", "siac.opra.recipient.obi.v6.2.bidpriceshort", ftypes.INT16)
siac_opra_recipient_obi_v6_2.fields.bid_size = ProtoField.new("Bid Size", "siac.opra.recipient.obi.v6.2.bidsize", ftypes.UINT32)
siac_opra_recipient_obi_v6_2.fields.bid_size_short = ProtoField.new("Bid Size Short", "siac.opra.recipient.obi.v6.2.bidsizeshort", ftypes.UINT16)
siac_opra_recipient_obi_v6_2.fields.block_checksum = ProtoField.new("Block Checksum", "siac.opra.recipient.obi.v6.2.blockchecksum", ftypes.UINT16)
siac_opra_recipient_obi_v6_2.fields.block_header = ProtoField.new("Block Header", "siac.opra.recipient.obi.v6.2.blockheader", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.block_pad_byte = ProtoField.new("Block Pad Byte", "siac.opra.recipient.obi.v6.2.blockpadbyte", ftypes.UINT8)
siac_opra_recipient_obi_v6_2.fields.block_sequence_number = ProtoField.new("Block Sequence Number", "siac.opra.recipient.obi.v6.2.blocksequencenumber", ftypes.UINT32)
siac_opra_recipient_obi_v6_2.fields.block_size = ProtoField.new("Block Size", "siac.opra.recipient.obi.v6.2.blocksize", ftypes.UINT16)
siac_opra_recipient_obi_v6_2.fields.block_timestamp = ProtoField.new("Block Timestamp", "siac.opra.recipient.obi.v6.2.blocktimestamp", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.control_message = ProtoField.new("Control Message", "siac.opra.recipient.obi.v6.2.controlmessage", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.control_message_type = ProtoField.new("Control Message Type", "siac.opra.recipient.obi.v6.2.controlmessagetype", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.data_feed_indicator = ProtoField.new("Data Feed Indicator", "siac.opra.recipient.obi.v6.2.datafeedindicator", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.denominator_code = ProtoField.new("Denominator Code", "siac.opra.recipient.obi.v6.2.denominatorcode", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.equity_and_index_end_of_day_summary_message = ProtoField.new("Equity And Index End Of Day Summary Message", "siac.opra.recipient.obi.v6.2.equityandindexendofdaysummarymessage", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.equity_and_index_last_sale_message = ProtoField.new("Equity And Index Last Sale Message", "siac.opra.recipient.obi.v6.2.equityandindexlastsalemessage", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.expiration_block = ProtoField.new("Expiration Block", "siac.opra.recipient.obi.v6.2.expirationblock", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.expiration_day = ProtoField.new("Expiration Day", "siac.opra.recipient.obi.v6.2.expirationday", ftypes.UINT8)
siac_opra_recipient_obi_v6_2.fields.expiration_month = ProtoField.new("Expiration Month", "siac.opra.recipient.obi.v6.2.expirationmonth", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.expiration_year = ProtoField.new("Expiration Year", "siac.opra.recipient.obi.v6.2.expirationyear", ftypes.UINT8)
siac_opra_recipient_obi_v6_2.fields.high_price = ProtoField.new("High Price", "siac.opra.recipient.obi.v6.2.highprice", ftypes.INT32)
siac_opra_recipient_obi_v6_2.fields.index_value = ProtoField.new("Index Value", "siac.opra.recipient.obi.v6.2.indexvalue", ftypes.INT32)
siac_opra_recipient_obi_v6_2.fields.index_value_denominator_code = ProtoField.new("Index Value Denominator Code", "siac.opra.recipient.obi.v6.2.indexvaluedenominatorcode", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.last_price = ProtoField.new("Last Price", "siac.opra.recipient.obi.v6.2.lastprice", ftypes.INT32)
siac_opra_recipient_obi_v6_2.fields.long_equity_and_index_quote_message = ProtoField.new("Long Equity And Index Quote Message", "siac.opra.recipient.obi.v6.2.longequityandindexquotemessage", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.low_price = ProtoField.new("Low Price", "siac.opra.recipient.obi.v6.2.lowprice", ftypes.INT32)
siac_opra_recipient_obi_v6_2.fields.message = ProtoField.new("Message", "siac.opra.recipient.obi.v6.2.message", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.message_category = ProtoField.new("Message Category", "siac.opra.recipient.obi.v6.2.messagecategory", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.message_data = ProtoField.new("Message Data", "siac.opra.recipient.obi.v6.2.messagedata", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.message_data_length = ProtoField.new("Message Data Length", "siac.opra.recipient.obi.v6.2.messagedatalength", ftypes.UINT16)
siac_opra_recipient_obi_v6_2.fields.message_indicator = ProtoField.new("Message Indicator", "siac.opra.recipient.obi.v6.2.messageindicator", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.message_type = ProtoField.new("Message Type", "siac.opra.recipient.obi.v6.2.messagetype", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.messages_in_block = ProtoField.new("Messages In Block", "siac.opra.recipient.obi.v6.2.messagesinblock", ftypes.UINT8)
siac_opra_recipient_obi_v6_2.fields.nanoseconds = ProtoField.new("Nanoseconds", "siac.opra.recipient.obi.v6.2.nanoseconds", ftypes.UINT32)
siac_opra_recipient_obi_v6_2.fields.net_change = ProtoField.new("Net Change", "siac.opra.recipient.obi.v6.2.netchange", ftypes.INT32)
siac_opra_recipient_obi_v6_2.fields.offer_index_value = ProtoField.new("Offer Index Value", "siac.opra.recipient.obi.v6.2.offerindexvalue", ftypes.INT64)
siac_opra_recipient_obi_v6_2.fields.offer_price = ProtoField.new("Offer Price", "siac.opra.recipient.obi.v6.2.offerprice", ftypes.INT32)
siac_opra_recipient_obi_v6_2.fields.offer_price_short = ProtoField.new("Offer Price Short", "siac.opra.recipient.obi.v6.2.offerpriceshort", ftypes.INT16)
siac_opra_recipient_obi_v6_2.fields.offer_size = ProtoField.new("Offer Size", "siac.opra.recipient.obi.v6.2.offersize", ftypes.UINT32)
siac_opra_recipient_obi_v6_2.fields.offer_size_short = ProtoField.new("Offer Size Short", "siac.opra.recipient.obi.v6.2.offersizeshort", ftypes.UINT16)
siac_opra_recipient_obi_v6_2.fields.open_interest_message = ProtoField.new("Open Interest Message", "siac.opra.recipient.obi.v6.2.openinterestmessage", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.open_interest_volume = ProtoField.new("Open Interest Volume", "siac.opra.recipient.obi.v6.2.openinterestvolume", ftypes.UINT32)
siac_opra_recipient_obi_v6_2.fields.open_price = ProtoField.new("Open Price", "siac.opra.recipient.obi.v6.2.openprice", ftypes.INT32)
siac_opra_recipient_obi_v6_2.fields.packet = ProtoField.new("Packet", "siac.opra.recipient.obi.v6.2.packet", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.participant_id = ProtoField.new("Participant Id", "siac.opra.recipient.obi.v6.2.participantid", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.participant_reference_number = ProtoField.new("Participant Reference Number", "siac.opra.recipient.obi.v6.2.participantreferencenumber", ftypes.UINT32)
siac_opra_recipient_obi_v6_2.fields.payload = ProtoField.new("Payload", "siac.opra.recipient.obi.v6.2.payload", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.premium_price = ProtoField.new("Premium Price", "siac.opra.recipient.obi.v6.2.premiumprice", ftypes.INT32)
siac_opra_recipient_obi_v6_2.fields.premium_price_denominator_code = ProtoField.new("Premium Price Denominator Code", "siac.opra.recipient.obi.v6.2.premiumpricedenominatorcode", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.price = ProtoField.new("Price", "siac.opra.recipient.obi.v6.2.price", ftypes.INT32)
siac_opra_recipient_obi_v6_2.fields.quote_message_type = ProtoField.new("Quote Message Type", "siac.opra.recipient.obi.v6.2.quotemessagetype", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.reserved_1 = ProtoField.new("Reserved 1", "siac.opra.recipient.obi.v6.2.reserved1", ftypes.BYTES)
siac_opra_recipient_obi_v6_2.fields.reserved_4 = ProtoField.new("Reserved 4", "siac.opra.recipient.obi.v6.2.reserved4", ftypes.BYTES)
siac_opra_recipient_obi_v6_2.fields.retransmission_indicator = ProtoField.new("Retransmission Indicator", "siac.opra.recipient.obi.v6.2.retransmissionindicator", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.seconds = ProtoField.new("Seconds", "siac.opra.recipient.obi.v6.2.seconds", ftypes.UINT32)
siac_opra_recipient_obi_v6_2.fields.security_symbol = ProtoField.new("Security Symbol", "siac.opra.recipient.obi.v6.2.securitysymbol", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.security_symbol_short = ProtoField.new("Security Symbol Short", "siac.opra.recipient.obi.v6.2.securitysymbolshort", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.session_indicator = ProtoField.new("Session Indicator", "siac.opra.recipient.obi.v6.2.sessionindicator", ftypes.UINT8)
siac_opra_recipient_obi_v6_2.fields.short_equity_and_index_quote_message = ProtoField.new("Short Equity And Index Quote Message", "siac.opra.recipient.obi.v6.2.shortequityandindexquotemessage", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.size = ProtoField.new("Size", "siac.opra.recipient.obi.v6.2.size", ftypes.UINT32)
siac_opra_recipient_obi_v6_2.fields.strike_price = ProtoField.new("Strike Price", "siac.opra.recipient.obi.v6.2.strikeprice", ftypes.UINT32)
siac_opra_recipient_obi_v6_2.fields.strike_price_denominator_code = ProtoField.new("Strike Price Denominator Code", "siac.opra.recipient.obi.v6.2.strikepricedenominatorcode", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.strike_price_short = ProtoField.new("Strike Price Short", "siac.opra.recipient.obi.v6.2.strikepriceshort", ftypes.UINT16)
siac_opra_recipient_obi_v6_2.fields.trade_identifier = ProtoField.new("Trade Identifier", "siac.opra.recipient.obi.v6.2.tradeidentifier", ftypes.UINT32)
siac_opra_recipient_obi_v6_2.fields.trade_message_type = ProtoField.new("Trade Message Type", "siac.opra.recipient.obi.v6.2.trademessagetype", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.transaction_id = ProtoField.new("Transaction Id", "siac.opra.recipient.obi.v6.2.transactionid", ftypes.UINT32)
siac_opra_recipient_obi_v6_2.fields.underlying_price = ProtoField.new("Underlying Price", "siac.opra.recipient.obi.v6.2.underlyingprice", ftypes.INT64)
siac_opra_recipient_obi_v6_2.fields.underlying_price_denominator_code = ProtoField.new("Underlying Price Denominator Code", "siac.opra.recipient.obi.v6.2.underlyingpricedenominatorcode", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.underlying_value_bid_and_offer_message = ProtoField.new("Underlying Value Bid And Offer Message", "siac.opra.recipient.obi.v6.2.underlyingvaluebidandoffermessage", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.underlying_value_last_sale_message = ProtoField.new("Underlying Value Last Sale Message", "siac.opra.recipient.obi.v6.2.underlyingvaluelastsalemessage", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.underlying_value_message = ProtoField.new("Underlying Value Message", "siac.opra.recipient.obi.v6.2.underlyingvaluemessage", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.underlying_value_message_payload = ProtoField.new("Underlying Value Message Payload", "siac.opra.recipient.obi.v6.2.underlyingvaluemessagepayload", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.underlying_value_message_type = ProtoField.new("Underlying Value Message Type", "siac.opra.recipient.obi.v6.2.underlyingvaluemessagetype", ftypes.STRING)
siac_opra_recipient_obi_v6_2.fields.version = ProtoField.new("Version", "siac.opra.recipient.obi.v6.2.version", ftypes.UINT8)
siac_opra_recipient_obi_v6_2.fields.volume = ProtoField.new("Volume", "siac.opra.recipient.obi.v6.2.volume", ftypes.UINT32)
-----------------------------------------------------------------------
-- Declare Dissection Options
-----------------------------------------------------------------------
-- Siac Opra Recipient Obi 6.2 Element Dissection Options
show.administrative_message = true
show.best_bid_and_offer_appendage = true
show.best_bid_appendage = true
show.best_offer_appendage = true
show.block_header = true
show.block_timestamp = true
show.control_message = true
show.equity_and_index_end_of_day_summary_message = true
show.equity_and_index_last_sale_message = true
show.expiration_block = true
show.long_equity_and_index_quote_message = true
show.message = true
show.open_interest_message = true
show.packet = true
show.short_equity_and_index_quote_message = true
show.underlying_value_bid_and_offer_message = true
show.underlying_value_last_sale_message = true
show.underlying_value_message = true
show.payload = false
show.underlying_value_message_payload = false
-- Register Siac Opra Recipient Obi 6.2 Show Options
siac_opra_recipient_obi_v6_2.prefs.show_administrative_message = Pref.bool("Show Administrative Message", show.administrative_message, "Parse and add Administrative Message to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_best_bid_and_offer_appendage = Pref.bool("Show Best Bid And Offer Appendage", show.best_bid_and_offer_appendage, "Parse and add Best Bid And Offer Appendage to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_best_bid_appendage = Pref.bool("Show Best Bid Appendage", show.best_bid_appendage, "Parse and add Best Bid Appendage to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_best_offer_appendage = Pref.bool("Show Best Offer Appendage", show.best_offer_appendage, "Parse and add Best Offer Appendage to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_block_header = Pref.bool("Show Block Header", show.block_header, "Parse and add Block Header to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_block_timestamp = Pref.bool("Show Block Timestamp", show.block_timestamp, "Parse and add Block Timestamp to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_control_message = Pref.bool("Show Control Message", show.control_message, "Parse and add Control Message to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_equity_and_index_end_of_day_summary_message = Pref.bool("Show Equity And Index End Of Day Summary Message", show.equity_and_index_end_of_day_summary_message, "Parse and add Equity And Index End Of Day Summary Message to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_equity_and_index_last_sale_message = Pref.bool("Show Equity And Index Last Sale Message", show.equity_and_index_last_sale_message, "Parse and add Equity And Index Last Sale Message to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_expiration_block = Pref.bool("Show Expiration Block", show.expiration_block, "Parse and add Expiration Block to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_long_equity_and_index_quote_message = Pref.bool("Show Long Equity And Index Quote Message", show.long_equity_and_index_quote_message, "Parse and add Long Equity And Index Quote Message to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_message = Pref.bool("Show Message", show.message, "Parse and add Message to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_open_interest_message = Pref.bool("Show Open Interest Message", show.open_interest_message, "Parse and add Open Interest Message to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_packet = Pref.bool("Show Packet", show.packet, "Parse and add Packet to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_short_equity_and_index_quote_message = Pref.bool("Show Short Equity And Index Quote Message", show.short_equity_and_index_quote_message, "Parse and add Short Equity And Index Quote Message to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_underlying_value_bid_and_offer_message = Pref.bool("Show Underlying Value Bid And Offer Message", show.underlying_value_bid_and_offer_message, "Parse and add Underlying Value Bid And Offer Message to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_underlying_value_last_sale_message = Pref.bool("Show Underlying Value Last Sale Message", show.underlying_value_last_sale_message, "Parse and add Underlying Value Last Sale Message to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_underlying_value_message = Pref.bool("Show Underlying Value Message", show.underlying_value_message, "Parse and add Underlying Value Message to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_payload = Pref.bool("Show Payload", show.payload, "Parse and add Payload to protocol tree")
siac_opra_recipient_obi_v6_2.prefs.show_underlying_value_message_payload = Pref.bool("Show Underlying Value Message Payload", show.underlying_value_message_payload, "Parse and add Underlying Value Message Payload to protocol tree")
-- Handle changed preferences
function siac_opra_recipient_obi_v6_2.prefs_changed()
local changed = false
-- Check if show options have changed
if show.administrative_message ~= siac_opra_recipient_obi_v6_2.prefs.show_administrative_message then
show.administrative_message = siac_opra_recipient_obi_v6_2.prefs.show_administrative_message
changed = true
end
if show.best_bid_and_offer_appendage ~= siac_opra_recipient_obi_v6_2.prefs.show_best_bid_and_offer_appendage then
show.best_bid_and_offer_appendage = siac_opra_recipient_obi_v6_2.prefs.show_best_bid_and_offer_appendage
changed = true
end
if show.best_bid_appendage ~= siac_opra_recipient_obi_v6_2.prefs.show_best_bid_appendage then
show.best_bid_appendage = siac_opra_recipient_obi_v6_2.prefs.show_best_bid_appendage
changed = true
end
if show.best_offer_appendage ~= siac_opra_recipient_obi_v6_2.prefs.show_best_offer_appendage then
show.best_offer_appendage = siac_opra_recipient_obi_v6_2.prefs.show_best_offer_appendage
changed = true
end
if show.block_header ~= siac_opra_recipient_obi_v6_2.prefs.show_block_header then
show.block_header = siac_opra_recipient_obi_v6_2.prefs.show_block_header
changed = true
end
if show.block_timestamp ~= siac_opra_recipient_obi_v6_2.prefs.show_block_timestamp then
show.block_timestamp = siac_opra_recipient_obi_v6_2.prefs.show_block_timestamp
changed = true
end
if show.control_message ~= siac_opra_recipient_obi_v6_2.prefs.show_control_message then
show.control_message = siac_opra_recipient_obi_v6_2.prefs.show_control_message
changed = true
end
if show.equity_and_index_end_of_day_summary_message ~= siac_opra_recipient_obi_v6_2.prefs.show_equity_and_index_end_of_day_summary_message then
show.equity_and_index_end_of_day_summary_message = siac_opra_recipient_obi_v6_2.prefs.show_equity_and_index_end_of_day_summary_message
changed = true
end
if show.equity_and_index_last_sale_message ~= siac_opra_recipient_obi_v6_2.prefs.show_equity_and_index_last_sale_message then
show.equity_and_index_last_sale_message = siac_opra_recipient_obi_v6_2.prefs.show_equity_and_index_last_sale_message
changed = true
end
if show.expiration_block ~= siac_opra_recipient_obi_v6_2.prefs.show_expiration_block then
show.expiration_block = siac_opra_recipient_obi_v6_2.prefs.show_expiration_block
changed = true
end
if show.long_equity_and_index_quote_message ~= siac_opra_recipient_obi_v6_2.prefs.show_long_equity_and_index_quote_message then
show.long_equity_and_index_quote_message = siac_opra_recipient_obi_v6_2.prefs.show_long_equity_and_index_quote_message
changed = true
end
if show.message ~= siac_opra_recipient_obi_v6_2.prefs.show_message then
show.message = siac_opra_recipient_obi_v6_2.prefs.show_message
changed = true
end
if show.open_interest_message ~= siac_opra_recipient_obi_v6_2.prefs.show_open_interest_message then
show.open_interest_message = siac_opra_recipient_obi_v6_2.prefs.show_open_interest_message
changed = true
end
if show.packet ~= siac_opra_recipient_obi_v6_2.prefs.show_packet then
show.packet = siac_opra_recipient_obi_v6_2.prefs.show_packet
changed = true
end
if show.short_equity_and_index_quote_message ~= siac_opra_recipient_obi_v6_2.prefs.show_short_equity_and_index_quote_message then
show.short_equity_and_index_quote_message = siac_opra_recipient_obi_v6_2.prefs.show_short_equity_and_index_quote_message
changed = true
end
if show.underlying_value_bid_and_offer_message ~= siac_opra_recipient_obi_v6_2.prefs.show_underlying_value_bid_and_offer_message then
show.underlying_value_bid_and_offer_message = siac_opra_recipient_obi_v6_2.prefs.show_underlying_value_bid_and_offer_message
changed = true
end
if show.underlying_value_last_sale_message ~= siac_opra_recipient_obi_v6_2.prefs.show_underlying_value_last_sale_message then
show.underlying_value_last_sale_message = siac_opra_recipient_obi_v6_2.prefs.show_underlying_value_last_sale_message
changed = true
end
if show.underlying_value_message ~= siac_opra_recipient_obi_v6_2.prefs.show_underlying_value_message then
show.underlying_value_message = siac_opra_recipient_obi_v6_2.prefs.show_underlying_value_message
changed = true
end
if show.payload ~= siac_opra_recipient_obi_v6_2.prefs.show_payload then
show.payload = siac_opra_recipient_obi_v6_2.prefs.show_payload
changed = true
end
if show.underlying_value_message_payload ~= siac_opra_recipient_obi_v6_2.prefs.show_underlying_value_message_payload then
show.underlying_value_message_payload = siac_opra_recipient_obi_v6_2.prefs.show_underlying_value_message_payload
changed = true
end
-- Reload on changed preference
if changed then
reload()
end
end
-----------------------------------------------------------------------
-- Protocol Functions
-----------------------------------------------------------------------
-- Is value not even?
uneven = function(value)
return (value % 2 == 1)
end
-----------------------------------------------------------------------
-- Dissect Siac Opra Recipient Obi 6.2
-----------------------------------------------------------------------
-- Size: Block Pad Byte
siac_opra_recipient_obi_v6_2_size_of.block_pad_byte = 1
-- Display: Block Pad Byte
siac_opra_recipient_obi_v6_2_display.block_pad_byte = function(value)
return "Block Pad Byte: "..value
end
-- Dissect: Block Pad Byte
siac_opra_recipient_obi_v6_2_dissect.block_pad_byte = function(buffer, offset, packet, parent)
local length = siac_opra_recipient_obi_v6_2_size_of.block_pad_byte
local range = buffer(offset, length)
local value = range:uint()
local display = siac_opra_recipient_obi_v6_2_display.block_pad_byte(value, buffer, offset, packet, parent)
parent:add(siac_opra_recipient_obi_v6_2.fields.block_pad_byte, range, value, display)
return offset + length, value
end
-- Size: Offer Index Value
siac_opra_recipient_obi_v6_2_size_of.offer_index_value = 8
-- Display: Offer Index Value
siac_opra_recipient_obi_v6_2_display.offer_index_value = function(value)
return "Offer Index Value: "..value
end
-- Dissect: Offer Index Value
siac_opra_recipient_obi_v6_2_dissect.offer_index_value = function(buffer, offset, packet, parent)
local length = siac_opra_recipient_obi_v6_2_size_of.offer_index_value
local range = buffer(offset, length)
local value = range:int64()
local display = siac_opra_recipient_obi_v6_2_display.offer_index_value(value, buffer, offset, packet, parent)
parent:add(siac_opra_recipient_obi_v6_2.fields.offer_index_value, range, value, display)
return offset + length, value
end
-- Size: Bid Index Value
siac_opra_recipient_obi_v6_2_size_of.bid_index_value = 4
-- Display: Bid Index Value
siac_opra_recipient_obi_v6_2_display.bid_index_value = function(value)
return "Bid Index Value: "..value
end
-- Dissect: Bid Index Value
siac_opra_recipient_obi_v6_2_dissect.bid_index_value = function(buffer, offset, packet, parent)
local length = siac_opra_recipient_obi_v6_2_size_of.bid_index_value
local range = buffer(offset, length)
local value = range:int()
local display = siac_opra_recipient_obi_v6_2_display.bid_index_value(value, buffer, offset, packet, parent)
parent:add(siac_opra_recipient_obi_v6_2.fields.bid_index_value, range, value, display)
return offset + length, value
end
-- Size: Index Value Denominator Code
siac_opra_recipient_obi_v6_2_size_of.index_value_denominator_code = 1
-- Display: Index Value Denominator Code
siac_opra_recipient_obi_v6_2_display.index_value_denominator_code = function(value)
if value == "A" then
return "Index Value Denominator Code: Ten (A)"
end
if value == "B" then
return "Index Value Denominator Code: Hundred (B)"
end
if value == "C" then
return "Index Value Denominator Code: Thousand (C)"
end
if value == "D" then
return "Index Value Denominator Code: Ten Thousand (D)"
end
if value == "E" then
return "Index Value Denominator Code: Hundred Thousand (E)"
end
if value == "F" then
return "Index Value Denominator Code: Million (F)"
end
if value == "G" then
return "Index Value Denominator Code: Ten Million (G)"
end
if value == "I" then
return "Index Value Denominator Code: No Fraction (I)"
end
return "Index Value Denominator Code: Unknown("..value..")"
end
-- Dissect: Index Value Denominator Code
siac_opra_recipient_obi_v6_2_dissect.index_value_denominator_code = function(buffer, offset, packet, parent)
local length = siac_opra_recipient_obi_v6_2_size_of.index_value_denominator_code
local range = buffer(offset, length)
local value = range:string()
local display = siac_opra_recipient_obi_v6_2_display.index_value_denominator_code(value, buffer, offset, packet, parent)
parent:add(siac_opra_recipient_obi_v6_2.fields.index_value_denominator_code, range, value, display)
return offset + length, value
end
-- Size: Reserved 1
siac_opra_recipient_obi_v6_2_size_of.reserved_1 = 1
-- Display: Reserved 1
siac_opra_recipient_obi_v6_2_display.reserved_1 = function(value)
return "Reserved 1: "..value
end
-- Dissect: Reserved 1
siac_opra_recipient_obi_v6_2_dissect.reserved_1 = function(buffer, offset, packet, parent)
local length = siac_opra_recipient_obi_v6_2_size_of.reserved_1
local range = buffer(offset, length)
local value = range:bytes():tohex(false, " ")
local display = siac_opra_recipient_obi_v6_2_display.reserved_1(value, buffer, offset, packet, parent)
parent:add(siac_opra_recipient_obi_v6_2.fields.reserved_1, range, value, display)
return offset + length, value
end
-- Size: Security Symbol
siac_opra_recipient_obi_v6_2_size_of.security_symbol = 5
-- Display: Security Symbol
siac_opra_recipient_obi_v6_2_display.security_symbol = function(value)
return "Security Symbol: "..value
end
-- Dissect: Security Symbol
siac_opra_recipient_obi_v6_2_dissect.security_symbol = function(buffer, offset, packet, parent)
local length = siac_opra_recipient_obi_v6_2_size_of.security_symbol
local range = buffer(offset, length)
local value = range:string()
local display = siac_opra_recipient_obi_v6_2_display.security_symbol(value, buffer, offset, packet, parent)
parent:add(siac_opra_recipient_obi_v6_2.fields.security_symbol, range, value, display)
return offset + length, value
end
-- Size: Participant Reference Number
siac_opra_recipient_obi_v6_2_size_of.participant_reference_number = 4
-- Display: Participant Reference Number
siac_opra_recipient_obi_v6_2_display.participant_reference_number = function(value)
return "Participant Reference Number: "..value
end
-- Dissect: Participant Reference Number
siac_opra_recipient_obi_v6_2_dissect.participant_reference_number = function(buffer, offset, packet, parent)
local length = siac_opra_recipient_obi_v6_2_size_of.participant_reference_number
local range = buffer(offset, length)
local value = range:uint()
local display = siac_opra_recipient_obi_v6_2_display.participant_reference_number(value, buffer, offset, packet, parent)
parent:add(siac_opra_recipient_obi_v6_2.fields.participant_reference_number, range, value, display)
return offset + length, value
end
-- Size: Transaction Id
siac_opra_recipient_obi_v6_2_size_of.transaction_id = 4
-- Display: Transaction Id
siac_opra_recipient_obi_v6_2_display.transaction_id = function(value)
return "Transaction Id: "..value
end
-- Dissect: Transaction Id
siac_opra_recipient_obi_v6_2_dissect.transaction_id = function(buffer, offset, packet, parent)
local length = siac_opra_recipient_obi_v6_2_size_of.transaction_id
local range = buffer(offset, length)
local value = range:uint()
local display = siac_opra_recipient_obi_v6_2_display.transaction_id(value, buffer, offset, packet, parent)
parent:add(siac_opra_recipient_obi_v6_2.fields.transaction_id, range, value, display)
return offset + length, value
end
-- Size: Message Indicator
siac_opra_recipient_obi_v6_2_size_of.message_indicator = 1
-- Display: Message Indicator
siac_opra_recipient_obi_v6_2_display.message_indicator = function(value)
return "Message Indicator: "..value
end
-- Dissect: Message Indicator
siac_opra_recipient_obi_v6_2_dissect.message_indicator = function(buffer, offset, packet, parent)
local length = siac_opra_recipient_obi_v6_2_size_of.message_indicator
local range = buffer(offset, length)
local value = range:string()
local display = siac_opra_recipient_obi_v6_2_display.message_indicator(value, buffer, offset, packet, parent)
parent:add(siac_opra_recipient_obi_v6_2.fields.message_indicator, range, value, display)
return offset + length, value
end
-- Calculate size of: Underlying Value Bid And Offer Message
siac_opra_recipient_obi_v6_2_size_of.underlying_value_bid_and_offer_message = function(buffer, offset)
local index = 0
index = index + siac_opra_recipient_obi_v6_2_size_of.message_indicator
index = index + siac_opra_recipient_obi_v6_2_size_of.transaction_id
index = index + siac_opra_recipient_obi_v6_2_size_of.participant_reference_number
index = index + siac_opra_recipient_obi_v6_2_size_of.security_symbol
index = index + siac_opra_recipient_obi_v6_2_size_of.reserved_1
index = index + siac_opra_recipient_obi_v6_2_size_of.index_value_denominator_code
index = index + siac_opra_recipient_obi_v6_2_size_of.bid_index_value
index = index + siac_opra_recipient_obi_v6_2_size_of.offer_index_value
return index
end
-- Display: Underlying Value Bid And Offer Message
siac_opra_recipient_obi_v6_2_display.underlying_value_bid_and_offer_message = function(buffer, offset, size, packet, parent)
return ""
end
-- Dissect Fields: Underlying Value Bid And Offer Message
siac_opra_recipient_obi_v6_2_dissect.underlying_value_bid_and_offer_message_fields = function(buffer, offset, packet, parent)
local index = offset
-- Message Indicator: 1 Byte Ascii String
index, message_indicator = siac_opra_recipient_obi_v6_2_dissect.message_indicator(buffer, index, packet, parent)
-- Transaction Id: 4 Byte Unsigned Fixed Width Integer
index, transaction_id = siac_opra_recipient_obi_v6_2_dissect.transaction_id(buffer, index, packet, parent)
-- Participant Reference Number: 4 Byte Unsigned Fixed Width Integer
index, participant_reference_number = siac_opra_recipient_obi_v6_2_dissect.participant_reference_number(buffer, index, packet, parent)
-- Security Symbol: 5 Byte Ascii String
index, security_symbol = siac_opra_recipient_obi_v6_2_dissect.security_symbol(buffer, index, packet, parent)
-- Reserved 1: 1 Byte
index, reserved_1 = siac_opra_recipient_obi_v6_2_dissect.reserved_1(buffer, index, packet, parent)
-- Index Value Denominator Code: 1 Byte Ascii String Enum with 8 values
index, index_value_denominator_code = siac_opra_recipient_obi_v6_2_dissect.index_value_denominator_code(buffer, index, packet, parent)
-- Bid Index Value: 4 Byte Signed Fixed Width Integer
index, bid_index_value = siac_opra_recipient_obi_v6_2_dissect.bid_index_value(buffer, index, packet, parent)
-- Offer Index Value: 8 Byte Signed Fixed Width Integer
index, offer_index_value = siac_opra_recipient_obi_v6_2_dissect.offer_index_value(buffer, index, packet, parent)
return index
end
-- Dissect: Underlying Value Bid And Offer Message
siac_opra_recipient_obi_v6_2_dissect.underlying_value_bid_and_offer_message = function(buffer, offset, packet, parent)
-- Optionally add struct element to protocol tree
if show.underlying_value_bid_and_offer_message then
local length = siac_opra_recipient_obi_v6_2_size_of.underlying_value_bid_and_offer_message(buffer, offset)
local range = buffer(offset, length)
local display = siac_opra_recipient_obi_v6_2_display.underlying_value_bid_and_offer_message(buffer, packet, parent)
parent = parent:add(siac_opra_recipient_obi_v6_2.fields.underlying_value_bid_and_offer_message, range, display)
end
return siac_opra_recipient_obi_v6_2_dissect.underlying_value_bid_and_offer_message_fields(buffer, offset, packet, parent)
end
-- Size: Reserved 4
siac_opra_recipient_obi_v6_2_size_of.reserved_4 = 4
-- Display: Reserved 4
siac_opra_recipient_obi_v6_2_display.reserved_4 = function(value)
return "Reserved 4: "..value
end
-- Dissect: Reserved 4
siac_opra_recipient_obi_v6_2_dissect.reserved_4 = function(buffer, offset, packet, parent)
local length = siac_opra_recipient_obi_v6_2_size_of.reserved_4
local range = buffer(offset, length)
local value = range:bytes():tohex(false, " ")
local display = siac_opra_recipient_obi_v6_2_display.reserved_4(value, buffer, offset, packet, parent)
parent:add(siac_opra_recipient_obi_v6_2.fields.reserved_4, range, value, display)
return offset + length, value
end
-- Size: Index Value
siac_opra_recipient_obi_v6_2_size_of.index_value = 4
-- Display: Index Value
siac_opra_recipient_obi_v6_2_display.index_value = function(value)
return "Index Value: "..value
end
-- Dissect: Index Value
siac_opra_recipient_obi_v6_2_dissect.index_value = function(buffer, offset, packet, parent)
local length = siac_opra_recipient_obi_v6_2_size_of.index_value
local range = buffer(offset, length)
local value = range:int()
local display = siac_opra_recipient_obi_v6_2_display.index_value(value, buffer, offset, packet, parent)
parent:add(siac_opra_recipient_obi_v6_2.fields.index_value, range, value, display)
return offset + length, value
end
-- Calculate size of: Underlying Value Last Sale Message
siac_opra_recipient_obi_v6_2_size_of.underlying_value_last_sale_message = function(buffer, offset)
local index = 0
index = index + siac_opra_recipient_obi_v6_2_size_of.message_indicator
index = index + siac_opra_recipient_obi_v6_2_size_of.transaction_id
index = index + siac_opra_recipient_obi_v6_2_size_of.participant_reference_number
index = index + siac_opra_recipient_obi_v6_2_size_of.security_symbol
index = index + siac_opra_recipient_obi_v6_2_size_of.reserved_1
index = index + siac_opra_recipient_obi_v6_2_size_of.index_value_denominator_code
index = index + siac_opra_recipient_obi_v6_2_size_of.index_value
index = index + siac_opra_recipient_obi_v6_2_size_of.reserved_4
return index
end
-- Display: Underlying Value Last Sale Message
siac_opra_recipient_obi_v6_2_display.underlying_value_last_sale_message = function(buffer, offset, size, packet, parent)
return ""
end
-- Dissect Fields: Underlying Value Last Sale Message
siac_opra_recipient_obi_v6_2_dissect.underlying_value_last_sale_message_fields = function(buffer, offset, packet, parent)
local index = offset
-- Message Indicator: 1 Byte Ascii String
index, message_indicator = siac_opra_recipient_obi_v6_2_dissect.message_indicator(buffer, index, packet, parent)
-- Transaction Id: 4 Byte Unsigned Fixed Width Integer
index, transaction_id = siac_opra_recipient_obi_v6_2_dissect.transaction_id(buffer, index, packet, parent)
-- Participant Reference Number: 4 Byte Unsigned Fixed Width Integer
index, participant_reference_number = siac_opra_recipient_obi_v6_2_dissect.participant_reference_number(buffer, index, packet, parent)
-- Security Symbol: 5 Byte Ascii String
index, security_symbol = siac_opra_recipient_obi_v6_2_dissect.security_symbol(buffer, index, packet, parent)
-- Reserved 1: 1 Byte
index, reserved_1 = siac_opra_recipient_obi_v6_2_dissect.reserved_1(buffer, index, packet, parent)
-- Index Value Denominator Code: 1 Byte Ascii String Enum with 8 values
index, index_value_denominator_code = siac_opra_recipient_obi_v6_2_dissect.index_value_denominator_code(buffer, index, packet, parent)
-- Index Value: 4 Byte Signed Fixed Width Integer
index, index_value = siac_opra_recipient_obi_v6_2_dissect.index_value(buffer, index, packet, parent)
-- Reserved 4: 4 Byte
index, reserved_4 = siac_opra_recipient_obi_v6_2_dissect.reserved_4(buffer, index, packet, parent)
return index
end
-- Dissect: Underlying Value Last Sale Message
siac_opra_recipient_obi_v6_2_dissect.underlying_value_last_sale_message = function(buffer, offset, packet, parent)
-- Optionally add struct element to protocol tree
if show.underlying_value_last_sale_message then
local length = siac_opra_recipient_obi_v6_2_size_of.underlying_value_last_sale_message(buffer, offset)
local range = buffer(offset, length)
local display = siac_opra_recipient_obi_v6_2_display.underlying_value_last_sale_message(buffer, packet, parent)
parent = parent:add(siac_opra_recipient_obi_v6_2.fields.underlying_value_last_sale_message, range, display)
end
return siac_opra_recipient_obi_v6_2_dissect.underlying_value_last_sale_message_fields(buffer, offset, packet, parent)
end
-- Calculate runtime size of: Underlying Value Message Payload
siac_opra_recipient_obi_v6_2_size_of.underlying_value_message_payload = function(buffer, offset, underlying_value_message_type)
-- Size of Underlying Value Last Sale Message
if underlying_value_message_type == " " then
return siac_opra_recipient_obi_v6_2_size_of.underlying_value_last_sale_message(buffer, offset)
end
-- Size of Underlying Value Bid And Offer Message
if underlying_value_message_type == "I" then
return siac_opra_recipient_obi_v6_2_size_of.underlying_value_bid_and_offer_message(buffer, offset)
end
return 0
end
-- Display: Underlying Value Message Payload
siac_opra_recipient_obi_v6_2_display.underlying_value_message_payload = function(buffer, offset, packet, parent)
return ""
end
-- Dissect Branches: Underlying Value Message Payload
siac_opra_recipient_obi_v6_2_dissect.underlying_value_message_payload_branches = function(buffer, offset, packet, parent, underlying_value_message_type)
-- Dissect Underlying Value Last Sale Message
if underlying_value_message_type == " " then
return siac_opra_recipient_obi_v6_2_dissect.underlying_value_last_sale_message(buffer, offset, packet, parent)
end
-- Dissect Underlying Value Bid And Offer Message
if underlying_value_message_type == "I" then
return siac_opra_recipient_obi_v6_2_dissect.underlying_value_bid_and_offer_message(buffer, offset, packet, parent)
end
return offset
end
-- Dissect: Underlying Value Message Payload
siac_opra_recipient_obi_v6_2_dissect.underlying_value_message_payload = function(buffer, offset, packet, parent, underlying_value_message_type)
if not show.underlying_value_message_payload then
return siac_opra_recipient_obi_v6_2_dissect.underlying_value_message_payload_branches(buffer, offset, packet, parent, underlying_value_message_type)
end
-- Calculate size and check that branch is not empty
local size = siac_opra_recipient_obi_v6_2_size_of.underlying_value_message_payload(buffer, offset, underlying_value_message_type)
if size == 0 then
return offset
end
-- Dissect Element
local range = buffer(offset, size)
local display = siac_opra_recipient_obi_v6_2_display.underlying_value_message_payload(buffer, packet, parent)
local element = parent:add(siac_opra_recipient_obi_v6_2.fields.underlying_value_message_payload, range, display)
return siac_opra_recipient_obi_v6_2_dissect.underlying_value_message_payload_branches(buffer, offset, packet, parent, underlying_value_message_type)
end
-- Size: Underlying Value Message Type
siac_opra_recipient_obi_v6_2_size_of.underlying_value_message_type = 1
-- Display: Underlying Value Message Type
siac_opra_recipient_obi_v6_2_display.underlying_value_message_type = function(value)
if value == " " then
return "Underlying Value Message Type: Underlying Value Last Sale Message (<whitespace>)"
end
if value == "I" then
return "Underlying Value Message Type: Underlying Value Bid And Offer Message (I)"
end
return "Underlying Value Message Type: Unknown("..value..")"
end
-- Dissect: Underlying Value Message Type
siac_opra_recipient_obi_v6_2_dissect.underlying_value_message_type = function(buffer, offset, packet, parent)
local length = siac_opra_recipient_obi_v6_2_size_of.underlying_value_message_type
local range = buffer(offset, length)
local value = range:string()
local display = siac_opra_recipient_obi_v6_2_display.underlying_value_message_type(value, buffer, offset, packet, parent)
parent:add(siac_opra_recipient_obi_v6_2.fields.underlying_value_message_type, range, value, display)
return offset + length, value
end
-- Calculate size of: Underlying Value Message
siac_opra_recipient_obi_v6_2_size_of.underlying_value_message = function(buffer, offset)
local index = 0
index = index + siac_opra_recipient_obi_v6_2_size_of.underlying_value_message_type
-- Calculate runtime size of Underlying Value Message Payload field
local underlying_value_message_payload_offset = offset + index
local underlying_value_message_payload_type = buffer(underlying_value_message_payload_offset - 1, 1):string()
index = index + siac_opra_recipient_obi_v6_2_size_of.underlying_value_message_payload(buffer, underlying_value_message_payload_offset, underlying_value_message_payload_type)
return index
end
-- Display: Underlying Value Message
siac_opra_recipient_obi_v6_2_display.underlying_value_message = function(buffer, offset, size, packet, parent)
return ""
end
-- Dissect Fields: Underlying Value Message
siac_opra_recipient_obi_v6_2_dissect.underlying_value_message_fields = function(buffer, offset, packet, parent)
local index = offset
-- Underlying Value Message Type: 1 Byte Ascii String Enum with 2 values
index, underlying_value_message_type = siac_opra_recipient_obi_v6_2_dissect.underlying_value_message_type(buffer, index, packet, parent)
-- Underlying Value Message Payload: Runtime Type with 2 branches
index = siac_opra_recipient_obi_v6_2_dissect.underlying_value_message_payload(buffer, index, packet, parent, underlying_value_message_type)
return index
end
-- Dissect: Underlying Value Message
siac_opra_recipient_obi_v6_2_dissect.underlying_value_message = function(buffer, offset, packet, parent)
-- Optionally add dynamic struct element to protocol tree
if show.underlying_value_message then
local length = siac_opra_recipient_obi_v6_2_size_of.underlying_value_message(buffer, offset)
local range = buffer(offset, length)
local display = siac_opra_recipient_obi_v6_2_display.underlying_value_message(buffer, packet, parent)
parent = parent:add(siac_opra_recipient_obi_v6_2.fields.underlying_value_message, range, display)
end
return siac_opra_recipient_obi_v6_2_dissect.underlying_value_message_fields(buffer, offset, packet, parent)
end
-- Size: Control Message Type
siac_opra_recipient_obi_v6_2_size_of.control_message_type = 1
-- Display: Control Message Type
siac_opra_recipient_obi_v6_2_display.control_message_type = function(value)
if value == "A" then
return "Control Message Type: Start Of Test Cycle (A)"
end
if value == "B" then
return "Control Message Type: End Of Test Cycle (B)"
end
if value == "C" then
return "Control Message Type: Start Of Day (C)"
end
if value == "D" then
return "Control Message Type: Good Morning (D)"
end
if value == "E" then
return "Control Message Type: Start Of Summary (E)"
end
if value == "F" then
return "Control Message Type: End Of Summary (F)"
end
if value == "G" then
return "Control Message Type: Early Market Close (G)"
end
if value == "H" then
return "Control Message Type: End Of Transaction Reporting (H)"
end
if value == "I" then
return "Control Message Type: Good Night (I)"
end
if value == "J" then
return "Control Message Type: End Of Day (J)"
end
if value == "K" then
return "Control Message Type: Reset Block Sequence Number (K)"
end
if value == "L" then
return "Control Message Type: Start Of Open Interest (L)"
end
if value == "M" then
return "Control Message Type: End Of Open Interest (M)"
end
if value == "N" then
return "Control Message Type: Line Integrity (N)"
end
if value == "P" then
return "Control Message Type: Disaster Recovery Data Center Activation (P)"
end
return "Control Message Type: Unknown("..value..")"
end
-- Dissect: Control Message Type
siac_opra_recipient_obi_v6_2_dissect.control_message_type = function(buffer, offset, packet, parent)
local length = siac_opra_recipient_obi_v6_2_size_of.control_message_type
local range = buffer(offset, length)
local value = range:string()
local display = siac_opra_recipient_obi_v6_2_display.control_message_type(value, buffer, offset, packet, parent)
parent:add(siac_opra_recipient_obi_v6_2.fields.control_message_type, range, value, display)
return offset + length, value
end
-- Calculate size of: Control Message
siac_opra_recipient_obi_v6_2_size_of.control_message = function(buffer, offset)
local index = 0
index = index + siac_opra_recipient_obi_v6_2_size_of.control_message_type
index = index + siac_opra_recipient_obi_v6_2_size_of.message_indicator
index = index + siac_opra_recipient_obi_v6_2_size_of.transaction_id
index = index + siac_opra_recipient_obi_v6_2_size_of.participant_reference_number
return index
end
-- Display: Control Message
siac_opra_recipient_obi_v6_2_display.control_message = function(buffer, offset, size, packet, parent)
return ""
end
-- Dissect Fields: Control Message
siac_opra_recipient_obi_v6_2_dissect.control_message_fields = function(buffer, offset, packet, parent)
local index = offset
-- Control Message Type: 1 Byte Ascii String Enum with 15 values
index, control_message_type = siac_opra_recipient_obi_v6_2_dissect.control_message_type(buffer, index, packet, parent)
-- Message Indicator: 1 Byte Ascii String
index, message_indicator = siac_opra_recipient_obi_v6_2_dissect.message_indicator(buffer, index, packet, parent)
-- Transaction Id: 4 Byte Unsigned Fixed Width Integer
index, transaction_id = siac_opra_recipient_obi_v6_2_dissect.transaction_id(buffer, index, packet, parent)
-- Participant Reference Number: 4 Byte Unsigned Fixed Width Integer
index, participant_reference_number = siac_opra_recipient_obi_v6_2_dissect.participant_reference_number(buffer, index, packet, parent)
return index
end
-- Dissect: Control Message
siac_opra_recipient_obi_v6_2_dissect.control_message = function(buffer, offset, packet, parent)
-- Optionally add struct element to protocol tree
if show.control_message then
local length = siac_opra_recipient_obi_v6_2_size_of.control_message(buffer, offset)
local range = buffer(offset, length)
local display = siac_opra_recipient_obi_v6_2_display.control_message(buffer, packet, parent)
parent = parent:add(siac_opra_recipient_obi_v6_2.fields.control_message, range, display)
end
return siac_opra_recipient_obi_v6_2_dissect.control_message_fields(buffer, offset, packet, parent)
end
-- Display: Message Data
siac_opra_recipient_obi_v6_2_display.message_data = function(value)
return "Message Data: "..value
end
-- Dissect runtime sized field: Message Data
siac_opra_recipient_obi_v6_2_dissect.message_data = function(buffer, offset, packet, parent, size)
local range = buffer(offset, size)
local value = range:string()
local display = siac_opra_recipient_obi_v6_2_display.message_data(value, buffer, offset, packet, parent, size)
parent:add(siac_opra_recipient_obi_v6_2.fields.message_data, range, value, display)
return offset + size
end
-- Size: Message Data Length
siac_opra_recipient_obi_v6_2_size_of.message_data_length = 2
-- Display: Message Data Length
siac_opra_recipient_obi_v6_2_display.message_data_length = function(value)
return "Message Data Length: "..value
end
-- Dissect: Message Data Length
siac_opra_recipient_obi_v6_2_dissect.message_data_length = function(buffer, offset, packet, parent)
local length = siac_opra_recipient_obi_v6_2_size_of.message_data_length
local range = buffer(offset, length)
local value = range:uint()
local display = siac_opra_recipient_obi_v6_2_display.message_data_length(value, buffer, offset, packet, parent)
parent:add(siac_opra_recipient_obi_v6_2.fields.message_data_length, range, value, display)
return offset + length, value
end
-- Size: Message Type
siac_opra_recipient_obi_v6_2_size_of.message_type = 1
-- Display: Message Type
siac_opra_recipient_obi_v6_2_display.message_type = function(value)
return "Message Type: "..value
end
-- Dissect: Message Type
siac_opra_recipient_obi_v6_2_dissect.message_type = function(buffer, offset, packet, parent)
local length = siac_opra_recipient_obi_v6_2_size_of.message_type
local range = buffer(offset, length)
local value = range:string()
local display = siac_opra_recipient_obi_v6_2_display.message_type(value, buffer, offset, packet, parent)
parent:add(siac_opra_recipient_obi_v6_2.fields.message_type, range, value, display)
return offset + length, value
end
-- Read runtime size of: Administrative Message
siac_opra_recipient_obi_v6_2_size_of.administrative_message = function(buffer, offset)
local index = offset
-- Dependency element: Message Data Length
local message_data_length = buffer(offset + 10, 2):uint()
return message_data_length + 12
end
-- Display: Administrative Message
siac_opra_recipient_obi_v6_2_display.administrative_message = function(buffer, offset, size, packet, parent)
return ""
end
-- Dissect Fields: Administrative Message
siac_opra_recipient_obi_v6_2_dissect.administrative_message_fields = function(buffer, offset, packet, parent, size_of_administrative_message)
local index = offset
-- Message Type: 1 Byte Ascii String
index, message_type = siac_opra_recipient_obi_v6_2_dissect.message_type(buffer, index, packet, parent)
-- Message Indicator: 1 Byte Ascii String
index, message_indicator = siac_opra_recipient_obi_v6_2_dissect.message_indicator(buffer, index, packet, parent)
-- Transaction Id: 4 Byte Unsigned Fixed Width Integer
index, transaction_id = siac_opra_recipient_obi_v6_2_dissect.transaction_id(buffer, index, packet, parent)
-- Participant Reference Number: 4 Byte Unsigned Fixed Width Integer
index, participant_reference_number = siac_opra_recipient_obi_v6_2_dissect.participant_reference_number(buffer, index, packet, parent)
-- Message Data Length: 2 Byte Unsigned Fixed Width Integer
index, message_data_length = siac_opra_recipient_obi_v6_2_dissect.message_data_length(buffer, index, packet, parent)
-- Runtime optional field exists: Message Data
local message_data_exists = message_data_length > 0
-- Runtime optional field: Message Data
if message_data_exists then
-- Message Data: 1 Byte Ascii String
index = siac_opra_recipient_obi_v6_2_dissect.message_data(buffer, index, packet, parent, message_data_length)
end
return index