Skip to content

Commit

Permalink
Some Itch and Ouch updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Open-Markets-Initiative committed Jul 18, 2023
1 parent 7c79e55 commit 5548baa
Show file tree
Hide file tree
Showing 28 changed files with 650 additions and 4,264 deletions.
48 changes: 33 additions & 15 deletions Asx/Asx.Securities.Ntp.Itch.v1.05.Script.Dissector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,24 @@ function asx_securities_ntp_itch_v1_05.prefs_changed()
end


-----------------------------------------------------------------------
-- Protocol Functions
-----------------------------------------------------------------------

-- trim trailing spaces
trim_right_spaces = function(str)
local finish = str:len()

for i = 1, finish do
if str:byte(i) == 0x20 then
return str:sub(1, i - 1)
end
end

return str
end


-----------------------------------------------------------------------
-- Dissect Asx Securities Ntp Itch 1.05
-----------------------------------------------------------------------
Expand Down Expand Up @@ -872,7 +890,7 @@ end
asx_securities_ntp_itch_v1_05_dissect.text = function(buffer, offset, packet, parent)
local length = asx_securities_ntp_itch_v1_05_size_of.text
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_ntp_itch_v1_05_display.text(value, buffer, offset, packet, parent)

parent:add(asx_securities_ntp_itch_v1_05.fields.text, range, value, display)
Expand All @@ -892,7 +910,7 @@ end
asx_securities_ntp_itch_v1_05_dissect.source_id = function(buffer, offset, packet, parent)
local length = asx_securities_ntp_itch_v1_05_size_of.source_id
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_ntp_itch_v1_05_display.source_id(value, buffer, offset, packet, parent)

parent:add(asx_securities_ntp_itch_v1_05.fields.source_id, range, value, display)
Expand Down Expand Up @@ -1457,7 +1475,7 @@ end
asx_securities_ntp_itch_v1_05_dissect.seller_participant_id = function(buffer, offset, packet, parent)
local length = asx_securities_ntp_itch_v1_05_size_of.seller_participant_id
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_ntp_itch_v1_05_display.seller_participant_id(value, buffer, offset, packet, parent)

parent:add(asx_securities_ntp_itch_v1_05.fields.seller_participant_id, range, value, display)
Expand Down Expand Up @@ -1564,7 +1582,7 @@ end
asx_securities_ntp_itch_v1_05_dissect.buyer_participant_id = function(buffer, offset, packet, parent)
local length = asx_securities_ntp_itch_v1_05_size_of.buyer_participant_id
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_ntp_itch_v1_05_display.buyer_participant_id(value, buffer, offset, packet, parent)

parent:add(asx_securities_ntp_itch_v1_05.fields.buyer_participant_id, range, value, display)
Expand Down Expand Up @@ -1885,7 +1903,7 @@ end
asx_securities_ntp_itch_v1_05_dissect.participant_id_seller = function(buffer, offset, packet, parent)
local length = asx_securities_ntp_itch_v1_05_size_of.participant_id_seller
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_ntp_itch_v1_05_display.participant_id_seller(value, buffer, offset, packet, parent)

parent:add(asx_securities_ntp_itch_v1_05.fields.participant_id_seller, range, value, display)
Expand All @@ -1905,7 +1923,7 @@ end
asx_securities_ntp_itch_v1_05_dissect.participant_id_buyer = function(buffer, offset, packet, parent)
local length = asx_securities_ntp_itch_v1_05_size_of.participant_id_buyer
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_ntp_itch_v1_05_display.participant_id_buyer(value, buffer, offset, packet, parent)

parent:add(asx_securities_ntp_itch_v1_05.fields.participant_id_buyer, range, value, display)
Expand Down Expand Up @@ -2591,7 +2609,7 @@ end
asx_securities_ntp_itch_v1_05_dissect.counter_party_id = function(buffer, offset, packet, parent)
local length = asx_securities_ntp_itch_v1_05_size_of.counter_party_id
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_ntp_itch_v1_05_display.counter_party_id(value, buffer, offset, packet, parent)

