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

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

shobhit_garg91
169914
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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×1,620
×637
×431
×12

question asked: 18 Aug '16, 10:38

question was seen: 1,651 times

last updated: 20 Aug '16, 11:04

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