Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cellframe/cellframe-sdk
  • MIKA83/cellframe-sdk
2 results
Show changes
Commits on Source (19)
Showing
with 42 additions and 140 deletions
...@@ -49,7 +49,7 @@ endif() ...@@ -49,7 +49,7 @@ endif()
# General chain libs # General chain libs
if (CELLFRAME_MODULES MATCHES "chains") if (CELLFRAME_MODULES MATCHES "chains")
message("[+] Module 'chains'") message("[+] Module 'chains'")
set(CELLFRAME_LIBS ${CELLFRAME_LIBS} dap_chain_common dap_chain dap_chain_global_db dap_chain_wallet dap_chain_crypto) set(CELLFRAME_LIBS ${CELLFRAME_LIBS} dap_chain_common dap_chain dap_chain_global_db dap_chain_wallet)
endif() endif()
# Networking # Networking
......
#ifndef crypto_stream_salsa2012_H #ifndef crypto_stream_salsa2012_H
#define crypto_stream_salsa2012_H #define crypto_stream_salsa2012_H
#define __STDC_LIMIT_MACROS
/* /*
* WARNING: This is just a stream cipher. It is NOT authenticated encryption. * WARNING: This is just a stream cipher. It is NOT authenticated encryption.
* While it provides some protection against eavesdropping, it does NOT * While it provides some protection against eavesdropping, it does NOT
...@@ -10,12 +10,20 @@ ...@@ -10,12 +10,20 @@
*/ */
#include <stddef.h> #include <stddef.h>
#include "utils.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#define SODIUM_MIN(A, B) ((A) < (B) ? (A) : (B))
#if defined(UINT64_MAX) && defined(SIZE_MAX)
#define SODIUM_SIZE_MAX SODIUM_MIN(UINT64_MAX, SIZE_MAX)
#else
#define SODIUM_SIZE_MAX ((1 << 30) - 1)
#endif
#define crypto_stream_salsa2012_KEYBYTES 32U #define crypto_stream_salsa2012_KEYBYTES 32U
size_t crypto_stream_salsa2012_keybytes(void); size_t crypto_stream_salsa2012_keybytes(void);
......
...@@ -8,8 +8,6 @@ Public domain. ...@@ -8,8 +8,6 @@ Public domain.
#include "crypto_core_salsa2012.h" #include "crypto_core_salsa2012.h"
#include "crypto_stream_salsa2012.h" #include "crypto_stream_salsa2012.h"
#include "utils.h"
/** /**
* @brief generate gamma bytes * @brief generate gamma bytes
......
#ifndef sodium_utils_H
#define sodium_utils_H
#include <stddef.h>
#define SODIUM_MIN(A, B) ((A) < (B) ? (A) : (B))
#define SODIUM_SIZE_MAX SODIUM_MIN(UINT64_MAX, SIZE_MAX)
#endif
...@@ -32,7 +32,7 @@ void test_encypt_decrypt(int count_steps, const dap_enc_key_type_t key_type, con ...@@ -32,7 +32,7 @@ void test_encypt_decrypt(int count_steps, const dap_enc_key_type_t key_type, con
randombytes(kex, kex_size); randombytes(kex, kex_size);
dap_enc_key_t* key = dap_enc_key_new_generate(key_type, kex, kex_size, seed, seed_size, cipher_key_size); dap_enc_key_t* key = dap_enc_key_new_generate(key_type, kex, kex_size, seed, seed_size, cipher_key_size);
source_size = 1 + random_uint32_t(max_source_size); source_size = 256;//1 + random_uint32_t(max_source_size);
uint8_t *source = DAP_NEW_SIZE(uint8_t, source_size); uint8_t *source = DAP_NEW_SIZE(uint8_t, source_size);
......
...@@ -20,12 +20,13 @@ int main(void) ...@@ -20,12 +20,13 @@ int main(void)
// switch off debug info from library // switch off debug info from library
dap_log_level_set(L_CRITICAL); dap_log_level_set(L_CRITICAL);
const int test_numbers = 100; const int test_numbers = 100;
dap_enc_ringct20_tests_run(test_numbers);//return 0;
dap_enc_multi_sign_tests_run(); dap_enc_multi_sign_tests_run();
dap_enc_newhope_tests_run(test_numbers); dap_enc_newhope_tests_run(test_numbers);
test_encypt_decrypt (test_numbers, DAP_ENC_KEY_TYPE_SEED_OFB, 32);
test_encypt_decrypt_fast (test_numbers, DAP_ENC_KEY_TYPE_SEED_OFB, 32);
test_encypt_decrypt (test_numbers, DAP_ENC_KEY_TYPE_SALSA2012, 32); test_encypt_decrypt (test_numbers, DAP_ENC_KEY_TYPE_SALSA2012, 32);
test_encypt_decrypt_fast (test_numbers, DAP_ENC_KEY_TYPE_SALSA2012, 32); test_encypt_decrypt_fast (test_numbers, DAP_ENC_KEY_TYPE_SALSA2012, 32);
test_encypt_decrypt (test_numbers, DAP_ENC_KEY_TYPE_SEED_OFB, 32);
test_encypt_decrypt_fast (test_numbers, DAP_ENC_KEY_TYPE_SEED_OFB, 32);
test_encypt_decrypt (test_numbers, DAP_ENC_KEY_TYPE_GOST_OFB, 32); test_encypt_decrypt (test_numbers, DAP_ENC_KEY_TYPE_GOST_OFB, 32);
test_encypt_decrypt_fast (test_numbers, DAP_ENC_KEY_TYPE_GOST_OFB, 32); test_encypt_decrypt_fast (test_numbers, DAP_ENC_KEY_TYPE_GOST_OFB, 32);
test_encypt_decrypt (test_numbers, DAP_ENC_KEY_TYPE_KUZN_OFB, 32); test_encypt_decrypt (test_numbers, DAP_ENC_KEY_TYPE_KUZN_OFB, 32);
...@@ -38,7 +39,6 @@ int main(void) ...@@ -38,7 +39,6 @@ int main(void)
test_encypt_decrypt_fast (test_numbers, DAP_ENC_KEY_TYPE_IAES, 32); test_encypt_decrypt_fast (test_numbers, DAP_ENC_KEY_TYPE_IAES, 32);
test_encypt_decrypt (test_numbers, DAP_ENC_KEY_TYPE_OAES, 32); test_encypt_decrypt (test_numbers, DAP_ENC_KEY_TYPE_OAES, 32);
test_encypt_decrypt_fast (test_numbers, DAP_ENC_KEY_TYPE_OAES, 32); test_encypt_decrypt_fast (test_numbers, DAP_ENC_KEY_TYPE_OAES, 32);
dap_enc_ringct20_tests_run(test_numbers);
// return 0; // return 0;
dap_enc_tests_run(); dap_enc_tests_run();
......
...@@ -15,6 +15,6 @@ add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_SRCS} ${DAP_CHAIN_HEADERS}) ...@@ -15,6 +15,6 @@ add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_SRCS} ${DAP_CHAIN_HEADERS})
#find_package(PkgConfig REQUIRED) #find_package(PkgConfig REQUIRED)
#pkg_search_module(GLIB REQUIRED glib-2.0) #pkg_search_module(GLIB REQUIRED glib-2.0)
target_link_libraries(dap_chain dap_core dap_chain_common dap_chain_crypto dap_chain_mempool dap_chain_global_db ${GLIB_LDFLAGS}) target_link_libraries(dap_chain dap_core dap_chain_common dap_chain_mempool dap_chain_global_db ${GLIB_LDFLAGS})
target_include_directories(dap_chain INTERFACE . include/ ${GLIB_INCLUDE_DIRS}) target_include_directories(dap_chain INTERFACE . include/ ${GLIB_INCLUDE_DIRS})
target_include_directories(${PROJECT_NAME} PUBLIC include) target_include_directories(${PROJECT_NAME} PUBLIC include)
...@@ -336,7 +336,7 @@ int dap_chain_ledger_token_emission_add_check(dap_ledger_t *a_ledger, const dap_ ...@@ -336,7 +336,7 @@ int dap_chain_ledger_token_emission_add_check(dap_ledger_t *a_ledger, const dap_
log_it(L_ERROR, "Can't add token emission datum of %llu %s ( 0x%s ): already present in cache", log_it(L_ERROR, "Can't add token emission datum of %llu %s ( 0x%s ): already present in cache",
a_token_emission->hdr.value, c_token_ticker, l_hash_str); a_token_emission->hdr.value, c_token_ticker, l_hash_str);
ret = -1; ret = -1;
}else if ( (! l_token_item) && ( HASH_COUNT( l_ledger_priv->treshold_emissions) < s_treshold_emissions_max )) { }else if ( (! l_token_item) && ( HASH_COUNT( l_ledger_priv->treshold_emissions) >= s_treshold_emissions_max )) {
log_it(L_WARNING,"Treshold for emissions is overfulled (%lu max)", log_it(L_WARNING,"Treshold for emissions is overfulled (%lu max)",
s_treshold_emissions_max); s_treshold_emissions_max);
ret = -2; ret = -2;
......
...@@ -8,6 +8,6 @@ add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_BLOCK_CS_POA_SRCS} ${DAP_CHAIN_BL ...@@ -8,6 +8,6 @@ add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_BLOCK_CS_POA_SRCS} ${DAP_CHAIN_BL
add_definitions ("-DDAP_CHAIN_BLOCK_CS_POA") add_definitions ("-DDAP_CHAIN_BLOCK_CS_POA")
target_link_libraries(dap_chain_cs_block_poa dap_core dap_crypto dap_chain dap_chain_crypto dap_chain_cs_block ) target_link_libraries(dap_chain_cs_block_poa dap_core dap_crypto dap_chain dap_chain_cs_block )
target_include_directories(dap_chain_cs_block_poa INTERFACE .) target_include_directories(dap_chain_cs_block_poa INTERFACE .)
...@@ -7,6 +7,6 @@ file(GLOB DAP_CHAIN_BLOCK_CS_POW_HEADERS include/*.h) ...@@ -7,6 +7,6 @@ file(GLOB DAP_CHAIN_BLOCK_CS_POW_HEADERS include/*.h)
add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_BLOCK_CS_POW_SRCS} ${DAP_CHAIN_BLOCK_CS_POW_HEADERS}) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_BLOCK_CS_POW_SRCS} ${DAP_CHAIN_BLOCK_CS_POW_HEADERS})
target_link_libraries(dap_chain_cs_block_pow dap_core dap_crypto dap_chain dap_chain_crypto dap_chain_cs_block ) target_link_libraries(dap_chain_cs_block_pow dap_core dap_crypto dap_chain dap_chain_cs_block )
target_include_directories(dap_chain_block_cs_pow INTERFACE .) target_include_directories(dap_chain_block_cs_pow INTERFACE .)
...@@ -11,6 +11,6 @@ endif() ...@@ -11,6 +11,6 @@ endif()
add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_DAG_CS_POA_SRCS} ${DAP_CHAIN_DAG_CS_POA_HEADERS}) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_DAG_CS_POA_SRCS} ${DAP_CHAIN_DAG_CS_POA_HEADERS})
target_link_libraries(dap_chain_cs_dag_poa dap_core dap_crypto dap_chain dap_chain_crypto dap_chain_cs_dag ) target_link_libraries(dap_chain_cs_dag_poa dap_core dap_crypto dap_chain dap_chain_cs_dag )
target_include_directories(dap_chain_cs_dag_poa INTERFACE .) target_include_directories(dap_chain_cs_dag_poa INTERFACE .)
target_include_directories(${PROJECT_NAME} PUBLIC include) target_include_directories(${PROJECT_NAME} PUBLIC include)
...@@ -11,6 +11,6 @@ endif() ...@@ -11,6 +11,6 @@ endif()
add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_CS_DAG_POS_SRCS} ${DAP_CHAIN_CS_DAG_POS_HEADERS}) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_CS_DAG_POS_SRCS} ${DAP_CHAIN_CS_DAG_POS_HEADERS})
target_link_libraries(dap_chain_cs_dag_pos dap_core dap_crypto dap_chain dap_chain_crypto dap_chain_cs_dag ) target_link_libraries(dap_chain_cs_dag_pos dap_core dap_crypto dap_chain dap_chain_cs_dag )
target_include_directories(dap_chain_cs_dag_pos INTERFACE .) target_include_directories(dap_chain_cs_dag_pos INTERFACE .)
target_include_directories(${PROJECT_NAME} PUBLIC include) target_include_directories(${PROJECT_NAME} PUBLIC include)
...@@ -11,7 +11,7 @@ endif() ...@@ -11,7 +11,7 @@ endif()
add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_GLOBAL_DB_SRC} ${DAP_CHAIN_GLOBAL_DB_HDR}) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_GLOBAL_DB_SRC} ${DAP_CHAIN_GLOBAL_DB_HDR})
target_link_libraries(${PROJECT_NAME} dap_core dap_crypto dap_chain dap_chain_crypto sqlite3 dap_cuttdb json-c) target_link_libraries(${PROJECT_NAME} dap_core dap_crypto dap_chain sqlite3 dap_cuttdb json-c)
target_include_directories(dap_chain_global_db INTERFACE .) target_include_directories(dap_chain_global_db INTERFACE .)
target_include_directories(${PROJECT_NAME} PUBLIC include) target_include_directories(${PROJECT_NAME} PUBLIC include)
......
...@@ -39,12 +39,12 @@ endif() ...@@ -39,12 +39,12 @@ endif()
add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_NET_SRCS} ${DAP_CHAIN_NET_HEADERS} ${IPUTILS_SRCS} ${IPUTILS_HEADERS}) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_NET_SRCS} ${DAP_CHAIN_NET_HEADERS} ${IPUTILS_SRCS} ${IPUTILS_HEADERS})
if(WIN32) if(WIN32)
target_link_libraries(dap_chain_net dap_core dap_crypto dap_client dap_stream_ch_chain dap_stream_ch_chain_net dap_chain dap_chain_crypto dap_chain_wallet dap_chain_net_srv dap_chain_mempool dap_chain_global_db ) target_link_libraries(dap_chain_net dap_core dap_crypto dap_client dap_stream_ch_chain dap_stream_ch_chain_net dap_chain dap_chain_wallet dap_chain_net_srv dap_chain_mempool dap_chain_global_db )
endif() endif()
if(UNIX) if(UNIX)
target_link_libraries(${PROJECT_NAME} dap_core dap_crypto dap_client dap_stream_ch_chain dap_stream_ch_chain_net dap_chain target_link_libraries(${PROJECT_NAME} dap_core dap_crypto dap_client dap_stream_ch_chain dap_stream_ch_chain_net dap_chain
dap_chain_crypto dap_chain_wallet dap_chain_net_srv dap_chain_net_srv_vpn dap_chain_mempool dap_chain_global_db dap_chain_wallet dap_chain_net_srv dap_chain_mempool dap_chain_global_db
resolv resolv
) )
endif() endif()
......
...@@ -943,10 +943,6 @@ int dap_chain_node_cli_init(dap_config_t * g_config) ...@@ -943,10 +943,6 @@ int dap_chain_node_cli_init(dap_config_t * g_config)
dap_chain_node_cli_cmd_item_create("tx_history", com_tx_history, NULL, "Transaction history (for address or by hash)", dap_chain_node_cli_cmd_item_create("tx_history", com_tx_history, NULL, "Transaction history (for address or by hash)",
"tx_history [-addr <addr> | -w <wallet name> | -tx <tx_hash>] -net <net name> -chain <chain name>\n"); "tx_history [-addr <addr> | -w <wallet name> | -tx <tx_hash>] -net <net name> -chain <chain name>\n");
// vpn client
dap_chain_node_cli_cmd_item_create ("vpn_client", com_vpn_client, NULL, "VPN client control",
"vpn_client [start -addr <server address> -port <server port>| stop | status]\n");
// Log // Log
dap_chain_node_cli_cmd_item_create ("print_log", com_print_log, NULL, "Print log info", dap_chain_node_cli_cmd_item_create ("print_log", com_print_log, NULL, "Print log info",
......
...@@ -76,7 +76,6 @@ ...@@ -76,7 +76,6 @@
#include "dap_chain_node_ping.h" #include "dap_chain_node_ping.h"
#include "dap_chain_net_srv.h" #include "dap_chain_net_srv.h"
#ifndef _WIN32 #ifndef _WIN32
#include "dap_chain_net_vpn_client.h"
#include "dap_chain_net_news.h" #include "dap_chain_net_news.h"
#endif #endif
#include "dap_chain_cell.h" #include "dap_chain_cell.h"
...@@ -1570,12 +1569,18 @@ int com_tx_wallet(int argc, char ** argv, void *arg_func, char **str_reply) ...@@ -1570,12 +1569,18 @@ int com_tx_wallet(int argc, char ** argv, void *arg_func, char **str_reply)
} }
} }
// dap_sign_type_t l_sign_type = { SIG_TYPE_BLISS }; dap_sign_type_t l_sign_type;
dap_sign_type_t l_sign_type = dap_sign_type_from_str(l_sign_type_str); if (!l_sign_type_str) {
if(l_sign_type.type == SIG_TYPE_NULL){
l_sign_type.type = SIG_TYPE_DILITHIUM; l_sign_type.type = SIG_TYPE_DILITHIUM;
l_sign_type_str = dap_sign_type_to_str(l_sign_type); l_sign_type_str = dap_sign_type_to_str(l_sign_type);
} else {
l_sign_type = dap_sign_type_from_str(l_sign_type_str);
if (l_sign_type.type == SIG_TYPE_NULL){
dap_chain_node_cli_set_reply_text(str_reply, "Unknown signature type");
return -1;
}
} }
uint8_t *l_seed = NULL; uint8_t *l_seed = NULL;
size_t l_seed_size = 0; size_t l_seed_size = 0;
size_t l_restore_str_size = dap_strlen(l_restore_str); size_t l_restore_str_size = dap_strlen(l_restore_str);
...@@ -3540,7 +3545,7 @@ int com_tx_verify(int argc, char ** argv, void *arg_func, char **str_reply) ...@@ -3540,7 +3545,7 @@ int com_tx_verify(int argc, char ** argv, void *arg_func, char **str_reply)
if(str_reply) if(str_reply)
dap_chain_node_cli_set_reply_text(str_reply, "command \"%s\" not recognized", argv[1]); dap_chain_node_cli_set_reply_text(str_reply, "command \"%s\" not recognized", argv[1]);
} }
if(str_reply) else if(str_reply)
dap_chain_node_cli_set_reply_text(str_reply, "command not defined, enter \"help <cmd name>\""); dap_chain_node_cli_set_reply_text(str_reply, "command not defined, enter \"help <cmd name>\"");
return -1; return -1;
} }
...@@ -3794,103 +3799,3 @@ int com_news(int a_argc, char ** a_argv, void *a_arg_func, char **a_str_reply) ...@@ -3794,103 +3799,3 @@ int com_news(int a_argc, char ** a_argv, void *a_arg_func, char **a_str_reply)
dap_chain_node_cli_set_reply_text(a_str_reply, "News added from %s successfully", l_from); dap_chain_node_cli_set_reply_text(a_str_reply, "News added from %s successfully", l_from);
return 0; return 0;
} }
/**
* vpn_client command
*
* VPN client control
*/
int com_vpn_client(int a_argc, char ** a_argv, void *arg_func, char **a_str_reply)
{
#ifndef _WIN32
enum {
CMD_NONE, CMD_START, CMD_STOP, CMD_STATUS
};
int l_arg_index = 1;
// find net
dap_chain_net_t *l_net = NULL;
if(dap_chain_node_cli_cmd_values_parse_net_chain(&l_arg_index, a_argc, a_argv, a_str_reply, NULL, &l_net) < 0)
return -2;
int cmd_num = CMD_NONE;
if(dap_chain_node_cli_find_option_val(a_argv, l_arg_index, min(a_argc, l_arg_index + 1), "start", NULL)) {
cmd_num = CMD_START;
}
else if(dap_chain_node_cli_find_option_val(a_argv, l_arg_index, min(a_argc, l_arg_index + 1), "stop", NULL)) {
cmd_num = CMD_STOP;
}
else if(dap_chain_node_cli_find_option_val(a_argv, l_arg_index, min(a_argc, l_arg_index + 1), "status", NULL)) {
cmd_num = CMD_STATUS;
}
if(cmd_num == CMD_NONE) {
if(!a_argv[1])
dap_chain_node_cli_set_reply_text(a_str_reply, "invalid parameters");
else
dap_chain_node_cli_set_reply_text(a_str_reply, "parameter %s not recognized", a_argv[1]);
return -1;
}
switch (cmd_num)
{
case CMD_START: {
const char * l_str_addr = NULL; // for example, "192.168.100.93"
const char * l_str_port = NULL; // for example, "8079"
dap_chain_node_cli_find_option_val(a_argv, l_arg_index, a_argc, "-addr", &l_str_addr);
if(!l_str_addr) {
dap_chain_node_cli_set_reply_text(a_str_reply,
"VPN server address not defined, use -addr <vpn server ipv4 address> parameter");
break;
}
dap_chain_node_cli_find_option_val(a_argv, l_arg_index, a_argc, "-port", &l_str_port);
int l_srv_port = (l_str_port) ? (int) strtoll(l_str_port, 0, 10) : 0;
if(!l_srv_port) {
dap_chain_node_cli_set_reply_text(a_str_reply,
"VPN server port not defined, use -port <vpn server port> parameter");
break;
}
int l_res = dap_chain_net_vpn_client_start(l_net, l_str_addr, NULL, l_srv_port);
switch (l_res) {
case 0:
dap_chain_node_cli_set_reply_text(a_str_reply, "VPN client started successfully");
break;
case 1:
dap_chain_node_cli_set_reply_text(a_str_reply, "VPN client already started");
break;
case -2:
case -3:
dap_chain_node_cli_set_reply_text(a_str_reply, "Can't connect to VPN server");
break;
default:
dap_chain_node_cli_set_reply_text(a_str_reply, "Can't start VPN client");
break;
}
return l_res;
}
break;
case CMD_STOP: {
int res = dap_chain_net_vpn_client_stop();
if(!res)
dap_chain_node_cli_set_reply_text(a_str_reply, "VPN client stopped successfully");
else
dap_chain_node_cli_set_reply_text(a_str_reply, "VPN client not stopped");
return res;
}
//break;
case CMD_STATUS:
switch (dap_chain_net_vpn_client_status()) {
// switch (0){
case 0:
dap_chain_node_cli_set_reply_text(a_str_reply, "VPN client stopped");
return 0;
case 1:
dap_chain_node_cli_set_reply_text(a_str_reply, "VPN client started");
return 0;
case -1:
dap_chain_node_cli_set_reply_text(a_str_reply, "Can't get VPN state");
return -1;
}
break;
}
#endif
return 0;
}
...@@ -7,7 +7,7 @@ file(GLOB DAP_CHAIN_NET_SRV_HEADERS include/*.h libmaxminddb/*.h) ...@@ -7,7 +7,7 @@ file(GLOB DAP_CHAIN_NET_SRV_HEADERS include/*.h libmaxminddb/*.h)
add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_NET_SRV_SRCS} ${DAP_CHAIN_NET_SRV_HEADERS}) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_NET_SRV_SRCS} ${DAP_CHAIN_NET_SRV_HEADERS})
target_link_libraries(dap_chain_net_srv dap_core dap_crypto dap_chain dap_chain_crypto dap_chain_net dap_chain_wallet) target_link_libraries(dap_chain_net_srv dap_core dap_crypto dap_chain dap_chain_net dap_chain_wallet)
target_include_directories(dap_chain_net_srv INTERFACE .) target_include_directories(dap_chain_net_srv INTERFACE .)
target_include_directories(${PROJECT_NAME} PUBLIC include) target_include_directories(${PROJECT_NAME} PUBLIC include)
...@@ -7,6 +7,6 @@ file(GLOB DAP_CHAIN_NET_SRV_APP_HEADERS include/*.h) ...@@ -7,6 +7,6 @@ file(GLOB DAP_CHAIN_NET_SRV_APP_HEADERS include/*.h)
add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_NET_SRV_APP_SRCS} ${DAP_CHAIN_NET_SRV_APP_HEADERS}) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_NET_SRV_APP_SRCS} ${DAP_CHAIN_NET_SRV_APP_HEADERS})
target_link_libraries(dap_chain_net_srv_app dap_core dap_crypto dap_chain dap_chain_crypto dap_chain_net dap_chain_net_srv) target_link_libraries(dap_chain_net_srv_app dap_core dap_crypto dap_chain dap_chain_net dap_chain_net_srv)
target_include_directories(dap_chain_net_srv_app INTERFACE .) target_include_directories(dap_chain_net_srv_app INTERFACE .)
target_include_directories(${PROJECT_NAME} PUBLIC include) target_include_directories(${PROJECT_NAME} PUBLIC include)
...@@ -15,7 +15,7 @@ endif() ...@@ -15,7 +15,7 @@ endif()
add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_NET_SRV_VPN_SRCS} ${DAP_CHAIN_NET_SRV_VPN_HEADERS}) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_NET_SRV_VPN_SRCS} ${DAP_CHAIN_NET_SRV_VPN_HEADERS})
target_link_libraries(${PROJECT_NAME} dap_core dap_crypto dap_stream dap_chain dap_chain_crypto dap_chain_net dap_chain_net_srv) target_link_libraries(${PROJECT_NAME} dap_core dap_crypto dap_stream dap_chain dap_chain_net dap_chain_net_srv)
add_definitions("-DDAP_TUN_IN_WORKER") add_definitions("-DDAP_TUN_IN_WORKER")
target_include_directories(${PROJECT_NAME} INTERFACE .) target_include_directories(${PROJECT_NAME} INTERFACE .)
target_include_directories(${PROJECT_NAME} PUBLIC include) target_include_directories(${PROJECT_NAME} PUBLIC include)
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
#include "dap_chain_net.h" #include "dap_chain_net.h"
#include "dap_chain_net_srv.h" #include "dap_chain_net_srv.h"
#include "dap_chain_net_srv_vpn.h" #include "dap_chain_net_srv_vpn.h"
#include "dap_chain_net_srv_vpn_cmd.h"
#include "dap_chain_net_srv_stream_session.h" #include "dap_chain_net_srv_stream_session.h"
#include "dap_chain_net_vpn_client.h" #include "dap_chain_net_vpn_client.h"
#include "dap_chain_ledger.h" #include "dap_chain_ledger.h"
...@@ -298,7 +299,10 @@ int dap_chain_net_srv_vpn_init(dap_config_t * g_config) { ...@@ -298,7 +299,10 @@ int dap_chain_net_srv_vpn_init(dap_config_t * g_config) {
break; // double break exits tokenizer loop and steps to next price item break; // double break exits tokenizer loop and steps to next price item
} }
} }
return 0;
int retVal = dap_chain_net_srv_vpn_cmd_init();
return retVal;
} }
return -1; return -1;
} }
......