lokinet/include/llarp/exit_info.h

67 lines
1.2 KiB
C
Raw Normal View History

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
2018-05-25 09:17:08 +00:00
/**
* exit_info.h
*
* utilities for handling exits on the llarp network
*/
2018-01-08 13:49:05 +00:00
#ifdef __cplusplus
extern "C" {
#endif
2018-05-25 09:17:08 +00:00
/// Exit info model
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);
2018-01-29 14:27:24 +00:00
struct llarp_xi_list;
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);
2018-04-04 15:19:11 +00:00
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);
void
llarp_xi_list_pushback(struct llarp_xi_list *l, struct llarp_xi *xi);
2018-05-30 20:56:47 +00:00
void
llarp_xi_list_copy(struct llarp_xi_list *dst, struct llarp_xi_list *src);
void
llarp_xi_copy(struct llarp_xi *dst, struct llarp_xi *src);
struct llarp_xi_list_iter
{
2018-04-05 14:43:16 +00:00
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
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