krpc_protocol v0.0.2 KRPCProtocol.Decoder

KRPCProtocol.Encoder provides functions to decode mainline DHT messages.

Summary

Functions

This function takes a byte string which is encoded in compact format and extracts the socket address (IPv4, port) and returns it

This function takes the nodes element and extracts all the IPv4 nodes and returns it as a list

This function extracts the Ipv4 address from a ‘get_peers’ response which are sharing the given infohash. (values)

Functions

compact_format(arg)

This function takes a byte string which is encoded in compact format and extracts the socket address (IPv4, port) and returns it.

decode(payload)
extract_nodes(nodes)

This function takes the nodes element and extracts all the IPv4 nodes and returns it as a list.

extract_nodes(arg, result)
extract_values(nodes)

This function extracts the Ipv4 address from a ‘get_peers’ response which are sharing the given infohash. (values)

extract_values(list, result)