Skip to content

Commit 0e5c9e3

Browse files
Add Currenex Ouch v26
1 parent 9c3dc63 commit 0e5c9e3

4 files changed

Lines changed: 2592 additions & 3 deletions

File tree

Currenex/Currenex_Forex_Esp_Citch_v9_0_Dissector.lua

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ currenex_forex_esp_citch_v9_0.fields.instrument_index = ProtoField.new("Instrume
2727
currenex_forex_esp_citch_v9_0.fields.instrument_info = ProtoField.new("Instrument Info", "currenex.forex.esp.citch.v9.0.instrumentinfo", ftypes.STRING)
2828
currenex_forex_esp_citch_v9_0.fields.instrument_type = ProtoField.new("Instrument Type", "currenex.forex.esp.citch.v9.0.instrumenttype", ftypes.STRING)
2929
currenex_forex_esp_citch_v9_0.fields.itch_etx = ProtoField.new("Itch Etx", "currenex.forex.esp.citch.v9.0.itchetx", ftypes.INT8)
30+
currenex_forex_esp_citch_v9_0.fields.itch_soh = ProtoField.new("Itch Soh", "currenex.forex.esp.citch.v9.0.itchsoh", ftypes.INT8)
3031
currenex_forex_esp_citch_v9_0.fields.logon = ProtoField.new("Logon", "currenex.forex.esp.citch.v9.0.logon", ftypes.STRING)
3132
currenex_forex_esp_citch_v9_0.fields.logout = ProtoField.new("Logout", "currenex.forex.esp.citch.v9.0.logout", ftypes.STRING)
3233
currenex_forex_esp_citch_v9_0.fields.max_amount = ProtoField.new("Max Amount", "currenex.forex.esp.citch.v9.0.maxamount", ftypes.INT64)
@@ -1557,6 +1558,26 @@ currenex_forex_esp_citch_v9_0_dissect.message_header = function(buffer, offset,
15571558
return currenex_forex_esp_citch_v9_0_dissect.message_header_fields(buffer, offset, packet, parent)
15581559
end
15591560

1561+
-- Size: Itch Soh
1562+
currenex_forex_esp_citch_v9_0_size_of.itch_soh = 1
1563+
1564+
-- Display: Itch Soh
1565+
currenex_forex_esp_citch_v9_0_display.itch_soh = function(value)
1566+
return "Itch Soh: "..value
1567+
end
1568+
1569+
-- Dissect: Itch Soh
1570+
currenex_forex_esp_citch_v9_0_dissect.itch_soh = function(buffer, offset, packet, parent)
1571+
local length = currenex_forex_esp_citch_v9_0_size_of.itch_soh
1572+
local range = buffer(offset, length)
1573+
local value = range:int()
1574+
local display = currenex_forex_esp_citch_v9_0_display.itch_soh(value, buffer, offset, packet, parent)
1575+
1576+
parent:add(currenex_forex_esp_citch_v9_0.fields.itch_soh, range, value, display)
1577+
1578+
return offset + length, value
1579+
end
1580+
15601581
-- Dissect Packet
15611582
currenex_forex_esp_citch_v9_0_dissect.packet = function(buffer, packet, parent)
15621583
local index = 0
@@ -1566,7 +1587,7 @@ currenex_forex_esp_citch_v9_0_dissect.packet = function(buffer, packet, parent)
15661587

15671588
while index < end_of_payload do
15681589

1569-
-- Itch Soh
1590+
-- Itch Soh: 1 Byte Fixed Width Integer Static
15701591
index, itch_soh = currenex_forex_esp_citch_v9_0_dissect.itch_soh(buffer, index, packet, parent)
15711592

15721593
-- Message Header: Struct of 3 fields
@@ -1620,11 +1641,26 @@ verify.currenex_forex_esp_citch_v9_0_packet_size = function(buffer)
16201641
return true
16211642
end
16221643

1644+
-- Verify Itch Soh Field
1645+
verify.itch_soh = function(buffer)
1646+
-- Attempt to read field
1647+
local value = buffer(0, 1):int()
1648+
1649+
if value == 1 then
1650+
return true
1651+
end
1652+
1653+
return false
1654+
end
1655+
16231656
-- Dissector Heuristic for Currenex Forex Esp Citch 9.0
16241657
local function currenex_forex_esp_citch_v9_0_heuristic(buffer, packet, parent)
16251658
-- Verify packet length
16261659
if not verify.currenex_forex_esp_citch_v9_0_packet_size(buffer) then return false end
16271660

1661+
-- Verify Itch Soh
1662+
if not verify.itch_soh(buffer) then return false end
1663+
16281664
-- Protocol is valid, set conversation and dissect this packet
16291665
packet.conversation = currenex_forex_esp_citch_v9_0
16301666
currenex_forex_esp_citch_v9_0.dissector(buffer, packet, parent)

0 commit comments

Comments
 (0)