Revision history [back]
wireshark lua for a new ethernet header
I want to use wireshark to strip or recognize a new ethernet header.
The whole packets like: Ethernet II header(type 0xf001)+new private header(10 bytes)+normal ethernet type like 0x0800 or 0x0806+data
Here is my lua, my problem is wireshark cannot go ahead process normal ethernet type.
f2_shim = Proto ("f2_shim","Cisco F2 shim header")
index = ProtoField.uint16("Index","f2_shim.index",base.HEX)
data = ProtoField.uint64("Data","f2_shim.data",base.HEX)
f2_shim.fields = {index, data}
function f2_shim.dissector(buffer,pinfo,tree)
pinfo.cols.protocol = "f2_shim"
local subtree = tree:add(f2_shim,buffer(),"f2_shim Header")
subtree:add(index,buffer:range(0,2))
subtree:add(buffer(2,8),"data1: " .. buffer(2,8):uint64())
Dissector.get("ethertype"):call(buffer:range(10):tvb(),pinfo,tree)
end
ether_table = DissectorTable.get("ethertype")
ether_table:add(0xf001,f2_shim)
wireshark lua for a new ethernet header
I want to use wireshark to strip or recognize a new ethernet header.
The whole packets like: Ethernet II header(type 0xf001)+new private header(10 bytes)+normal ethernet type like 0x0800 or 0x0806+data
Here is my lua, my problem is wireshark cannot go ahead process normal ethernet type.
pinfo.cols.protocol = "f2_shim"
end
ether_table = DissectorTable.get("ethertype")
ether_table:add(0xf001,f2_shim)
wireshark lua for a new ethernet header
I want to use wireshark to strip or recognize a new ethernet header.
The whole packets like: Ethernet II header(type 0xf001)+new private header(10 bytes)+normal ethernet type like 0x0800 or 0x0806+data
Here is my lua, my problem is wireshark cannot go ahead process normal ethernet type.
f2_shim = Proto ("f2_shim","Cisco F2 shim header")
header")
index = ProtoField.uint16("Index","f2_shim.index",base.HEX)
ProtoField.uint16("Index","f2_shim.index",base.HEX)
data = ProtoField.uint64("Data","f2_shim.data",base.HEX)
ProtoField.uint64("Data","f2_shim.data",base.HEX) f2_shim.fields = {index, data}
function f2_shim.dissector(buffer,pinfo,tree)
f2_shim.dissector(buffer,pinfo,tree)
pinfo.cols.protocol = "f2_shim"
local subtree = tree:add(f2_shim,buffer(),"f2_shim Header")
subtree:add(index,buffer:range(0,2))
subtree:add(buffer(2,8),"data1: " .. buffer(2,8):uint64())
Dissector.get("ethertype"):call(buffer:range(10):tvb(),pinfo,tree)
end
ether_table = DissectorTable.get("ethertype")
DissectorTable.get("ethertype") ether_table:add(0xf001,f2_shim)
wireshark lua for a new ethernet header
I want to use wireshark to strip or recognize a new ethernet header.
The whole packets like: Ethernet II header(type 0xf001)+new private header(10 bytes)+normal ethernet type like 0x0800 or 0x0806+data
Here is my lua, my problem is wireshark cannot go ahead process normal ethernet type.
f2_shim = Proto ("f2_shim","Cisco F2 shim header") index = ProtoField.uint16("Index","f2_shim.index",base.HEX) data = ProtoField.uint64("Data","f2_shim.data",base.HEX) f2_shim.fields = {index, data}
function f2_shim.dissector(buffer,pinfo,tree) pinfo.cols.protocol = "f2_shim" local subtree = tree:add(f2_shim,buffer(),"f2_shim Header") subtree:add(index,buffer:range(0,2)) subtree:add(buffer(2,8),"data1: " .. buffer(2,8):uint64()) Dissector.get("ethertype"):call(buffer:range(10):tvb(),pinfo,tree) end
ether_table = DissectorTable.get("ethertype") ether_table:add(0xf001,f2_shim)