Re: Re: Vendor packet #23

Negin Mosavi <[email protected]> Mon, 29 Mar 2010 08:42:42 -0700 (PDT)
Newsgroups gmane.network.gnutella.devel
Message-ID <[email protected]>
--ZHLzaFeN7xTfUnw8e-JVl3b52DubM1cIhspJdVk
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

hi
i have three question in Gnutella:
1.when i install Gnutellasim in linux, i have one error and lake of gnu src=
.tar.gz where can i get this file(web site)?
2. in Gnutella network if one servent get the IP address, this IP address i=
s static or Dynamic?
3.Does every servent for connecting in Gnutella network =C2=A0 have usernam=
e and password?
thanks





________________________________
From: "[email protected]" <[email protected]>
To: [email protected]
Sent: Sat, March 6, 2010 9:24:13 PM
Subject: [the_gdf] Re: Vendor packet #23

=C2=A0=20
Quoting Nikolay Raspopov <ryo-oh-ki@narod. ru> from ml.gnutella. dev-forum:
:Hello, Raphael_Manfredi@ pobox.com!
:You wrote to <the_gdf@yahoogroups .com> on Sat, 6 Mar 2010 12:29:00 +0000 =
(UTC):
:
: RM> :As I know its vendor packet and decoded as Vendor=3D"LIME" ,
: RM> Function=3D23, Version=3D2 :followed by unknown byte "07" and query(?=
)
: RM> string :"urn:sha1:4HGMT342 UDELUECVQZFGGEY2 ZNT2XWWJ" .
:
: RM> LIME/23v2 is known as "HEAD Ping".
: RM> Its purpose is to request alternate locations for the shared file.
:
:Thanks. And how to reply on this packet?

Well, with a LIME/24v2, known as "HEAD Pong", of course!

The code bits:

enum {
VMSG_HEAD_CODE_ NOT_FOUND =3D 0,
VMSG_HEAD_CODE_ COMPLETE =3D 1 << 0,
VMSG_HEAD_CODE_ PARTIAL =3D 1 << 1,

VMSG_HEAD_STATUS_ FIREWALLED =3D 1 << 2,
VMSG_HEAD_STATUS_ DOWNLOADING =3D 1 << 3,

VMSG_HEAD_CODE_ MASK =3D 0x03
};

The payload is made of GGEP keys.

The "C" key has a single byte code, whose bits are defined in the enum
above.

The "Q" key holds a single byte describing the queue status. Don't know
the exact coding of this field. Probably the number of queue slots availabl=
e?

The "V" key holds the 4-byte vendor code string, e.g. "GTKG".

The "F" key holds one boolean byte, set to 1 if you support TLS.

The "A" key holds a packed IP:port vector of alt-locs
(port is LE16, IP is BE32).

The "T" key is a bitfield indicating which of the alt locs support TLS.
Format unknown, sorry. GTKG issues it, but all I have is a C code algorithm
written by Chritian Biere. Can't tell what the specs are exactly.

Here's the C code:

"hcnt" is the number of alt-locs in the "hvec" array.

guchar tls_bytes[(G_ N_ELEMENTS( hvec) + 7) / 8];
guint tls_index, tls_length;
guint i;

g_assert(hcnt <=3D G_N_ELEMENTS( hvec));
memset(tls_bytes, 0, sizeof tls_bytes);
tls_index =3D 0;
tls_length =3D 0;

for (i =3D 0; i < hcnt; i++) {
host_addr_t addr;
guint16 port;
char alt[6];

if (NET_TYPE_IPV4 !=3D gnet_host_get_ net(&hvec[ i]))
continue;

addr =3D gnet_host_get_ addr(&hvec[ i]);
port =3D gnet_host_get_ port(&hvec[ i]);
poke_be32(&alt[ 0], host_addr_ipv4( addr));
poke_le16(&alt[ 4], port);

if (tls_cache_lookup( addr, port)) {
tls_bytes[tls_ index >> 3] |=3D 0x80U >> (tls_index & 7);
tls_length =3D (tls_index >> 3) + 1;
}
tls_index++;
}

