-----------------------------------------------------------------------
-- Lua Script Wireshark Dissector
-- 
-- Please see end of file for rules and regulations
-----------------------------------------------------------------------

-- Nasdaq PhlxOptions MarketDepth Itch 1.6 Protocol
local omi_nasdaq_phlxoptions_marketdepth_itch_v1_6 = Proto("Nasdaq.PhlxOptions.MarketDepth.Itch.v1.6.Lua", "Nasdaq PhlxOptions MarketDepth Itch 1.6")

-- Protocol table
local nasdaq_phlxoptions_marketdepth_itch_v1_6 = {}

-----------------------------------------------------------------------
-- Declare Protocol Fields
-----------------------------------------------------------------------

-- Nasdaq PhlxOptions MarketDepth Itch 1.6 Fields
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.ask_price = ProtoField.new("Ask Price", "nasdaq.phlxoptions.marketdepth.itch.v1.6.askprice", ftypes.DOUBLE)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.ask_reference_number_delta = ProtoField.new("Ask Reference Number Delta", "nasdaq.phlxoptions.marketdepth.itch.v1.6.askreferencenumberdelta", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.ask_size = ProtoField.new("Ask Size", "nasdaq.phlxoptions.marketdepth.itch.v1.6.asksize", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.auction_id = ProtoField.new("Auction Id", "nasdaq.phlxoptions.marketdepth.itch.v1.6.auctionid", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.auction_type = ProtoField.new("Auction Type", "nasdaq.phlxoptions.marketdepth.itch.v1.6.auctiontype", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.base_reference_number = ProtoField.new("Base Reference Number", "nasdaq.phlxoptions.marketdepth.itch.v1.6.basereferencenumber", ftypes.UINT64)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.bid_price = ProtoField.new("Bid Price", "nasdaq.phlxoptions.marketdepth.itch.v1.6.bidprice", ftypes.DOUBLE)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.bid_reference_number_delta = ProtoField.new("Bid Reference Number Delta", "nasdaq.phlxoptions.marketdepth.itch.v1.6.bidreferencenumberdelta", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.bid_size = ProtoField.new("Bid Size", "nasdaq.phlxoptions.marketdepth.itch.v1.6.bidsize", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.cancelled_contracts = ProtoField.new("Cancelled Contracts", "nasdaq.phlxoptions.marketdepth.itch.v1.6.cancelledcontracts", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.change_reason = ProtoField.new("Change Reason", "nasdaq.phlxoptions.marketdepth.itch.v1.6.changereason", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.cross_number = ProtoField.new("Cross Number", "nasdaq.phlxoptions.marketdepth.itch.v1.6.crossnumber", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.cross_type = ProtoField.new("Cross Type", "nasdaq.phlxoptions.marketdepth.itch.v1.6.crosstype", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.current_trading_state = ProtoField.new("Current Trading State", "nasdaq.phlxoptions.marketdepth.itch.v1.6.currenttradingstate", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.customer_indicator = ProtoField.new("Customer Indicator", "nasdaq.phlxoptions.marketdepth.itch.v1.6.customerindicator", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.event_code = ProtoField.new("Event Code", "nasdaq.phlxoptions.marketdepth.itch.v1.6.eventcode", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.executed_contracts = ProtoField.new("Executed Contracts", "nasdaq.phlxoptions.marketdepth.itch.v1.6.executedcontracts", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.expiration_date = ProtoField.new("Expiration Date", "nasdaq.phlxoptions.marketdepth.itch.v1.6.expirationdate", ftypes.UINT8)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.expiration_month = ProtoField.new("Expiration Month", "nasdaq.phlxoptions.marketdepth.itch.v1.6.expirationmonth", ftypes.UINT8)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.expiration_year = ProtoField.new("Expiration Year", "nasdaq.phlxoptions.marketdepth.itch.v1.6.expirationyear", ftypes.UINT8)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.explicit_strike_price = ProtoField.new("Explicit Strike Price", "nasdaq.phlxoptions.marketdepth.itch.v1.6.explicitstrikeprice", ftypes.DOUBLE)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.imbalance_direction = ProtoField.new("Imbalance Direction", "nasdaq.phlxoptions.marketdepth.itch.v1.6.imbalancedirection", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.imbalance_price = ProtoField.new("Imbalance Price", "nasdaq.phlxoptions.marketdepth.itch.v1.6.imbalanceprice", ftypes.DOUBLE)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.imbalance_volume = ProtoField.new("Imbalance Volume", "nasdaq.phlxoptions.marketdepth.itch.v1.6.imbalancevolume", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.market_side = ProtoField.new("Market Side", "nasdaq.phlxoptions.marketdepth.itch.v1.6.marketside", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.match_number = ProtoField.new("Match Number", "nasdaq.phlxoptions.marketdepth.itch.v1.6.matchnumber", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.message = ProtoField.new("Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.message", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.message_count = ProtoField.new("Message Count", "nasdaq.phlxoptions.marketdepth.itch.v1.6.messagecount", ftypes.UINT16)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.message_header = ProtoField.new("Message Header", "nasdaq.phlxoptions.marketdepth.itch.v1.6.messageheader", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.message_length = ProtoField.new("Message Length", "nasdaq.phlxoptions.marketdepth.itch.v1.6.messagelength", ftypes.UINT16)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.message_type = ProtoField.new("Message Type", "nasdaq.phlxoptions.marketdepth.itch.v1.6.messagetype", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.mpv = ProtoField.new("Mpv", "nasdaq.phlxoptions.marketdepth.itch.v1.6.mpv", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.new_reference_number_delta = ProtoField.new("New Reference Number Delta", "nasdaq.phlxoptions.marketdepth.itch.v1.6.newreferencenumberdelta", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.number_of_reference_number_deltas = ProtoField.new("Number Of Reference Number Deltas", "nasdaq.phlxoptions.marketdepth.itch.v1.6.numberofreferencenumberdeltas", ftypes.UINT16)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.open_state = ProtoField.new("Open State", "nasdaq.phlxoptions.marketdepth.itch.v1.6.openstate", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.option_id = ProtoField.new("Option Id", "nasdaq.phlxoptions.marketdepth.itch.v1.6.optionid", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.option_type = ProtoField.new("Option Type", "nasdaq.phlxoptions.marketdepth.itch.v1.6.optiontype", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.options_closing_type = ProtoField.new("Options Closing Type", "nasdaq.phlxoptions.marketdepth.itch.v1.6.optionsclosingtype", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.order_id = ProtoField.new("Order Id", "nasdaq.phlxoptions.marketdepth.itch.v1.6.orderid", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.order_reference_number_delta = ProtoField.new("Order Reference Number Delta", "nasdaq.phlxoptions.marketdepth.itch.v1.6.orderreferencenumberdelta", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.original_ask_reference_number_delta = ProtoField.new("Original Ask Reference Number Delta", "nasdaq.phlxoptions.marketdepth.itch.v1.6.originalaskreferencenumberdelta", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.original_bid_reference_number_delta = ProtoField.new("Original Bid Reference Number Delta", "nasdaq.phlxoptions.marketdepth.itch.v1.6.originalbidreferencenumberdelta", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.original_reference_number_delta = ProtoField.new("Original Reference Number Delta", "nasdaq.phlxoptions.marketdepth.itch.v1.6.originalreferencenumberdelta", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.packet = ProtoField.new("Packet", "nasdaq.phlxoptions.marketdepth.itch.v1.6.packet", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.packet_header = ProtoField.new("Packet Header", "nasdaq.phlxoptions.marketdepth.itch.v1.6.packetheader", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.paired_contracts = ProtoField.new("Paired Contracts", "nasdaq.phlxoptions.marketdepth.itch.v1.6.pairedcontracts", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.payload = ProtoField.new("Payload", "nasdaq.phlxoptions.marketdepth.itch.v1.6.payload", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.price = ProtoField.new("Price", "nasdaq.phlxoptions.marketdepth.itch.v1.6.price", ftypes.DOUBLE)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.printable = ProtoField.new("Printable", "nasdaq.phlxoptions.marketdepth.itch.v1.6.printable", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.reference_number_delta = ProtoField.new("Reference Number Delta", "nasdaq.phlxoptions.marketdepth.itch.v1.6.referencenumberdelta", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.reserved = ProtoField.new("Reserved", "nasdaq.phlxoptions.marketdepth.itch.v1.6.reserved", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.second = ProtoField.new("Second", "nasdaq.phlxoptions.marketdepth.itch.v1.6.second", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.security_symbol = ProtoField.new("Security Symbol", "nasdaq.phlxoptions.marketdepth.itch.v1.6.securitysymbol", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.sequence_number = ProtoField.new("Sequence Number", "nasdaq.phlxoptions.marketdepth.itch.v1.6.sequencenumber", ftypes.UINT64)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.session = ProtoField.new("Session", "nasdaq.phlxoptions.marketdepth.itch.v1.6.session", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.short_ask_price = ProtoField.new("Short Ask Price", "nasdaq.phlxoptions.marketdepth.itch.v1.6.shortaskprice", ftypes.DOUBLE)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.short_ask_size = ProtoField.new("Short Ask Size", "nasdaq.phlxoptions.marketdepth.itch.v1.6.shortasksize", ftypes.UINT16)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.short_bid_price = ProtoField.new("Short Bid Price", "nasdaq.phlxoptions.marketdepth.itch.v1.6.shortbidprice", ftypes.DOUBLE)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.short_bid_size = ProtoField.new("Short Bid Size", "nasdaq.phlxoptions.marketdepth.itch.v1.6.shortbidsize", ftypes.UINT16)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.short_price = ProtoField.new("Short Price", "nasdaq.phlxoptions.marketdepth.itch.v1.6.shortprice", ftypes.DOUBLE)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.short_volume = ProtoField.new("Short Volume", "nasdaq.phlxoptions.marketdepth.itch.v1.6.shortvolume", ftypes.UINT16)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.source = ProtoField.new("Source", "nasdaq.phlxoptions.marketdepth.itch.v1.6.source", ftypes.UINT8)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.timestamp = ProtoField.new("Timestamp", "nasdaq.phlxoptions.marketdepth.itch.v1.6.timestamp", ftypes.UINT32)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.tradable = ProtoField.new("Tradable", "nasdaq.phlxoptions.marketdepth.itch.v1.6.tradable", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.trade_indicator = ProtoField.new("Trade Indicator", "nasdaq.phlxoptions.marketdepth.itch.v1.6.tradeindicator", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.underlying_symbol = ProtoField.new("Underlying Symbol", "nasdaq.phlxoptions.marketdepth.itch.v1.6.underlyingsymbol", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.volume = ProtoField.new("Volume", "nasdaq.phlxoptions.marketdepth.itch.v1.6.volume", ftypes.UINT32)

-- Nasdaq PhlxOptions MarketDepth Itch 1.6 messages
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.add_order_long_message = ProtoField.new("Add Order Long Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.addorderlongmessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.add_order_short_message = ProtoField.new("Add Order Short Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.addordershortmessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.add_quote_long_message = ProtoField.new("Add Quote Long Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.addquotelongmessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.add_quote_short_message = ProtoField.new("Add Quote Short Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.addquoteshortmessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.auction_notification_message = ProtoField.new("Auction Notification Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.auctionnotificationmessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.base_reference_message = ProtoField.new("Base Reference Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.basereferencemessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.block_delete_message = ProtoField.new("Block Delete Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.blockdeletemessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.broken_trade_order_executed_message = ProtoField.new("Broken Trade Order Executed Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.brokentradeorderexecutedmessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.non_auction_options_trade_message = ProtoField.new("Non Auction Options Trade Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.nonauctionoptionstrademessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.option_directory_message = ProtoField.new("Option Directory Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.optiondirectorymessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.options_cross_trade_message = ProtoField.new("Options Cross Trade Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.optionscrosstrademessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.order_replace_long_message = ProtoField.new("Order Replace Long Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.orderreplacelongmessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.order_replace_short_message = ProtoField.new("Order Replace Short Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.orderreplaceshortmessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.quote_delete_message = ProtoField.new("Quote Delete Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.quotedeletemessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.quote_replace_long_message = ProtoField.new("Quote Replace Long Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.quotereplacelongmessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.quote_replace_short_message = ProtoField.new("Quote Replace Short Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.quotereplaceshortmessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.seconds_message = ProtoField.new("Seconds Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.secondsmessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.security_open_message = ProtoField.new("Security Open Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.securityopenmessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.single_side_cancel_message = ProtoField.new("Single Side Cancel Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.singlesidecancelmessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.single_side_delete_message = ProtoField.new("Single Side Delete Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.singlesidedeletemessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.single_side_executed_message = ProtoField.new("Single Side Executed Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.singlesideexecutedmessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.single_side_executed_with_price_message = ProtoField.new("Single Side Executed With Price Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.singlesideexecutedwithpricemessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.single_side_replace_long_message = ProtoField.new("Single Side Replace Long Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.singlesidereplacelongmessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.single_side_replace_short_message = ProtoField.new("Single Side Replace Short Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.singlesidereplaceshortmessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.single_side_update_message = ProtoField.new("Single Side Update Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.singlesideupdatemessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.system_event_message = ProtoField.new("System Event Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.systemeventmessage", ftypes.STRING)
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.trading_action_message = ProtoField.new("Trading Action Message", "nasdaq.phlxoptions.marketdepth.itch.v1.6.tradingactionmessage", ftypes.STRING)

-- Nasdaq PhlxOptions MarketDepth Itch 1.6 generated fields
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.message_index = ProtoField.new("Message Index", "nasdaq.phlxoptions.marketdepth.itch.v1.6.messageindex", ftypes.UINT16)

-----------------------------------------------------------------------
-- Declare Dissection Options
-----------------------------------------------------------------------

local show = {}

-- Nasdaq PhlxOptions MarketDepth Itch 1.6 Element Dissection Options
show.add_order_long_message = true
show.add_order_short_message = true
show.add_quote_long_message = true
show.add_quote_short_message = true
show.auction_notification_message = true
show.base_reference_message = true
show.block_delete_message = true
show.broken_trade_order_executed_message = true
show.message = true
show.message_header = true
show.non_auction_options_trade_message = true
show.option_directory_message = true
show.options_cross_trade_message = true
show.order_replace_long_message = true
show.order_replace_short_message = true
show.packet = true
show.packet_header = true
show.quote_delete_message = true
show.quote_replace_long_message = true
show.quote_replace_short_message = true
show.seconds_message = true
show.security_open_message = true
show.single_side_cancel_message = true
show.single_side_delete_message = true
show.single_side_executed_message = true
show.single_side_executed_with_price_message = true
show.single_side_replace_long_message = true
show.single_side_replace_short_message = true
show.single_side_update_message = true
show.system_event_message = true
show.trading_action_message = true
show.payload = false

-- Register Nasdaq PhlxOptions MarketDepth Itch 1.6 Show Options
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_add_order_long_message = Pref.bool("Show Add Order Long Message", show.add_order_long_message, "Parse and add Add Order Long Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_add_order_short_message = Pref.bool("Show Add Order Short Message", show.add_order_short_message, "Parse and add Add Order Short Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_add_quote_long_message = Pref.bool("Show Add Quote Long Message", show.add_quote_long_message, "Parse and add Add Quote Long Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_add_quote_short_message = Pref.bool("Show Add Quote Short Message", show.add_quote_short_message, "Parse and add Add Quote Short Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_auction_notification_message = Pref.bool("Show Auction Notification Message", show.auction_notification_message, "Parse and add Auction Notification Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_base_reference_message = Pref.bool("Show Base Reference Message", show.base_reference_message, "Parse and add Base Reference Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_block_delete_message = Pref.bool("Show Block Delete Message", show.block_delete_message, "Parse and add Block Delete Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_broken_trade_order_executed_message = Pref.bool("Show Broken Trade Order Executed Message", show.broken_trade_order_executed_message, "Parse and add Broken Trade Order Executed Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_message = Pref.bool("Show Message", show.message, "Parse and add Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_message_header = Pref.bool("Show Message Header", show.message_header, "Parse and add Message Header to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_non_auction_options_trade_message = Pref.bool("Show Non Auction Options Trade Message", show.non_auction_options_trade_message, "Parse and add Non Auction Options Trade Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_option_directory_message = Pref.bool("Show Option Directory Message", show.option_directory_message, "Parse and add Option Directory Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_options_cross_trade_message = Pref.bool("Show Options Cross Trade Message", show.options_cross_trade_message, "Parse and add Options Cross Trade Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_order_replace_long_message = Pref.bool("Show Order Replace Long Message", show.order_replace_long_message, "Parse and add Order Replace Long Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_order_replace_short_message = Pref.bool("Show Order Replace Short Message", show.order_replace_short_message, "Parse and add Order Replace Short Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_packet = Pref.bool("Show Packet", show.packet, "Parse and add Packet to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_packet_header = Pref.bool("Show Packet Header", show.packet_header, "Parse and add Packet Header to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_quote_delete_message = Pref.bool("Show Quote Delete Message", show.quote_delete_message, "Parse and add Quote Delete Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_quote_replace_long_message = Pref.bool("Show Quote Replace Long Message", show.quote_replace_long_message, "Parse and add Quote Replace Long Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_quote_replace_short_message = Pref.bool("Show Quote Replace Short Message", show.quote_replace_short_message, "Parse and add Quote Replace Short Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_seconds_message = Pref.bool("Show Seconds Message", show.seconds_message, "Parse and add Seconds Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_security_open_message = Pref.bool("Show Security Open Message", show.security_open_message, "Parse and add Security Open Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_cancel_message = Pref.bool("Show Single Side Cancel Message", show.single_side_cancel_message, "Parse and add Single Side Cancel Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_delete_message = Pref.bool("Show Single Side Delete Message", show.single_side_delete_message, "Parse and add Single Side Delete Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_executed_message = Pref.bool("Show Single Side Executed Message", show.single_side_executed_message, "Parse and add Single Side Executed Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_executed_with_price_message = Pref.bool("Show Single Side Executed With Price Message", show.single_side_executed_with_price_message, "Parse and add Single Side Executed With Price Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_replace_long_message = Pref.bool("Show Single Side Replace Long Message", show.single_side_replace_long_message, "Parse and add Single Side Replace Long Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_replace_short_message = Pref.bool("Show Single Side Replace Short Message", show.single_side_replace_short_message, "Parse and add Single Side Replace Short Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_update_message = Pref.bool("Show Single Side Update Message", show.single_side_update_message, "Parse and add Single Side Update Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_system_event_message = Pref.bool("Show System Event Message", show.system_event_message, "Parse and add System Event Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_trading_action_message = Pref.bool("Show Trading Action Message", show.trading_action_message, "Parse and add Trading Action Message to protocol tree")
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_payload = Pref.bool("Show Payload", show.payload, "Parse and add Payload to protocol tree")

-- Handle changed preferences
function omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs_changed()
  local changed = false

  -- Check if show options have changed
  if show.add_order_long_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_add_order_long_message then
    show.add_order_long_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_add_order_long_message
    changed = true
  end
  if show.add_order_short_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_add_order_short_message then
    show.add_order_short_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_add_order_short_message
    changed = true
  end
  if show.add_quote_long_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_add_quote_long_message then
    show.add_quote_long_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_add_quote_long_message
    changed = true
  end
  if show.add_quote_short_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_add_quote_short_message then
    show.add_quote_short_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_add_quote_short_message
    changed = true
  end
  if show.auction_notification_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_auction_notification_message then
    show.auction_notification_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_auction_notification_message
    changed = true
  end
  if show.base_reference_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_base_reference_message then
    show.base_reference_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_base_reference_message
    changed = true
  end
  if show.block_delete_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_block_delete_message then
    show.block_delete_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_block_delete_message
    changed = true
  end
  if show.broken_trade_order_executed_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_broken_trade_order_executed_message then
    show.broken_trade_order_executed_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_broken_trade_order_executed_message
    changed = true
  end
  if show.message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_message then
    show.message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_message
    changed = true
  end
  if show.message_header ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_message_header then
    show.message_header = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_message_header
    changed = true
  end
  if show.non_auction_options_trade_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_non_auction_options_trade_message then
    show.non_auction_options_trade_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_non_auction_options_trade_message
    changed = true
  end
  if show.option_directory_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_option_directory_message then
    show.option_directory_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_option_directory_message
    changed = true
  end
  if show.options_cross_trade_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_options_cross_trade_message then
    show.options_cross_trade_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_options_cross_trade_message
    changed = true
  end
  if show.order_replace_long_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_order_replace_long_message then
    show.order_replace_long_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_order_replace_long_message
    changed = true
  end
  if show.order_replace_short_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_order_replace_short_message then
    show.order_replace_short_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_order_replace_short_message
    changed = true
  end
  if show.packet ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_packet then
    show.packet = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_packet
    changed = true
  end
  if show.packet_header ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_packet_header then
    show.packet_header = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_packet_header
    changed = true
  end
  if show.quote_delete_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_quote_delete_message then
    show.quote_delete_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_quote_delete_message
    changed = true
  end
  if show.quote_replace_long_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_quote_replace_long_message then
    show.quote_replace_long_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_quote_replace_long_message
    changed = true
  end
  if show.quote_replace_short_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_quote_replace_short_message then
    show.quote_replace_short_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_quote_replace_short_message
    changed = true
  end
  if show.seconds_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_seconds_message then
    show.seconds_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_seconds_message
    changed = true
  end
  if show.security_open_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_security_open_message then
    show.security_open_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_security_open_message
    changed = true
  end
  if show.single_side_cancel_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_cancel_message then
    show.single_side_cancel_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_cancel_message
    changed = true
  end
  if show.single_side_delete_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_delete_message then
    show.single_side_delete_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_delete_message
    changed = true
  end
  if show.single_side_executed_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_executed_message then
    show.single_side_executed_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_executed_message
    changed = true
  end
  if show.single_side_executed_with_price_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_executed_with_price_message then
    show.single_side_executed_with_price_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_executed_with_price_message
    changed = true
  end
  if show.single_side_replace_long_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_replace_long_message then
    show.single_side_replace_long_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_replace_long_message
    changed = true
  end
  if show.single_side_replace_short_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_replace_short_message then
    show.single_side_replace_short_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_replace_short_message
    changed = true
  end
  if show.single_side_update_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_update_message then
    show.single_side_update_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_single_side_update_message
    changed = true
  end
  if show.system_event_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_system_event_message then
    show.system_event_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_system_event_message
    changed = true
  end
  if show.trading_action_message ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_trading_action_message then
    show.trading_action_message = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_trading_action_message
    changed = true
  end
  if show.payload ~= omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_payload then
    show.payload = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.prefs.show_payload
    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 Nasdaq PhlxOptions MarketDepth Itch 1.6
-----------------------------------------------------------------------

-- Reserved
nasdaq_phlxoptions_marketdepth_itch_v1_6.reserved = {}

-- Size: Reserved
nasdaq_phlxoptions_marketdepth_itch_v1_6.reserved.size = 3

-- Display: Reserved
nasdaq_phlxoptions_marketdepth_itch_v1_6.reserved.display = function(value)
  return "Reserved: "..value
end

-- Dissect: Reserved
nasdaq_phlxoptions_marketdepth_itch_v1_6.reserved.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.reserved.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.reserved.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.reserved, range, value, display)

  return offset + length, value
end

-- Customer Indicator
nasdaq_phlxoptions_marketdepth_itch_v1_6.customer_indicator = {}

-- Size: Customer Indicator
nasdaq_phlxoptions_marketdepth_itch_v1_6.customer_indicator.size = 1

-- Display: Customer Indicator
nasdaq_phlxoptions_marketdepth_itch_v1_6.customer_indicator.display = function(value)
  if value == "C" then
    return "Customer Indicator: Customer (C)"
  end
  if value == "F" then
    return "Customer Indicator: Firm (F)"
  end
  if value == "M" then
    return "Customer Indicator: Onfloor (M)"
  end
  if value == "P" then
    return "Customer Indicator: Professional (P)"
  end
  if value == "B" then
    return "Customer Indicator: Non Phlx (B)"
  end

  return "Customer Indicator: Unknown("..value..")"
end

-- Dissect: Customer Indicator
nasdaq_phlxoptions_marketdepth_itch_v1_6.customer_indicator.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.customer_indicator.size
  local range = buffer(offset, length)
  local value = range:string()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.customer_indicator.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.customer_indicator, range, value, display)

  return offset + length, value
end

-- Imbalance Volume
nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_volume = {}

-- Size: Imbalance Volume
nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_volume.size = 4

-- Display: Imbalance Volume
nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_volume.display = function(value)
  return "Imbalance Volume: "..value
end

-- Dissect: Imbalance Volume
nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_volume.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_volume.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_volume.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.imbalance_volume, range, value, display)

  return offset + length, value
end

-- Imbalance Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_price = {}

-- Size: Imbalance Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_price.size = 4

-- Display: Imbalance Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_price.display = function(value)
  return "Imbalance Price: "..value
end

-- Translate: Imbalance Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_price.translate = function(raw)
  return raw/10000
end

-- Dissect: Imbalance Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_price.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_price.size
  local range = buffer(offset, length)
  local raw = range:int()
  local value = nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_price.translate(raw)
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_price.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.imbalance_price, range, value, display)

  return offset + length, value
end

-- Option Id
nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id = {}

-- Size: Option Id
nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.size = 4

-- Display: Option Id
nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.display = function(value)
  return "Option Id: "..value
end

-- Dissect: Option Id
nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.option_id, range, value, display)

  return offset + length, value
end

-- Imbalance Direction
nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_direction = {}

-- Size: Imbalance Direction
nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_direction.size = 1

-- Display: Imbalance Direction
nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_direction.display = function(value)
  if value == "B" then
    return "Imbalance Direction: Buy (B)"
  end
  if value == "S" then
    return "Imbalance Direction: Sell (S)"
  end

  return "Imbalance Direction: Unknown("..value..")"
end

-- Dissect: Imbalance Direction
nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_direction.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_direction.size
  local range = buffer(offset, length)
  local value = range:string()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_direction.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.imbalance_direction, range, value, display)

  return offset + length, value
end

-- Paired Contracts
nasdaq_phlxoptions_marketdepth_itch_v1_6.paired_contracts = {}

-- Size: Paired Contracts
nasdaq_phlxoptions_marketdepth_itch_v1_6.paired_contracts.size = 4

-- Display: Paired Contracts
nasdaq_phlxoptions_marketdepth_itch_v1_6.paired_contracts.display = function(value)
  return "Paired Contracts: "..value
end

-- Dissect: Paired Contracts
nasdaq_phlxoptions_marketdepth_itch_v1_6.paired_contracts.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.paired_contracts.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.paired_contracts.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.paired_contracts, range, value, display)

  return offset + length, value
end

-- Auction Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_type = {}

-- Size: Auction Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_type.size = 1

-- Display: Auction Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_type.display = function(value)
  if value == "O" then
    return "Auction Type: Opening (O)"
  end
  if value == "R" then
    return "Auction Type: Reopening (R)"
  end
  if value == "I" then
    return "Auction Type: Exposure (I)"
  end

  return "Auction Type: Unknown("..value..")"
end

-- Dissect: Auction Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_type.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_type.size
  local range = buffer(offset, length)
  local value = range:string()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_type.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.auction_type, range, value, display)

  return offset + length, value
end

-- Auction Id
nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_id = {}

-- Size: Auction Id
nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_id.size = 4

-- Display: Auction Id
nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_id.display = function(value)
  return "Auction Id: "..value
end

-- Dissect: Auction Id
nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_id.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_id.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_id.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.auction_id, range, value, display)

  return offset + length, value
end

-- Timestamp
nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp = {}

-- Size: Timestamp
nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size = 4

-- Display: Timestamp
nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.display = function(value)
  return "Timestamp: "..value
end

-- Dissect: Timestamp
nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.timestamp, range, value, display)

  return offset + length, value
end

-- Auction Notification Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_notification_message = {}

-- Size: Auction Notification Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_notification_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_id.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_type.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.paired_contracts.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_direction.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_volume.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.customer_indicator.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.reserved.size

-- Display: Auction Notification Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_notification_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Auction Notification Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_notification_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Auction Id: 4 Byte Unsigned Fixed Width Integer
  index, auction_id = nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_id.dissect(buffer, index, packet, parent)

  -- Auction Type: 1 Byte Ascii String Enum with 3 values
  index, auction_type = nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_type.dissect(buffer, index, packet, parent)

  -- Paired Contracts: 4 Byte Unsigned Fixed Width Integer
  index, paired_contracts = nasdaq_phlxoptions_marketdepth_itch_v1_6.paired_contracts.dissect(buffer, index, packet, parent)

  -- Imbalance Direction: 1 Byte Ascii String Enum with 2 values
  index, imbalance_direction = nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_direction.dissect(buffer, index, packet, parent)

  -- Option Id: 4 Byte Unsigned Fixed Width Integer
  index, option_id = nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.dissect(buffer, index, packet, parent)

  -- Imbalance Price: 4 Byte Signed Fixed Width Integer
  index, imbalance_price = nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_price.dissect(buffer, index, packet, parent)

  -- Imbalance Volume: 4 Byte Unsigned Fixed Width Integer
  index, imbalance_volume = nasdaq_phlxoptions_marketdepth_itch_v1_6.imbalance_volume.dissect(buffer, index, packet, parent)

  -- Customer Indicator: 1 Byte Ascii String Enum with 5 values
  index, customer_indicator = nasdaq_phlxoptions_marketdepth_itch_v1_6.customer_indicator.dissect(buffer, index, packet, parent)

  -- Reserved: 3 Byte Unsigned Fixed Width Integer
  index, reserved = nasdaq_phlxoptions_marketdepth_itch_v1_6.reserved.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Auction Notification Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_notification_message.dissect = function(buffer, offset, packet, parent)
  if show.auction_notification_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.auction_notification_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_notification_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_notification_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_notification_message.fields(buffer, offset, packet, parent)
  end
end

-- Match Number
nasdaq_phlxoptions_marketdepth_itch_v1_6.match_number = {}

-- Size: Match Number
nasdaq_phlxoptions_marketdepth_itch_v1_6.match_number.size = 4

-- Display: Match Number
nasdaq_phlxoptions_marketdepth_itch_v1_6.match_number.display = function(value)
  return "Match Number: "..value
end

-- Dissect: Match Number
nasdaq_phlxoptions_marketdepth_itch_v1_6.match_number.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.match_number.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.match_number.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.match_number, range, value, display)

  return offset + length, value
end

-- Cross Number
nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_number = {}

-- Size: Cross Number
nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_number.size = 4

-- Display: Cross Number
nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_number.display = function(value)
  return "Cross Number: "..value
end

-- Dissect: Cross Number
nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_number.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_number.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_number.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.cross_number, range, value, display)

  return offset + length, value
end

-- Broken Trade Order Executed Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.broken_trade_order_executed_message = {}

-- Size: Broken Trade Order Executed Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.broken_trade_order_executed_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_number.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.match_number.size

-- Display: Broken Trade Order Executed Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.broken_trade_order_executed_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Broken Trade Order Executed Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.broken_trade_order_executed_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Cross Number: 4 Byte Unsigned Fixed Width Integer
  index, cross_number = nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_number.dissect(buffer, index, packet, parent)

  -- Match Number: 4 Byte Unsigned Fixed Width Integer
  index, match_number = nasdaq_phlxoptions_marketdepth_itch_v1_6.match_number.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Broken Trade Order Executed Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.broken_trade_order_executed_message.dissect = function(buffer, offset, packet, parent)
  if show.broken_trade_order_executed_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.broken_trade_order_executed_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.broken_trade_order_executed_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.broken_trade_order_executed_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.broken_trade_order_executed_message.fields(buffer, offset, packet, parent)
  end
end

-- Volume
nasdaq_phlxoptions_marketdepth_itch_v1_6.volume = {}

-- Size: Volume
nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.size = 4

-- Display: Volume
nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.display = function(value)
  return "Volume: "..value
end

-- Dissect: Volume
nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.volume, range, value, display)

  return offset + length, value
end

-- Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.price = {}

-- Size: Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.price.size = 4

-- Display: Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.price.display = function(value)
  return "Price: "..value
end

-- Translate: Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.price.translate = function(raw)
  return raw/10000
end

-- Dissect: Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.price.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.price.size
  local range = buffer(offset, length)
  local raw = range:int()
  local value = nasdaq_phlxoptions_marketdepth_itch_v1_6.price.translate(raw)
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.price.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.price, range, value, display)

  return offset + length, value
end

-- Cross Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_type = {}

-- Size: Cross Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_type.size = 1

-- Display: Cross Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_type.display = function(value)
  if value == "O" then
    return "Cross Type: Opening Reopening (O)"
  end

  return "Cross Type: Unknown("..value..")"
end

-- Dissect: Cross Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_type.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_type.size
  local range = buffer(offset, length)
  local value = range:string()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_type.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.cross_type, range, value, display)

  return offset + length, value
end

-- Options Cross Trade Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.options_cross_trade_message = {}

-- Size: Options Cross Trade Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.options_cross_trade_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_number.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.match_number.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_type.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.size

-- Display: Options Cross Trade Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.options_cross_trade_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Options Cross Trade Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.options_cross_trade_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Option Id: 4 Byte Unsigned Fixed Width Integer
  index, option_id = nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.dissect(buffer, index, packet, parent)

  -- Cross Number: 4 Byte Unsigned Fixed Width Integer
  index, cross_number = nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_number.dissect(buffer, index, packet, parent)

  -- Match Number: 4 Byte Unsigned Fixed Width Integer
  index, match_number = nasdaq_phlxoptions_marketdepth_itch_v1_6.match_number.dissect(buffer, index, packet, parent)

  -- Cross Type: 1 Byte Ascii String Enum with 1 values
  index, cross_type = nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_type.dissect(buffer, index, packet, parent)

  -- Price: 4 Byte Signed Fixed Width Integer
  index, price = nasdaq_phlxoptions_marketdepth_itch_v1_6.price.dissect(buffer, index, packet, parent)

  -- Volume: 4 Byte Unsigned Fixed Width Integer
  index, volume = nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Options Cross Trade Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.options_cross_trade_message.dissect = function(buffer, offset, packet, parent)
  if show.options_cross_trade_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.options_cross_trade_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.options_cross_trade_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.options_cross_trade_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.options_cross_trade_message.fields(buffer, offset, packet, parent)
  end
end

-- Trade Indicator
nasdaq_phlxoptions_marketdepth_itch_v1_6.trade_indicator = {}

-- Size: Trade Indicator
nasdaq_phlxoptions_marketdepth_itch_v1_6.trade_indicator.size = 1

-- Display: Trade Indicator
nasdaq_phlxoptions_marketdepth_itch_v1_6.trade_indicator.display = function(value)
  if value == "O" then
    return "Trade Indicator: Non Displayable (O)"
  end
  if value == "C" then
    return "Trade Indicator: Complex (C)"
  end
  if value == "P" then
    return "Trade Indicator: Pixl (P)"
  end

  return "Trade Indicator: Unknown("..value..")"
end

-- Dissect: Trade Indicator
nasdaq_phlxoptions_marketdepth_itch_v1_6.trade_indicator.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.trade_indicator.size
  local range = buffer(offset, length)
  local value = range:string()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.trade_indicator.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.trade_indicator, range, value, display)

  return offset + length, value
end

-- Non Auction Options Trade Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.non_auction_options_trade_message = {}

-- Size: Non Auction Options Trade Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.non_auction_options_trade_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.trade_indicator.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_number.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.match_number.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.size

-- Display: Non Auction Options Trade Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.non_auction_options_trade_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Non Auction Options Trade Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.non_auction_options_trade_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Trade Indicator: 1 Byte Ascii String Enum with 3 values
  index, trade_indicator = nasdaq_phlxoptions_marketdepth_itch_v1_6.trade_indicator.dissect(buffer, index, packet, parent)

  -- Option Id: 4 Byte Unsigned Fixed Width Integer
  index, option_id = nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.dissect(buffer, index, packet, parent)

  -- Cross Number: 4 Byte Unsigned Fixed Width Integer
  index, cross_number = nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_number.dissect(buffer, index, packet, parent)

  -- Match Number: 4 Byte Unsigned Fixed Width Integer
  index, match_number = nasdaq_phlxoptions_marketdepth_itch_v1_6.match_number.dissect(buffer, index, packet, parent)

  -- Price: 4 Byte Signed Fixed Width Integer
  index, price = nasdaq_phlxoptions_marketdepth_itch_v1_6.price.dissect(buffer, index, packet, parent)

  -- Volume: 4 Byte Unsigned Fixed Width Integer
  index, volume = nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Non Auction Options Trade Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.non_auction_options_trade_message.dissect = function(buffer, offset, packet, parent)
  if show.non_auction_options_trade_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.non_auction_options_trade_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.non_auction_options_trade_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.non_auction_options_trade_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.non_auction_options_trade_message.fields(buffer, offset, packet, parent)
  end
end

-- Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta = {}

-- Size: Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta.size = 4

-- Display: Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta.display = function(value)
  return "Reference Number Delta: "..value
end

-- Dissect: Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.reference_number_delta, range, value, display)

  return offset + length, value
end

-- Number Of Reference Number Deltas
nasdaq_phlxoptions_marketdepth_itch_v1_6.number_of_reference_number_deltas = {}

-- Size: Number Of Reference Number Deltas
nasdaq_phlxoptions_marketdepth_itch_v1_6.number_of_reference_number_deltas.size = 2

-- Display: Number Of Reference Number Deltas
nasdaq_phlxoptions_marketdepth_itch_v1_6.number_of_reference_number_deltas.display = function(value)
  return "Number Of Reference Number Deltas: "..value
end

-- Dissect: Number Of Reference Number Deltas
nasdaq_phlxoptions_marketdepth_itch_v1_6.number_of_reference_number_deltas.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.number_of_reference_number_deltas.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.number_of_reference_number_deltas.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.number_of_reference_number_deltas, range, value, display)

  return offset + length, value
end

-- Block Delete Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.block_delete_message = {}

-- Size: Block Delete Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.block_delete_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.number_of_reference_number_deltas.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta.size

-- Display: Block Delete Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.block_delete_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Block Delete Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.block_delete_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Number Of Reference Number Deltas: 2 Byte Unsigned Fixed Width Integer
  index, number_of_reference_number_deltas = nasdaq_phlxoptions_marketdepth_itch_v1_6.number_of_reference_number_deltas.dissect(buffer, index, packet, parent)

  -- Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Block Delete Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.block_delete_message.dissect = function(buffer, offset, packet, parent)
  if show.block_delete_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.block_delete_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.block_delete_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.block_delete_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.block_delete_message.fields(buffer, offset, packet, parent)
  end
end

-- Ask Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_reference_number_delta = {}

-- Size: Ask Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_reference_number_delta.size = 4

-- Display: Ask Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_reference_number_delta.display = function(value)
  return "Ask Reference Number Delta: "..value
end

-- Dissect: Ask Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_reference_number_delta.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_reference_number_delta.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_reference_number_delta.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.ask_reference_number_delta, range, value, display)

  return offset + length, value
end

-- Bid Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_reference_number_delta = {}

-- Size: Bid Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_reference_number_delta.size = 4

-- Display: Bid Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_reference_number_delta.display = function(value)
  return "Bid Reference Number Delta: "..value
end

-- Dissect: Bid Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_reference_number_delta.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_reference_number_delta.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_reference_number_delta.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.bid_reference_number_delta, range, value, display)

  return offset + length, value
end

-- Quote Delete Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_delete_message = {}

-- Size: Quote Delete Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_delete_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_reference_number_delta.size

-- Display: Quote Delete Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_delete_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Quote Delete Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_delete_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Bid Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, bid_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Ask Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, ask_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_reference_number_delta.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Quote Delete Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_delete_message.dissect = function(buffer, offset, packet, parent)
  if show.quote_delete_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.quote_delete_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_delete_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_delete_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_delete_message.fields(buffer, offset, packet, parent)
  end
end

-- Ask Size
nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_size = {}

-- Size: Ask Size
nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_size.size = 4

-- Display: Ask Size
nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_size.display = function(value)
  return "Ask Size: "..value
end

-- Dissect: Ask Size
nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_size.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_size.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_size.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.ask_size, range, value, display)

  return offset + length, value
end

-- Ask Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_price = {}

-- Size: Ask Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_price.size = 4

-- Display: Ask Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_price.display = function(value)
  return "Ask Price: "..value
end

-- Translate: Ask Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_price.translate = function(raw)
  return raw/10000
end

-- Dissect: Ask Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_price.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_price.size
  local range = buffer(offset, length)
  local raw = range:int()
  local value = nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_price.translate(raw)
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_price.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.ask_price, range, value, display)

  return offset + length, value
end

-- Bid Size
nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_size = {}

-- Size: Bid Size
nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_size.size = 4

-- Display: Bid Size
nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_size.display = function(value)
  return "Bid Size: "..value
end

-- Dissect: Bid Size
nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_size.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_size.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_size.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.bid_size, range, value, display)

  return offset + length, value
end

-- Bid Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_price = {}

-- Size: Bid Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_price.size = 4

-- Display: Bid Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_price.display = function(value)
  return "Bid Price: "..value
end

-- Translate: Bid Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_price.translate = function(raw)
  return raw/10000
end

-- Dissect: Bid Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_price.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_price.size
  local range = buffer(offset, length)
  local raw = range:int()
  local value = nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_price.translate(raw)
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_price.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.bid_price, range, value, display)

  return offset + length, value
end

-- Original Ask Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.original_ask_reference_number_delta = {}

-- Size: Original Ask Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.original_ask_reference_number_delta.size = 4

-- Display: Original Ask Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.original_ask_reference_number_delta.display = function(value)
  return "Original Ask Reference Number Delta: "..value
end

-- Dissect: Original Ask Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.original_ask_reference_number_delta.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.original_ask_reference_number_delta.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.original_ask_reference_number_delta.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.original_ask_reference_number_delta, range, value, display)

  return offset + length, value
end

-- Original Bid Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.original_bid_reference_number_delta = {}

-- Size: Original Bid Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.original_bid_reference_number_delta.size = 4

-- Display: Original Bid Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.original_bid_reference_number_delta.display = function(value)
  return "Original Bid Reference Number Delta: "..value
end

-- Dissect: Original Bid Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.original_bid_reference_number_delta.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.original_bid_reference_number_delta.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.original_bid_reference_number_delta.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.original_bid_reference_number_delta, range, value, display)

  return offset + length, value
end

-- Quote Replace Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_long_message = {}

-- Size: Quote Replace Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_long_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.original_bid_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.original_ask_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_size.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_size.size

-- Display: Quote Replace Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_long_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Quote Replace Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_long_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Original Bid Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, original_bid_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.original_bid_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Bid Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, bid_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Original Ask Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, original_ask_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.original_ask_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Ask Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, ask_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Bid Price: 4 Byte Signed Fixed Width Integer
  index, bid_price = nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_price.dissect(buffer, index, packet, parent)

  -- Bid Size: 4 Byte Unsigned Fixed Width Integer
  index, bid_size = nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_size.dissect(buffer, index, packet, parent)

  -- Ask Price: 4 Byte Signed Fixed Width Integer
  index, ask_price = nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_price.dissect(buffer, index, packet, parent)

  -- Ask Size: 4 Byte Unsigned Fixed Width Integer
  index, ask_size = nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_size.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Quote Replace Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_long_message.dissect = function(buffer, offset, packet, parent)
  if show.quote_replace_long_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.quote_replace_long_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_long_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_long_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_long_message.fields(buffer, offset, packet, parent)
  end
end

-- Short Ask Size
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_size = {}

-- Size: Short Ask Size
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_size.size = 2

-- Display: Short Ask Size
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_size.display = function(value)
  return "Short Ask Size: "..value
end

-- Dissect: Short Ask Size
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_size.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_size.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_size.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.short_ask_size, range, value, display)

  return offset + length, value
end

-- Short Ask Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_price = {}

-- Size: Short Ask Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_price.size = 2

-- Display: Short Ask Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_price.display = function(value)
  return "Short Ask Price: "..value
end

-- Translate: Short Ask Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_price.translate = function(raw)
  return raw/100
end

-- Dissect: Short Ask Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_price.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_price.size
  local range = buffer(offset, length)
  local raw = range:int()
  local value = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_price.translate(raw)
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_price.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.short_ask_price, range, value, display)

  return offset + length, value
end

-- Short Bid Size
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_size = {}

-- Size: Short Bid Size
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_size.size = 2

-- Display: Short Bid Size
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_size.display = function(value)
  return "Short Bid Size: "..value
end

-- Dissect: Short Bid Size
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_size.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_size.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_size.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.short_bid_size, range, value, display)

  return offset + length, value
end

-- Short Bid Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_price = {}

-- Size: Short Bid Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_price.size = 2

-- Display: Short Bid Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_price.display = function(value)
  return "Short Bid Price: "..value
end

-- Translate: Short Bid Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_price.translate = function(raw)
  return raw/100
end

-- Dissect: Short Bid Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_price.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_price.size
  local range = buffer(offset, length)
  local raw = range:int()
  local value = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_price.translate(raw)
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_price.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.short_bid_price, range, value, display)

  return offset + length, value
end

-- Quote Replace Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_short_message = {}

-- Size: Quote Replace Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_short_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.original_bid_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.original_ask_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_size.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_size.size

-- Display: Quote Replace Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_short_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Quote Replace Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_short_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Original Bid Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, original_bid_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.original_bid_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Bid Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, bid_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Original Ask Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, original_ask_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.original_ask_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Ask Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, ask_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Short Bid Price: 2 Byte Signed Fixed Width Integer
  index, short_bid_price = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_price.dissect(buffer, index, packet, parent)

  -- Short Bid Size: 2 Byte Unsigned Fixed Width Integer
  index, short_bid_size = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_size.dissect(buffer, index, packet, parent)

  -- Short Ask Price: 2 Byte Signed Fixed Width Integer
  index, short_ask_price = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_price.dissect(buffer, index, packet, parent)

  -- Short Ask Size: 2 Byte Unsigned Fixed Width Integer
  index, short_ask_size = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_size.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Quote Replace Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_short_message.dissect = function(buffer, offset, packet, parent)
  if show.quote_replace_short_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.quote_replace_short_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_short_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_short_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_short_message.fields(buffer, offset, packet, parent)
  end
end

-- Change Reason
nasdaq_phlxoptions_marketdepth_itch_v1_6.change_reason = {}

-- Size: Change Reason
nasdaq_phlxoptions_marketdepth_itch_v1_6.change_reason.size = 1

-- Display: Change Reason
nasdaq_phlxoptions_marketdepth_itch_v1_6.change_reason.display = function(value)
  if value == "U" then
    return "Change Reason: User (U)"
  end
  if value == "R" then
    return "Change Reason: Reprice (R)"
  end
  if value == "S" then
    return "Change Reason: Suspend (S)"
  end
  if value == "E" then
    return "Change Reason: Exhausted (E)"
  end

  return "Change Reason: Unknown("..value..")"
end

-- Dissect: Change Reason
nasdaq_phlxoptions_marketdepth_itch_v1_6.change_reason.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.change_reason.size
  local range = buffer(offset, length)
  local value = range:string()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.change_reason.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.change_reason, range, value, display)

  return offset + length, value
end

-- Single Side Update Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_update_message = {}

-- Size: Single Side Update Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_update_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.change_reason.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.size

-- Display: Single Side Update Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_update_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Single Side Update Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_update_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta.dissect(buffer, index, packet, parent)

  -- Change Reason: 1 Byte Ascii String Enum with 4 values
  index, change_reason = nasdaq_phlxoptions_marketdepth_itch_v1_6.change_reason.dissect(buffer, index, packet, parent)

  -- Price: 4 Byte Signed Fixed Width Integer
  index, price = nasdaq_phlxoptions_marketdepth_itch_v1_6.price.dissect(buffer, index, packet, parent)

  -- Volume: 4 Byte Unsigned Fixed Width Integer
  index, volume = nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Single Side Update Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_update_message.dissect = function(buffer, offset, packet, parent)
  if show.single_side_update_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.single_side_update_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_update_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_update_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_update_message.fields(buffer, offset, packet, parent)
  end
end

-- Single Side Delete Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_delete_message = {}

-- Size: Single Side Delete Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_delete_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta.size

-- Display: Single Side Delete Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_delete_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Single Side Delete Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_delete_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Single Side Delete Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_delete_message.dissect = function(buffer, offset, packet, parent)
  if show.single_side_delete_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.single_side_delete_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_delete_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_delete_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_delete_message.fields(buffer, offset, packet, parent)
  end
end

-- Order Id
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_id = {}

-- Size: Order Id
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_id.size = 4

-- Display: Order Id
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_id.display = function(value)
  return "Order Id: "..value
end

-- Dissect: Order Id
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_id.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.order_id.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.order_id.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.order_id, range, value, display)

  return offset + length, value
end

-- New Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.new_reference_number_delta = {}

-- Size: New Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.new_reference_number_delta.size = 4

-- Display: New Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.new_reference_number_delta.display = function(value)
  return "New Reference Number Delta: "..value
end

-- Dissect: New Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.new_reference_number_delta.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.new_reference_number_delta.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.new_reference_number_delta.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.new_reference_number_delta, range, value, display)

  return offset + length, value
end

-- Original Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.original_reference_number_delta = {}

-- Size: Original Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.original_reference_number_delta.size = 4

-- Display: Original Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.original_reference_number_delta.display = function(value)
  return "Original Reference Number Delta: "..value
end

-- Dissect: Original Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.original_reference_number_delta.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.original_reference_number_delta.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.original_reference_number_delta.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.original_reference_number_delta, range, value, display)

  return offset + length, value
end

-- Order Replace Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_long_message = {}

-- Size: Order Replace Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_long_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.original_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.new_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.order_id.size

-- Display: Order Replace Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_long_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Order Replace Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_long_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Original Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, original_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.original_reference_number_delta.dissect(buffer, index, packet, parent)

  -- New Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, new_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.new_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Price: 4 Byte Signed Fixed Width Integer
  index, price = nasdaq_phlxoptions_marketdepth_itch_v1_6.price.dissect(buffer, index, packet, parent)

  -- Volume: 4 Byte Unsigned Fixed Width Integer
  index, volume = nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.dissect(buffer, index, packet, parent)

  -- Order Id: 4 Byte Unsigned Fixed Width Integer
  index, order_id = nasdaq_phlxoptions_marketdepth_itch_v1_6.order_id.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Order Replace Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_long_message.dissect = function(buffer, offset, packet, parent)
  if show.order_replace_long_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.order_replace_long_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_long_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_long_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_long_message.fields(buffer, offset, packet, parent)
  end
end

-- Short Volume
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_volume = {}

-- Size: Short Volume
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_volume.size = 2

-- Display: Short Volume
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_volume.display = function(value)
  return "Short Volume: "..value
end

-- Dissect: Short Volume
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_volume.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_volume.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_volume.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.short_volume, range, value, display)

  return offset + length, value
end

-- Short Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_price = {}

-- Size: Short Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_price.size = 2

-- Display: Short Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_price.display = function(value)
  return "Short Price: "..value
end

-- Translate: Short Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_price.translate = function(raw)
  return raw/100
end

-- Dissect: Short Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.short_price.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_price.size
  local range = buffer(offset, length)
  local raw = range:int()
  local value = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_price.translate(raw)
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_price.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.short_price, range, value, display)

  return offset + length, value
end

-- Order Replace Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_short_message = {}

-- Size: Order Replace Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_short_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.original_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.new_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.short_price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.short_volume.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.order_id.size

-- Display: Order Replace Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_short_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Order Replace Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_short_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Original Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, original_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.original_reference_number_delta.dissect(buffer, index, packet, parent)

  -- New Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, new_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.new_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Short Price: 2 Byte Signed Fixed Width Integer
  index, short_price = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_price.dissect(buffer, index, packet, parent)

  -- Short Volume: 2 Byte Unsigned Fixed Width Integer
  index, short_volume = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_volume.dissect(buffer, index, packet, parent)

  -- Order Id: 4 Byte Unsigned Fixed Width Integer
  index, order_id = nasdaq_phlxoptions_marketdepth_itch_v1_6.order_id.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Order Replace Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_short_message.dissect = function(buffer, offset, packet, parent)
  if show.order_replace_short_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.order_replace_short_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_short_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_short_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_short_message.fields(buffer, offset, packet, parent)
  end
end

-- Single Side Replace Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_long_message = {}

-- Size: Single Side Replace Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_long_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.original_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.new_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.size

-- Display: Single Side Replace Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_long_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Single Side Replace Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_long_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Original Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, original_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.original_reference_number_delta.dissect(buffer, index, packet, parent)

  -- New Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, new_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.new_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Price: 4 Byte Signed Fixed Width Integer
  index, price = nasdaq_phlxoptions_marketdepth_itch_v1_6.price.dissect(buffer, index, packet, parent)

  -- Volume: 4 Byte Unsigned Fixed Width Integer
  index, volume = nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Single Side Replace Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_long_message.dissect = function(buffer, offset, packet, parent)
  if show.single_side_replace_long_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.single_side_replace_long_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_long_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_long_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_long_message.fields(buffer, offset, packet, parent)
  end
end

-- Single Side Replace Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_short_message = {}

-- Size: Single Side Replace Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_short_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.original_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.new_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.short_price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.short_volume.size

-- Display: Single Side Replace Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_short_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Single Side Replace Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_short_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Original Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, original_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.original_reference_number_delta.dissect(buffer, index, packet, parent)

  -- New Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, new_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.new_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Short Price: 2 Byte Signed Fixed Width Integer
  index, short_price = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_price.dissect(buffer, index, packet, parent)

  -- Short Volume: 2 Byte Unsigned Fixed Width Integer
  index, short_volume = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_volume.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Single Side Replace Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_short_message.dissect = function(buffer, offset, packet, parent)
  if show.single_side_replace_short_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.single_side_replace_short_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_short_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_short_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_short_message.fields(buffer, offset, packet, parent)
  end
end

-- Cancelled Contracts
nasdaq_phlxoptions_marketdepth_itch_v1_6.cancelled_contracts = {}

-- Size: Cancelled Contracts
nasdaq_phlxoptions_marketdepth_itch_v1_6.cancelled_contracts.size = 4

-- Display: Cancelled Contracts
nasdaq_phlxoptions_marketdepth_itch_v1_6.cancelled_contracts.display = function(value)
  return "Cancelled Contracts: "..value
end

-- Dissect: Cancelled Contracts
nasdaq_phlxoptions_marketdepth_itch_v1_6.cancelled_contracts.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.cancelled_contracts.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.cancelled_contracts.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.cancelled_contracts, range, value, display)

  return offset + length, value
end

-- Single Side Cancel Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_cancel_message = {}

-- Size: Single Side Cancel Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_cancel_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.cancelled_contracts.size

-- Display: Single Side Cancel Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_cancel_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Single Side Cancel Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_cancel_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta.dissect(buffer, index, packet, parent)

  -- Cancelled Contracts: 4 Byte Unsigned Fixed Width Integer
  index, cancelled_contracts = nasdaq_phlxoptions_marketdepth_itch_v1_6.cancelled_contracts.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Single Side Cancel Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_cancel_message.dissect = function(buffer, offset, packet, parent)
  if show.single_side_cancel_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.single_side_cancel_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_cancel_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_cancel_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_cancel_message.fields(buffer, offset, packet, parent)
  end
end

-- Printable
nasdaq_phlxoptions_marketdepth_itch_v1_6.printable = {}

-- Size: Printable
nasdaq_phlxoptions_marketdepth_itch_v1_6.printable.size = 1

-- Display: Printable
nasdaq_phlxoptions_marketdepth_itch_v1_6.printable.display = function(value)
  if value == "N" then
    return "Printable: Nonprintable (N)"
  end
  if value == "Y" then
    return "Printable: Printable (Y)"
  end

  return "Printable: Unknown("..value..")"
end

-- Dissect: Printable
nasdaq_phlxoptions_marketdepth_itch_v1_6.printable.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.printable.size
  local range = buffer(offset, length)
  local value = range:string()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.printable.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.printable, range, value, display)

  return offset + length, value
end

-- Single Side Executed With Price Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_with_price_message = {}

-- Size: Single Side Executed With Price Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_with_price_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_number.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.match_number.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.printable.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.size

-- Display: Single Side Executed With Price Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_with_price_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Single Side Executed With Price Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_with_price_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta.dissect(buffer, index, packet, parent)

  -- Cross Number: 4 Byte Unsigned Fixed Width Integer
  index, cross_number = nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_number.dissect(buffer, index, packet, parent)

  -- Match Number: 4 Byte Unsigned Fixed Width Integer
  index, match_number = nasdaq_phlxoptions_marketdepth_itch_v1_6.match_number.dissect(buffer, index, packet, parent)

  -- Printable: 1 Byte Ascii String Enum with 2 values
  index, printable = nasdaq_phlxoptions_marketdepth_itch_v1_6.printable.dissect(buffer, index, packet, parent)

  -- Price: 4 Byte Signed Fixed Width Integer
  index, price = nasdaq_phlxoptions_marketdepth_itch_v1_6.price.dissect(buffer, index, packet, parent)

  -- Volume: 4 Byte Unsigned Fixed Width Integer
  index, volume = nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Single Side Executed With Price Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_with_price_message.dissect = function(buffer, offset, packet, parent)
  if show.single_side_executed_with_price_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.single_side_executed_with_price_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_with_price_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_with_price_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_with_price_message.fields(buffer, offset, packet, parent)
  end
end

-- Executed Contracts
nasdaq_phlxoptions_marketdepth_itch_v1_6.executed_contracts = {}

-- Size: Executed Contracts
nasdaq_phlxoptions_marketdepth_itch_v1_6.executed_contracts.size = 4

-- Display: Executed Contracts
nasdaq_phlxoptions_marketdepth_itch_v1_6.executed_contracts.display = function(value)
  return "Executed Contracts: "..value
end

-- Dissect: Executed Contracts
nasdaq_phlxoptions_marketdepth_itch_v1_6.executed_contracts.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.executed_contracts.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.executed_contracts.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.executed_contracts, range, value, display)

  return offset + length, value
end

-- Single Side Executed Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_message = {}

-- Size: Single Side Executed Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.executed_contracts.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_number.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.match_number.size

-- Display: Single Side Executed Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Single Side Executed Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.reference_number_delta.dissect(buffer, index, packet, parent)

  -- Executed Contracts: 4 Byte Unsigned Fixed Width Integer
  index, executed_contracts = nasdaq_phlxoptions_marketdepth_itch_v1_6.executed_contracts.dissect(buffer, index, packet, parent)

  -- Cross Number: 4 Byte Unsigned Fixed Width Integer
  index, cross_number = nasdaq_phlxoptions_marketdepth_itch_v1_6.cross_number.dissect(buffer, index, packet, parent)

  -- Match Number: 4 Byte Unsigned Fixed Width Integer
  index, match_number = nasdaq_phlxoptions_marketdepth_itch_v1_6.match_number.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Single Side Executed Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_message.dissect = function(buffer, offset, packet, parent)
  if show.single_side_executed_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.single_side_executed_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_message.fields(buffer, offset, packet, parent)
  end
end

-- Add Quote Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_long_message = {}

-- Size: Add Quote Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_long_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_size.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_size.size

-- Display: Add Quote Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_long_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Add Quote Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_long_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Bid Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, bid_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Ask Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, ask_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Option Id: 4 Byte Unsigned Fixed Width Integer
  index, option_id = nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.dissect(buffer, index, packet, parent)

  -- Bid Price: 4 Byte Signed Fixed Width Integer
  index, bid_price = nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_price.dissect(buffer, index, packet, parent)

  -- Bid Size: 4 Byte Unsigned Fixed Width Integer
  index, bid_size = nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_size.dissect(buffer, index, packet, parent)

  -- Ask Price: 4 Byte Signed Fixed Width Integer
  index, ask_price = nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_price.dissect(buffer, index, packet, parent)

  -- Ask Size: 4 Byte Unsigned Fixed Width Integer
  index, ask_size = nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_size.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Add Quote Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_long_message.dissect = function(buffer, offset, packet, parent)
  if show.add_quote_long_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.add_quote_long_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_long_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_long_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_long_message.fields(buffer, offset, packet, parent)
  end
end

-- Add Quote Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_short_message = {}

-- Size: Add Quote Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_short_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_size.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_size.size

-- Display: Add Quote Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_short_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Add Quote Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_short_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Bid Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, bid_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.bid_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Ask Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, ask_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.ask_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Option Id: 4 Byte Unsigned Fixed Width Integer
  index, option_id = nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.dissect(buffer, index, packet, parent)

  -- Short Bid Price: 2 Byte Signed Fixed Width Integer
  index, short_bid_price = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_price.dissect(buffer, index, packet, parent)

  -- Short Bid Size: 2 Byte Unsigned Fixed Width Integer
  index, short_bid_size = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_bid_size.dissect(buffer, index, packet, parent)

  -- Short Ask Price: 2 Byte Signed Fixed Width Integer
  index, short_ask_price = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_price.dissect(buffer, index, packet, parent)

  -- Short Ask Size: 2 Byte Unsigned Fixed Width Integer
  index, short_ask_size = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_ask_size.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Add Quote Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_short_message.dissect = function(buffer, offset, packet, parent)
  if show.add_quote_short_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.add_quote_short_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_short_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_short_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_short_message.fields(buffer, offset, packet, parent)
  end
end

-- Market Side
nasdaq_phlxoptions_marketdepth_itch_v1_6.market_side = {}

-- Size: Market Side
nasdaq_phlxoptions_marketdepth_itch_v1_6.market_side.size = 1

-- Display: Market Side
nasdaq_phlxoptions_marketdepth_itch_v1_6.market_side.display = function(value)
  if value == "B" then
    return "Market Side: Buy (B)"
  end
  if value == "S" then
    return "Market Side: Sell (S)"
  end
  if value == "X" then
    return "Market Side: Buy (X)"
  end
  if value == "Y" then
    return "Market Side: Sell (Y)"
  end
  if value == "M" then
    return "Market Side: Buy (M)"
  end
  if value == "N" then
    return "Market Side: Sell (N)"
  end

  return "Market Side: Unknown("..value..")"
end

-- Dissect: Market Side
nasdaq_phlxoptions_marketdepth_itch_v1_6.market_side.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.market_side.size
  local range = buffer(offset, length)
  local value = range:string()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.market_side.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.market_side, range, value, display)

  return offset + length, value
end

-- Order Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_reference_number_delta = {}

-- Size: Order Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_reference_number_delta.size = 4

-- Display: Order Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_reference_number_delta.display = function(value)
  return "Order Reference Number Delta: "..value
end

-- Dissect: Order Reference Number Delta
nasdaq_phlxoptions_marketdepth_itch_v1_6.order_reference_number_delta.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.order_reference_number_delta.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.order_reference_number_delta.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.order_reference_number_delta, range, value, display)

  return offset + length, value
end

-- Add Order Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_long_message = {}

-- Size: Add Order Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_long_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.order_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.market_side.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.order_id.size

-- Display: Add Order Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_long_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Add Order Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_long_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Order Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, order_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.order_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Market Side: 1 Byte Ascii String Enum with 6 values
  index, market_side = nasdaq_phlxoptions_marketdepth_itch_v1_6.market_side.dissect(buffer, index, packet, parent)

  -- Option Id: 4 Byte Unsigned Fixed Width Integer
  index, option_id = nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.dissect(buffer, index, packet, parent)

  -- Price: 4 Byte Signed Fixed Width Integer
  index, price = nasdaq_phlxoptions_marketdepth_itch_v1_6.price.dissect(buffer, index, packet, parent)

  -- Volume: 4 Byte Unsigned Fixed Width Integer
  index, volume = nasdaq_phlxoptions_marketdepth_itch_v1_6.volume.dissect(buffer, index, packet, parent)

  -- Order Id: 4 Byte Unsigned Fixed Width Integer
  index, order_id = nasdaq_phlxoptions_marketdepth_itch_v1_6.order_id.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Add Order Long Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_long_message.dissect = function(buffer, offset, packet, parent)
  if show.add_order_long_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.add_order_long_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_long_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_long_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_long_message.fields(buffer, offset, packet, parent)
  end
end

-- Add Order Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_short_message = {}

-- Size: Add Order Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_short_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.order_reference_number_delta.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.market_side.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.short_price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.short_volume.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.order_id.size

-- Display: Add Order Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_short_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Add Order Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_short_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Order Reference Number Delta: 4 Byte Unsigned Fixed Width Integer
  index, order_reference_number_delta = nasdaq_phlxoptions_marketdepth_itch_v1_6.order_reference_number_delta.dissect(buffer, index, packet, parent)

  -- Market Side: 1 Byte Ascii String Enum with 6 values
  index, market_side = nasdaq_phlxoptions_marketdepth_itch_v1_6.market_side.dissect(buffer, index, packet, parent)

  -- Option Id: 4 Byte Unsigned Fixed Width Integer
  index, option_id = nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.dissect(buffer, index, packet, parent)

  -- Short Price: 2 Byte Signed Fixed Width Integer
  index, short_price = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_price.dissect(buffer, index, packet, parent)

  -- Short Volume: 2 Byte Unsigned Fixed Width Integer
  index, short_volume = nasdaq_phlxoptions_marketdepth_itch_v1_6.short_volume.dissect(buffer, index, packet, parent)

  -- Order Id: 4 Byte Unsigned Fixed Width Integer
  index, order_id = nasdaq_phlxoptions_marketdepth_itch_v1_6.order_id.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Add Order Short Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_short_message.dissect = function(buffer, offset, packet, parent)
  if show.add_order_short_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.add_order_short_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_short_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_short_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_short_message.fields(buffer, offset, packet, parent)
  end
end

-- Open State
nasdaq_phlxoptions_marketdepth_itch_v1_6.open_state = {}

-- Size: Open State
nasdaq_phlxoptions_marketdepth_itch_v1_6.open_state.size = 1

-- Display: Open State
nasdaq_phlxoptions_marketdepth_itch_v1_6.open_state.display = function(value)
  if value == "Y" then
    return "Open State: Open (Y)"
  end
  if value == "N" then
    return "Open State: Closed (N)"
  end

  return "Open State: Unknown("..value..")"
end

-- Dissect: Open State
nasdaq_phlxoptions_marketdepth_itch_v1_6.open_state.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.open_state.size
  local range = buffer(offset, length)
  local value = range:string()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.open_state.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.open_state, range, value, display)

  return offset + length, value
end

-- Security Open Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.security_open_message = {}

-- Size: Security Open Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.security_open_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.open_state.size

-- Display: Security Open Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.security_open_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Security Open Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.security_open_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Option Id: 4 Byte Unsigned Fixed Width Integer
  index, option_id = nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.dissect(buffer, index, packet, parent)

  -- Open State: 1 Byte Ascii String Enum with 2 values
  index, open_state = nasdaq_phlxoptions_marketdepth_itch_v1_6.open_state.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Security Open Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.security_open_message.dissect = function(buffer, offset, packet, parent)
  if show.security_open_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.security_open_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.security_open_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.security_open_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.security_open_message.fields(buffer, offset, packet, parent)
  end
end

-- Current Trading State
nasdaq_phlxoptions_marketdepth_itch_v1_6.current_trading_state = {}

-- Size: Current Trading State
nasdaq_phlxoptions_marketdepth_itch_v1_6.current_trading_state.size = 1

-- Display: Current Trading State
nasdaq_phlxoptions_marketdepth_itch_v1_6.current_trading_state.display = function(value)
  if value == "H" then
    return "Current Trading State: Halt (H)"
  end
  if value == "T" then
    return "Current Trading State: Trading (T)"
  end
  if value == "B" then
    return "Current Trading State: Buy Side Trading Suspended Or Exhausted (B)"
  end
  if value == "S" then
    return "Current Trading State: Sell Side Trading Suspended Or Exhausted (S)"
  end

  return "Current Trading State: Unknown("..value..")"
end

-- Dissect: Current Trading State
nasdaq_phlxoptions_marketdepth_itch_v1_6.current_trading_state.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.current_trading_state.size
  local range = buffer(offset, length)
  local value = range:string()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.current_trading_state.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.current_trading_state, range, value, display)

  return offset + length, value
end

-- Trading Action Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.trading_action_message = {}

-- Size: Trading Action Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.trading_action_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.current_trading_state.size

-- Display: Trading Action Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.trading_action_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Trading Action Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.trading_action_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Option Id: 4 Byte Unsigned Fixed Width Integer
  index, option_id = nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.dissect(buffer, index, packet, parent)

  -- Current Trading State: 1 Byte Ascii String Enum with 4 values
  index, current_trading_state = nasdaq_phlxoptions_marketdepth_itch_v1_6.current_trading_state.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Trading Action Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.trading_action_message.dissect = function(buffer, offset, packet, parent)
  if show.trading_action_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.trading_action_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.trading_action_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.trading_action_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.trading_action_message.fields(buffer, offset, packet, parent)
  end
end

-- Mpv
nasdaq_phlxoptions_marketdepth_itch_v1_6.mpv = {}

-- Size: Mpv
nasdaq_phlxoptions_marketdepth_itch_v1_6.mpv.size = 1

-- Display: Mpv
nasdaq_phlxoptions_marketdepth_itch_v1_6.mpv.display = function(value)
  if value == "E" then
    return "Mpv: Everywhere (E)"
  end
  if value == "S" then
    return "Mpv: Scaled (S)"
  end
  if value == "P" then
    return "Mpv: Pilot (P)"
  end

  return "Mpv: Unknown("..value..")"
end

-- Dissect: Mpv
nasdaq_phlxoptions_marketdepth_itch_v1_6.mpv.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.mpv.size
  local range = buffer(offset, length)
  local value = range:string()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.mpv.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.mpv, range, value, display)

  return offset + length, value
end

-- Tradable
nasdaq_phlxoptions_marketdepth_itch_v1_6.tradable = {}

-- Size: Tradable
nasdaq_phlxoptions_marketdepth_itch_v1_6.tradable.size = 1

-- Display: Tradable
nasdaq_phlxoptions_marketdepth_itch_v1_6.tradable.display = function(value)
  if value == "Y" then
    return "Tradable: Tradable (Y)"
  end
  if value == "N" then
    return "Tradable: Not Tradable (N)"
  end

  return "Tradable: Unknown("..value..")"
end

-- Dissect: Tradable
nasdaq_phlxoptions_marketdepth_itch_v1_6.tradable.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.tradable.size
  local range = buffer(offset, length)
  local value = range:string()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.tradable.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.tradable, range, value, display)

  return offset + length, value
end

-- Options Closing Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.options_closing_type = {}

-- Size: Options Closing Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.options_closing_type.size = 1

-- Display: Options Closing Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.options_closing_type.display = function(value)
  if value == "N" then
    return "Options Closing Type: Normal (N)"
  end
  if value == "L" then
    return "Options Closing Type: Late (L)"
  end
  if value == "W" then
    return "Options Closing Type: Wco Early Closing (W)"
  end

  return "Options Closing Type: Unknown("..value..")"
end

-- Dissect: Options Closing Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.options_closing_type.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.options_closing_type.size
  local range = buffer(offset, length)
  local value = range:string()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.options_closing_type.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.options_closing_type, range, value, display)

  return offset + length, value
end

-- Underlying Symbol
nasdaq_phlxoptions_marketdepth_itch_v1_6.underlying_symbol = {}

-- Size: Underlying Symbol
nasdaq_phlxoptions_marketdepth_itch_v1_6.underlying_symbol.size = 13

-- Display: Underlying Symbol
nasdaq_phlxoptions_marketdepth_itch_v1_6.underlying_symbol.display = function(value)
  return "Underlying Symbol: "..value
end

-- Dissect: Underlying Symbol
nasdaq_phlxoptions_marketdepth_itch_v1_6.underlying_symbol.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.underlying_symbol.size
  local range = buffer(offset, length)
  local value = trim_right_spaces(range:string())
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.underlying_symbol.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.underlying_symbol, range, value, display)

  return offset + length, value
end

-- Source
nasdaq_phlxoptions_marketdepth_itch_v1_6.source = {}

-- Size: Source
nasdaq_phlxoptions_marketdepth_itch_v1_6.source.size = 1

-- Display: Source
nasdaq_phlxoptions_marketdepth_itch_v1_6.source.display = function(value)
  return "Source: "..value
end

-- Dissect: Source
nasdaq_phlxoptions_marketdepth_itch_v1_6.source.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.source.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.source.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.source, range, value, display)

  return offset + length, value
end

-- Option Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.option_type = {}

-- Size: Option Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.option_type.size = 1

-- Display: Option Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.option_type.display = function(value)
  if value == "C" then
    return "Option Type: Call (C)"
  end
  if value == "P" then
    return "Option Type: Put (P)"
  end

  return "Option Type: Unknown("..value..")"
end

-- Dissect: Option Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.option_type.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.option_type.size
  local range = buffer(offset, length)
  local value = range:string()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.option_type.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.option_type, range, value, display)

  return offset + length, value
end

-- Explicit Strike Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.explicit_strike_price = {}

-- Size: Explicit Strike Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.explicit_strike_price.size = 4

-- Display: Explicit Strike Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.explicit_strike_price.display = function(value)
  return "Explicit Strike Price: "..value
end

-- Translate: Explicit Strike Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.explicit_strike_price.translate = function(raw)
  return raw/10000
end

-- Dissect: Explicit Strike Price
nasdaq_phlxoptions_marketdepth_itch_v1_6.explicit_strike_price.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.explicit_strike_price.size
  local range = buffer(offset, length)
  local raw = range:int()
  local value = nasdaq_phlxoptions_marketdepth_itch_v1_6.explicit_strike_price.translate(raw)
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.explicit_strike_price.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.explicit_strike_price, range, value, display)

  return offset + length, value
end

-- Expiration Date
nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_date = {}

-- Size: Expiration Date
nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_date.size = 1

-- Display: Expiration Date
nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_date.display = function(value)
  return "Expiration Date: "..value
end

-- Dissect: Expiration Date
nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_date.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_date.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_date.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.expiration_date, range, value, display)

  return offset + length, value
end

-- Expiration Month
nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_month = {}

-- Size: Expiration Month
nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_month.size = 1

-- Display: Expiration Month
nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_month.display = function(value)
  return "Expiration Month: "..value
end

-- Dissect: Expiration Month
nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_month.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_month.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_month.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.expiration_month, range, value, display)

  return offset + length, value
end

-- Expiration Year
nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_year = {}

-- Size: Expiration Year
nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_year.size = 1

-- Display: Expiration Year
nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_year.display = function(value)
  return "Expiration Year: "..value
end

-- Dissect: Expiration Year
nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_year.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_year.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_year.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.expiration_year, range, value, display)

  return offset + length, value
end

-- Security Symbol
nasdaq_phlxoptions_marketdepth_itch_v1_6.security_symbol = {}

-- Size: Security Symbol
nasdaq_phlxoptions_marketdepth_itch_v1_6.security_symbol.size = 6

-- Display: Security Symbol
nasdaq_phlxoptions_marketdepth_itch_v1_6.security_symbol.display = function(value)
  return "Security Symbol: "..value
end

-- Dissect: Security Symbol
nasdaq_phlxoptions_marketdepth_itch_v1_6.security_symbol.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.security_symbol.size
  local range = buffer(offset, length)
  local value = trim_right_spaces(range:string())
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.security_symbol.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.security_symbol, range, value, display)

  return offset + length, value
end

-- Option Directory Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.option_directory_message = {}

-- Size: Option Directory Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.option_directory_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.security_symbol.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_year.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_month.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_date.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.explicit_strike_price.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.option_type.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.source.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.underlying_symbol.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.options_closing_type.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.tradable.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.mpv.size

-- Display: Option Directory Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.option_directory_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Option Directory Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.option_directory_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Option Id: 4 Byte Unsigned Fixed Width Integer
  index, option_id = nasdaq_phlxoptions_marketdepth_itch_v1_6.option_id.dissect(buffer, index, packet, parent)

  -- Security Symbol: 6 Byte Ascii String
  index, security_symbol = nasdaq_phlxoptions_marketdepth_itch_v1_6.security_symbol.dissect(buffer, index, packet, parent)

  -- Expiration Year: 1 Byte Unsigned Fixed Width Integer
  index, expiration_year = nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_year.dissect(buffer, index, packet, parent)

  -- Expiration Month: 1 Byte Unsigned Fixed Width Integer
  index, expiration_month = nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_month.dissect(buffer, index, packet, parent)

  -- Expiration Date: 1 Byte Unsigned Fixed Width Integer
  index, expiration_date = nasdaq_phlxoptions_marketdepth_itch_v1_6.expiration_date.dissect(buffer, index, packet, parent)

  -- Explicit Strike Price: 4 Byte Signed Fixed Width Integer
  index, explicit_strike_price = nasdaq_phlxoptions_marketdepth_itch_v1_6.explicit_strike_price.dissect(buffer, index, packet, parent)

  -- Option Type: 1 Byte Ascii String Enum with 2 values
  index, option_type = nasdaq_phlxoptions_marketdepth_itch_v1_6.option_type.dissect(buffer, index, packet, parent)

  -- Source: 1 Byte Unsigned Fixed Width Integer
  index, source = nasdaq_phlxoptions_marketdepth_itch_v1_6.source.dissect(buffer, index, packet, parent)

  -- Underlying Symbol: 13 Byte Ascii String
  index, underlying_symbol = nasdaq_phlxoptions_marketdepth_itch_v1_6.underlying_symbol.dissect(buffer, index, packet, parent)

  -- Options Closing Type: 1 Byte Ascii String Enum with 3 values
  index, options_closing_type = nasdaq_phlxoptions_marketdepth_itch_v1_6.options_closing_type.dissect(buffer, index, packet, parent)

  -- Tradable: 1 Byte Ascii String Enum with 2 values
  index, tradable = nasdaq_phlxoptions_marketdepth_itch_v1_6.tradable.dissect(buffer, index, packet, parent)

  -- Mpv: 1 Byte Ascii String Enum with 3 values
  index, mpv = nasdaq_phlxoptions_marketdepth_itch_v1_6.mpv.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Option Directory Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.option_directory_message.dissect = function(buffer, offset, packet, parent)
  if show.option_directory_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.option_directory_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.option_directory_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.option_directory_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.option_directory_message.fields(buffer, offset, packet, parent)
  end
end

-- Base Reference Number
nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_number = {}

-- Size: Base Reference Number
nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_number.size = 8

-- Display: Base Reference Number
nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_number.display = function(value)
  return "Base Reference Number: "..value
end

-- Dissect: Base Reference Number
nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_number.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_number.size
  local range = buffer(offset, length)
  local value = range:uint64()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_number.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.base_reference_number, range, value, display)

  return offset + length, value
end

-- Base Reference Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_message = {}

-- Size: Base Reference Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_number.size

-- Display: Base Reference Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Base Reference Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Base Reference Number: 8 Byte Unsigned Fixed Width Integer
  index, base_reference_number = nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_number.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Base Reference Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_message.dissect = function(buffer, offset, packet, parent)
  if show.base_reference_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.base_reference_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_message.fields(buffer, offset, packet, parent)
  end
end

-- Event Code
nasdaq_phlxoptions_marketdepth_itch_v1_6.event_code = {}

-- Size: Event Code
nasdaq_phlxoptions_marketdepth_itch_v1_6.event_code.size = 1

-- Display: Event Code
nasdaq_phlxoptions_marketdepth_itch_v1_6.event_code.display = function(value)
  if value == "O" then
    return "Event Code: Start Of Messages This Is Always The First Message Sent In Any Trading Day (O)"
  end
  if value == "S" then
    return "Event Code: Start Of System Hours This Message Indicates That Phlx® Is Open And Ready To Start Accepting Orders (S)"
  end
  if value == "Q" then
    return "Event Code: Start Of Opening Process This Message Is Intended To Indicate That Phlx® Has Started Its Opening Auction Process (Q)"
  end
  if value == "N" then
    return "Event Code: End Of Normal Hours Processing This Message Is Intended To Indicate That Phlx® Will No Longer Accept Any New Orders Or Changes To Existing Orders For Options That Trade During Normal Trading Hours (N)"
  end
  if value == "L" then
    return "Event Code: End Of Late Hours Processing This Message Is Intended To Indicate That Phlx® Will No Longer Accept Any New Orders Or Changes To Existing Orders For Options That Trade During Extended Hours (L)"
  end
  if value == "E" then
    return "Event Code: End Of System Hours This Message Indicates That Phlx® Options System Is Now Closed (E)"
  end
  if value == "C" then
    return "Event Code: End Of Messages This Is Always The Last Message Sent In Any Trading Day (C)"
  end
  if value == "W" then
    return "Event Code: End Of Wco Early Closing This Message Is Intended To Indicate That The Exchange Will No Longer Accept Any New Orders Or Changes To Existing Orders On Last Trading Date Of Wco Options (W)"
  end

  return "Event Code: Unknown("..value..")"
end

-- Dissect: Event Code
nasdaq_phlxoptions_marketdepth_itch_v1_6.event_code.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.event_code.size
  local range = buffer(offset, length)
  local value = range:string()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.event_code.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.event_code, range, value, display)

  return offset + length, value
end

-- System Event Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.system_event_message = {}

-- Size: System Event Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.system_event_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.event_code.size

-- Display: System Event Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.system_event_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: System Event Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.system_event_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Timestamp: 4 Byte Unsigned Fixed Width Integer
  index, timestamp = nasdaq_phlxoptions_marketdepth_itch_v1_6.timestamp.dissect(buffer, index, packet, parent)

  -- Event Code: 1 Byte Ascii String Enum with 8 values
  index, event_code = nasdaq_phlxoptions_marketdepth_itch_v1_6.event_code.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: System Event Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.system_event_message.dissect = function(buffer, offset, packet, parent)
  if show.system_event_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.system_event_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.system_event_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.system_event_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.system_event_message.fields(buffer, offset, packet, parent)
  end
end

-- Second
nasdaq_phlxoptions_marketdepth_itch_v1_6.second = {}

-- Size: Second
nasdaq_phlxoptions_marketdepth_itch_v1_6.second.size = 4

-- Display: Second
nasdaq_phlxoptions_marketdepth_itch_v1_6.second.display = function(value)
  return "Second: "..value
end

-- Dissect: Second
nasdaq_phlxoptions_marketdepth_itch_v1_6.second.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.second.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.second.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.second, range, value, display)

  return offset + length, value
end

-- Seconds Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.seconds_message = {}

-- Size: Seconds Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.seconds_message.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.second.size

-- Display: Seconds Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.seconds_message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Seconds Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.seconds_message.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Second: 4 Byte Unsigned Fixed Width Integer
  index, second = nasdaq_phlxoptions_marketdepth_itch_v1_6.second.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Seconds Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.seconds_message.dissect = function(buffer, offset, packet, parent)
  if show.seconds_message then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.seconds_message, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.seconds_message.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.seconds_message.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.seconds_message.fields(buffer, offset, packet, parent)
  end
end

-- Payload
nasdaq_phlxoptions_marketdepth_itch_v1_6.payload = {}

-- Size: Payload
nasdaq_phlxoptions_marketdepth_itch_v1_6.payload.size = function(buffer, offset, message_type)
  -- Size of Seconds Message
  if message_type == "T" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.seconds_message.size
  end
  -- Size of System Event Message
  if message_type == "S" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.system_event_message.size
  end
  -- Size of Base Reference Message
  if message_type == "L" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_message.size
  end
  -- Size of Option Directory Message
  if message_type == "R" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.option_directory_message.size
  end
  -- Size of Trading Action Message
  if message_type == "H" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.trading_action_message.size
  end
  -- Size of Security Open Message
  if message_type == "O" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.security_open_message.size
  end
  -- Size of Add Order Short Message
  if message_type == "a" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_short_message.size
  end
  -- Size of Add Order Long Message
  if message_type == "A" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_long_message.size
  end
  -- Size of Add Quote Short Message
  if message_type == "j" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_short_message.size
  end
  -- Size of Add Quote Long Message
  if message_type == "J" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_long_message.size
  end
  -- Size of Single Side Executed Message
  if message_type == "E" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_message.size
  end
  -- Size of Single Side Executed With Price Message
  if message_type == "C" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_with_price_message.size
  end
  -- Size of Single Side Cancel Message
  if message_type == "X" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_cancel_message.size
  end
  -- Size of Single Side Replace Short Message
  if message_type == "u" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_short_message.size
  end
  -- Size of Single Side Replace Long Message
  if message_type == "U" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_long_message.size
  end
  -- Size of Order Replace Short Message
  if message_type == "v" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_short_message.size
  end
  -- Size of Order Replace Long Message
  if message_type == "V" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_long_message.size
  end
  -- Size of Single Side Delete Message
  if message_type == "D" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_delete_message.size
  end
  -- Size of Single Side Update Message
  if message_type == "G" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_update_message.size
  end
  -- Size of Quote Replace Short Message
  if message_type == "k" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_short_message.size
  end
  -- Size of Quote Replace Long Message
  if message_type == "K" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_long_message.size
  end
  -- Size of Quote Delete Message
  if message_type == "Y" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_delete_message.size
  end
  -- Size of Block Delete Message
  if message_type == "Z" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.block_delete_message.size
  end
  -- Size of Non Auction Options Trade Message
  if message_type == "P" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.non_auction_options_trade_message.size
  end
  -- Size of Options Cross Trade Message
  if message_type == "Q" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.options_cross_trade_message.size
  end
  -- Size of Broken Trade Order Executed Message
  if message_type == "B" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.broken_trade_order_executed_message.size
  end
  -- Size of Auction Notification Message
  if message_type == "I" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_notification_message.size
  end

  return 0
end

-- Display: Payload
nasdaq_phlxoptions_marketdepth_itch_v1_6.payload.display = function(buffer, offset, packet, parent)
  return ""
end

-- Dissect Branches: Payload
nasdaq_phlxoptions_marketdepth_itch_v1_6.payload.branches = function(buffer, offset, packet, parent, message_type)
  -- Dissect Seconds Message
  if message_type == "T" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.seconds_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect System Event Message
  if message_type == "S" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.system_event_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Base Reference Message
  if message_type == "L" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.base_reference_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Option Directory Message
  if message_type == "R" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.option_directory_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Trading Action Message
  if message_type == "H" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.trading_action_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Security Open Message
  if message_type == "O" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.security_open_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Add Order Short Message
  if message_type == "a" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_short_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Add Order Long Message
  if message_type == "A" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.add_order_long_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Add Quote Short Message
  if message_type == "j" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_short_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Add Quote Long Message
  if message_type == "J" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.add_quote_long_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Single Side Executed Message
  if message_type == "E" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Single Side Executed With Price Message
  if message_type == "C" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_executed_with_price_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Single Side Cancel Message
  if message_type == "X" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_cancel_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Single Side Replace Short Message
  if message_type == "u" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_short_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Single Side Replace Long Message
  if message_type == "U" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_replace_long_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Order Replace Short Message
  if message_type == "v" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_short_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Order Replace Long Message
  if message_type == "V" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.order_replace_long_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Single Side Delete Message
  if message_type == "D" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_delete_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Single Side Update Message
  if message_type == "G" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.single_side_update_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Quote Replace Short Message
  if message_type == "k" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_short_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Quote Replace Long Message
  if message_type == "K" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_replace_long_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Quote Delete Message
  if message_type == "Y" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.quote_delete_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Block Delete Message
  if message_type == "Z" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.block_delete_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Non Auction Options Trade Message
  if message_type == "P" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.non_auction_options_trade_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Options Cross Trade Message
  if message_type == "Q" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.options_cross_trade_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Broken Trade Order Executed Message
  if message_type == "B" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.broken_trade_order_executed_message.dissect(buffer, offset, packet, parent)
  end
  -- Dissect Auction Notification Message
  if message_type == "I" then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.auction_notification_message.dissect(buffer, offset, packet, parent)
  end

  return offset
end

-- Dissect: Payload
nasdaq_phlxoptions_marketdepth_itch_v1_6.payload.dissect = function(buffer, offset, packet, parent, message_type)
  if not show.payload then
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.payload.branches(buffer, offset, packet, parent, message_type)
  end

  -- Calculate size and check that branch is not empty
  local size = nasdaq_phlxoptions_marketdepth_itch_v1_6.payload.size(buffer, offset, message_type)
  if size == 0 then
    return offset
  end

  -- Dissect Element
  local range = buffer(offset, size)
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.payload.display(buffer, packet, parent)
  local element = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.payload, range, display)

  return nasdaq_phlxoptions_marketdepth_itch_v1_6.payload.branches(buffer, offset, packet, parent, message_type)
end

-- Message Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.message_type = {}

-- Size: Message Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.message_type.size = 1

-- Display: Message Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.message_type.display = function(value)
  if value == "T" then
    return "Message Type: Seconds Message (T)"
  end
  if value == "S" then
    return "Message Type: System Event Message (S)"
  end
  if value == "L" then
    return "Message Type: Base Reference Message (L)"
  end
  if value == "R" then
    return "Message Type: Option Directory Message (R)"
  end
  if value == "H" then
    return "Message Type: Trading Action Message (H)"
  end
  if value == "O" then
    return "Message Type: Security Open Message (O)"
  end
  if value == "a" then
    return "Message Type: Add Order Short Message (a)"
  end
  if value == "A" then
    return "Message Type: Add Order Long Message (A)"
  end
  if value == "j" then
    return "Message Type: Add Quote Short Message (j)"
  end
  if value == "J" then
    return "Message Type: Add Quote Long Message (J)"
  end
  if value == "E" then
    return "Message Type: Single Side Executed Message (E)"
  end
  if value == "C" then
    return "Message Type: Single Side Executed With Price Message (C)"
  end
  if value == "X" then
    return "Message Type: Single Side Cancel Message (X)"
  end
  if value == "u" then
    return "Message Type: Single Side Replace Short Message (u)"
  end
  if value == "U" then
    return "Message Type: Single Side Replace Long Message (U)"
  end
  if value == "v" then
    return "Message Type: Order Replace Short Message (v)"
  end
  if value == "V" then
    return "Message Type: Order Replace Long Message (V)"
  end
  if value == "D" then
    return "Message Type: Single Side Delete Message (D)"
  end
  if value == "G" then
    return "Message Type: Single Side Update Message (G)"
  end
  if value == "k" then
    return "Message Type: Quote Replace Short Message (k)"
  end
  if value == "K" then
    return "Message Type: Quote Replace Long Message (K)"
  end
  if value == "Y" then
    return "Message Type: Quote Delete Message (Y)"
  end
  if value == "Z" then
    return "Message Type: Block Delete Message (Z)"
  end
  if value == "P" then
    return "Message Type: Non Auction Options Trade Message (P)"
  end
  if value == "Q" then
    return "Message Type: Options Cross Trade Message (Q)"
  end
  if value == "B" then
    return "Message Type: Broken Trade Order Executed Message (B)"
  end
  if value == "I" then
    return "Message Type: Auction Notification Message (I)"
  end

  return "Message Type: Unknown("..value..")"
end

-- Dissect: Message Type
nasdaq_phlxoptions_marketdepth_itch_v1_6.message_type.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.message_type.size
  local range = buffer(offset, length)
  local value = range:string()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.message_type.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.message_type, range, value, display)

  return offset + length, value
end

-- Message Length
nasdaq_phlxoptions_marketdepth_itch_v1_6.message_length = {}

-- Size: Message Length
nasdaq_phlxoptions_marketdepth_itch_v1_6.message_length.size = 2

-- Display: Message Length
nasdaq_phlxoptions_marketdepth_itch_v1_6.message_length.display = function(value)
  return "Message Length: "..value
end

-- Dissect: Message Length
nasdaq_phlxoptions_marketdepth_itch_v1_6.message_length.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.message_length.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.message_length.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.message_length, range, value, display)

  return offset + length, value
end

-- Message Header
nasdaq_phlxoptions_marketdepth_itch_v1_6.message_header = {}

-- Size: Message Header
nasdaq_phlxoptions_marketdepth_itch_v1_6.message_header.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.message_length.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.message_type.size

-- Display: Message Header
nasdaq_phlxoptions_marketdepth_itch_v1_6.message_header.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Message Header
nasdaq_phlxoptions_marketdepth_itch_v1_6.message_header.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Message Length: 2 Byte Unsigned Fixed Width Integer
  index, message_length = nasdaq_phlxoptions_marketdepth_itch_v1_6.message_length.dissect(buffer, index, packet, parent)

  -- Message Type: 1 Byte Ascii String Enum with 27 values
  index, message_type = nasdaq_phlxoptions_marketdepth_itch_v1_6.message_type.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Message Header
nasdaq_phlxoptions_marketdepth_itch_v1_6.message_header.dissect = function(buffer, offset, packet, parent)
  if show.message_header then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.message_header, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.message_header.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.message_header.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.message_header.fields(buffer, offset, packet, parent)
  end
end

-- Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.message = {}

-- Display: Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.message.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.message.fields = function(buffer, offset, packet, parent, size_of_message, message_index)
  local index = offset

  -- Implicit Message Index
  if message_index ~= nil then
    local iteration = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.message_index, message_index)
    iteration:set_generated()
  end

  -- Message Header: Struct of 2 fields
  index, message_header = nasdaq_phlxoptions_marketdepth_itch_v1_6.message_header.dissect(buffer, index, packet, parent)

  -- Dependency element: Message Type
  local message_type = buffer(index - 1, 1):string()

  -- Payload: Runtime Type with 27 branches
  index = nasdaq_phlxoptions_marketdepth_itch_v1_6.payload.dissect(buffer, index, packet, parent, message_type)

  return index
end

-- Dissect: Message
nasdaq_phlxoptions_marketdepth_itch_v1_6.message.dissect = function(buffer, offset, packet, parent, size_of_message, message_index)
  local index = offset + size_of_message

  -- Optionally add group/struct element to protocol tree
  if show.message then
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.message, buffer(offset, 0))
    local current = nasdaq_phlxoptions_marketdepth_itch_v1_6.message.fields(buffer, offset, packet, parent, size_of_message, message_index)
    parent:set_len(size_of_message)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.message.display(buffer, packet, parent)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    nasdaq_phlxoptions_marketdepth_itch_v1_6.message.fields(buffer, offset, packet, parent, size_of_message, message_index)

    return index
  end
end

-- Message Count
nasdaq_phlxoptions_marketdepth_itch_v1_6.message_count = {}

-- Size: Message Count
nasdaq_phlxoptions_marketdepth_itch_v1_6.message_count.size = 2

-- Display: Message Count
nasdaq_phlxoptions_marketdepth_itch_v1_6.message_count.display = function(value)
  return "Message Count: "..value
end

-- Dissect: Message Count
nasdaq_phlxoptions_marketdepth_itch_v1_6.message_count.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.message_count.size
  local range = buffer(offset, length)
  local value = range:uint()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.message_count.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.message_count, range, value, display)

  return offset + length, value
end

-- Sequence Number
nasdaq_phlxoptions_marketdepth_itch_v1_6.sequence_number = {}

-- Size: Sequence Number
nasdaq_phlxoptions_marketdepth_itch_v1_6.sequence_number.size = 8

-- Display: Sequence Number
nasdaq_phlxoptions_marketdepth_itch_v1_6.sequence_number.display = function(value)
  return "Sequence Number: "..value
end

-- Dissect: Sequence Number
nasdaq_phlxoptions_marketdepth_itch_v1_6.sequence_number.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.sequence_number.size
  local range = buffer(offset, length)
  local value = range:uint64()
  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.sequence_number.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.sequence_number, range, value, display)

  return offset + length, value
end

-- Session
nasdaq_phlxoptions_marketdepth_itch_v1_6.session = {}

-- Size: Session
nasdaq_phlxoptions_marketdepth_itch_v1_6.session.size = 10

-- Display: Session
nasdaq_phlxoptions_marketdepth_itch_v1_6.session.display = function(value)
  -- Check if field has value
  if value == nil or value == '' then
    return "Session: No Value"
  end

  return "Session: "..value
end

-- Dissect: Session
nasdaq_phlxoptions_marketdepth_itch_v1_6.session.dissect = function(buffer, offset, packet, parent)
  local length = nasdaq_phlxoptions_marketdepth_itch_v1_6.session.size
  local range = buffer(offset, length)

  -- parse last octet
  local last = buffer(offset + length - 1, 1):uint()

  -- read full string or up to first zero
  local value = ''
  if last == 0 then
    value = range:stringz()
  else
    value = range:string()
  end

  local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.session.display(value, buffer, offset, packet, parent)

  parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.session, range, value, display)

  return offset + length, value
end

-- Packet Header
nasdaq_phlxoptions_marketdepth_itch_v1_6.packet_header = {}

-- Size: Packet Header
nasdaq_phlxoptions_marketdepth_itch_v1_6.packet_header.size =
  nasdaq_phlxoptions_marketdepth_itch_v1_6.session.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.sequence_number.size + 
  nasdaq_phlxoptions_marketdepth_itch_v1_6.message_count.size

-- Display: Packet Header
nasdaq_phlxoptions_marketdepth_itch_v1_6.packet_header.display = function(packet, parent, length)
  return ""
end

-- Dissect Fields: Packet Header
nasdaq_phlxoptions_marketdepth_itch_v1_6.packet_header.fields = function(buffer, offset, packet, parent)
  local index = offset

  -- Session: 10 Byte Ascii String
  index, session = nasdaq_phlxoptions_marketdepth_itch_v1_6.session.dissect(buffer, index, packet, parent)

  -- Sequence Number: 8 Byte Unsigned Fixed Width Integer
  index, sequence_number = nasdaq_phlxoptions_marketdepth_itch_v1_6.sequence_number.dissect(buffer, index, packet, parent)

  -- Message Count: 2 Byte Unsigned Fixed Width Integer
  index, message_count = nasdaq_phlxoptions_marketdepth_itch_v1_6.message_count.dissect(buffer, index, packet, parent)

  return index
end

-- Dissect: Packet Header
nasdaq_phlxoptions_marketdepth_itch_v1_6.packet_header.dissect = function(buffer, offset, packet, parent)
  if show.packet_header then
    -- Optionally add element to protocol tree
    parent = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.fields.packet_header, buffer(offset, 0))
    local index = nasdaq_phlxoptions_marketdepth_itch_v1_6.packet_header.fields(buffer, offset, packet, parent)
    local length = index - offset
    parent:set_len(length)
    local display = nasdaq_phlxoptions_marketdepth_itch_v1_6.packet_header.display(packet, parent, length)
    parent:append_text(display)

    return index, parent
  else
    -- Skip element, add fields directly
    return nasdaq_phlxoptions_marketdepth_itch_v1_6.packet_header.fields(buffer, offset, packet, parent)
  end
end

-- Packet
nasdaq_phlxoptions_marketdepth_itch_v1_6.packet = {}

-- Dissect Packet
nasdaq_phlxoptions_marketdepth_itch_v1_6.packet.dissect = function(buffer, packet, parent)
  local index = 0

  -- Packet Header: Struct of 3 fields
  index, packet_header = nasdaq_phlxoptions_marketdepth_itch_v1_6.packet_header.dissect(buffer, index, packet, parent)

  -- Dependency element: Message Count
  local message_count = buffer(index - 2, 2):uint()

  -- Repeating: Message
  for message_index = 1, message_count do

    -- Dependency element: Message Length
    local message_length = buffer(index, 2):uint()

    -- Runtime Size Of: Message
    local size_of_message = message_length + 2

    -- Message: Struct of 2 fields
    index, message = nasdaq_phlxoptions_marketdepth_itch_v1_6.message.dissect(buffer, index, packet, parent, size_of_message, message_index)
  end

  return index
end


-----------------------------------------------------------------------
-- Protocol Dissector and Components
-----------------------------------------------------------------------

-- Initialize Dissector
function omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.init()
end

-- Dissector for Nasdaq PhlxOptions MarketDepth Itch 1.6
function omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.dissector(buffer, packet, parent)

  -- Set protocol name
  packet.cols.protocol = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.name

  -- Dissect protocol
  local protocol = parent:add(omi_nasdaq_phlxoptions_marketdepth_itch_v1_6, buffer(), omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.description, "("..buffer:len().." Bytes)")
  return nasdaq_phlxoptions_marketdepth_itch_v1_6.packet.dissect(buffer, packet, protocol)
end

-- Register With Udp Table
local udp_table = DissectorTable.get("udp.port")
udp_table:add(65333, omi_nasdaq_phlxoptions_marketdepth_itch_v1_6)


-----------------------------------------------------------------------
-- Protocol Heuristics
-----------------------------------------------------------------------

-- Verify size of packet
nasdaq_phlxoptions_marketdepth_itch_v1_6.packet.requiredsize = function(buffer)

  return true
end

-- Dissector Heuristic for Nasdaq PhlxOptions MarketDepth Itch 1.6
local function omi_nasdaq_phlxoptions_marketdepth_itch_v1_6_heuristic(buffer, packet, parent)
  -- Verify packet length
  if not nasdaq_phlxoptions_marketdepth_itch_v1_6.packet.requiredsize(buffer) then return false end

  -- Protocol is valid, set conversation and dissect this packet
  packet.conversation = omi_nasdaq_phlxoptions_marketdepth_itch_v1_6
  omi_nasdaq_phlxoptions_marketdepth_itch_v1_6.dissector(buffer, packet, parent)

  return true
end

-- Register Heuristic for Nasdaq PhlxOptions MarketDepth Itch 1.6
omi_nasdaq_phlxoptions_marketdepth_itch_v1_6:register_heuristic("udp", omi_nasdaq_phlxoptions_marketdepth_itch_v1_6_heuristic)

-----------------------------------------------------------------------
-- Lua dissectors are an easily edited and modified cross-platform dissection solution.
-- Feel free to modify. Enjoy.
-----------------------------------------------------------------------
-- 
-- Protocol:
--   Organization: National Association of Securities Dealers Automated Quotations
--   Version: 1.6
--   Date: Thursday, March 8, 2018
--   Specification: phlxdepth.pdf
-- 
-- Script:
--   Generator: 1.5.0.0
--   Compiler: 2.0
--   License: Public/GPLv3
--   Authors: Omi Developers
-- 
-- This dissector script was generated by The Open Markets Initiative (Omi).
-- 
-- For full Omi information:
-- https://github.com/Open-Markets-Initiative/Directory
-----------------------------------------------------------------------