parent:add(asx_securities_ntp_itch_v1_05.fields.counter_party_id, range, value, display)
Expand Down Expand Up @@ -3240,7 +3258,7 @@ end
asx_securities_ntp_itch_v1_05_dissect.cfi_code = function(buffer, offset, packet, parent)
local length = asx_securities_ntp_itch_v1_05_size_of.cfi_code
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_ntp_itch_v1_05_display.cfi_code(value, buffer, offset, packet, parent)

parent:add(asx_securities_ntp_itch_v1_05.fields.cfi_code, range, value, display)
Expand All @@ -3260,7 +3278,7 @@ end
asx_securities_ntp_itch_v1_05_dissect.long_name = function(buffer, offset, packet, parent)
local length = asx_securities_ntp_itch_v1_05_size_of.long_name
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_ntp_itch_v1_05_display.long_name(value, buffer, offset, packet, parent)

parent:add(asx_securities_ntp_itch_v1_05.fields.long_name, range, value, display)
Expand All @@ -3280,7 +3298,7 @@ end
asx_securities_ntp_itch_v1_05_dissect.symbol_name = function(buffer, offset, packet, parent)
local length = asx_securities_ntp_itch_v1_05_size_of.symbol_name
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_ntp_itch_v1_05_display.symbol_name(value, buffer, offset, packet, parent)

parent:add(asx_securities_ntp_itch_v1_05.fields.symbol_name, range, value, display)
Expand Down Expand Up @@ -3540,7 +3558,7 @@ end
asx_securities_ntp_itch_v1_05_dissect.basis_of_quotation = function(buffer, offset, packet, parent)
local length = asx_securities_ntp_itch_v1_05_size_of.basis_of_quotation
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_ntp_itch_v1_05_display.basis_of_quotation(value, buffer, offset, packet, parent)

parent:add(asx_securities_ntp_itch_v1_05.fields.basis_of_quotation, range, value, display)
Expand Down Expand Up @@ -3680,7 +3698,7 @@ end
asx_securities_ntp_itch_v1_05_dissect.currency = function(buffer, offset, packet, parent)
local length = asx_securities_ntp_itch_v1_05_size_of.currency
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_ntp_itch_v1_05_display.currency(value, buffer, offset, packet, parent)

parent:add(asx_securities_ntp_itch_v1_05.fields.currency, range, value, display)
Expand Down Expand Up @@ -3964,7 +3982,7 @@ end
asx_securities_ntp_itch_v1_05_dissect.instrument = function(buffer, offset, packet, parent)
local length = asx_securities_ntp_itch_v1_05_size_of.instrument
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_ntp_itch_v1_05_display.instrument(value, buffer, offset, packet, parent)

parent:add(asx_securities_ntp_itch_v1_05.fields.instrument, range, value, display)
Expand All @@ -3984,7 +4002,7 @@ end
asx_securities_ntp_itch_v1_05_dissect.exchange = function(buffer, offset, packet, parent)
local length = asx_securities_ntp_itch_v1_05_size_of.exchange
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_ntp_itch_v1_05_display.exchange(value, buffer, offset, packet, parent)

parent:add(asx_securities_ntp_itch_v1_05.fields.exchange, range, value, display)
Expand All @@ -4004,7 +4022,7 @@ end
asx_securities_ntp_itch_v1_05_dissect.isin = function(buffer, offset, packet, parent)
local length = asx_securities_ntp_itch_v1_05_size_of.isin
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_ntp_itch_v1_05_display.isin(value, buffer, offset, packet, parent)

parent:add(asx_securities_ntp_itch_v1_05.fields.isin, range, value, display)
Expand Down
42 changes: 30 additions & 12 deletions Asx/Asx.Securities.SR8.Itch.v2.0.Script.Dissector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,24 @@ function asx_securities_sr8_itch_v2_0.prefs_changed()
end


-----------------------------------------------------------------------
-- Protocol Functions
-----------------------------------------------------------------------

