×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    309

    Smile how to extract the IP address from the IP packet using the IP hook

    Thanks a lot.
    Last edited by liuxingyu_best; 2009-01-06 at 10:31.

  2. #2
    Registered User
    Join Date
    Aug 2007
    Posts
    14

    Re: how to extract the IP address from the IP packet using the IP hook

    If using the post hook

    - the info addresses are normally (*) link layer addresses (TInetAddr class is only for IP addresses -- either IPv4 or IPv6)

    - do not use the "Address()" method (it only works for IPv4 and is totally unneeded limitation). Address() returns 0 for non-IP addresses and IPv6.

    - if you want to get address into text string, just use the Output function of the TInetAddress (it handles both IPv6 and IPv4).

    - if you want to actually see the IP packet, you have to use UnPack and Pack functions to the aPacket and then look into the actual packet content... (there should be examples how to do this somewhere...)

    (*) multicast and broadcast addresses are retained as IP addresses at this point (it the responsiblity of the driver to convert them to link layer equivalents). If the link layer does not use addresses (PPP), then the addresses in info are undefined (though may have some leftover garbage that looks like IP-address).

    Note, in other hooking points (execpt post and pre), the info addresses are IP addresses (always presented in IPv6 format, even IPv4 addresses)

  3. #3
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    309

    Smile Re: how to extract the IP address from the IP packet using the IP hook

    Thanks a lot.
    Last edited by liuxingyu_best; 2009-01-06 at 10:31.

Similar Threads

  1. SIP calls over Packet data
    By thefamilyman in forum VoIP
    Replies: 8
    Last Post: 2010-04-27, 06:12
  2. Mobile-Mobile packet switched connections, address issues, handover, disconnections.
    By Marzullo in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2007-07-19, 06:58
  3. TCP server packet receiving problem
    By raj_rr7 in forum Symbian Networking & Messaging (Closed)
    Replies: 9
    Last Post: 2007-07-12, 12:24
  4. Aphanumeric Address formats on MM1?
    By shtobias in forum General Messaging
    Replies: 0
    Last Post: 2003-09-09, 07:49
  5. Help! Help! My IP address is changing like crazy !!
    By jwynn_in_nh in forum Mobile Java General
    Replies: 0
    Last Post: 2003-07-22, 22:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×