Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 29th, 2012  |  syntax: None  |  size: 1.03 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. issue 'attempt to index global 'base'' within protocol fields creation
  2. do
  3.  
  4.     local asc_sccp =Proto("asc_sccp", "ASC Skinny Client Control Protocol")
  5.  
  6.     local f =asc_sccp.fields
  7.  
  8.  
  9.     f.length = ProtoField.bytes("asc_sccp.length", "length")  
  10.     f.version =ProtoField.uint8("asc_sccp.version", "version", base.HEX, 0xC)
  11.  
  12.  
  13.  
  14.     function asc_sccp.init()
  15.     end  
  16.  
  17.  
  18.     function asc_sccp.dissector(buffer,pinfo,tree)
  19.  
  20.         local subtree = tree:add (asc_sccp, buffer())
  21.         local offset = 0
  22.  
  23.         pinfo.cols.protocol = asc_sccp.name
  24.  
  25.         local length = buffer (offset, 4)
  26.  
  27.         subtree:add (f.length, length)
  28.         subtree:append_text ("Data length: " .. length)
  29.  
  30.         offset = offset + 4
  31.  
  32.         local version = buffer (offset, 4)
  33.  
  34.         subtree:add (f.version, version)
  35.         subtree:append_text ("    Version: " .. version)
  36.  
  37.  
  38.     end
  39.  
  40.     local tcp_table = DissectorTable.get("tcp.port")
  41.     tcp_table:add(2000, asc_sccp)  
  42.  
  43. end
  44.        
  45. f.version =ProtoField.uint8("asc_sccp.version", "version", base.HEX, 0xC)