Created
October 21, 2019 03:29
-
-
Save kyab/fd4a7af16f1dcdfa597628519c3e6d45 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snmpex_proto = Proto("snmpex","My SNMP Extension") | |
snmpex_proto.fields.location = ProtoField.string("snmpex_proto.location","Location") | |
-- create a function to dissect it | |
function snmpex_proto.dissector(buffer,pinfo,tree) | |
print("mydissector get called!(print)") | |
pinfo.cols.protocol = "SNMPEX" | |
local subtree = tree:add(snmpex_proto, buffer(), "My SNMP Extension") | |
-- subtree:add(snmpex_proto.fields.location, location, tostring(buffer())) | |
subtree:add(snmpex_proto.fields.location, buffer()) | |
end | |
oid_table = DissectorTable.get("snmp.variable_oid") | |
oid_table:add("1.3.6.1.2.1.1.6.0",snmpex_proto) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment