Skip to content
Snippets Groups Projects
Commit 5798efe6 authored by pavel.uhanov's avatar pavel.uhanov
Browse files

[*] add win32

parent b53c3021
No related branches found
No related tags found
1 merge request!2120feature-15728
Pipeline #52417 failed with stage
in 16 minutes and 49 seconds
......@@ -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())
......
......@@ -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];
......
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment