From f0baf44e4c244d2fc3fe95e6b5839ae58fe0f28a Mon Sep 17 00:00:00 2001 From: "Dmitriy A. Gerasimov" <dmitriy.gerasimov@demlabs.net> Date: Sat, 6 Oct 2018 16:23:27 +0700 Subject: [PATCH] [+] Renames --- CMakeLists.txt | 4 ++-- dap_chain_net_srv.h | 2 +- dap_chain_net_srv_common.c | 0 dap_chain_net_srv_common.h | 15 +++++++++++++++ dap_chain_net_srv_pkt.c | 3 --- dap_chain_net_srv_pkt.h | 35 ----------------------------------- 6 files changed, 18 insertions(+), 41 deletions(-) create mode 100644 dap_chain_net_srv_common.c create mode 100644 dap_chain_net_srv_common.h delete mode 100644 dap_chain_net_srv_pkt.c delete mode 100644 dap_chain_net_srv_pkt.h diff --git a/CMakeLists.txt b/CMakeLists.txt index aff1200..5d3b84f 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 e1ef269..c2e3c78 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 0000000..e69de29 diff --git a/dap_chain_net_srv_common.h b/dap_chain_net_srv_common.h new file mode 100644 index 0000000..5140363 --- /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 81f7256..0000000 --- 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 264a613..0000000 --- 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; -- GitLab