-- trim trailing spaces
trim_right_spaces = function(str)
local finish = str:len()

for i = 1, finish do
if str:byte(i) == 0x20 then
return str:sub(1, i - 1)
end
end

return str
end


-----------------------------------------------------------------------
-- Dissect Asx Securities SR8 Itch 2.0
-----------------------------------------------------------------------
Expand Down Expand Up @@ -561,7 +579,7 @@ end
asx_securities_sr8_itch_v2_0_dissect.participant_id_counterparty = function(buffer, offset, packet, parent)
local length = asx_securities_sr8_itch_v2_0_size_of.participant_id_counterparty
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_sr8_itch_v2_0_display.participant_id_counterparty(value, buffer, offset, packet, parent)

parent:add(asx_securities_sr8_itch_v2_0.fields.participant_id_counterparty, range, value, display)
Expand All @@ -581,7 +599,7 @@ end
asx_securities_sr8_itch_v2_0_dissect.participant_id_owner = function(buffer, offset, packet, parent)
local length = asx_securities_sr8_itch_v2_0_size_of.participant_id_owner
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_sr8_itch_v2_0_display.participant_id_owner(value, buffer, offset, packet, parent)

parent:add(asx_securities_sr8_itch_v2_0.fields.participant_id_owner, range, value, display)
Expand Down Expand Up @@ -1163,7 +1181,7 @@ end
asx_securities_sr8_itch_v2_0_dissect.participant_id = function(buffer, offset, packet, parent)
local length = asx_securities_sr8_itch_v2_0_size_of.participant_id
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_sr8_itch_v2_0_display.participant_id(value, buffer, offset, packet, parent)

parent:add(asx_securities_sr8_itch_v2_0.fields.participant_id, range, value, display)
Expand Down Expand Up @@ -1398,7 +1416,7 @@ end
asx_securities_sr8_itch_v2_0_dissect.state_name = function(buffer, offset, packet, parent)
local length = asx_securities_sr8_itch_v2_0_size_of.state_name
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_sr8_itch_v2_0_display.state_name(value, buffer, offset, packet, parent)

parent:add(asx_securities_sr8_itch_v2_0.fields.state_name, range, value, display)
Expand Down Expand Up @@ -1701,7 +1719,7 @@ end
asx_securities_sr8_itch_v2_0_dissect.leg_4_symbol = function(buffer, offset, packet, parent)
local length = asx_securities_sr8_itch_v2_0_size_of.leg_4_symbol
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_sr8_itch_v2_0_display.leg_4_symbol(value, buffer, offset, packet, parent)

parent:add(asx_securities_sr8_itch_v2_0.fields.leg_4_symbol, range, value, display)
Expand Down Expand Up @@ -1771,7 +1789,7 @@ end
asx_securities_sr8_itch_v2_0_dissect.leg_3_symbol = function(buffer, offset, packet, parent)
local length = asx_securities_sr8_itch_v2_0_size_of.leg_3_symbol
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_sr8_itch_v2_0_display.leg_3_symbol(value, buffer, offset, packet, parent)

parent:add(asx_securities_sr8_itch_v2_0.fields.leg_3_symbol, range, value, display)
Expand Down Expand Up @@ -1838,7 +1856,7 @@ end
asx_securities_sr8_itch_v2_0_dissect.leg_2_symbol = function(buffer, offset, packet, parent)
local length = asx_securities_sr8_itch_v2_0_size_of.leg_2_symbol
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_sr8_itch_v2_0_display.leg_2_symbol(value, buffer, offset, packet, parent)

parent:add(asx_securities_sr8_itch_v2_0.fields.leg_2_symbol, range, value, display)
Expand Down Expand Up @@ -1905,7 +1923,7 @@ end
asx_securities_sr8_itch_v2_0_dissect.leg_1_symbol = function(buffer, offset, packet, parent)
local length = asx_securities_sr8_itch_v2_0_size_of.leg_1_symbol
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_sr8_itch_v2_0_display.leg_1_symbol(value, buffer, offset, packet, parent)