Then you send in "T" the tls_length first bytes of the tls_bytes[] array.
Hope you can figure it out from this C code. It's rather clear, but I
would of course have preferred an English comment alongside. :-)

That's all I know, because that is all GTKG currently supports.

All this was done by Christian who reverse-engineered the LimeWire Java cod=
e.
I don't read LimeWire's code, so I don't know if there are new features tha=
t
LimeWire currently supports that were not implemented by Christian,

Perhaps someone from LimeWire could infirm / confim / complement these note=
s
so that we have definitive specs.

Raphael




=20=20=20=20=20=20

[Non-text portions of this message have been removed]


--ZHLzaFeN7xTfUnw8e-JVl3b52DubM1cIhspJdVk
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/htm=
l4/strict.dtd">
<html>
<head>
</head>







<body style=3D"background-color: #fff;">
<span style=3D"display:none">&nbsp;</span>

<!--~-|**|PrettyHtmlStartT|**|-~-->
<div id=3D"ygrp-mlmsg" style=3D"position:relative;">
  <div id=3D"ygrp-msg" style=3D"z-index: 1;">
<!--~-|**|PrettyHtmlEndT|**|-~-->

    <div id=3D"ygrp-text" >
=20=20=20=20=20=20
=20=20=20=20=20=20
      <p>hi<br>
i have three question in Gnutella:<br>
1.when i install Gnutellasim in linux, i have one error and lake of gnu src=
.tar.gz where can i get this file(web site)?<br>
2. in Gnutella network if one servent get the IP address, this IP address i=
s static or Dynamic?<br>
3.Does every servent for connecting in Gnutella network =C2=A0 have usernam=
e and password?<br>
thanks<br>
<br>
____________<wbr>_________<wbr>_________<wbr>__<br>
From: &quot;<a href=3D"mailto:Raphael_Manfredi%40pobox.com">Raphael_Manfred=
i@<wbr>pobox.com</a>&quot; &lt;<a href=3D"mailto:Raphael_Manfredi%40pobox.c=
om">Raphael_Manfredi@<wbr>pobox.com</a>&gt;<br>
To: <a href=3D"mailto:the_gdf%40yahoogroups.com">the_gdf@yahoogroups<wbr>.c=
om</a><br>
Sent: Sat, March 6, 2010 9:24:13 PM<br>
Subject: [the_gdf] Re: Vendor packet #23<br>
<br>
=C2=A0 <br>
Quoting Nikolay Raspopov &lt;ryo-oh-ki@narod. ru&gt; from ml.gnutella. dev-=
forum:<br>
:Hello, Raphael_Manfredi@ pobox.com!<br>
:You wrote to &lt;the_gdf@yahoogroup<wbr>s .com&gt; on Sat, 6 Mar 2010 12:2=
9:00 &#43;0000 (UTC):<br>
:<br>
: RM&gt; :As I know its vendor packet and decoded as Vendor=3D&quot;LIME&qu=
ot; ,<br>
: RM&gt; Function=3D23, Version=3D2 :followed by unknown byte &quot;07&quot=
; and query(?)<br>
: RM&gt; string :&quot;urn:sha1:4HGMT342 UDELUECVQZFGGEY2 ZNT2XWWJ&quot; .<=
br>
:<br>
: RM&gt; LIME/23v2 is known as &quot;HEAD Ping&quot;.<br>
: RM&gt; Its purpose is to request alternate locations for the shared file.=
<br>
:<br>
:Thanks. And how to reply on this packet?<br>
<br>
Well, with a LIME/24v2, known as &quot;HEAD Pong&quot;, of course!<br>
<br>
The code bits:<br>
<br>
enum {<br>
VMSG_HEAD_CODE_ NOT_FOUND =3D 0,<br>
VMSG_HEAD_CODE_ COMPLETE =3D 1 &lt;&lt; 0,<br>
VMSG_HEAD_CODE_ PARTIAL =3D 1 &lt;&lt; 1,<br>
<br>
VMSG_HEAD_STATUS_ FIREWALLED =3D 1 &lt;&lt; 2,<br>
VMSG_HEAD_STATUS_ DOWNLOADING =3D 1 &lt;&lt; 3,<br>
<br>
VMSG_HEAD_CODE_ MASK =3D 0x03<br>
};<br>
<br>
The payload is made of GGEP keys.<br>
<br>
The &quot;C&quot; key has a single byte code, whose bits are defined in the=
 enum<br>
