Skip to content
Snippets Groups Projects
Commit 69bb4028 authored by dmitriy.gerasimov's avatar dmitriy.gerasimov
Browse files

Merge branch 'features-2565' into 'master'

Features 2565 - Created the basis for wrapping dap_chain_net

See merge request !1
parents b3435a0e 583a6625
No related branches found
No related tags found
1 merge request!1Features 2565 - Created the basis for wrapping dap_chain_net
Showing
with 827 additions and 0 deletions
[submodule "libdap-chain-net"]
path = libdap-chain-net
url = https://gitlab.demlabs.net/cellframe/libdap-chain-net.git
[submodule "libdap"]
path = libdap
url = https://gitlab.demlabs.net/cellframe/libdap.git
[submodule "libdap-crypto"]
path = libdap-crypto
url = https://gitlab.demlabs.net/cellframe/libdap-crypto.git
[submodule "libdap-client"]
path = libdap-client
url = https://gitlab.demlabs.net/cellframe/libdap-client.git
[submodule "libdap-stream-ch-chain"]
path = libdap-stream-ch-chain
url = https://gitlab.demlabs.net/cellframe/libdap-stream-ch-chain.git
[submodule "libdap-chain-gdb"]
path = libdap-chain-gdb
url = https://gitlab.demlabs.net/cellframe/libdap-chain-gdb.git
[submodule "libdap-stream-ch-chain-net"]
path = libdap-stream-ch-chain-net
url = https://gitlab.demlabs.net/cellframe/libdap-stream-ch-chain-net.git
[submodule "libdap-chain"]
path = libdap-chain
url = https://gitlab.demlabs.net/cellframe/libdap-chain.git
[submodule "libdap-chain-crypto"]
path = libdap-chain-crypto
url = https://gitlab.demlabs.net/cellframe/libdap-chain-crypto.git
[submodule "libdap-chain-wallet"]
path = libdap-chain-wallet
url = https://gitlab.demlabs.net/cellframe/libdap-chain-wallet.git
[submodule "libdap-chain-net-srv"]
path = libdap-chain-net-srv
url = https://gitlab.demlabs.net/cellframe/libdap-chain-net-srv.git
[submodule "libdap-chain-net-srv-vpn"]
path = libdap-chain-net-srv-vpn
url = https://gitlab.demlabs.net/cellframe/libdap-chain-net-srv-vpn.git
[submodule "libdap-chain-mempool"]
path = libdap-chain-mempool
url = https://gitlab.demlabs.net/cellframe/libdap-chain-mempool.git
[submodule "libdap-chain-global-db"]
path = libdap-chain-global-db
url = https://gitlab.demlabs.net/cellframe/libdap-chain-global-db.git
[submodule "libdap-server"]
path = libdap-server
url = https://gitlab.demlabs.net/cellframe/libdap-server.git
[submodule "libdap-server-core"]
path = libdap-server-core
url = https://gitlab.demlabs.net/cellframe/libdap-server-core.git
[submodule "libdap-stream"]
path = libdap-stream
url = https://gitlab.demlabs.net/cellframe/libdap-stream.git
[submodule "libdap-stream-ch"]
path = libdap-stream-ch
url = https://gitlab.demlabs.net/cellframe/libdap-stream-ch.git
[submodule "libdap-server-udp"]
path = libdap-server-udp
url = https://gitlab.demlabs.net/cellframe/libdap-server-udp.git
[submodule "libdap-chain-python"]
path = libdap-chain-python
url = https://gitlab.demlabs.net/cellframe/libdap-chain-python.git
[submodule "libdap-crypto-python"]
path = libdap-crypto-python
url = https://gitlab.demlabs.net/cellframe/libdap-crypto-python.git
[submodule "libdap-python"]
path = libdap-python
url = https://gitlab.demlabs.net/cellframe/libdap-python.git
[submodule "libdap-client-python"]
path = libdap-client-python
url = https://gitlab.demlabs.net/cellframe/libdap-client-python.git
project(dap_chain_net_python_module C)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_COLOR_MAKEFILE ON)
set(CMAKE_C_STANDARD 11)
add_definitions("-fpic")
add_definitions ("-DNODE_NETNAME=\"cellframe\"")
if(UNIX)
add_definitions("-DDAP_OS_UNIX")
endif()
if(NOT (${SUBMODULES_NO_BUILD} MATCHES ON))
set (SUBMODULES_NO_BUILD ON)
if (NOT (TARGET dap_core))
add_subdirectory(libdap)
target_compile_options(
dap_core PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_crypto))
add_subdirectory(libdap-crypto)
target_compile_options(
dap_crypto PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_chain))
add_subdirectory(libdap-chain)
target_compile_options(
dap_chain PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_chain_crypto))
add_subdirectory(libdap-chain-crypto)
target_compile_options(
dap_chain_crypto PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_chain_mempool))
add_subdirectory(libdap-chain-mempool)
target_compile_options(
dap_chain_mempool PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_chain_net))
add_subdirectory(libdap-chain-net)
target_compile_options(
dap_chain_net PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_server_core))
add_subdirectory(libdap-server-core)
target_compile_options(
dap_server_core PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_chain_global_db))
add_subdirectory(libdap-chain-global-db)
target_compile_options(
dap_chain_global_db PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_client))
add_subdirectory(libdap-client)
target_compile_options(
dap_client PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET libdap-server))
add_subdirectory(libdap-server)
# target_compile_options(
# libdap-server PRIVATE
# "-fpic"
# )
endif()
if (NOT (TARGET dap_stream))
add_subdirectory(libdap-stream)
target_compile_options(
dap_stream PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_stream_ch))
add_subdirectory(libdap-stream-ch)
target_compile_options(
dap_stream_ch PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_stream_ch_chain))
add_subdirectory(libdap-stream-ch-chain)
target_compile_options(
dap_stream_ch_chain PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_stream_ch_chain_net))
add_subdirectory(libdap-stream-ch-chain-net)
target_compile_options(
dap_stream_ch_chain_net PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_udp_server))
add_subdirectory(libdap-server-udp)
target_compile_options(
dap_udp_server PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_chain_net_srv))
add_subdirectory(libdap-chain-net-srv)
target_compile_options(
dap_chain_net_srv PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_chain_wallet))
add_subdirectory(libdap-chain-wallet)
target_compile_options(
dap_chain_wallet PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_chain_gdb))
add_subdirectory(libdap-chain-gdb)
target_compile_options(
dap_chain_gdb PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_python_module))
add_subdirectory(libdap-python)
target_compile_options(
dap_python_module PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_crypto_python_module))
add_subdirectory(libdap-crypto-python)
target_compile_options(
dap_crypto_python_module PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_chain_net_srv_vpn))
add_subdirectory(libdap-chain-net-srv-vpn)
target_compile_options(
dap_chain_net_srv_vpn PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_chain_python_module))
add_subdirectory(libdap-chain-python)
target_compile_options(
dap_chain_python_module PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_client_python_module))
add_subdirectory(libdap-client-python)
target_compile_options(
dap_client_python_module PRIVATE
"-fpic"
)
endif()
endif()
#add_definitions("-DDAP_APP_NAME=\"TestPRJ\" -DSYSTEM_CONFIGS_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\"")
file(GLOB CHAIN_NET_PYTHON_SRCS src/*.c)
file(GLOB CHAIN_NET_PYTHON_HEADERS include/*.h)
set(Python_ADDITIONAL_VERSIONS 3.7)
find_package (PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIR} include/)
add_library(${PROJECT_NAME} STATIC ${CHAIN_NET_PYTHON_SRCS} ${CHAIN_NET_PYTHON_HEADERS})
target_link_libraries(${PROJECT_NAME})
#target_compile_options(
# dap_core PRIVATE
# "-fpic"
#)
#target_compile_options(
# dap_crypto PRIVATE
# "-fpic"
#)
target_link_libraries(${PROJECT_NAME} dap_core dap_crypto dap_chain dap_chain_crypto dap_server_core dap_chain_net dap_chain_python_module dap_client_python_module)
#target_link_libraries(${PROJECT_NAME} dap_core dap_crypto dap_chain dap_chain_global_db dap_chain_crypto dap_chain_mempool
#
# ) #dap_chain_crypto dap_chain_mempool dap_chain_global_db )
#target_link_libraries(${PROJECT_NAME} dap_core dap_crypto)
target_include_directories(${PROJECT_NAME} PUBLIC include/ )
#if(BUILD_DAP_CRYPTO_PYTHON_TESTS)
# add_subdirectory(test)
# file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test/test_b58.py
# DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/test/)
# file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test/test_b64.py
# DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/test/)
# file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test/test_iaes256_cbc.py
# DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/test/)
# file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test/test_iaes256_cbc.py
# DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/test/)
# file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test/test_oaes.py
# DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/test/)
#endif()
#ifndef _WRAPPING_DAP_NET_PYTHON_
#define _WRAPPING_DAP_NET_PYTHON_
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "dap_chain_net.h"
#include "wrapping_dap_chain_net_state.h"
//#include "wrapping_dap_chain_net_state.h"
#include "wrapping_dap_chain_common_objects.h"
#include "wrapping_dap_chain_ledger.h"
#include "libdap-chain-python.h"
#include "libdap_chain_type_python.h"
#ifdef __cplusplus
extern "C"{
#endif
typedef struct PyDapChainNet{
PyObject_HEAD
dap_chain_net_t *chain_net;
}PyDapChainNetObject;
int dap_chain_net_init_py(void);
void dap_chain_net_deinit_py(void);
PyObject *dap_chain_net_load_all_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_state_go_to_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_start_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_stop_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_links_establish_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_sync_chains_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_sync_gdb_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_sync_all_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_proc_datapool_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_by_name_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_by_id_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_id_by_name_py(PyObject *self, PyObject *args);
PyObject *dap_chain_ledger_by_net_name_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_get_chain_by_name_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_get_cur_addr_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_get_cur_cell_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_get_cur_addr_int_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_get_gdb_group_mempool_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_get_gdb_group_mempool_by_chain_type_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_links_connect_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_get_chain_by_chain_type_py(PyObject *self, PyObject *args);
static PyMethodDef DapChainNetMethods[] = {
{"loadAll", dap_chain_net_load_all_py, METH_NOARGS | METH_STATIC, ""},
{"stateGoTo", dap_chain_net_state_go_to_py, METH_VARARGS, ""},
{"start", dap_chain_net_start_py, METH_VARARGS, ""},
{"stop", dap_chain_net_stop_py, METH_VARARGS, ""},
{"linksEstablish", dap_chain_net_links_establish_py, METH_VARARGS, ""},
{"syncChains", dap_chain_net_sync_all_py, METH_VARARGS, ""},
{"syncGdb", dap_chain_net_sync_gdb_py, METH_VARARGS, ""},
{"syncAll", dap_chain_net_sync_all_py, METH_VARARGS, ""},
{"procDatapool", dap_chain_net_proc_datapool_py, METH_VARARGS, ""},
{"byName", dap_chain_net_by_name_py, METH_VARARGS | METH_STATIC, ""},
{"byId", dap_chain_net_by_id_py, METH_VARARGS | METH_STATIC, ""},
{"idByName", dap_chain_net_id_by_name_py, METH_VARARGS | METH_STATIC, ""},
{"ledgerByNetName", dap_chain_ledger_by_net_name_py, METH_VARARGS | METH_STATIC, ""},
{"getChainByName", dap_chain_net_get_chain_by_name_py, METH_VARARGS, ""},
{"getCurAddr", dap_chain_net_get_cur_addr_py, METH_VARARGS, ""},
{"getCurCell", dap_chain_net_get_cur_cell_py, METH_VARARGS, ""},
{"getGdbGroupMempool", dap_chain_net_get_gdb_group_mempool_py, METH_VARARGS | METH_STATIC, ""},
{"getGdbGroupMempoolByChainType", dap_chain_net_get_gdb_group_mempool_by_chain_type_py, METH_VARARGS, ""},
{"linksConnect", dap_chain_net_links_connect_py, METH_VARARGS, ""},
{"getChainByChainType", dap_chain_net_get_chain_by_chain_type_py, METH_VARARGS, ""},
{NULL, NULL, 0, NULL}
};
static PyTypeObject DapChainNetObject_DapChainNetObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.ChainNet", /* tp_name */
sizeof(PyDapChainNetObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain net object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
DapChainNetMethods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
#ifdef __cplusplus
}
#endif
#endif //_WRAPPING_DAP_NET_PYTHON_
#ifndef _WRAPPING_DAP_CHAIN_NET_NODE_
#define _WRAPPING_DAP_CHAIN_NET_NODE_
#include <Python.h>
#include "dap_chain_node.h"
#include "wrapping_dap_chain_common_objects.h"
#include "libdap_chain_net_python.h"
typedef struct PyDapChainNode{
PyObject_HEAD
}PyDapChainNodeObject;
PyObject *dap_chain_node_gen_addr_py(PyObject *self, PyObject *args);
PyObject *dap_chain_node_check_addr_py(PyObject *self, PyObject *args);
PyObject *dap_chain_node_alias_find_py(PyObject *self, PyObject *args);
PyObject *dap_chain_node_alias_register_py(PyObject *self, PyObject *args);
PyObject *dap_chain_node_alias_delete_py(PyObject *self, PyObject *args);
static PyMethodDef DapChainNetNodeMethods[] = {
{"genAddr", dap_chain_node_gen_addr_py, METH_VARARGS | METH_STATIC, ""},
{"checkAddr", dap_chain_node_check_addr_py, METH_VARARGS | METH_STATIC, ""},
{"aliasFind", dap_chain_node_alias_find_py, METH_VARARGS | METH_STATIC, ""},
{"aliasRegister", dap_chain_node_alias_register_py, METH_VARARGS | METH_STATIC, ""},
{"aliasDelete", dap_chain_node_alias_delete_py, METH_VARARGS | METH_STATIC, ""},
{NULL, NULL, 0, NULL}
};
static PyTypeObject DapChainNodeInfoObject_DapChainNodeInfoObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.Node", /* tp_name */
sizeof(PyDapChainNodeObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain net node object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
DapChainNetNodeMethods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
#endif //_WRAPPING_DAP_CHAIN_NET_NODE_
#ifndef _WRAPPING_DAP_CHAIN_NET_NODE_CLI_
#define _WRAPPING_DAP_CHAIN_NET_NODE_CLI_
#include <Python.h>
#include "dap_config.h"
#include "dap_chain_node_cli.h"
#include "dap_chain_node_cli_cmd.h"
#include "wrapping_dap_chain_common_objects.h"
#include "wrapping_dap_chain_net_node.h"
#ifdef __cplusplus
extern "C"{
#endif
typedef struct PyDapChainNodeCli{
PyObject_HEAD
cmdfunc_t *func;
}PyDapChainNodeCliObject;
static PyObject *binded_object_cmdfunc = NULL;
int dap_chain_node_cli_init_py(dap_config_t *g_config);
void dap_chain_node_cli_delete_py(void);
PyObject *DapChainNodeCliObject_new(PyTypeObject *type_object, PyObject *args, PyObject *kwds);
PyObject *dap_chain_node_cli_cmd_item_create_py(PyObject *self, PyObject *args);
PyObject *dap_chain_node_cli_set_reply_text_py(PyObject *self, PyObject *args);
PyObject *dap_chain_node_addr_get_by_alias_py(PyObject *self, PyObject *args);
static PyMethodDef DapChainNodeCliMethods[] = {
{"cmdItemCreate", dap_chain_node_cli_cmd_item_create_py, METH_VARARGS, ""},
{"setReplyText", dap_chain_node_cli_set_reply_text_py, METH_VARARGS, ""},
{"getByAlias", dap_chain_node_addr_get_by_alias_py, METH_VARARGS | METH_STATIC, ""},
{NULL, NULL, 0, NULL}
};
static PyTypeObject DapChainNodeCliObject_DapChainNodeCliObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.Node.cli", /* tp_name */
sizeof(PyDapChainNodeCliObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain net node cli object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
DapChainNodeCliMethods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
DapChainNodeCliObject_new, /* tp_new */
};
char **PyListToString(PyObject *list);
PyObject *stringToPyList(char **list);
#ifdef __cplusplus
}
#endif
#endif //_WRAPPING_DAP_CHAIN_NET_NODE_CLI_
#ifndef _WRAPPING_DAP_CHAIN_NODE_CLIENT_
#define _WRAPPING_DAP_CHAIN_NODE_CLIENT_
#include <Python.h>
#include "dap_chain_node_client.h"
#include "wrapping_dap_chain_net_node_info.h"
#include "libdap_client_python.h"
#include "wrapping_dap_client_stage.h"
#ifdef __cplusplus
extern "C"{
#endif
typedef struct PyDapChainNodeClient{
PyObject_HEAD
dap_chain_node_client_t *node_client;
}PyDapChainNodeClientObject;
int dap_chain_node_client_init_py(void);
void dap_chain_node_client_deinit_py(void);
PyObject *dap_chain_client_connect_py(PyObject *self, PyObject *args);
PyObject *dap_chain_node_client_connect_py(PyObject *self, PyObject *args);
PyObject *dap_chain_node_client_close_py(PyObject *self, PyObject *args);
PyObject *dap_chain_node_client_send_ch_pkt_py(PyObject *self, PyObject *args);
PyObject *dap_chain_node_client_wait_py(PyObject *self, PyObject *args);
PyObject *dap_chain_node_client_set_callbacks_py(PyObject *self, PyObject *args);
static PyMethodDef DapChainNodeClientMethods[] = {
{"clientConnect", dap_chain_client_connect_py, METH_VARARGS | METH_STATIC, ""},
{"nodeClientConnect", (PyCFunction)dap_chain_node_client_connect_py, METH_VARARGS | METH_STATIC, ""},
{"close", (PyCFunction)dap_chain_node_client_close_py, METH_VARARGS, ""},
{"sendChPkt", (PyCFunction)dap_chain_node_client_send_ch_pkt_py, METH_VARARGS, ""},
{"wait", (PyCFunction)dap_chain_node_client_wait_py, METH_VARARGS, ""},
{"setCallbacks", (PyCFunction)dap_chain_node_client_set_callbacks_py, METH_VARARGS | METH_STATIC, ""},
{NULL, NULL, 0, NULL}
};
static PyTypeObject DapChainNodeClientObject_DapChainNodeClientObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.Node.Client", /* tp_name */
sizeof(PyDapChainNodeClientObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain net node client object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
DapChainNodeClientMethods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
#ifdef __cplusplus
}
#endif
#endif //_WRAPPING_DAP_CHAIN_NODE_CLIENT_
#ifndef _WRAPPING_DAP_CHAIN_NODE_INFO
#define _WRAPPING_DAP_CHAIN_NODE_INFO
#include <Python.h>
#include "dap_chain_node.h"
#include "libdap_chain_net_python.h"
#include "wrapping_dap_chain_common_objects.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct PyDapChainNodeInfo{
PyObject_HEAD
dap_chain_node_info_t *node_info;
}PyDapChainNodeInfoObject;
PyObject *dap_chain_node_info_save_py(PyObject *self, PyObject *args);
PyObject *dap_chain_node_info_read_py(PyObject *self, PyObject *args);
static PyMethodDef DapChainNetNodeInfoMethods[] = {
{"save", dap_chain_node_info_save_py, METH_VARARGS, ""},
{"read", dap_chain_node_info_read_py, METH_VARARGS | METH_STATIC, ""},
{NULL, NULL, 0, NULL}
};
static PyTypeObject DapChainNodeInfoObject_DapChainNodeInfoObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.Node.Info", /* tp_name */
sizeof(PyDapChainNodeInfoObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain net node info object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
DapChainNetNodeInfoMethods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
#ifdef __cplusplus
}
#endif
#endif //_WRAPPING_DAP_CHAIN_NODE_INFO
#ifndef _WRAPPING_DAP_CHAIN_NET_STATE_
#define _WRAPPING_DAP_CHAIN_NET_STATE_
#include <Python.h>
#include "dap_chain_net.h"
#ifdef __cplusplus
extern "C"{
#endif
typedef struct PyDapChainNetState{
PyObject_HEAD
dap_chain_net_state_t state;
}PyDapChainNetStateObject;
PyObject *NET_STATE_OFFLINE_PY(void);
PyObject *NET_STATE_LINKS_PREPARE_PY(void);
PyObject *NET_STATE_LINKS_CONNECTING_PY(void);
PyObject *NET_STATE_LINKS_ESTABLISHED_PY(void);
PyObject *NET_STATE_ADDR_REQUEST_PY(void); // Waiting for address assign
PyObject *NET_STATE_ONLINE_PY(void);
PyObject *NET_STATE_SYNC_GDB_PY(void);
PyObject *NET_STATE_SYNC_CHAINS_PY(void);
static PyMethodDef PyDapChainNetStateMethods[] = {
{"NET_STATE_OFFLINE", (PyCFunction)NET_STATE_OFFLINE_PY, METH_NOARGS | METH_STATIC, ""},
{"NET_STATE_LINKS_PREPARE", (PyCFunction)NET_STATE_LINKS_PREPARE_PY, METH_NOARGS | METH_STATIC, ""},
{"NET_STATE_LINKS_CONNECTING", (PyCFunction)NET_STATE_LINKS_CONNECTING_PY, METH_NOARGS | METH_STATIC, ""},
{"NET_STATE_LINKS_ESTABLISHED", (PyCFunction)NET_STATE_LINKS_ESTABLISHED_PY, METH_NOARGS | METH_STATIC, ""},
{"NET_STATE_ADDR_REQUEST", (PyCFunction)NET_STATE_ADDR_REQUEST_PY, METH_NOARGS | METH_STATIC, ""},
{"NET_STATE_SYNC_GDB", (PyCFunction)NET_STATE_SYNC_GDB_PY, METH_NOARGS | METH_STATIC, ""},
{"NET_STATE_SYNC_CHAINS", (PyCFunction)NET_STATE_SYNC_CHAINS_PY, METH_NOARGS | METH_STATIC, ""},
/*{"csAdd", (PyCFunction)dap_chain_cs_add_py, METH_VARARGS, ""},
{"csCreate", (PyCFunction)dap_chain_cs_create_py, METH_VARARGS, ""},
{"classAdd", (PyCFunction)dap_chain_class_add_py, METH_VARARGS, ""},
{"classCreate", (PyCFunction)dap_chain_class_create_py, METH_VARARGS, ""},*/
{NULL, NULL, 0, NULL}
};
static PyTypeObject DapChainNetStateObject_DapChainNetStateObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.ChainNetState", /* tp_name */
sizeof(PyDapChainNetStateObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain net staties object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
PyDapChainNetStateMethods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
#ifdef __cplusplus
}
#endif
#endif // _WRAPPING_DAP_CHAIN_NET_STATE_
Subproject commit ba3e1eed7b6e76393c035986fe27c8e49cafc2d9
Subproject commit 008b7a65045c6b20b7daf743b112ba16aa0172a9
Subproject commit 1a7f57339041f51675a766fb7848d16c6010ff11
Subproject commit eb4cec1af570b411ba19dc5b03589dd02be9db09
Subproject commit 1419a98d73dcc1927f59645e97b23adb813b47aa
Subproject commit 6a91d6b8a821b5e3ad470bf75452cfaeab1899a0
Subproject commit 37eb1ddca764eb558224371801967b4d96b93965
Subproject commit f15809e9abf5d54642cc84dae4fe73666eda5a38
Subproject commit 01afd8dc04708458fb742c36a0a5b49e01dd6716
Subproject commit 4bbc01ce9a5878c155a67e7cd36535419e360a54
Subproject commit 93c2043d3c74fc6dceba75d2d9862317d9ba6990
Subproject commit ca5ac6ff584ba8220aba04ffa8be1fc6bc0a5d57
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