This is our old Q&A Site. Please post any new questions and answers at


I started to make a lua port of the PTP/IP dissector split into the PTP/IP part and an dependent an PTP part. The idea is the PTP/IP dissector parses the IP specific structure parts (length, packet type) and then passes these to an PTP packet dissector.

However, in the PTP dissector I can not declare the 'imported' fields of the PTP/IP dissector:

top level

local length_field ="ptp.length")
local packet_type_field ="ptp.pktType")   
local header_offset_field ="ptp.headerOffset") -- protocol specific offset from the PTP/IP or PTP dissector

results in an error message bad argument #1 to 'new' (Field new: a field with this name must exist).

When I move it to function ptp_proto.dissector(tvb,pinfo,tree) the error message is (Field new: A Field extractor must be defined before Taps or Dissectors are called)

asked 08 Mar '16, 04:43

Thomas%20E's gravatar image

Thomas E
accept rate: 0%

Maybe this is due to the order which Wireshark finds & executes your .lua files. Try creating a new script that initializes your dissectors in correct order.

Renaming your files in alphabetical order could also work .. if sorting order of read .lua files is the issue.

permanent link

answered 27 Apr '16, 14:56

kim's gravatar image

accept rate: 50%

It worked. The 'parent' dissector needs to load before the child dissectors. An implementation is at

(30 May '16, 07:49) Thomas E
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 08 Mar '16, 04:43

question was seen: 1,430 times

last updated: 30 May '16, 07:49

p​o​w​e​r​e​d by O​S​Q​A