above.<br>
<br>
The &quot;Q&quot; key holds a single byte describing the queue status. Don'=
t know<br>
the exact coding of this field. Probably the number of queue slots availabl=
e?<br>
<br>
The &quot;V&quot; key holds the 4-byte vendor code string, e.g. &quot;GTKG&=
quot;.<br>
<br>
The &quot;F&quot; key holds one boolean byte, set to 1 if you support TLS.<=
br>
<br>
The &quot;A&quot; key holds a packed IP:port vector of alt-locs<br>
(port is LE16, IP is BE32).<br>
<br>
The &quot;T&quot; key is a bitfield indicating which of the alt locs suppor=
t TLS.<br>
Format unknown, sorry. GTKG issues it, but all I have is a C code algorithm=
<br>
written by Chritian Biere. Can't tell what the specs are exactly.<br>
<br>
Here's the C code:<br>
<br>
&quot;hcnt&quot; is the number of alt-locs in the &quot;hvec&quot; array.<b=
r>
<br>
guchar tls_bytes[(G_ N_ELEMENTS( hvec) + 7) / 8];<br>
guint tls_index, tls_length;<br>
guint i;<br>
<br>
g_assert(hcnt &lt;=3D G_N_ELEMENTS( hvec));<br>
memset(tls_bytes, 0, sizeof tls_bytes);<br>
tls_index =3D 0;<br>
tls_length =3D 0;<br>
<br>
for (i =3D 0; i &lt; hcnt; i&#43;+) {<br>
host_addr_t addr;<br>
guint16 port;<br>
char alt[6];<br>
<br>
if (NET_TYPE_IPV4 !=3D gnet_host_get_ net(&amp;hvec[ i]))<br>
continue;<br>
<br>
addr =3D gnet_host_get_ addr(&amp;hvec[ i]);<br>
port =3D gnet_host_get_ port(&amp;hvec[ i]);<br>
poke_be32(&amp;alt[ 0], host_addr_ipv4( addr));<br>
poke_le16(&amp;alt[ 4], port);<br>
<br>
if (tls_cache_lookup( addr, port)) {<br>
tls_bytes[tls_ index &gt;&gt; 3] |=3D 0x80U &gt;&gt; (tls_index &amp; 7);<b=
r>
tls_length =3D (tls_index &gt;&gt; 3) + 1;<br>
}<br>
tls_index&#43;+;<br>
}<br>
<br>
Then you send in &quot;T&quot; the tls_length first bytes of the tls_bytes[=
] array.<br>
Hope you can figure it out from this C code. It's rather clear, but I<br>
would of course have preferred an English comment alongside. :-)<br>
<br>
That's all I know, because that is all GTKG currently supports.<br>
<br>
All this was done by Christian who reverse-engineered the LimeWire Java cod=
e.<br>
I don't read LimeWire's code, so I don't know if there are new features tha=
t<br>
LimeWire currently supports that were not implemented by Christian,<br>
<br>
Perhaps someone from LimeWire could infirm / confim / complement these note=
s<br>
so that we have definitive specs.<br>
<br>
Raphael<br>
<br>
[Non-text portions of this message have been removed]<br>
<br>
</p>

    </div>
=20=20=20=20=20

    <!--~-|**|PrettyHtmlStart|**|-~-->
    <div style=3D"color: #fff; height: 0;">__._,_.___</div>

=20=20=20=20=20=20=20=20
=20=20
=20=20=20
    <div id=3D"ygrp-actbar" style=3D"clear: both; margin-bottom: 10px; whit=
e-space: nowrap; color: #666; padding-top: 15px;">
      <div>
        <a href=3D"mailto:[email protected]?subject=3DRe: [the_gdf] Re=
: Vendor packet #23" style=3D"margin-right: 0; padding-right: 0;">
	  Reply to <span style=3D"font-weight: 700;">sender</span></a> |
        <a href=3D"mailto:[email protected]?subject=3DRe: [the_gdf] R=
