function sensor_dissector(buffer, pinfo, subtree1, sensor_protocol, offset, num_of_instance, queue_id) if queue_id == 0 then require("sensor_dissector") sensor_dissector_0(buffer, pinfo, subtree1, sensor_protocol, offset, num_of_instance) elseif queue_id == 1 then require("sensor_dissector") sensor_dissector_1(buffer, pinfo, subtree1, sensor_protocol, offset, num_of_instance) elseif queue_id == 2 then require("sensor_dissector") sensor_dissector_2(buffer, pinfo, subtree1, sensor_protocol, offset, num_of_instance) elseif queue_id == 3 then require("sensor_dissector") sensor_dissector_3(buffer, pinfo, subtree1, sensor_protocol, offset, num_of_instance) elseif queue_id == 4 then require("sensor_dissector") sensor_dissector_4(buffer, pinfo, subtree1, sensor_protocol, offset, num_of_instance) elseif queue_id == 5 then require("sensor_dissector") sensor_dissector_5(buffer, pinfo, subtree1, sensor_protocol, offset, num_of_instance) elseif queue_id == 6 then require("sensor_dissector") sensor_dissector_6(buffer, pinfo, subtree1, sensor_protocol, offset, num_of_instance) elseif queue_id == 7 then require("sensor_dissector") sensor_dissector_7(buffer, pinfo, subtree1, sensor_protocol, offset, num_of_instance) elseif queue_id == 8 then require("sensor_dissector") sensor_dissector_8(buffer, pinfo, subtree1, sensor_protocol, offset, num_of_instance) elseif queue_id == 9 then require("sensor_dissector") sensor_dissector_9(buffer, pinfo, subtree1, sensor_protocol, offset, num_of_instance) elseif queue_id == 10 then require("sensor_dissector") sensor_dissector_10(buffer, pinfo, subtree1, sensor_protocol, offset, num_of_instance) elseif queue_id == 11 then require("sensor_dissector") sensor_dissector_11(buffer, pinfo, subtree1, sensor_protocol, offset, num_of_instance) elseif queue_id == 12 then require("sensor_dissector") sensor_dissector_12(buffer, pinfo, subtree1, sensor_protocol, offset, num_of_instance) elseif queue_id == 13 then require("sensor_dissector") sensor_dissector_13(buffer, pinfo, subtree1, sensor_protocol, offset, num_of_instance) elseif queue_id == 14 then require("sensor_dissector") sensor_dissector_14(buffer, pinfo, subtree1, sensor_protocol, offset, num_of_instance) elseif queue_id == 15 then require("sensor_dissector") sensor_dissector_15(buffer, pinfo, subtree1, sensor_protocol, offset, num_of_instance) end end --------------------------------------------------------------------------------------- function sensor_dissector_0(buffer, pinfo, tree, sensor_protocol, offset, num_of_instance) -- Define the fields of the protocol local f_vbus_voltage = ProtoField.float("psm.vbus_voltage", "Vbus Voltage") local f_vshunt_voltage = ProtoField.float("psm.vshunt_voltage", "Vshunt Voltage") local f_current = ProtoField.float("psm.current", "Current") local f_power = ProtoField.uint32("psm.power", "Power") local f_epoch_time = ProtoField.uint32("psm.epoch_time", "Epoch Time") -- Add the fields to the protocol sensor_protocol.fields = { f_vbus_voltage, f_vshunt_voltage, f_current, f_power, f_epoch_time } local subtree = tree:add(sensor_protocol, buffer(), "SENSOR") for i = 0, num_of_instance - 1 do local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE "..i) subtree1:add(f_vbus_voltage, buffer(offset, 4):le_float()) -- 4 bytes for float offset = offset + 4 subtree1:add(f_vshunt_voltage, buffer(offset, 4):le_float()) -- 4 bytes for float offset = offset + 4 subtree1:add(f_current, buffer(offset, 4):le_float()) -- 4 bytes for float offset = offset + 4 subtree1:add(f_power, buffer(offset, 4):le_uint()) -- 4 bytes for uint32 offset = offset + 4 subtree1:add(f_epoch_time, buffer(offset, 4):le_uint()) -- 4 bytes for uint32 offset = offset + 4 end end --------------------------------------------------------------------------------------------------- function sensor_dissector_1(buffer, pinfo, tree, sensor_protocol, offset, num_of_instance) -- Define the fields of the protocol local f_vbus_voltage = ProtoField.float("psm.vbus_voltage", "Vbus Voltage") local f_vshunt_voltage = ProtoField.float("psm.vshunt_voltage", "Vshunt Voltage") local f_current = ProtoField.float("psm.current", "Current") local f_power = ProtoField.uint32("psm.power", "Power") local f_epoch_time = ProtoField.uint32("psm.epoch_time", "Epoch Time") -- Add the fields to the protocol sensor_protocol.fields = { f_vbus_voltage, f_vshunt_voltage, f_current, f_power, f_epoch_time } local subtree = tree:add(sensor_protocol, buffer(), "SENSOR") for i = 0, num_of_instance - 1 do local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE "..i) subtree1:add(f_vbus_voltage, buffer(offset, 4):le_float()) -- 4 bytes for float offset = offset + 4 subtree1:add(f_vshunt_voltage, buffer(offset, 4):le_float()) -- 4 bytes for float offset = offset + 4 subtree1:add(f_current, buffer(offset, 4):le_float()) -- 4 bytes for float offset = offset + 4 subtree1:add(f_power, buffer(offset, 4):le_uint()) -- 4 bytes for uint32 offset = offset + 4 subtree1:add(f_epoch_time, buffer(offset, 4):le_uint()) -- 4 bytes for uint32 offset = offset + 4 end end ----------------------------------------------------------------------------------------------------------------- function sensor_dissector_2(buffer, pinfo, tree, sensor_protocol, offset, num_of_instance) -- Define the fields for the protocol local f_temperature = ProtoField.float("sensor_protocol.temperature", "Temperature") local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "Temp Epoch Time") -- Add the fields to the protocol sensor_protocol.fields = { f_temperature, f_temp_epoch_time } local subtree = tree:add(sensor_protocol, buffer(), "SENSOR") -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect) for i = 0, num_of_instance - 1 do -- Add the new structure data as a subtree local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE "..i) -- dissect temperature (4 bytes for float) local temperature = buffer(offset, 4):le_float() -- Float type is 4 bytes (32 bits) subtree1:add(f_temperature, temperature) offset = offset + 4 -- dissect dt_epoch_time (4 bytes for uint32) local temp_epoch_time = buffer(offset, 4):le_uint() -- uint32 is 4 bytes subtree1:add(f_temp_epoch_time, temp_epoch_time) offset = offset + 4 end end ------------------------------------------------------------------------------------------------------------------------ function sensor_dissector_3(buffer, pinfo, tree, sensor_protocol, offset, num_of_instance) -- Define the fields for the protocol local f_temperature = ProtoField.float("sensor_protocol.temperature", "Temperature") local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "Temp Epoch Time") -- Add the fields to the protocol sensor_protocol.fields = { f_temperature, f_temp_epoch_time } local subtree = tree:add(sensor_protocol, buffer(), "SENSOR") -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect) for i = 0, num_of_instance - 1 do -- Add the new structure data as a subtree local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE "..i) -- dissect temperature (4 bytes for float) local temperature = buffer(offset, 4):le_float() -- Float type is 4 bytes (32 bits) subtree1:add(f_temperature, temperature) offset = offset + 4 -- dissect dt_epoch_time (4 bytes for uint32) local temp_epoch_time = buffer(offset, 4):le_uint() -- uint32 is 4 bytes subtree1:add(f_temp_epoch_time, temp_epoch_time) offset = offset + 4 end end ------------------------------------------------------------------------------------------------------------------------- function sensor_dissector_4(buffer, pinfo, tree, sensor_protocol, offset, num_of_instance) -- Define the fields for the protocol local f_temperature = ProtoField.float("sensor_protocol.temperature", "Temperature") local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "Temp Epoch Time") -- Add the fields to the protocol sensor_protocol.fields = { f_temperature, f_temp_epoch_time } local subtree = tree:add(sensor_protocol, buffer(), "SENSOR") -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect) for i = 0, num_of_instance - 1 do -- Add the new structure data as a subtree local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE "..i) -- dissect temperature (4 bytes for float) local temperature = buffer(offset, 4):le_float() -- Float type is 4 bytes (32 bits) subtree1:add(f_temperature, temperature) offset = offset + 4 -- dissect dt_epoch_time (4 bytes for uint32) local temp_epoch_time = buffer(offset, 4):le_uint() -- uint32 is 4 bytes subtree1:add(f_temp_epoch_time, temp_epoch_time) offset = offset + 4 end end ------------------------------------------------------------------------------------------------------------------------- function sensor_dissector_5(buffer, pinfo, tree, sensor_protocol, offset, num_of_instance) -- Define the fields for the protocol local f_temperature = ProtoField.float("sensor_protocol.temperature", "Temperature") local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "Temp Epoch Time") -- Add the fields to the protocol sensor_protocol.fields = { f_temperature, f_temp_epoch_time } local subtree = tree:add(sensor_protocol, buffer(), "SENSOR") -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect) for i = 0, num_of_instance - 1 do -- Add the new structure data as a subtree local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE "..i) -- dissect temperature (4 bytes for float) local temperature = buffer(offset, 4):le_float() -- Float type is 4 bytes (32 bits) subtree1:add(f_temperature, temperature) offset = offset + 4 -- dissect dt_epoch_time (4 bytes for uint32) local temp_epoch_time = buffer(offset, 4):le_uint() -- uint32 is 4 bytes subtree1:add(f_temp_epoch_time, temp_epoch_time) offset = offset + 4 end end ------------------------------------------------------------------------------------------------------------------------- function sensor_dissector_6(buffer, pinfo, tree, sensor_protocol, offset, num_of_instance) -- Define the fields for the protocol local f_temperature = ProtoField.float("sensor_protocol.temperature", "Temperature") local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "Temp Epoch Time") -- Add the fields to the protocol sensor_protocol.fields = { f_temperature, f_temp_epoch_time } local subtree = tree:add(sensor_protocol, buffer(), "SENSOR") -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect) for i = 0, num_of_instance - 1 do -- Add the new structure data as a subtree local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE "..i) -- dissect temperature (4 bytes for float) local temperature = buffer(offset, 4):le_float() -- Float type is 4 bytes (32 bits) subtree1:add(f_temperature, temperature) offset = offset + 4 -- dissect dt_epoch_time (4 bytes for uint32) local temp_epoch_time = buffer(offset, 4):le_uint() -- uint32 is 4 bytes subtree1:add(f_temp_epoch_time, temp_epoch_time) offset = offset + 4 end end ------------------------------------------------------------------------------------------------------------------------- function sensor_dissector_7(buffer, pinfo, tree, sensor_protocol, offset, num_of_instance) -- Define the fields for the protocol local f_temperature = ProtoField.float("sensor_protocol.temperature", "Temperature") local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "Temp Epoch Time") -- Add the fields to the protocol sensor_protocol.fields = { f_temperature, f_temp_epoch_time } local subtree = tree:add(sensor_protocol, buffer(), "SENSOR") -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect) for i = 0, num_of_instance - 1 do -- Add the new structure data as a subtree local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE "..i) -- dissect temperature (4 bytes for float) local temperature = buffer(offset, 4):le_float() -- Float type is 4 bytes (32 bits) subtree1:add(f_temperature, temperature) offset = offset + 4 -- dissect dt_epoch_time (4 bytes for uint32) local temp_epoch_time = buffer(offset, 4):le_uint() -- uint32 is 4 bytes subtree1:add(f_temp_epoch_time, temp_epoch_time) offset = offset + 4 end end ------------------------------------------------------------------------------------------------------------------------- function sensor_dissector_8(buffer, pinfo, tree, sensor_protocol, offset, num_of_instance) -- Define the fields for the protocol local f_temperature = ProtoField.float("sensor_protocol.temperature", "Temperature") local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "Temp Epoch Time") -- Add the fields to the protocol sensor_protocol.fields = { f_temperature, f_temp_epoch_time } local subtree = tree:add(sensor_protocol, buffer(), "SENSOR") -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect) for i = 0, num_of_instance - 1 do -- Add the new structure data as a subtree local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE "..i) -- dissect temperature (4 bytes for float) local temperature = buffer(offset, 4):le_float() -- Float type is 4 bytes (32 bits) subtree1:add(f_temperature, temperature) offset = offset + 4 -- dissect dt_epoch_time (4 bytes for uint32) local temp_epoch_time = buffer(offset, 4):le_uint() -- uint32 is 4 bytes subtree1:add(f_temp_epoch_time, temp_epoch_time) offset = offset + 4 end end ------------------------------------------------------------------------------------------------------------------------- function sensor_dissector_9(buffer, pinfo, tree, sensor_protocol, offset, num_of_instance) -- Define the fields for the protocol local f_temperature = ProtoField.float("sensor_protocol.temperature", "Temperature") local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "Temp Epoch Time") -- Add the fields to the protocol sensor_protocol.fields = { f_temperature, f_temp_epoch_time } local subtree = tree:add(sensor_protocol, buffer(), "SENSOR") -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect) for i = 0, num_of_instance - 1 do -- Add the new structure data as a subtree local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE "..i) -- dissect temperature (4 bytes for float) local temperature = buffer(offset, 4):le_float() -- Float type is 4 bytes (32 bits) subtree1:add(f_temperature, temperature) offset = offset + 4 -- dissect dt_epoch_time (4 bytes for uint32) local temp_epoch_time = buffer(offset, 4):le_uint() -- uint32 is 4 bytes subtree1:add(f_temp_epoch_time, temp_epoch_time) offset = offset + 4 end end ------------------------------------------------------------------------------------------------------------------------- function sensor_dissector_10(buffer, pinfo, tree, sensor_protocol, offset, num_of_instance) -- Define the fields for the protocol local f_temperature = ProtoField.float("sensor_protocol.temperature", "Temperature") local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "Temp Epoch Time") -- Add the fields to the protocol sensor_protocol.fields = { f_temperature, f_temp_epoch_time } local subtree = tree:add(sensor_protocol, buffer(), "SENSOR") -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect) for i = 0, num_of_instance - 1 do -- Add the new structure data as a subtree local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE "..i) -- dissect temperature (4 bytes for float) local temperature = buffer(offset, 4):le_float() -- Float type is 4 bytes (32 bits) subtree1:add(f_temperature, temperature) offset = offset + 4 -- dissect dt_epoch_time (4 bytes for uint32) local temp_epoch_time = buffer(offset, 4):le_uint() -- uint32 is 4 bytes subtree1:add(f_temp_epoch_time, temp_epoch_time) offset = offset + 4 end end ------------------------------------------------------------------------------------------------------------------------- function sensor_dissector_11(buffer, pinfo, tree, sensor_protocol, offset, num_of_instance) -- Define ProtoFields for the new structure fields local f_voltage = ProtoField.float("SensorData.voltage", "Voltage", base.DEC) local f_current = ProtoField.float("SensorData.current", "Current", base.DEC) local f_adm_epoch_time = ProtoField.uint32("SensorData.adm_epoch_time", "Epoch Time", base.DEC) -- Add the fields to the protocol sensor_protocol.fields = { f_voltage, f_current, f_adm_epoch_time } local subtree = tree:add(sensor_protocol, buffer(), "SENSOR") -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect) for i = 0, num_of_instance - 1 do -- Add the new structure data as a subtree local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE "..i) -- dissect voltage (4 bytes for float) local voltage = buffer(offset, 4):le_float() -- Float type is 4 bytes (32 bits) subtree1:add(f_voltage, voltage) offset = offset + 4 -- dissect current (4 bytes for float) local current = buffer(offset, 4):le_float() -- Float type is 4 bytes (32 bits) subtree1:add(f_current, current) offset = offset + 4 -- dissect adm_epoch_time (4 bytes for uint32) local adm_epoch_time = buffer(offset, 4):le_uint() -- uint32 is 4 bytes subtree1:add(f_adm_epoch_time, adm_epoch_time) offset = offset + 4 end end --------------------------------------------------------------------------------------------------------------------------- function sensor_dissector_12(buffer, pinfo, tree, sensor_protocol, offset, num_of_instance) -- Define ProtoFields for the new structure fields local f_voltage = ProtoField.float("SensorData.voltage", "Voltage", base.DEC) local f_current = ProtoField.float("SensorData.current", "Current", base.DEC) local f_adm_epoch_time = ProtoField.uint32("SensorData.adm_epoch_time", "Epoch Time", base.DEC) -- Add the fields to the protocol sensor_protocol.fields = { f_voltage, f_current, f_adm_epoch_time } local subtree = tree:add(sensor_protocol, buffer(), "SENSOR") -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect) for i = 0, num_of_instance - 1 do -- Add the new structure data as a subtree local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE "..i) -- dissect voltage (4 bytes for float) local voltage = buffer(offset, 4):le_float() -- Float type is 4 bytes (32 bits) subtree1:add(f_voltage, voltage) offset = offset + 4 -- dissect current (4 bytes for float) local current = buffer(offset, 4):le_float() -- Float type is 4 bytes (32 bits) subtree1:add(f_current, current) offset = offset + 4 -- dissect adm_epoch_time (4 bytes for uint32) local adm_epoch_time = buffer(offset, 4):le_uint() -- uint32 is 4 bytes subtree1:add(f_adm_epoch_time, adm_epoch_time) offset = offset + 4 end end --------------------------------------------------------------------------------------------------------------------------------------- function sensor_dissector_13(buffer, pinfo, tree, sensor_protocol, offset, num_of_instance) -- Define ProtoFields for the new structure fields local f_voltage = ProtoField.float("SensorData.voltage", "Voltage", base.DEC) local f_current = ProtoField.float("SensorData.current", "Current", base.DEC) local f_adm_epoch_time = ProtoField.uint32("SensorData.adm_epoch_time", "Epoch Time", base.DEC) -- Add the fields to the protocol sensor_protocol.fields = { f_voltage, f_current, f_adm_epoch_time } local subtree = tree:add(sensor_protocol, buffer(), "SENSOR") -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect) for i = 0, num_of_instance - 1 do -- Add the new structure data as a subtree local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE "..i) -- dissect voltage (4 bytes for float) local voltage = buffer(offset, 4):le_float() -- Float type is 4 bytes (32 bits) subtree1:add(f_voltage, voltage) offset = offset + 4 -- dissect current (4 bytes for float) local current = buffer(offset, 4):le_float() -- Float type is 4 bytes (32 bits) subtree1:add(f_current, current) offset = offset + 4 -- dissect adm_epoch_time (4 bytes for uint32) local adm_epoch_time = buffer(offset, 4):le_uint() -- uint32 is 4 bytes subtree1:add(f_adm_epoch_time, adm_epoch_time) offset = offset + 4 end end ---------------------------------------------------------------------------------------------------------------------------------------- function sensor_dissector_14(buffer, pinfo, tree, sensor_protocol, offset, num_of_instance) -- Define ProtoFields for the new structure fields local f_temperature = ProtoField.float("TemperatureData.temperature", "Temperature", base.DEC) local f_dt_epoch_time = ProtoField.uint32("TemperatureData.dt_epoch_time", "Epoch Time", base.DEC) -- Add the fields to the protocol sensor_protocol.fields = { f_temperature, f_dt_epoch_time } local subtree = tree:add(sensor_protocol, buffer(), "SENSOR") -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect) for i = 0, num_of_instance - 1 do -- Add the new structure data as a subtree local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE"..i) -- dissect temperature (4 bytes for float) local temperature = buffer(offset, 4):le_float() -- Float type is 4 bytes (32 bits) subtree1:add(f_temperature, temperature) offset = offset + 4 -- dissect dt_epoch_time (4 bytes for uint32) local dt_epoch_time = buffer(offset, 4):le_uint() -- uint32 is 4 bytes subtree1:add(f_dt_epoch_time, dt_epoch_time) offset = offset + 4 end end --------------------------------------------------------------------------------------------------------------------------------------- function sensor_dissector_15(buffer, pinfo, tree, sensor_protocol, offset, num_of_instance) -- Define ProtoFields for the new structure fields local f_temperature = ProtoField.float("TemperatureData.temperature", "Temperature", base.DEC) local f_dt_epoch_time = ProtoField.uint32("TemperatureData.dt_epoch_time", "Epoch Time", base.DEC) -- Add the fields to the protocol sensor_protocol.fields = { f_temperature, f_dt_epoch_time } local subtree = tree:add(sensor_protocol, buffer(), "SENSOR") -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect) for i = 1, num_of_instance do -- Add the new structure data as a subtree local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE"..i) -- dissect temperature (4 bytes for float) local temperature = buffer(offset, 4):le_float() -- Float type is 4 bytes (32 bits) subtree1:add(f_temperature, temperature) offset = offset + 4 -- dissect dt_epoch_time (4 bytes for uint32) local dt_epoch_time = buffer(offset, 4):le_uint() -- uint32 is 4 bytes subtree1:add(f_dt_epoch_time, dt_epoch_time) offset = offset + 4 end end ------------------------------------------------------------------------------------------------------------------------------------