Commit 53b2344b authored by root's avatar root

Initial commit - New TCP reassembly compared to last version on wikhan

parents
Pipeline #742 canceled with stages
local utils = require("utils")
local m = {
current_time = ProtoField.uint32("nel.gu.current_time","currentTime",base.DEC),
service_alias = ProtoField.string("nel.gu.service_alias","serviceAlias",base.ASCII),
var_name = ProtoField.string("nel.gu.var_name","varName",base.ASCII),
sample_period = ProtoField.uint32("nel.gu.sample_period","samplePeriod",base.DEC),
value = ProtoField.double("nel.gu.value","value")
}
function m.parse_graph_data(subtree,buffer)
local length = 0
local data = subtree:add(utils.fields.generic_byte,buffer(0,0)):set_text("Graph Update Data")
local s_size = buffer(length,4):le_uint()
data:add(m.service_alias,buffer(length+4,s_size))
length = 4 + s_size
s_size = buffer(length,4):le_uint()
data:add(m.var_name,buffer(length+4,s_size))
length = length + 4 + s_size
data:add_le(m.sample_period,buffer(length,4))
length = length + 4
data:add_le(m.value,buffer(length,8))
length = length + 8
return length
end
function m.get_fields()
local fields = {
gu_current_time = m.current_time,
gu_service_alias = m.service_alias,
gu_var_name = m.var_name,
gu_sample_period = m.sample_period,
gu_value = m.value
}
return fields
end
function m.parse(payloadSubtree, buffer)
payloadSubtree:add_le(m.current_time,buffer(0,4))
local size = buffer(4,4):le_int()
local graph_data = payloadSubtree:add(utils.fields.vector_size,buffer(4,4)):set_text(string.format("graphData[%i]",size))
local dataOffset = 8
for i=1,size do
dataOffset = dataOffset + m.parse_graph_data(graph_data,buffer(dataOffset,buffer:len()-dataOffset))
end
_G.processed = _G.processed + dataOffset
end
return m
local utils = require("utils")
local m = {
current_time = ProtoField.uint32("nel.hrgu.current_time","currentTime",base.DEC),
service_alias = ProtoField.string("nel.hrgu.service_alias","serviceAlias",base.ASCII),
var_name = ProtoField.string("nel.hrgu.var_name","varName",base.ASCII),
sample_tick = ProtoField.int64("nel.hrgu.sample_tick","sampleTick",base.DEC),
value = ProtoField.double("nel.hrgu.value","value")
}
function m.parse_hr_graph_data(subtree,buffer)
local length = 0
local data = subtree:add(utils.fields.generic_byte,buffer(0,0)):set_text("HighRez Graph Update Data")
data:add_le(m.sample_tick,buffer(length,8))
length = length + 8
data:add_le(m.value,buffer(length,8))
length = length + 8
return length
end
function m.get_fields()
local fields = {
hrgu_current_time = m.current_time,
hrgu_service_alias = m.service_alias,
hrgu_var_name = m.var_name,
hrgu_sample_tick = m.sample_tick,
hrgu_value = m.value
}
return fields
end
function m.parse(payloadSubtree, buffer)
local offset = 0
local s_size = buffer(0,4):le_uint()
payloadSubtree:add(m.service_alias,buffer(4,s_size))
offset = s_size+4
s_size = buffer(offset,4):le_uint()
payloadSubtree:add(m.var_name,buffer(offset+4,s_size))
offset = offset + s_size + 4
payloadSubtree:add_le(m.current_time,buffer(offset,4))
offset = offset + 4
local size = buffer(offset,4):le_int()
local hr_graph_data = payloadSubtree:add(utils.fields.vector_size,buffer(offset,4)):set_text(string.format("highRezGraphData[%i]",size))
local dataOffset = offset+4
for i=1,size do
dataOffset = dataOffset + m.parse_hr_graph_data(hr_graph_data,buffer(dataOffset,buffer:len()-dataOffset))
end
_G.processed = _G.processed + dataOffset
end
return m
local utils = require("utils")
local m = {
service_status = ProtoField.string("nel.ssu.service_status","serviceStatus",base.ASCII),
status_detail = ProtoField.string("nel.ssu.status_detail","statusDetail")
}
function m.get_fields()
local fields = {
ssu_service_status = m.service_status,
ssu_status_detail = m.status_detail
}
return fields
end
function m.parse(payloadSubtree, buffer)
local s_size = buffer(0,4):le_uint()
local data = payloadSubtree:add(m.service_status,buffer(4,s_size))
local s = {string.gsub(buffer(4,s_size):string(),"\t"," ")}
for k,v in string.gmatch(s[1], "(%g+)=(%g+)") do
data:add(m.status_detail,buffer(4,0)):set_text(string.format("%s: %s",k,v))
end
_G.processed = _G.processed + s_size + 4
end
return m
local utils = require("utils")
local service_status_update = require("service_status_update")
local m = {
shard_name = ProtoField.string("nel.usu.shard_name","shardName",base.ASCII),
service_long_name = ProtoField.string("nel.usu.service_lname","serviceLongName",base.ASCII),
service_short_name = ProtoField.string("nel.usu.service_sname","serviceShortName",base.ASCII),
service_alias_name = ProtoField.string("nel.usu.service_aname","serviceAliasName",base.ASCII),
running_state = ProtoField.int32("nel.usu.running_state","runningState",base.DEC,{[0]="Stopped",[1]="Running",[2]="Online"}),
running_orders = ProtoField.int32("nel.usu.running_orders","runningOrders",base.DEC,{[0]="Deactivated",[1]="Activated"}),
running_tag = ProtoField.int32("nel.usu.running_tag","runningTag",base.DEC,{[0]="Chain Crashing",[1]="Locally Started",[2]="Locally Stopped",[3]="Globally Stopped",[4]="Stopped for patch",[5]="Externally started",[6]="Slow to stop",[7]="Slow to start"}),
status = ProtoField.string("nel.usu.status","status",base.ASCII)
}
function m.parse_service_status(subtree,buffer)
local length = 0
local data = subtree:add(utils.fields.generic_byte,buffer(0,0)):set_text("Service Status Data")
local s_size = buffer(length,4):le_uint()
data:add(m.shard_name,buffer(length+4,s_size))
length = 4 + s_size
s_size = buffer(length,4):le_uint()
data:add(m.service_long_name,buffer(length+4,s_size))
length = length + 4 + s_size
s_size = buffer(length,4):le_uint()
data:add(m.service_short_name,buffer(length+4,s_size))
length = length + 4 + s_size
s_size = buffer(length,4):le_uint()
data:add(m.service_alias_name,buffer(length+4,s_size))
length = length + 4 + s_size
data:add_le(m.running_state,buffer(length,4))
data:add_le(m.running_orders,buffer(length+4,4))
length = length + 8
local set_size = buffer(length,4):le_uint()
local runningTags = data:add(utils.fields.vector_size,buffer(length,4)):set_text(string.format("runningTags[%i]",set_size))
length = length + 4
for i=1,set_size do
runningTags:add_le(m.running_tag,buffer(length,4))
length = length + 4
end
s_size = buffer(length,4):le_uint()
-- local serviceStatus = data:add(m.status,buffer(length+4,s_size))
service_status_update.parse(data,buffer(length))
length = length + 4 + s_size
_G.processed = _G.processed - s_size - 4
return length
end
function m.get_fields()
local fields = {
usu_shard_name = m.shard_name,
usu_service_long_name = m.service_long_name,
usu_service_short_name = m.service_short_name,
usu_service_alias_name = m.service_alias_name,
usu_running_state = m.running_state,
usu_running_orders = m.running_orders,
usu_running_tag = m.running_tag,
usu_status = m.status
}
return fields
end
function m.parse(payloadSubtree, buffer)
local size = buffer(0,4):le_int()
local statusData = payloadSubtree:add(utils.fields.vector_size,buffer(0,4)):set_text(string.format("serviceStatus[%i]",size))
local dataOffset = 4
for i=1,size do
dataOffset = dataOffset + m.parse_service_status(statusData,buffer(dataOffset,buffer:len()-dataOffset))
end
_G.processed = _G.processed + dataOffset
end
return m
package.prepend_path("nel")
local utils = require("utils")
local m = {
pos_x = ProtoField.float("nel.s_src_spwn_vld.pos.x","positionX"),
pos_y = ProtoField.float("nel.s_src_spwn_vld.pos.y","positionY"),
source_dataset_row = ProtoField.uint32("nel.s_src_spwn_vld.src_dataset_row","sourceDatasetRowIndex",base.DEC),
}
function m.get_fields()
local fields = {
s_src_spwn_vld_pos_x = m.pos_x,
s_src_spwn_vld_pos_y = m.pos_y,
s_src_spwn_vld_source_dataset_row = m.source_dataset_row,
}
return fields
end
function m.parse(payloadSubtree, buffer, length)
local offset = 0
payloadSubtree:add_le(m.pos_x,buffer(offset,4))
payloadSubtree:add_le(m.pos_y,buffer(offset+4,4))
offset = offset + 8
payloadSubtree:add_le(m.source_dataset_row,buffer(offset,4))
offset = offset + 4
_G.processed = _G.processed + offset
end
return m
package.prepend_path("nel")
local utils = require("utils")
local m = {
request_id = ProtoField.uint32("nel.bs_file.request_id","requestID",base.DEC),
file_name = ProtoField.string("nel.bs_file.file_name","fileName",base.ASCII),
timestamp = ProtoField.uint32("nel.bs_file.timestamp","timestamp",base.DEC),
size = ProtoField.uint32("nel.bs_file.size","size",base.DEC),
data = ProtoField.bytes("nel.bs_file.data","data"),
}
function m.get_fields()
local fields = {
bs_file_request_id = m.request_id,
bs_file_file_name = m.file_name,
bs_file_timestamp = m.timestamp,
bs_file_size = m.size,
bs_file_data = m.data,
}
return fields
end
function m.parse(payloadSubtree, buffer, length)
local offset = 0
payloadSubtree:add_le(m.request_id,buffer(offset,4))
offset = offset + 4
local s_size = buffer(offset,4):le_uint()
payloadSubtree:add(m.file_name,buffer(offset+4,s_size))
offset = offset + 4 + s_size
payloadSubtree:add_le(m.timestamp,buffer(offset,4))
payloadSubtree:add_le(m.size,buffer(offset+4,4))
offset = offset + 8
s_size = buffer(offset,4):le_uint()
if s_size > 0 then
payloadSubtree:add_le(m.data,buffer(offset+4,s_size))
end
offset = offset + 4 + s_size
_G.processed = _G.processed + _G.payload_size
end
return m
package.prepend_path("nel")
local utils = require("utils")
local m = {
request_id = ProtoField.uint32("nel.bs_file_class.request_id","requestID",base.DEC),
file_name = ProtoField.string("nel.bs_file_class.file_name","fileName",base.ASCII),
file_timestamp = ProtoField.absolute_time("nel.bs_file_class.file_timestamp","timestamp"),
file_size = ProtoField.uint32("nel.bs_file_class.file_size","fileSize",base.DEC),
}
function m.get_fields()
local fields = {
bs_file_class_request_id = m.request_id,
bs_file_class_file_name = m.file_name,
bs_file_class_file_timestamp = m.file_timestamp,
bs_file_class_file_size = m.file_size,
}
return fields
end
function m.parse(payloadSubtree, buffer)
local offset = 0
payloadSubtree:add_le(m.request_id,buffer(offset,4))
offset = offset + 4
local num_files = buffer(offset,4):le_uint()
local files = payloadSubtree:add_le(utils.fields.vector_size,buffer(offset,4)):set_text(string.format("Files[%i]",num_files))
offset = offset + 4
for i=1,num_files do
local file = files:add_le(utils.fields.generic_byte,buffer(offset,0)):set_text("File")
local s_size = buffer(offset,4):le_uint()
file:add(m.file_name,buffer(offset+4,s_size))
offset = offset + 4 + s_size
file:add_le(m.file_timestamp,buffer(offset,4))
file:add_le(m.file_size,buffer(offset+4,4))
offset = offset + 8
end
_G.processed = _G.processed + offset
end
return m
package.prepend_path("nel")
local utils = require("utils")
local m = {
read_mode = ProtoField.bool("nel.bs_read_mode.read_mode","readMode"),
}
function m.get_fields()
local fields = {
bs_read_mode_read_mode = m.read_mode,
}
return fields
end
function m.parse(payloadSubtree, buffer)
local offset = 0
payloadSubtree:add_le(m.read_mode,buffer(offset,1))
offset = offset + 1
_G.processed = _G.processed + offset
end
return m
package.prepend_path("nel")
local utils = require("utils")
local m = {
file_name = ProtoField.string("nel.delete_file.file_name","fileName",base.ASCII),
}
function m.get_fields()
local fields = {
delete_file_file_name = m.file_name,
}
return fields
end
function m.parse(payloadSubtree, buffer, length)
local offset = 0
local s_size = buffer(offset,4):le_uint()
payloadSubtree:add(m.file_name,buffer(offset+4,s_size))
offset = offset + 4 + s_size
_G.processed = _G.processed + offset
end
return m
package.prepend_path("nel")
local utils = require("utils")
local m = {
request_id = ProtoField.uint32("nel.get_file_class.request_id","requestID",base.DEC),
directory = ProtoField.string("nel.get_file_class.directory","directory",base.ASCII),
pattern = ProtoField.string("nel.get_file_class.pattern","pattern",base.ASCII),
}
function m.get_fields()
local fields = {
get_file_class_request_id = m.request_id,
get_file_class_directory = m.directory,
get_file_class_pattern = m.pattern,
}
return fields
end
function m.parse(payloadSubtree, buffer)
local offset = 0
payloadSubtree:add_le(m.request_id,buffer(offset,4))
offset = offset + 4
local s_size = buffer(offset,4):le_uint()
payloadSubtree:add_le(m.directory,buffer(offset+4,s_size))
offset = offset + 4 + s_size
local num_classes = buffer(offset,4):le_uint()
local classes = payloadSubtree:add_le(utils.fields.vector_size,buffer(offset,4)):set_text(string.format("Classes[%i]",num_classes))
offset = offset + 4
for i=1,num_classes do
local class = classes:add_le(utils.fields.generic_byte,buffer(offset,0)):set_text("Class")
local num_patterns = buffer(offset,4):le_uint()
offset = offset + 4
for j=1,num_patterns do
local p_size = buffer(offset,4):le_uint()
class:add(m.pattern,buffer(offset+4,p_size))
offset = offset + 4 + p_size
end
end
_G.processed = _G.processed + offset
end
return m
package.prepend_path("nel")
local utils = require("utils")
local m = {
request_id = ProtoField.uint32("nel.load_file.request_id","requestID",base.DEC),
file_name = ProtoField.string("nel.load_file.file_name","fileName",base.ASCII),
}
function m.get_fields()
local fields = {
load_file_request_id = m.request_id,
load_file_file_name = m.file_name,
}
return fields
end
function m.parse(payloadSubtree, buffer, length)
local offset = 0
payloadSubtree:add_le(m.request_id,buffer(offset,4))
offset = offset + 4
local s_size = buffer(offset,4):le_uint()
payloadSubtree:add(m.file_name,buffer(offset+4,s_size))
offset = offset + 4 + s_size
_G.processed = _G.processed + _G.payload_size
end
return m
package.prepend_path("nel")
local utils = require("utils")
local m = {
file_name = ProtoField.string("nel.save_file.file_name","fileName",base.ASCII),
file_data = ProtoField.bytes("nel.save_file.file_data","fileData")
}
function m.get_fields()
local fields = {
save_file_file_name = m.file_name,
save_file_file_data = m.file_data
}
return fields
end
function m.parse(payloadSubtree, buffer, length)
local offset = 0
local s_size = buffer(offset,4):le_uint()
payloadSubtree:add(m.file_name,buffer(offset+4,s_size))
offset = offset + 4 + s_size
payloadSubtree:add(m.file_data,buffer(offset,_G.payload_size-offset))
_G.processed = _G.processed + _G.payload_size
end
return m
local m = {}
local utils = require("utils")
m.fields = {
script_size = ProtoField.uint16("nel.scriptdata.script_size","scriptSize",base.DEC),
custom_element_prim_alias = ProtoField.uint32("nel.custom_element.prim_alias","primAlias",base.DEC),
custom_element_id = ProtoField.string("nel.custom_element.id","ID",base.ASCII),
tmp_val = ProtoField.string("nel.scriptdata.tmp_val","tmpVal",base.ASCII),
}
function m.parse_custom_element_id(payloadSubtree,buffer)
local offset = 0
payloadSubtree:add_le(m.fields.custom_element_prim_alias,buffer(offset,4))
local s_size = buffer(offset+4,4):le_uint()
payloadSubtree:add(m.fields.custom_element_id,buffer(offset+8,s_size))
offset = offset + 8 + s_size
return offset
end
function m.parse_scriptdata(payloadSubtree,buffer)
local offset = 0
local nb_scripts = buffer(offset,2):le_uint()
local scripts = payloadSubtree:add_le(m.fields.script_size,buffer(offset,2)):set_text(string.format("Scripts[%i]",nb_scripts))
offset = offset + 2
for i=1,nb_scripts do
local script = scripts:add_le(utils.fields.generic_byte,buffer(offset,0)):set_text("Script")
offset = offset + m.parse_custom_element_id(script,buffer(offset))
local nb_lines = buffer(offset,4):le_uint()
local lines = script:add_le(utils.fields.vector_size,buffer(offset,4)):set_text(string.format("Lines[%i]",nb_lines))
offset = offset + 4
for j=1,nb_lines do
s_size = buffer(offset,4):le_uint()
lines:add(m.fields.tmp_val,buffer(offset+4,s_size))
offset = offset + 4 + s_size
end
end
return offset
end
return m
package.prepend_path("nel")
local utils = require("utils")
local classes = require("classes")
local m = {
number_tables = ProtoField.uint16("nel.custom_loot_tables.nb_tables","nbTables",base.DEC),
money_factor = ProtoField.float("nel.custom_loot_tables.money.factor","moneyFactor",base.DEC),
money_proba = ProtoField.float("nel.custom_loot_tables.money.proba","moneyProba",base.DEC),
money_base = ProtoField.uint32("nel.custom_loot_tables.money.base","moneyBase",base.DEC),
}
function m.get_fields()
local fields = {
custom_loot_tables_number_tables = m.number_tables,
custom_loot_tables_money_factor = m.money_factor,
custom_loot_tables_money_proba = m.money_proba,
custom_loot_tables_money_base = m.money_base,
}
return fields
end
function m.parse(payloadSubtree, buffer)
local offset = 0
local t_size = buffer(offset,2):le_uint()
local loot_tables = payloadSubtree:add_le(m.number_tables,buffer(offset,2)):set_text(string.format("LootTables[%i]",t_size))
offset = offset + 2
for i=1,t_size do
local loot_table = loot_tables:add_le(utils.fields.generic_byte,buffer(offset,0)):set_text("Loot Table")
offset = offset + classes.parse_custom_element_id(loot_table,buffer(offset))
offset = offset + classes.parse_scriptdata(loot_table,buffer(offset))
loot_table:add_le(m.money_factor,buffer(offset,4))
loot_table:add_le(m.money_proba,buffer(offset+4,4))
offset = offset + 8
loot_table:add_le(m.money_base,buffer(offset,4))
offset = offset + 4
end
_G.processed = _G.processed + offset
end
return m
package.prepend_path("nel")