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

I am writing a Lua dissector for a protocol on top of the TCP protocol. It needs to store the acknowledgment number of request packets, in order to determine which is the corresponding response packet.

For example I can get the packet number with pinfo.number, is there any similar way I can access the acknowledgement number?

asked 07 May '12, 03:20

Ville's gravatar image

accept rate: 0%

edited 07 May '12, 03:55

What protocol are you dissecting?

(07 May '12, 03:37) helloworld

A special protocol on top of the TCP protocol.

(07 May '12, 03:56) Ville

You can define the desired fields with and then use the field definitions in the dissector function.

-- define the fields
tcp_srcp_f ="tcp.srcport")
tcp_dstp_f ="tcp.dstport")
tcp_ack_f ="tcp.ack")
tcp_seq_f ="tcp.seq")

function tcp_test_proto.dissector(buffer,pinfo,tree)
-- use the fields in the dissector
local sport = tcp_srcp_f()
local dport = tcp_dstp_f()
local ack = tcp_ack_f()
local seq = tcp_seq_f()


permanent link

answered 07 May '12, 06:57

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
accept rate: 15%

edited 07 May '12, 06:58

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: 07 May '12, 03:20

question was seen: 4,768 times

last updated: 07 May '12, 06:58

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