Gnutella Forums

Gnutella Forums (https://www.gnutellaforums.com/)
-   General Gnutella Development Discussion (https://www.gnutellaforums.com/general-gnutella-development-discussion/)
-   -   Pong Packet Question.. (https://www.gnutellaforums.com/general-gnutella-development-discussion/13705-pong-packet-question.html)

prh99 July 18th, 2002 06:57 PM

Pong Packet Question..
 
I was wonder what I am doing wrong with the four byte host address in the query hit packet.

I've written a client now I am just ironing the bugs out. I've set up a test network on my computer. My program connect to Gnucleus.

When send a query hit with the 127.0.0.1 (7F001 or 520193) I get some something like 16.0.127.0. My question is how do you encode the host address? is suppose to be 127001?

tshdos July 18th, 2002 09:35 PM

Looks like you have the bytes in the wrong order.

127.0.0.1 = 16777343 = 0x0100007F

Paradog July 19th, 2002 06:11 AM

Quote:

Originally posted by tshdos
Looks like you have the bytes in the wrong order.

127.0.0.1 = 16777343 = 0x0100007F

I thought the Ips were IPv4 and the other stuffs lil' Endian? :confused:

prh99 July 19th, 2002 02:12 PM

Quote:

Originally posted by tshdos
Looks like you have the bytes in the wrong order.

127.0.0.1 = 16777343 = 0x0100007F


Thanks that seems to have solved my bad packet problem.
The Gnutella specs are a little misleading. The show it as:

byte 0 byte 1 byte 2 byte3

and the first part of their example address (208 i believe) under the byte 0. Anyway thanks for clearing that up.

cultiv8r July 20th, 2002 03:44 AM

String to IP: inet_addr()
IP to InAddr: inet_ntoa()

Syfonic July 21st, 2002 05:40 AM

Does that help?


All times are GMT -7. The time now is 06:42 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.