![]() |
|
Register | FAQ | The Twelve Commandments | Members List | Calendar | Arcade | Find the Best VPN | Today's Posts | Search |
General Gnutella / Gnutella Network Discussion For general discussion about Gnutella and the Gnutella network. For discussion about a specific Gnutella client program, please post in one of the client forums above. |
![]() |
| LinkBack | Thread Tools | Display Modes |
| |||
![]() Hi, I'm developing a gnutella client. But I have one problem: After, connect and ping... a pong response arrive from the server. The problem is: I can't translate the IP. I tried to use inet_ntoa, struct in_addr,etc... But always the response are some like that: 163.82.0.0 or 79.88.0.0 How can I get a correct IP? My header: typedef struct { unsigned char message[16]; unsigned char func; unsigned char ttl; unsigned char hops; unsigned int datalen; } header; typedef struct { unsigned short port; unsigned int ip; unsigned int files; unsigned int size; } ping; regards Rogerio |
| |||
![]() Well, you better check to make sure a short is two bytes and a int is 32. Better to use something defined for this. Instead of re inventing the world, why not look at Gtk-Gnutella, Gnut or Napshare? Then you could move on beyond the simple communications stuff. The IP should be byte order, just make yourself a little HEX print routine and printout the WHOLE packet, remember the first 11 bytes are all the gnutella stuff then your response. It's more fun to play with something that is working, try the code below. http://sourceforge.net/projects/gtk-gnutella/ http://www.gnutelliums.com/linux_unix/gnut/ http://napshare.sourceforge.net/ |
![]() |
| |
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Log Pong | robinhood2451 | General Discussion | 1 | September 29th, 2005 12:00 AM |
Pong Server | EvicerateX | General Gnutella / Gnutella Network Discussion | 2 | September 14th, 2002 07:19 AM |
Pong Server | sangony | General Gnutella / Gnutella Network Discussion | 8 | September 12th, 2002 02:12 PM |
Ping & Pong? What for? | JackDCLee | General Gnutella Development Discussion | 5 | March 31st, 2002 12:59 AM |
Pong Question | Ivex | General Gnutella Development Discussion | 4 | January 22nd, 2002 05:24 AM |