2018-04-04 13:54:37 +00:00
|
|
|
#ifndef LLARP_ROUTER_IDENT_H
|
|
|
|
#define LLARP_ROUTER_IDENT_H
|
|
|
|
#include <llarp/address_info.h>
|
|
|
|
#include <llarp/crypto.h>
|
|
|
|
#include <llarp/exit_info.h>
|
2018-04-05 14:43:16 +00:00
|
|
|
#include <llarp/router_contact.h>
|
2018-04-04 13:54:37 +00:00
|
|
|
#include <stdbool.h>
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2018-04-05 14:43:16 +00:00
|
|
|
/**
|
|
|
|
* rotuer identity private info
|
2018-04-04 13:54:37 +00:00
|
|
|
*/
|
2018-04-05 14:43:16 +00:00
|
|
|
struct llarp_router_ident {
|
|
|
|
struct llarp_crypto *crypto;
|
2018-04-04 13:54:37 +00:00
|
|
|
llarp_seckey_t signkey;
|
|
|
|
uint64_t updated;
|
|
|
|
uint16_t version;
|
2018-04-05 14:43:16 +00:00
|
|
|
struct llarp_ai_list *addrs;
|
|
|
|
struct llarp_xi_list *exits;
|
2018-04-04 13:54:37 +00:00
|
|
|
};
|
|
|
|
|
2018-04-05 14:43:16 +00:00
|
|
|
void llarp_router_ident_new(struct llarp_router_ident **ri,
|
|
|
|
struct llarp_crypto *crypto);
|
2018-04-05 14:23:14 +00:00
|
|
|
|
2018-04-05 14:43:16 +00:00
|
|
|
void llarp_router_ident_append_ai(struct llarp_router_ident *ri,
|
|
|
|
struct llarp_ai *ai);
|
2018-04-05 14:23:14 +00:00
|
|
|
|
2018-04-05 14:43:16 +00:00
|
|
|
bool llarp_router_ident_bdecode(struct llarp_router_ident *ri,
|
|
|
|
llarp_buffer_t *buf);
|
|
|
|
bool llarp_router_ident_bencode(struct llarp_router_ident *ri,
|
|
|
|
llarp_buffer_t *buf);
|
|
|
|
void llarp_router_ident_free(struct llarp_router_ident **ri);
|
|
|
|
bool llarp_router_ident_generate_rc(struct llarp_router_ident *ri,
|
|
|
|
struct llarp_rc **rc);
|
2018-04-04 13:54:37 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|