Skip to content

Instantly share code, notes, and snippets.

View yotommy's full-sized avatar

Tom Smith yotommy

View GitHub Profile
-- trivial protocol example
-- inspired by http://wiki.wireshark.org/Lua/Dissectors
-- declare our protocol
trivial_proto = Proto("trivial","Trivial Protocol")
-- create a function to dissect it
function trivial_proto.dissector(buffer,pinfo,tree)
local trivial_pdu_len = 4
pinfo.cols.protocol = "TRIVIAL"
@yotommy
yotommy / trivial_dissector.lua
Last active August 29, 2015 13:57
Extract potentially multiple 'trivial' PDUs from a TCP segment
-- trivial protocol example
-- inspired by http://wiki.wireshark.org/Lua/Dissectors
-- declare our protocol
trivial_proto = Proto("trivial","Trivial Protocol")
-- create a function to dissect it
function trivial_proto.dissector(buffer,pinfo,tree)
local offset = pinfo.desegment_offset or 0
local trivial_pdu_len = 4