Skip to content

Commit b6ec718

Browse files
Regenerate Onyx Futures protocols with bitfields
1 parent 195bfec commit b6ec718

3 files changed

Lines changed: 46 additions & 19 deletions

File tree

Miax/Miax_OnyxFutures_DepthOfMarket_Mach_v1_0_b_Dissector.lua

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.data = ProtoField.new("Data",
3434
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.delete_order_message = ProtoField.new("Delete Order Message", "miax.onyxfutures.depthofmarket.mach.v1.0.b.deleteordermessage", ftypes.STRING)
3535
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.dom_version = ProtoField.new("Dom Version", "miax.onyxfutures.depthofmarket.mach.v1.0.b.domversion", ftypes.STRING)
3636
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.exchange = ProtoField.new("Exchange", "miax.onyxfutures.depthofmarket.mach.v1.0.b.exchange", ftypes.STRING)
37-
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.flags = ProtoField.new("Flags", "miax.onyxfutures.depthofmarket.mach.v1.0.b.flags", ftypes.UINT8)
3837
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.high_limit_price = ProtoField.new("High Limit Price", "miax.onyxfutures.depthofmarket.mach.v1.0.b.highlimitprice", ftypes.DOUBLE)
3938
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.instrument_clear_message = ProtoField.new("Instrument Clear Message", "miax.onyxfutures.depthofmarket.mach.v1.0.b.instrumentclearmessage", ftypes.STRING)
4039
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.instrument_id = ProtoField.new("Instrument Id", "miax.onyxfutures.depthofmarket.mach.v1.0.b.instrumentid", ftypes.UINT32)
@@ -49,13 +48,15 @@ miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.maximum_size = ProtoField.new(
4948
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.message = ProtoField.new("Message", "miax.onyxfutures.depthofmarket.mach.v1.0.b.message", ftypes.STRING)
5049
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.message_type = ProtoField.new("Message Type", "miax.onyxfutures.depthofmarket.mach.v1.0.b.messagetype", ftypes.STRING)
5150
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.minimum_size = ProtoField.new("Minimum Size", "miax.onyxfutures.depthofmarket.mach.v1.0.b.minimumsize", ftypes.UINT32)
51+
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.modify_flags = ProtoField.new("Modify Flags", "miax.onyxfutures.depthofmarket.mach.v1.0.b.modifyflags", ftypes.STRING)
5252
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.modify_order_message = ProtoField.new("Modify Order Message", "miax.onyxfutures.depthofmarket.mach.v1.0.b.modifyordermessage", ftypes.STRING)
5353
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.number_of_legs = ProtoField.new("Number Of Legs", "miax.onyxfutures.depthofmarket.mach.v1.0.b.numberoflegs", ftypes.UINT8)
5454
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.open_interest_quantity = ProtoField.new("Open Interest Quantity", "miax.onyxfutures.depthofmarket.mach.v1.0.b.openinterestquantity", ftypes.UINT32)
5555
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.open_interest_update_message = ProtoField.new("Open Interest Update Message", "miax.onyxfutures.depthofmarket.mach.v1.0.b.openinterestupdatemessage", ftypes.STRING)
5656
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.opening_match_quantity = ProtoField.new("Opening Match Quantity", "miax.onyxfutures.depthofmarket.mach.v1.0.b.openingmatchquantity", ftypes.UINT32)
5757
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.order_execution_message = ProtoField.new("Order Execution Message", "miax.onyxfutures.depthofmarket.mach.v1.0.b.orderexecutionmessage", ftypes.STRING)
5858
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.order_id = ProtoField.new("Order Id", "miax.onyxfutures.depthofmarket.mach.v1.0.b.orderid", ftypes.UINT64)
59+
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.order_position = ProtoField.new("Order Position", "miax.onyxfutures.depthofmarket.mach.v1.0.b.orderposition", ftypes.UINT8, {[1]="Yes",[0]="No"}, base.DEC, 0x01)
5960
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.order_side = ProtoField.new("Order Side", "miax.onyxfutures.depthofmarket.mach.v1.0.b.orderside", ftypes.STRING)
6061
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.order_type = ProtoField.new("Order Type", "miax.onyxfutures.depthofmarket.mach.v1.0.b.ordertype", ftypes.STRING)
6162
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.packet = ProtoField.new("Packet", "miax.onyxfutures.depthofmarket.mach.v1.0.b.packet", ftypes.STRING)
@@ -93,6 +94,7 @@ miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.underlying_asset = ProtoField.
9394
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.underlying_asset_type = ProtoField.new("Underlying Asset Type", "miax.onyxfutures.depthofmarket.mach.v1.0.b.underlyingassettype", ftypes.STRING)
9495
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.unit_of_measure = ProtoField.new("Unit Of Measure", "miax.onyxfutures.depthofmarket.mach.v1.0.b.unitofmeasure", ftypes.STRING)
9596
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.unit_of_measure_quantity = ProtoField.new("Unit Of Measure Quantity", "miax.onyxfutures.depthofmarket.mach.v1.0.b.unitofmeasurequantity", ftypes.UINT32)
97+
miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.unused_7 = ProtoField.new("Unused 7", "miax.onyxfutures.depthofmarket.mach.v1.0.b.unused7", ftypes.UINT8, nil, base.DEC, 0xFE)
9698

9799
-----------------------------------------------------------------------
98100
-- Declare Dissection Options
@@ -107,6 +109,7 @@ show.delete_order_message = true
107109
show.instrument_clear_message = true
108110
show.instrument_trading_status_notification_message = true
109111
show.message = true
112+
show.modify_flags = true
110113
show.modify_order_message = true
111114
show.open_interest_update_message = true
112115
show.order_execution_message = true
@@ -128,6 +131,7 @@ miax_onyxfutures_depthofmarket_mach_v1_0_b.prefs.show_delete_order_message = Pre
128131
miax_onyxfutures_depthofmarket_mach_v1_0_b.prefs.show_instrument_clear_message = Pref.bool("Show Instrument Clear Message", show.instrument_clear_message, "Parse and add Instrument Clear Message to protocol tree")
129132
miax_onyxfutures_depthofmarket_mach_v1_0_b.prefs.show_instrument_trading_status_notification_message = Pref.bool("Show Instrument Trading Status Notification Message", show.instrument_trading_status_notification_message, "Parse and add Instrument Trading Status Notification Message to protocol tree")
130133
miax_onyxfutures_depthofmarket_mach_v1_0_b.prefs.show_message = Pref.bool("Show Message", show.message, "Parse and add Message to protocol tree")
134+
miax_onyxfutures_depthofmarket_mach_v1_0_b.prefs.show_modify_flags = Pref.bool("Show Modify Flags", show.modify_flags, "Parse and add Modify Flags to protocol tree")
131135
miax_onyxfutures_depthofmarket_mach_v1_0_b.prefs.show_modify_order_message = Pref.bool("Show Modify Order Message", show.modify_order_message, "Parse and add Modify Order Message to protocol tree")
132136
miax_onyxfutures_depthofmarket_mach_v1_0_b.prefs.show_open_interest_update_message = Pref.bool("Show Open Interest Update Message", show.open_interest_update_message, "Parse and add Open Interest Update Message to protocol tree")
133137
miax_onyxfutures_depthofmarket_mach_v1_0_b.prefs.show_order_execution_message = Pref.bool("Show Order Execution Message", show.order_execution_message, "Parse and add Order Execution Message to protocol tree")
@@ -177,6 +181,10 @@ function miax_onyxfutures_depthofmarket_mach_v1_0_b.prefs_changed()
177181
show.message = miax_onyxfutures_depthofmarket_mach_v1_0_b.prefs.show_message
178182
changed = true
179183
end
184+
if show.modify_flags ~= miax_onyxfutures_depthofmarket_mach_v1_0_b.prefs.show_modify_flags then
185+
show.modify_flags = miax_onyxfutures_depthofmarket_mach_v1_0_b.prefs.show_modify_flags
186+
changed = true
187+
end
180188
if show.modify_order_message ~= miax_onyxfutures_depthofmarket_mach_v1_0_b.prefs.show_modify_order_message then
181189
show.modify_order_message = miax_onyxfutures_depthofmarket_mach_v1_0_b.prefs.show_modify_order_message
182190
changed = true
@@ -687,24 +695,43 @@ miax_onyxfutures_depthofmarket_mach_v1_0_b_dissect.delete_order_message = functi
687695
return miax_onyxfutures_depthofmarket_mach_v1_0_b_dissect.delete_order_message_fields(buffer, offset, packet, parent)
688696
end
689697

690-
-- Size: Flags
691-
miax_onyxfutures_depthofmarket_mach_v1_0_b_size_of.flags = 1
698+
-- Size: Modify Flags
699+
miax_onyxfutures_depthofmarket_mach_v1_0_b_size_of.modify_flags = 1
692700

693-
-- Display: Flags
694-
miax_onyxfutures_depthofmarket_mach_v1_0_b_display.flags = function(value)
695-
return "Flags: "..value
701+
-- Display: Modify Flags
702+
miax_onyxfutures_depthofmarket_mach_v1_0_b_display.modify_flags = function(buffer, packet, parent)
703+
local display = ""
704+
705+
-- Is Order Position flag set?
706+
if buffer:bitfield(7) > 0 then
707+
display = display.."Order Position|"
708+
end
709+
710+
return display:sub(1, -2)
696711
end
697712

698-
-- Dissect: Flags
699-
miax_onyxfutures_depthofmarket_mach_v1_0_b_dissect.flags = function(buffer, offset, packet, parent)
700-
local length = miax_onyxfutures_depthofmarket_mach_v1_0_b_size_of.flags
701-
local range = buffer(offset, length)
702-
local value = range:le_uint()
703-
local display = miax_onyxfutures_depthofmarket_mach_v1_0_b_display.flags(value, buffer, offset, packet, parent)
713+
-- Dissect Bit Fields: Modify Flags
714+
miax_onyxfutures_depthofmarket_mach_v1_0_b_dissect.modify_flags_bits = function(buffer, offset, packet, parent)
704715

705-
parent:add(miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.flags, range, value, display)
716+
-- Unused 7: 7 Bit
717+
parent:add(miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.unused_7, buffer(offset, 1))
706718

707-
return offset + length, value
719+
-- Order Position: 1 Bit
720+
parent:add(miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.order_position, buffer(offset, 1))
721+
end
722+
723+
-- Dissect: Modify Flags
724+
miax_onyxfutures_depthofmarket_mach_v1_0_b_dissect.modify_flags = function(buffer, offset, packet, parent)
725+
local size = 1
726+
local range = buffer(offset, size)
727+
local display = miax_onyxfutures_depthofmarket_mach_v1_0_b_display.modify_flags(range, packet, parent)
728+
local element = parent:add(miax_onyxfutures_depthofmarket_mach_v1_0_b.fields.modify_flags, range, display)
729+
730+
if show.modify_flags then
731+
miax_onyxfutures_depthofmarket_mach_v1_0_b_dissect.modify_flags_bits(buffer, offset, packet, element)
732+
end
733+
734+
return offset + 1, range
708735
end
709736

710737
-- Calculate size of: Modify Order Message
@@ -721,7 +748,7 @@ miax_onyxfutures_depthofmarket_mach_v1_0_b_size_of.modify_order_message = functi
721748

722749
index = index + miax_onyxfutures_depthofmarket_mach_v1_0_b_size_of.size
723750

724-
index = index + miax_onyxfutures_depthofmarket_mach_v1_0_b_size_of.flags
751+
index = index + miax_onyxfutures_depthofmarket_mach_v1_0_b_size_of.modify_flags
725752

726753
return index
727754
end
@@ -750,8 +777,8 @@ miax_onyxfutures_depthofmarket_mach_v1_0_b_dissect.modify_order_message_fields =
750777
-- Size: 4 Byte Unsigned Fixed Width Integer
751778
index, size = miax_onyxfutures_depthofmarket_mach_v1_0_b_dissect.size(buffer, index, packet, parent)
752779

753-
-- Flags: 1 Byte Unsigned Fixed Width Integer
754-
index, flags = miax_onyxfutures_depthofmarket_mach_v1_0_b_dissect.flags(buffer, index, packet, parent)
780+
-- Modify Flags: Struct of 2 fields
781+
index, modify_flags = miax_onyxfutures_depthofmarket_mach_v1_0_b_dissect.modify_flags(buffer, index, packet, parent)
755782

756783
return index
757784
end

Miax/ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
| Division | Data | Protocol | Version | Date | Size | [Status][Omi.Glossary.Status] | [Testing][Omi.Glossary.Testing] | Specification |
77
| --- | --- | --- | --- | ---: | ---: | --- | --- | --- |
8-
| OnyxFutures | [DepthOfMarket][Miax.OnyxFutures.DepthOfMarket.Mach.v1.0.b.Dissector] | Mach | [1.0.b][Miax.OnyxFutures.DepthOfMarket.Mach.v1.0.b.Dissector] | 3/25/2025 | 2934 | [Active][Omi.Glossary.Status.Active] | [Untested][Omi.Glossary.Testing.Untested] | [url][Miax.OnyxFutures.DepthOfMarket.Mach.v1.0.b.Url] - [pdf][Miax.OnyxFutures.DepthOfMarket.Mach.v1.0.b.Pdf] |
8+
| OnyxFutures | [DepthOfMarket][Miax.OnyxFutures.DepthOfMarket.Mach.v1.0.b.Dissector] | Mach | [1.0.b][Miax.OnyxFutures.DepthOfMarket.Mach.v1.0.b.Dissector] | 3/25/2025 | 2961 | [Active][Omi.Glossary.Status.Active] | [Untested][Omi.Glossary.Testing.Untested] | [url][Miax.OnyxFutures.DepthOfMarket.Mach.v1.0.b.Url] - [pdf][Miax.OnyxFutures.DepthOfMarket.Mach.v1.0.b.Pdf] |
99
| OnyxFutures | [HeaderOnly][Miax.OnyxFutures.Mach.v1.0.Dissector] | Mach | [1.0][Miax.OnyxFutures.Mach.v1.0.Dissector] | 6/26/2020 | 454 | [Active][Omi.Glossary.Status.Active] | [Verified][Omi.Glossary.Testing.Verified] | [url][Miax.OnyxFutures.Mach.v1.0.Url] - [pdf][Miax.OnyxFutures.Mach.v1.0.Pdf] |
1010
| OnyxFutures | [TopOfMarket][Miax.OnyxFutures.TopOfMarket.Mach.v1.0.b.Dissector] | Mach | [1.0.b][Miax.OnyxFutures.TopOfMarket.Mach.v1.0.b.Dissector] | 3/25/2025 | 2255 | [Active][Omi.Glossary.Status.Active] | [Verified][Omi.Glossary.Testing.Verified] | [url][Miax.OnyxFutures.TopOfMarket.Mach.v1.0.b.Url] - [pdf][Miax.OnyxFutures.TopOfMarket.Mach.v1.0.b.Pdf] |
1111
| Options | [ComplexTopOfMarket][Miax.Options.ComplexTopOfMarket.Mach.v1.3.Dissector] | Mach | [1.3][Miax.Options.ComplexTopOfMarket.Mach.v1.3.Dissector] | 3/16/2018 | 3056 | [Active][Omi.Glossary.Status.Active] | [Untested][Omi.Glossary.Testing.Untested] | [url][Miax.Options.ComplexTopOfMarket.Mach.v1.3.Url] - [pdf][Miax.Options.ComplexTopOfMarket.Mach.v1.3.Pdf] |

ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Updates are greatly appreciated; however, this entire repository is source gener
3232

3333
| Protocol Count | Generated Lines |
3434
| --- | --- |
35-
| 349 | 3,461,816 |
35+
| 349 | 3,461,843 |
3636

3737
## Testing
3838

0 commit comments

Comments
 (0)