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 |
2 Answers:
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) answered 23 Jul '12, 10:06 bball2601 |
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.. answered 04 Jun '13, 23:41 VelaiyatuPillai |
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.