Re: Re: Introducing TLS
"Sam Berlin" <[email protected]>
| Newsgroups | gmane.network.gnutella.devel |
|---|---|
| Message-ID | <[email protected]> |
The specification counts bits from left to right, so if the 16th host (the 15th bit starting with 0-based numbers) is TLS-capable, that would be described as: tls=0001, Whereas if the first host (0th bit) and the 14th host (13th bit) were TLS capable, that would be described as: tls=8002, That is, the hexademical representation is purely a nibble-per-nibble translation of each 4 bytes, starting from left to right, with 0000=0x0, 0001=0x1, 0010=0x2, 0011=0x3, etc... This method is preferred because when the number is unwrapped to the bits, you can easily index through the bits in the same order as the ip:port list. Trailing 0s in both hexademical and byte[] form can be discarded. My previous email was confusing though in that it could be construed to mean only 2 chars could be listed. Thanks for that clarification. Sam On 6/12/07, [email protected] <[email protected]> wrote: > Quoting Sam Berlin <[email protected]> from ml.gnutella.dev-forum: > : The X-Alt header is changed so that "tls=##" is written prior to any of > :the > : locations are listed. '##' is the hexademical representation of the > :byte[] > : that describes which of the following alternate locations can accept > :TLS. > > This specification is confusing. It looks like one cannot send more > than 8 addresses in X-Alt. > > '##' does not stand for 2 hex chars, but rather a complete bit array > in big-endian format, where bit 0 represents the first address, > bit 1 the second address, etc.. > > So in a list of 17 hosts where only the 16th (i.e. the last but not least) > host can support TLS, this is bit #15 (numbering starts at 0), you would say: > > tls=8000, > > at the beginning of the X-Alt field, where indeed only the bit #15 is set. > > Thanks for clarifying the specs accordingly. > > Raphael > > > > Yahoo! Groups Links > > > >