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

Hi, I am trying to find out whether a packet is TCP or UDP in my dissector. The way I am doing this is:- pinfo.cols.protocol == "tcp" , but for some reason, it is showing as false for valid TCP packets. Hence I wanted to know the correct way to recognize whether a packet is TCP or UDP in the dissector. I am using Lua to create my dissector. Thanks.

asked 18 Aug '16, 10:38

shobhit_garg91's gravatar image

accept rate: 0%

I've only written a postdissector in LUA but assuming your dissector sits above the IP layer can you not just extract the ip.protocol value?

(19 Aug '16, 15:24) PaulOfford

@PaulOfford is right except that the exact field name provided by Wireshark's IP dissector is ip.proto.

(20 Aug '16, 11:04) sindy
Be the first one to answer this question!
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: 18 Aug '16, 10:38

question was seen: 2,076 times

last updated: 20 Aug '16, 11:04

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