mirror of https://github.com/oxen-io/lokinet
add shadow plugin
This commit is contained in:
parent
e12bd9442f
commit
fc069e3810
|
@ -8,6 +8,9 @@ if(ASAN)
|
|||
set(OPTIMIZE_FLAGS "-O0")
|
||||
endif(ASAN)
|
||||
|
||||
if(SHADOW)
|
||||
add_definitions(-DTESTNET=true)
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Wall ${DEBUG_FLAGS} ${OPTIMIZE_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall ${DEBUG_FLAGS} ${OPTIMIZE_FLAGS}")
|
||||
|
@ -22,7 +25,7 @@ if(RELEASE_MOTTO)
|
|||
endif()
|
||||
|
||||
set(EXE llarpd)
|
||||
set(EXE_SRC daemon/main.cpp)
|
||||
set(EXE_SRC daemon/main.c)
|
||||
|
||||
if(SODIUM_INCLUDE_DIR)
|
||||
include_directories(${SODIUM_INCLUDE_DIR})
|
||||
|
@ -84,3 +87,10 @@ target_link_libraries(${EXE} ${STATIC_LIB})
|
|||
|
||||
add_executable(rcutil daemon/rcutil.cpp)
|
||||
target_link_libraries(rcutil ${STATIC_LIB} ${LIBS})
|
||||
|
||||
|
||||
if(SHADOW)
|
||||
add_shadow_plugin(shadow-plugin-llarpd ${EXE_SRC})
|
||||
target_link_libraries(shadow-plugin-llarpd ${STATIC_LIB})
|
||||
install(TARGETS shadow-pluging-llarpd DESTINATIONS plugins)
|
||||
endif()
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include <llarp.h>
|
||||
#include <signal.h>
|
||||
#include <memory>
|
||||
|
||||
struct llarp_main *ctx = 0;
|
||||
|
||||
|
@ -11,13 +10,17 @@ handle_signal(int sig)
|
|||
llarp_main_signal(ctx, sig);
|
||||
}
|
||||
|
||||
#ifndef TESTNET
|
||||
#define TESTNET false
|
||||
#endif
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
const char *conffname = "daemon.ini";
|
||||
if(argc > 1)
|
||||
conffname = argv[1];
|
||||
ctx = llarp_main_init(conffname, true);
|
||||
ctx = llarp_main_init(conffname, !TESTNET);
|
||||
int code = 1;
|
||||
if(ctx)
|
||||
{
|
|
@ -52,7 +52,7 @@ struct llarp_router_lookup_job
|
|||
struct llarp_dht_context* dht;
|
||||
llarp_pubkey_t target;
|
||||
bool found;
|
||||
llarp_rc result;
|
||||
struct llarp_rc result;
|
||||
};
|
||||
|
||||
// shallow copy
|
||||
|
|
|
@ -15,7 +15,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
/** 2^15 bytes */
|
||||
const size_t MAX_LINK_MSG_SIZE = 32768;
|
||||
#define MAX_LINK_MSG_SIZE (32768)
|
||||
|
||||
/**
|
||||
* wire layer transport interface
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <llarp/ev.h>
|
||||
#include <llarp/link.h>
|
||||
#include <llarp/logic.h>
|
||||
#include <llarp/nodedb.h>
|
||||
#include <llarp/router_contact.h>
|
||||
#include <llarp/threadpool.h>
|
||||
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
// forward declare
|
||||
struct llarp_alloc;
|
||||
|
||||
const size_t MAX_RC_SIZE = 1024;
|
||||
|
||||
struct llarp_rc
|
||||
|
|
Loading…
Reference in New Issue