e: Vendor packet #23">
	  Reply to <span style=3D"font-weight: 700;">group</span></a> |
        	  <a href=3D"http://groups.yahoo.com/group/the_gdf/post;_ylc=3DX3o=
DMTJxYXBsNGMzBF9TAzk3MzU5NzE0BGdycElkAzI2ODQyNTMEZ3Jwc3BJZAMxNzA1MDE2MDYxBG=
1zZ0lkAzIzNzAwBHNlYwNmdHIEc2xrA3JwbHkEc3RpbWUDMTI2OTg4NDEyMw--?act=3Dreply&=
messageNum=3D23700">Reply <span style=3D"font-weight: 700;">via web post</s=
pan></a> |
            	<a href=3D"http://groups.yahoo.com/group/the_gdf/post;_ylc=3DX=
3oDMTJlajNpZGRxBF9TAzk3MzU5NzE0BGdycElkAzI2ODQyNTMEZ3Jwc3BJZAMxNzA1MDE2MDYx=
BHNlYwNmdHIEc2xrA250cGMEc3RpbWUDMTI2OTg4NDEyMw--" style=3D"font-weight: 700=
;">Start a New Topic</a>
      </div>

                <a href=3D"http://groups.yahoo.com/group/the_gdf/message/23=
692;_ylc=3DX3oDMTM2dThvc3B0BF9TAzk3MzU5NzE0BGdycElkAzI2ODQyNTMEZ3Jwc3BJZAMx=
NzA1MDE2MDYxBG1zZ0lkAzIzNzAwBHNlYwNmdHIEc2xrA3Z0cGMEc3RpbWUDMTI2OTg4NDEyMwR=
0cGNJZAMyMzY5Mg--">Messages in this topic</a>
          (<span style=3D"font-weight: 700;">6</span>)
          </div>=20
<!------- Start Nav Bar ------>

<!-- |**|begin egp html banner|**| -->
<div id=3D"ygrp-vital" style=3D"background-color: #e0ecee; font-family: Ver=
dana; font-size: 10px; margin-bottom: 10px; padding: 10px;">
      <span id=3D"vithd" style=3D"font-weight: bold; color: #333; text-tran=
sform: uppercase; ">Recent Activity:</span>

    <ul style=3D"list-style-type: none; margin: 0; padding: 0; display: inl=
ine;">
            <li style=3D"border-right: 1px solid #000; font-weight: 700; di=
splay: inline; padding: 0 5px; margin-left: 0;">
      <span class=3D"cat"><a href=3D"http://groups.yahoo.com/group/the_gdf/=
members;_ylc=3DX3oDMTJmbnA1cjRvBF9TAzk3MzU5NzE0BGdycElkAzI2ODQyNTMEZ3Jwc3BJ=
ZAMxNzA1MDE2MDYxBHNlYwN2dGwEc2xrA3ZtYnJzBHN0aW1lAzEyNjk4ODQxMjM-?o=3D6" sty=
le=3D"text-decoration: none;">New Members</a></span>
      <span class=3D"ct" style=3D"color: #ff7900;">1</span>
    </li>
                                              </ul>
=20=20=20=20
  <div style=3D"clear: both; padding-top: 2px; color: #1e66ae;">
    <a href=3D"http://groups.yahoo.com/group/the_gdf;_ylc=3DX3oDMTJlZGdna3J=
sBF9TAzk3MzU5NzE0BGdycElkAzI2ODQyNTMEZ3Jwc3BJZAMxNzA1MDE2MDYxBHNlYwN2dGwEc2=
xrA3ZnaHAEc3RpbWUDMTI2OTg4NDEyMw--" style=3D"text-decoration: none;">Visit =
Your Group</a>
  </div>
</div>

=20=20
<div id=3D"ft" style=3D"font-family: Arial; font-size: 11px; margin-top: 5p=
x; padding: 0 2px 0 0; clear: both;">
  <a href=3D"http://groups.yahoo.com/;_ylc=3DX3oDMTJkbm4xNDU4BF9TAzk3MzU5Nz=
