This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can I get source ip address and destination ip address of udp packet?

 
vikas byn
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I get source ip address and destination ip address of udp packet?
 
vikas byn
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


It will give information of Source address only.

actually I have one udp server in java at localhost and have some virtual interfaces on it.

now I send udp packet on this server at one virtual interface(say eth0:1). I received that packet but when extract information of source address only.

while i see tcpdump it will give information of source and destination.

that's why i am asking here if tcpdump get information of source and destination then java should have some api to get these information.

 
Rob Spoor
Sheriff
Pie
Posts: 20669
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you click on that link you are sure to see a few other methods that return other addresses. Try those first.
 
vikas byn
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:If you click on that link you are sure to see a few other methods that return other addresses. Try those first.


i tried it there are two methods for getting ip information - public SocketAddress getSocketAddress() and public InetAddress getAddress() - they give same address information.

actually i need three things - payload, source address and destination address (which is virtual interface in my case).

please forgive me for my bad english.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic