7 // http://www.bittorrent.org/beps/bep_0010.html
9 ExtendedHandshakeMessage struct {
10 M map[ExtensionName]ExtensionNumber `bencode:"m"`
11 V string `bencode:"v,omitempty"`
12 Reqq int `bencode:"reqq,omitempty"`
13 // The only mention of this I can find is in https://www.bittorrent.org/beps/bep_0011.html
15 Encryption bool `bencode:"e"`
17 MetadataSize int `bencode:"metadata_size,omitempty"`
18 // The local client port. It would be redundant for the receiving side of
19 // a connection to send this.
20 Port int `bencode:"p,omitempty"`
21 YourIp CompactIp `bencode:"yourip,omitempty"`
22 Ipv4 CompactIp `bencode:"ipv4,omitempty"`
23 Ipv6 net.IP `bencode:"ipv6,omitempty"`
31 // http://www.bittorrent.org/beps/bep_0011.html
32 ExtensionNamePex ExtensionName = "ut_pex"
34 ExtensionDeleteNumber ExtensionNumber = 0
37 func (me *ExtensionNumber) UnmarshalBinary(b []byte) error {
38 *me = ExtensionNumber(b[0])