E0BGdycElkAzI2ODQyNTMEZ3Jwc3BJZAMxNzA1MDE2MDYxBHNlYwNmdHIEc2xrA2dmcARzdGltZ=
QMxMjY5ODg0MTIz" style=3D"float: left;"><img src=3D"http://l.yimg.com/a/i/u=
s/yg/logo/us.gif" height=3D"15" width=3D"137" alt=3D"Yahoo! Groups" style=
=3D"border: 0;"/></a>
  <div style=3D"color: #747575; float: right;">Switch to: <a href=3D"mailto=
:[email protected]?subject=3DChange Delivery Format: Trad=
itional" style=3D"text-decoration: none;">Text-Only</a>, <a href=3D"mailto:=
[email protected]?subject=3DEmail Delivery: Digest" class=3D"m=
argin-rt" style=3D"text-decoration: none;">Daily Digest</a> &bull; <a href=
=3D"mailto:[email protected]?subject=3DUnsubscribe" style=
=3D"text-decoration: none;">Unsubscribe</a> &bull; <a href=3D"http://docs.y=
ahoo.com/info/terms/" style=3D"text-decoration: none;">Terms of Use</a></di=
v>
</div>

<!-- |**|end egp html banner|**| -->

  </div> <!-- ygrp-msg -->

  <!-- Sponsor -->
  <!-- |**|begin egp html banner|**| -->
  <div id=3D"ygrp-sponsor" style=3D"width:160px; float:right; clear:none; m=
argin:0 0 25px 0; background: #fff;">

<!-- Start Recommendations -->
<div id=3D"ygrp-reco">
     </div>
<!-- End Recommendations -->



  </div>   <!-- |**|end egp html banner|**| -->

  <div style=3D"clear:both; color: #FFF; font-size:1px;">.</div>
</div>

  <img src=3D"http://geo.yahoo.com/serv?s=3D97359714/grpId=3D2684253/grpspI=
d=3D1705016061/msgId=3D23700/stime=3D1269884123/nc1=3D4836040/nc2=3D5741393=
/nc3=3D5733767" width=3D"1" height=3D"1"> <br>

<div style=3D"color: #fff; height: 0;">__,_._,___</div>
<!--~-|**|PrettyHtmlEnd|**|-~-->

</body>

<!--~-|**|PrettyHtmlStart|**|-~-->
<head>
  <style type=3D"text/css">
  <!--
  #ygrp-mkp {
  border: 1px solid #d8d8d8;
  font-family: Arial;
  margin: 10px 0;
  padding: 0 10px;
}

#ygrp-mkp hr {
  border: 1px solid #d8d8d8;
}

#ygrp-mkp #hd {
  color: #628c2a;
  font-size: 85%;
  font-weight: 700;
  line-height: 122%;
  margin: 10px 0;
}

#ygrp-mkp #ads {
  margin-bottom: 10px;
}

#ygrp-mkp .ad {
  padding: 0 0;
}

#ygrp-mkp .ad a {
  color: #0000ff;
  text-decoration: none;
}
  #ygrp-sponsor #ygrp-lc {
  font-family: Arial;
}

#ygrp-sponsor #ygrp-lc #hd {
  margin: 10px 0px;
  font-weight: 700;
  font-size: 78%;
  line-height: 122%;
}

#ygrp-sponsor #ygrp-lc .ad {
  margin-bottom: 10px;
  padding: 0 0;
}

  a {
    color: #1e66ae;
  }

  #actions {
    font-family: Verdana;
    font-size: 11px;
    padding: 10px 0;
  }

  #activity {
    background-color: #e0ecee;
    float: left;
    font-family: Verdana;
    font-size: 10px;
    padding: 10px;
  }

  #activity span {
    font-weight: 700;
  }

  #activity span:first-child {
    text-transform: uppercase;
  }

  #activity span a {
    color: #5085b6;
    text-decoration: none;
  }

  #activity span span {
    color: #ff7900;
  }

  #activity span .underline {
    text-decoration: underline;
  }

  .attach {
    clear: both;
    display: table;
    font-family: Arial;
    font-size: 12px;
    padding: 10px 0;
    width: 400px;
  }

  .attach div a {
    text-decoration: none;
  }

  .attach img {
    border: none;
    padding-right: 5px;
  }

  .attach label {
    display: block;
    margin-bottom: 5px;
  }

  .attach label a {
    text-decoration: none;
  }
