diff --git a/CMakeLists.txt b/CMakeLists.txt index aff1200b730eabde824e2abbe99c86def4a2716d..5d3b84fa128b049c421d455b928234b02e899194 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,12 +3,12 @@ project (dap_chain_net_srv) set(DAP_CHAIN_NET_SRV_SRCS dap_chain_net_srv.c - dap_chain_net_srv_pkt.c + dap_chain_net_srv_common.c ) set(DAP_CHAIN_NET_SRV_HEADERS dap_chain_net_srv.h - dap_chain_net_srv_pkt.h + dap_chain_net_srv_common.h ) add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_NET_SRV_SRCS} ${DAP_CHAIN_NET_SRV_HEADERS}) diff --git a/dap_chain_net_srv.h b/dap_chain_net_srv.h index e1ef2690e1e59411f4f847aed499f57f17e409cc..c2e3c78315e7b128f1ffba0cb1c7c6b923e24fb9 100644 --- a/dap_chain_net_srv.h +++ b/dap_chain_net_srv.h @@ -24,7 +24,7 @@ #pragma once #include "dap_chain_net_node.h" -#include "dap_chain_net_srv_pkt.h" +#include "dap_chain_net_srv_common.h" typedef struct dap_chain_net_srv { diff --git a/dap_chain_net_srv_common.c b/dap_chain_net_srv_common.c new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/dap_chain_net_srv_common.h b/dap_chain_net_srv_common.h new file mode 100644 index 0000000000000000000000000000000000000000..51403634cc1cf2032011cbe4efe3d4857841ca8f --- /dev/null +++ b/dap_chain_net_srv_common.h @@ -0,0 +1,15 @@ +#pragma once +#include <stdint.h> +#include "dap_common.h" +#include "dap_math_ops.h" + +#define DAP_CHAIN_NET_SRV_UID_SIZE 16 +typedef union{ + uint8_t raw[DAP_CHAIN_NET_SRV_UID_SIZE]; +#if DAP_CHAIN_NET_SRV_UID_SIZE == 8 + uint64_t raw_ui64[1]; +#elif DAP_CHAIN_NET_SRV_UID_SIZE == 16 + uint64_t raw_ui64[2]; + dap_uint128_t raw_ui128[1]; +#endif +} dap_chain_net_srv_uid_t; diff --git a/dap_chain_net_srv_pkt.c b/dap_chain_net_srv_pkt.c deleted file mode 100644 index 81f7256af3f1750c5a328a76891e6c6597efdb77..0000000000000000000000000000000000000000 --- a/dap_chain_net_srv_pkt.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "dap_chain_net_srv_pkt.h" - -#define LOG_TAG "chain_net_srv_pkt" diff --git a/dap_chain_net_srv_pkt.h b/dap_chain_net_srv_pkt.h deleted file mode 100644 index 264a613685c1f3646f054c38f770d97c4710d188..0000000000000000000000000000000000000000 --- a/dap_chain_net_srv_pkt.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Authors: - * Dmitriy A. Gearasimov <kahovski@gmail.com> - * DeM Labs Inc. https://demlabs.net - * DeM Labs Open source community https://github.com/demlabsinc - * Copyright (c) 2017-2018 - * All rights reserved. - - This file is part of DAP (Deus Applications Prototypes) the open source project - - DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - DAP is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - 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/>. -*/ - -#pragma once - -#include <stdint.h> - -typedef uint64_t dap_chain_net_srv_uid_t; -typedef struct dap_chain_net_srv_pkt{ - struct { - dap_chain_net_srv_uid_t uid; - } __attribute__((packed)) header ; - uint8_t data[]; -} __attribute__((packed)) dap_chain_net_srv_pkt_t;