diff --git a/modules/net/dap_chain_node_rpc.c b/modules/net/dap_chain_node_rpc.c index 97908825673e9badd4e4329a86cfee14311ab4c5..26a72e918cae4861f04534c32e7e1d0d396fdeb7 100644 --- a/modules/net/dap_chain_node_rpc.c +++ b/modules/net/dap_chain_node_rpc.c @@ -131,12 +131,16 @@ void dap_chain_node_rpc_init(dap_config_t *a_cfg) return; } if (l_role == RPC_ROLE_SERVER) { +#ifndef WIN32 if (dap_proc_thread_timer_add(NULL, s_update_node_rpc_states_info, NULL, s_timer_update_states_info)) { log_it(L_ERROR, "Can't activate timer on node states update"); } else { s_cmd_call_stat = DAP_NEW_Z_COUNT_RET_IF_FAIL(struct cmd_call_stat, DAP_CHAIN_NODE_CLI_CMD_ID_TOTAL); dap_cli_server_statistic_callback_add(s_collect_cmd_stat_info); } +#else + log_it(L_ERROR, "RPC server role on win32 not avaible"); +#endif } } if (l_role == RPC_ROLE_ROOT && !dap_chain_node_rpc_is_my_node_authorized()) diff --git a/modules/net/include/dap_chain_node_rpc.h b/modules/net/include/dap_chain_node_rpc.h index f8b9cb74d010b8559e423b716163c7b873d713a1..77f9e5804b78ff11d913a57f95d5a6183203a691 100644 --- a/modules/net/include/dap_chain_node_rpc.h +++ b/modules/net/include/dap_chain_node_rpc.h @@ -18,11 +18,32 @@ You should have received a copy of the GNU General Public License along with any DAP based project. If not, see <http://www.gnu.org/licenses/>. */ -#include <sys/sysinfo.h> + #include "dap_chain_node.h" #include "dap_chain_node_cli_cmd.h" #include "dap_config.h" +#ifndef WIN32 +#include <sys/sysinfo.h> +#else +struct sysinfo { // temporary added to read + __kernel_long_t uptime; /* Seconds since boot */ + __kernel_ulong_t loads[3]; /* 1, 5, and 15 minute load averages */ + __kernel_ulong_t totalram; /* Total usable main memory size */ + __kernel_ulong_t freeram; /* Available memory size */ + __kernel_ulong_t sharedram; /* Amount of shared memory */ + __kernel_ulong_t bufferram; /* Memory used by buffers */ + __kernel_ulong_t totalswap; /* Total swap space size */ + __kernel_ulong_t freeswap; /* swap space still available */ + __u16 procs; /* Number of current processes */ + __u16 pad; /* Explicit padding for m68k */ + __kernel_ulong_t totalhigh; /* Total high memory size */ + __kernel_ulong_t freehigh; /* Available high memory size */ + __u32 mem_unit; /* Memory unit size in bytes */ + char _f[20-2*sizeof(__kernel_ulong_t)-sizeof(__u32)]; /* Padding: libc5 uses this.. */ +}; +#endif + typedef struct dap_chain_node_rpc_cmd_states_info { int16_t count; int64_t time_stat[DAP_CHAIN_NODE_CLI_CMD_ID_TOTAL]; diff --git a/modules/service/voting/dap_chain_net_srv_voting.c b/modules/service/voting/dap_chain_net_srv_voting.c index e5e7cd185f6731320b4c30fe94e62d4bd029923d..eef4c26bb97b4b058085a07b083de8a36b032dab 100644 --- a/modules/service/voting/dap_chain_net_srv_voting.c +++ b/modules/service/voting/dap_chain_net_srv_voting.c @@ -39,6 +39,7 @@ #include "dap_cli_server.h" #include "dap_chain_wallet_cache.h" #include "dap_chain_node_cli.h" +#include "dap_chain_node_cli_cmd.h" #define LOG_TAG "chain_net_voting"