=20=20
  blockquote {
    margin: 0 0 0 4px;
  }

  .bold {
    font-family: Arial;
    font-size: 13px;
    font-weight: 700;
  }

  .bold a {
    text-decoration: none;
  }

  dd.last p a {
    font-family: Verdana;
    font-weight: 700;
  }

  dd.last p span {
    margin-right: 10px;
    font-family: Verdana;
    font-weight: 700;
  }

  dd.last p span.yshortcuts {
    margin-right: 0;
  }

  div.attach-table div div a {
    text-decoration: none;
  }

  div.attach-table {
    width: 400px;
  }

  div.file-title a, div.file-title a:active, div.file-title a:hover, div.fi=
le-title a:visited {
    text-decoration: none;
  }

  div.photo-title a, div.photo-title a:active, div.photo-title a:hover, div=
.photo-title a:visited {
    text-decoration: none;
  }

  div#ygrp-mlmsg #ygrp-msg p a span.yshortcuts {
    font-family: Verdana;
    font-size: 10px;
    font-weight: normal;
  }

  .green {
    color: #628c2a;
  }

  .MsoNormal {
    margin: 0 0 0 0;
  }

  o {
    font-size: 0;
  }

  #photos div {
    float: left;
    width: 72px;
  }

  #photos div div {
    border: 1px solid #666666;
    height: 62px;
    overflow: hidden;
    width: 62px;
  }

  #photos div label {
    color: #666666;
    font-size: 10px;
    overflow: hidden;
    text-align: center;
    white-space: nowrap;
    width: 64px;
  }

  #reco-category {
    font-size: 77%;
  }

  #reco-desc {
    font-size: 77%;
  }

  .replbq {
    margin: 4px;
  }

  #ygrp-actbar div a:first-child {
   /* border-right: 0px solid #000;*/
    margin-right: 2px;
    padding-right: 5px;
  }

  #ygrp-mlmsg {
    font-size: 13px;
    font-family: Arial, helvetica,clean, sans-serif;
    *font-size: small;
    *font: x-small;
  }

  #ygrp-mlmsg table {
    font-size: inherit;
    font: 100%;
  }

  #ygrp-mlmsg select, input, textarea {
    font: 99% Arial, Helvetica, clean, sans-serif;
  }

  #ygrp-mlmsg pre, code {
    font:115% monospace;
    *font-size:100%;
  }

  #ygrp-mlmsg * {
    line-height: 1.22em;
  }

  #ygrp-mlmsg #logo {
    padding-bottom: 10px;
  }

  #ygrp-mlmsg a {
    color: #1E66AE;
  }

  #ygrp-msg p a {
    font-family: Verdana;
  }

  #ygrp-msg p#attach-count span {
    color: #1E66AE;
    font-weight: 700;
  }

  #ygrp-reco #reco-head {
    color: #ff7900;
    font-weight: 700;
  }

  #ygrp-reco {
    margin-bottom: 20px;
    padding: 0px;
  }

  #ygrp-sponsor #ov li a {
    font-size: 130%;
    text-decoration: none;
  }

  #ygrp-sponsor #ov li {
    font-size: 77%;
    list-style-type: square;
    padding: 6px 0;
  }=20

  #ygrp-sponsor #ov ul {
    margin: 0;
    padding: 0 0 0 8px;
  }

  #ygrp-text {
    font-family: Georgia;
  }

  #ygrp-text p {
    margin: 0 0 1em 0;
  }

  #ygrp-text tt {
    font-size: 120%;
  }

  #ygrp-vital ul li:last-child {
    border-right: none !important;=20
  }=20
  -->
  </style>
</head>

<!--~-|**|PrettyHtmlEnd|**|-~-->
</html>
<!-- end group email -->


--ZHLzaFeN7xTfUnw8e-JVl3b52DubM1cIhspJdVk--