1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00
lokinet/include/llarp/router.h

53 lines
1.4 KiB
C
Raw Normal View History

2018-01-25 17:24:33 +01:00
#ifndef LLARP_ROUTER_H_
#define LLARP_ROUTER_H_
#include <llarp/config.h>
#include <llarp/ev.h>
2018-04-30 20:18:34 +02:00
#include <llarp/logic.h>
2018-06-06 14:59:15 +02:00
#include <llarp/nodedb.h>
2018-06-19 00:03:50 +02:00
#include <llarp/pathbuilder.h>
#include <llarp/router_contact.h>
2018-01-27 02:18:10 +01:00
#include <llarp/threadpool.h>
2018-01-25 17:24:33 +01:00
2018-01-29 15:27:24 +01:00
struct llarp_router;
2018-01-25 17:24:33 +01:00
bool
2018-05-22 21:19:06 +02:00
llarp_findOrCreateIdentity(struct llarp_crypto *crypto, const char *path,
byte_t *secretkey);
struct llarp_router *
llarp_init_router(struct llarp_threadpool *worker,
struct llarp_ev_loop *netloop, struct llarp_logic *logic);
void
llarp_free_router(struct llarp_router **router);
2018-01-25 17:24:33 +01:00
bool
2018-06-13 14:58:51 +02:00
llarp_router_try_connect(struct llarp_router *router, struct llarp_rc *remote,
uint16_t numretries);
2018-01-25 17:24:33 +01:00
2018-06-19 00:03:50 +02:00
/// override default path builder function (FFI)
void
llarp_router_override_path_selection(struct llarp_router *router,
llarp_pathbuilder_select_hop_func func);
bool
llarp_configure_router(struct llarp_router *router, struct llarp_config *conf);
void
2018-05-30 22:56:47 +02:00
llarp_run_router(struct llarp_router *router, struct llarp_nodedb *nodedb);
void
llarp_stop_router(struct llarp_router *router);
struct llarp_router_link_iter
{
void *user;
bool (*visit)(struct llarp_router_link_iter *, struct llarp_router *,
struct llarp_link *);
};
void
llarp_router_iterate_links(struct llarp_router *router,
struct llarp_router_link_iter iter);
2018-01-27 02:18:10 +01:00
2018-01-25 17:24:33 +01:00
#endif