#include "router_contact.hpp" #include "address_info.hpp" #include "bencode.hpp" #include "exit_info.hpp" extern "C" {} namespace llarp { bool BEncode(const llarp_rc &a, llarp_buffer_t *buff) { std::list addresses = ai_list_to_std(a.addrs); std::list exits = xi_list_to_std(a.exits); return bencodeDict(buff) && bencodeDictKey(buff, "a") && BEncode(addresses, buff) && bencodeDict_Bytes(buff, "k", a.pubkey, sizeof(a.pubkey)) && bencodeDict_Int(buff, "v", 0) && bencodeDictKey(buff, "x") && BEncode(exits, buff) && bencodeDict_Bytes(buff, "z", a.signature, sizeof(a.signature)) && bencodeEnd(buff); } } // namespace llarp