Ask Your Question

Revision history [back]

Plugin shows name but nothing else

Hi there, I have a lua script for separating data, as shown I can see the name of the protocol but there is nothing else. There should be a drop down where all the data is sorted so I can read the data better. Does anyone know where the bug is here? Thank you very much.

-- Definieren der Protokollinformationen

local p_wsci = Proto("wsci", "Workstation Control Interface")

-- Definieren der Felder, die im Protokoll angezeigt werden sollen local f_wsci_action = ProtoField.string("wsci.action", "Action") local f_wsci_data = ProtoField.string("wsci.data", "Data")

p_wsci.fields = {f_wsci_action, f_wsci_data}

-- Definieren der Dissektor-Funktion function p_wsci.dissector(tvb, pinfo, tree) pinfo.cols.protocol:set("WSCI") pinfo.cols.info:clear()

local subtree = tree:add(p_wsci, tvb())

-- Überprüfung, ob die Daten mit 55555555000000b200000002 beginnen
local data = tvb:range(0):bytes():tohex()
print("Data: " .. data)  -- Print the data for debugging
if string.sub(data, 1, 24) == "55555555000000b200000002" then
    print("Data starts with 55 55 55 55 00 00 00 b2 00 00 00 02")  -- Print a message for debugging
    -- Extrahieren der benötigten Ziffern
    local action = tvb:range(12):string()
    subtree:add(f_wsci_action, action)

    -- Extrahieren der Daten und Umwandeln von Hexadezimal in ASCII
    local hex_data = string.sub(data, 25)
    local ascii_data = ""
    for i = 1, #hex_data, 2 do
        local byte = string.sub(hex_data, i, i+1)
        ascii_data = ascii_data .. string.char(tonumber(byte, 16))
    end
    print("ASCII data: " .. ascii_data)  -- Print the ASCII data for debugging

    -- Aufteilen der Daten an den Kommas und Hinzufügen zu einem Dropdown-Menü
    local data_items = split(ascii_data, ',')
    for i, item in ipairs(data_items) do
        subtree:add(f_wsci_data, item)
    end
end

end

-- Funktion zum Aufteilen einer Zeichenkette an einem Trennzeichen function split(s, delimiter) result = {} for match in (s..delimiter):gmatch("(.-)"..delimiter) do table.insert(result, match) end return result end

-- Registrieren vom Dissektor local tcp_port = DissectorTable.get("tcp.port") tcp_port:add(55671, p_wsci)

Plugin shows name but nothing else

Hi there, I have a lua script for separating data, as shown I can see the name of the protocol but there is nothing else. There should be a drop down where all the data is sorted so I can read the data better. Does anyone know where the bug is here? Thank you very much.

 -- Definieren der Protokollinformationen

local p_wsci = Proto("wsci", "Workstation Control Interface")

Interface") -- Definieren der Felder, die im Protokoll angezeigt werden sollen local f_wsci_action = ProtoField.string("wsci.action", "Action") local f_wsci_data = ProtoField.string("wsci.data", "Data")

"Data") p_wsci.fields = {f_wsci_action, f_wsci_data}

f_wsci_data} -- Definieren der Dissektor-Funktion function p_wsci.dissector(tvb, pinfo, tree) pinfo.cols.protocol:set("WSCI") pinfo.cols.info:clear()

pinfo.cols.info:clear()

    local subtree = tree:add(p_wsci, tvb())

 -- Überprüfung, ob die Daten mit 55555555000000b200000002 beginnen
 local data = tvb:range(0):bytes():tohex()
 print("Data: " .. data)  -- Print the data for debugging
 if string.sub(data, 1, 24) == "55555555000000b200000002" then
     print("Data starts with 55 55 55 55 00 00 00 b2 00 00 00 02")  -- Print a message for debugging
     -- Extrahieren der benötigten Ziffern
     local action = tvb:range(12):string()
     subtree:add(f_wsci_action, action)

     -- Extrahieren der Daten und Umwandeln von Hexadezimal in ASCII
     local hex_data = string.sub(data, 25)
     local ascii_data = ""
     for i = 1, #hex_data, 2 do
         local byte = string.sub(hex_data, i, i+1)
         ascii_data = ascii_data .. string.char(tonumber(byte, 16))
     end
     print("ASCII data: " .. ascii_data)  -- Print the ASCII data for debugging

     -- Aufteilen der Daten an den Kommas und Hinzufügen zu einem Dropdown-Menü
     local data_items = split(ascii_data, ',')
     for i, item in ipairs(data_items) do
         subtree:add(f_wsci_data, item)
        end
    end
end

end

-- Funktion zum Aufteilen einer Zeichenkette an einem Trennzeichen function split(s, delimiter) result = {} for match in (s..delimiter):gmatch("(.-)"..delimiter) do table.insert(result, match) end return result end

end -- Registrieren vom Dissektor local tcp_port = DissectorTable.get("tcp.port") tcp_port:add(55671, p_wsci)

p_wsci)
click to hide/show revision 3
None

Plugin shows name but nothing else

Hi there, I have a lua script for separating data, as shown I can see the name of the protocol but there is nothing else. There should be a drop down where all the data is sorted so I can read the data better. Does anyone know where the bug is here? Thank you very much.

    -- Definieren der Protokollinformationen
local p_wsci = Proto("wsci", "Workstation Control Interface")

-- Definieren der Felder, die im Protokoll angezeigt werden sollen
local f_wsci_action = ProtoField.string("wsci.action", "Action")
local f_wsci_data = ProtoField.string("wsci.data", "Data")

p_wsci.fields = {f_wsci_action, f_wsci_data}

-- Definieren der Dissektor-Funktion
function p_wsci.dissector(tvb, pinfo, tree)
    pinfo.cols.protocol:set("WSCI")
    pinfo.cols.info:clear()

    local subtree = tree:add(p_wsci, tvb())

    -- Überprüfung, ob die Daten mit 55555555000000b200000002 beginnen
    local data = tvb:range(0):bytes():tohex()
    print("Data: " .. data)  -- Print the data for debugging
    if string.sub(data, 1, 24) == "55555555000000b200000002" then
        print("Data starts with 55 55 55 55 00 00 00 b2 00 00 00 02")  -- Print a message for debugging
        -- Extrahieren der benötigten Ziffern
        local action = tvb:range(12):string()
        subtree:add(f_wsci_action, action)

        -- Extrahieren der Daten und Umwandeln von Hexadezimal in ASCII
        local hex_data = string.sub(data, 25)
        local ascii_data = ""
        for i = 1, #hex_data, 2 do
            local byte = string.sub(hex_data, i, i+1)
            ascii_data = ascii_data .. string.char(tonumber(byte, 16))
        end
        print("ASCII data: " .. ascii_data)  -- Print the ASCII data for debugging

        -- Aufteilen der Daten an den Kommas und Hinzufügen zu einem Dropdown-Menü
        local data_items = split(ascii_data, ',')
        for i, item in ipairs(data_items) do
            subtree:add(f_wsci_data, item)
        end
    end
end

-- Funktion zum Aufteilen einer Zeichenkette an einem Trennzeichen
function split(s, delimiter)
    result = {}
    for match in (s..delimiter):gmatch("(.-)"..delimiter) do
        table.insert(result, match)
    end
    return result
end

-- Registrieren vom Dissektor
local tcp_port = DissectorTable.get("tcp.port")
tcp_port:add(55671, p_wsci)