2018-01-25 16:24:33 +00:00
|
|
|
#ifndef LLARP_XI_H
|
|
|
|
#define LLARP_XI_H
|
2018-01-26 14:17:51 +00:00
|
|
|
#include <llarp/buffer.h>
|
2018-04-04 16:10:27 +00:00
|
|
|
#include <llarp/crypto.h>
|
2018-01-25 16:24:33 +00:00
|
|
|
#include <llarp/net.h>
|
2018-01-08 13:49:05 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2018-01-29 14:27:24 +00:00
|
|
|
struct llarp_xi {
|
2018-04-04 13:54:37 +00:00
|
|
|
struct in6_addr address;
|
|
|
|
struct in6_addr netmask;
|
2018-04-04 16:10:27 +00:00
|
|
|
llarp_pubkey_t pubkey;
|
2018-01-29 14:27:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
bool llarp_xi_bdecode(struct llarp_xi *xi, llarp_buffer_t *buf);
|
|
|
|
bool llarp_xi_bencode(struct llarp_xi *xi, llarp_buffer_t *buf);
|
|
|
|
|
|
|
|
struct llarp_xi_list;
|
|
|
|
|
2018-04-05 14:43:16 +00:00
|
|
|
struct llarp_xi_list *llarp_xi_list_new();
|
2018-05-10 23:32:46 +00:00
|
|
|
void llarp_xi_list_free(struct llarp_xi_list **l);
|
|
|
|
|
|
|
|
bool llarp_xi_list_bdecode(struct llarp_xi_list *l, llarp_buffer_t *buf);
|
|
|
|
bool llarp_xi_list_bencode(struct llarp_xi_list *l, llarp_buffer_t *buf);
|
2018-04-04 15:19:11 +00:00
|
|
|
|
2018-04-05 14:43:16 +00:00
|
|
|
struct llarp_xi_list_iter {
|
|
|
|
void *user;
|
|
|
|
struct llarp_xi_list *list;
|
|
|
|
bool (*visit)(struct llarp_xi_list_iter *, struct llarp_xi *);
|
|
|
|
};
|
2018-04-04 15:19:11 +00:00
|
|
|
|
2018-04-05 14:43:16 +00:00
|
|
|
void llarp_xi_list_iterate(struct llarp_xi_list *l,
|
|
|
|
struct llarp_xi_list_iter *iter);
|
2018-04-04 15:19:11 +00:00
|
|
|
|
2018-01-08 13:49:05 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|