Gnutella Forums

Gnutella Forums (https://www.gnutellaforums.com/)
-   General Gnutella / Gnutella Network Discussion (https://www.gnutellaforums.com/general-gnutella-gnutella-network-discussion/)
-   -   help with PONG (https://www.gnutellaforums.com/general-gnutella-gnutella-network-discussion/1146-help-pong.html)

RogerioS April 17th, 2001 10:59 AM

help with PONG
 
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

zap ping April 20th, 2001 03:52 PM

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/


All times are GMT -7. The time now is 01:37 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.