You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lokinet/llarp/router.hpp

42 lines
811 B
C++

7 years ago
#ifndef LLARP_ROUTER_HPP
#define LLARP_ROUTER_HPP
#include <llarp/link.h>
7 years ago
#include <llarp/router.h>
7 years ago
#include <functional>
#include "mem.hpp"
7 years ago
namespace llarp {
struct router_links {
llarp_link *link = nullptr;
router_links *next = nullptr;
};
7 years ago
7 years ago
} // namespace llarp
7 years ago
7 years ago
struct llarp_router {
6 years ago
bool ready;
6 years ago
const char * transport_keyfile = "transport.key";
6 years ago
const char * transport_certfile = "transport.pem";
6 years ago
struct llarp_ev_loop * netloop;
7 years ago
struct llarp_threadpool *tp;
llarp::router_links links;
llarp_crypto crypto;
llarp_msg_muxer muxer;
llarp_path_context *paths;
6 years ago
llarp_alloc * mem;
7 years ago
6 years ago
llarp_router(llarp_alloc * mem);
7 years ago
~llarp_router();
7 years ago
7 years ago
void AddLink(struct llarp_link *link);
7 years ago
7 years ago
void ForEachLink(std::function<void(llarp_link *)> visitor);
7 years ago
7 years ago
void Close();
6 years ago
bool Ready();
7 years ago
};
7 years ago
#endif