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

I am making a custom dissector that needs to be able to find the source ip address of a packet and compare it with the IP address of the host computer.

How would I be able to find the source IP address?

Thanks in advance for any help.

asked 23 Jul '12, 08:23

bball2601's gravatar image

bball2601
16567
accept rate: 50%


I just figured it out, but for anyone who is having trouble with the same type of thing, you can output your source ip address as a string with ip_to_str(pinfo->src.data)

permanent link

answered 23 Jul '12, 10:06

bball2601's gravatar image

bball2601
16567
accept rate: 50%

Note that ip_to_str() assumes the source address is an IPv4 address. You might want to check the type of the address and handle IPv6 addresses as well.

(23 Jul '12, 15:22) Guy Harris ♦♦
-1

To find the Internet IP address visit the site IP-details.com here it displays the information like ISP(Internet Service Provider),IP location,country,latitude,longitude etc..

permanent link

answered 04 Jun '13, 23:41

VelaiyatuPillai's gravatar image

VelaiyatuPillai
102
accept rate: 0%

Your answer
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:

×637
×178
×48

question asked: 23 Jul '12, 08:23

question was seen: 35,827 times

last updated: 04 Jun '13, 23:41

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