parent:add(asx_securities_sr8_itch_v2_0.fields.leg_1_symbol, range, value, display)
Expand Down Expand Up @@ -2045,7 +2063,7 @@ end
asx_securities_sr8_itch_v2_0_dissect.trading_currency = function(buffer, offset, packet, parent)
local length = asx_securities_sr8_itch_v2_0_size_of.trading_currency
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_sr8_itch_v2_0_display.trading_currency(value, buffer, offset, packet, parent)

parent:add(asx_securities_sr8_itch_v2_0.fields.trading_currency, range, value, display)
Expand Down Expand Up @@ -2098,7 +2116,7 @@ end
asx_securities_sr8_itch_v2_0_dissect.isin = function(buffer, offset, packet, parent)
local length = asx_securities_sr8_itch_v2_0_size_of.isin
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_sr8_itch_v2_0_display.isin(value, buffer, offset, packet, parent)

parent:add(asx_securities_sr8_itch_v2_0.fields.isin, range, value, display)
Expand All @@ -2118,7 +2136,7 @@ end
asx_securities_sr8_itch_v2_0_dissect.long_name = function(buffer, offset, packet, parent)
local length = asx_securities_sr8_itch_v2_0_size_of.long_name
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_sr8_itch_v2_0_display.long_name(value, buffer, offset, packet, parent)

parent:add(asx_securities_sr8_itch_v2_0.fields.long_name, range, value, display)
Expand All @@ -2138,7 +2156,7 @@ end
asx_securities_sr8_itch_v2_0_dissect.symbol = function(buffer, offset, packet, parent)
local length = asx_securities_sr8_itch_v2_0_size_of.symbol
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_sr8_itch_v2_0_display.symbol(value, buffer, offset, packet, parent)

parent:add(asx_securities_sr8_itch_v2_0.fields.symbol, range, value, display)
Expand Down
28 changes: 23 additions & 5 deletions Asx/Asx.Securities.T24.Itch.v1.13.Script.Dissector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,24 @@ function asx_securities_t24_itch_v1_13.prefs_changed()
end


-----------------------------------------------------------------------
-- Protocol Functions
-----------------------------------------------------------------------

-- trim trailing spaces
trim_right_spaces = function(str)
local finish = str:len()

for i = 1, finish do
if str:byte(i) == 0x20 then
return str:sub(1, i - 1)
end
end

return str
end


-----------------------------------------------------------------------
-- Dissect Asx Securities T24 Itch 1.13
-----------------------------------------------------------------------
Expand Down Expand Up @@ -918,7 +936,7 @@ end
asx_securities_t24_itch_v1_13_dissect.text_message = function(buffer, offset, packet, parent)
local length = asx_securities_t24_itch_v1_13_size_of.text_message
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_t24_itch_v1_13_display.text_message(value, buffer, offset, packet, parent)

parent:add(asx_securities_t24_itch_v1_13.fields.text_message, range, value, display)
Expand All @@ -938,7 +956,7 @@ end
asx_securities_t24_itch_v1_13_dissect.source_id = function(buffer, offset, packet, parent)
local length = asx_securities_t24_itch_v1_13_size_of.source_id
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_t24_itch_v1_13_display.source_id(value, buffer, offset, packet, parent)

parent:add(asx_securities_t24_itch_v1_13.fields.source_id, range, value, display)
Expand Down Expand Up @@ -4240,7 +4258,7 @@ end
asx_securities_t24_itch_v1_13_dissect.currency = function(buffer, offset, packet, parent)
local length = asx_securities_t24_itch_v1_13_size_of.currency
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_t24_itch_v1_13_display.currency(value, buffer, offset, packet, parent)

parent:add(asx_securities_t24_itch_v1_13.fields.currency, range, value, display)
Expand Down Expand Up @@ -4605,7 +4623,7 @@ end
asx_securities_t24_itch_v1_13_dissect.instrument = function(buffer, offset, packet, parent)
local length = asx_securities_t24_itch_v1_13_size_of.instrument
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_t24_itch_v1_13_display.instrument(value, buffer, offset, packet, parent)

