Wireshark

  • Riverbed Technology
  • WinPcap
the world's foremost network protocol analyzer
  • Wireshark
    • About
    • Download
    • Blog
  • Get Help
    • Ask a Question
    • FAQs
    • Documentation
    • Mailing Lists
    • Online Tools
    • Wiki
    • Bug Tracker
  • Develop
    • Get Involved
    • Developer's Guide
    • Browse the Code
    • Latest Builds

Wireshark-users: Re: [Wireshark-users] Wireshark Lua question.

Date Index Thread Index Other Months All Mailing Lists
Date Prev Date Next Thread Prev Thread Next


From: Stig Bjørlykke <stig.bjorlykke@xxxxxxxxx>
Date: Mon, 5 Oct 2009 22:50:53 +0200

On 5. okt. 2009, at 22.07, Morita, Bill wrote:

I am seeking help in how to access the source and destination IP from a TCP packet in a LUA dissector of a protocol that uses TCP for transport.

You can use two methods to fetch the IP address:

1. The value in the "Source" column can be fetched from pinfo.src.

2. The value in "ip.src" can be fetched using a Field:

ip_src_f = Field.new("ip.src") ; must be registred outside the dissector

  if ip_src_f() then
    ip_src = ip_src_f().value
  end


When printing you have to use tostring(pinfo.src) or ip_src_f().label


--
Stig Bjørlykke



  • Follow-Ups:
    • Re: [Wireshark-users] Wireshark Lua question.
      • From: Guy Harris
  • References:
    • [Wireshark-users] Wireshark Lua question.
      • From: Morita, Bill
  • Prev by Date: [Wireshark-users] Wireshark Lua question.
  • Next by Date: Re: [Wireshark-users] Wireshark Lua question.
  • Previous by thread: [Wireshark-users] Wireshark Lua question.
  • Next by thread: Re: [Wireshark-users] Wireshark Lua question.
  • Index(es):
    • Date
    • Thread

Wireshark and the "fin" logo are registered trademarks of the Wireshark Foundation