parent:add(asx_securities_t24_itch_v1_13.fields.instrument, range, value, display)
Expand All @@ -4625,7 +4643,7 @@ end
asx_securities_t24_itch_v1_13_dissect.exchange = function(buffer, offset, packet, parent)
local length = asx_securities_t24_itch_v1_13_size_of.exchange
local range = buffer(offset, length)
local value = range:string()
local value = trim_right_spaces(range:string())
local display = asx_securities_t24_itch_v1_13_display.exchange(value, buffer, offset, packet, parent)

parent:add(asx_securities_t24_itch_v1_13.fields.exchange, range, value, display)
Expand Down
6 changes: 3 additions & 3 deletions Asx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

| Division | Data | Protocol | Version | Date | Size | [Status][Omi.Glossary.Status] | [Testing][Omi.Glossary.Testing] | Specification |
| --- | --- | --- | --- | ---: | ---: | --- | --- | --- |
| Securities | [Ntp][Asx.Securities.Ntp.Itch.v1.05.Dissector] | Itch | [1.05][Asx.Securities.Ntp.Itch.v1.05.Dissector] | 12/1/2017 | 5127 | [Active][Omi.Glossary.Status.Active] | [Verified][Omi.Glossary.Testing.Verified] | [pdf][Asx.Securities.Ntp.Itch.v1.05.Pdf] |
| Securities | [SR8][Asx.Securities.SR8.Itch.v2.0.Dissector] | Itch | [2.0][Asx.Securities.SR8.Itch.v2.0.Dissector] | 4/1/2015 | 2978 | [Deprecated][Omi.Glossary.Status.Deprecated] | [Untested][Omi.Glossary.Testing.Untested] | [pdf][Asx.Securities.SR8.Itch.v2.0.Pdf] |
| Securities | [T24][Asx.Securities.T24.Itch.v1.13.Dissector] | Itch | [1.13][Asx.Securities.T24.Itch.v1.13.Dissector] | 7/15/2014 | 6049 | [Deprecated][Omi.Glossary.Status.Deprecated] | [Untested][Omi.Glossary.Testing.Untested] | [pdf][Asx.Securities.T24.Itch.v1.13.Pdf] |
| Securities | [Ntp][Asx.Securities.Ntp.Itch.v1.05.Dissector] | Itch | [1.05][Asx.Securities.Ntp.Itch.v1.05.Dissector] | 12/1/2017 | 5145 | [Active][Omi.Glossary.Status.Active] | [Verified][Omi.Glossary.Testing.Verified] | [pdf][Asx.Securities.Ntp.Itch.v1.05.Pdf] |
| Securities | [SR8][Asx.Securities.SR8.Itch.v2.0.Dissector] | Itch | [2.0][Asx.Securities.SR8.Itch.v2.0.Dissector] | 4/1/2015 | 2996 | [Deprecated][Omi.Glossary.Status.Deprecated] | [Untested][Omi.Glossary.Testing.Untested] | [pdf][Asx.Securities.SR8.Itch.v2.0.Pdf] |
| Securities | [T24][Asx.Securities.T24.Itch.v1.13.Dissector] | Itch | [1.13][Asx.Securities.T24.Itch.v1.13.Dissector] | 7/15/2014 | 6067 | [Deprecated][Omi.Glossary.Status.Deprecated] | [Untested][Omi.Glossary.Testing.Untested] | [pdf][Asx.Securities.T24.Itch.v1.13.Pdf] |
| Securities | [SR8][Asx.Securities.SR8.Ouch.v2.0.Dissector] | Ouch | [2.0][Asx.Securities.SR8.Ouch.v2.0.Dissector] | 4/1/2015 | 2841 | [Deprecated][Omi.Glossary.Status.Deprecated] | [Untested][Omi.Glossary.Testing.Untested] | [pdf][Asx.Securities.SR8.Ouch.v2.0.Pdf] |


Expand Down
Loading

0 comments on commit 5548baa

Please sign in to comment.