diff --git a/dap_chain_net_node.c b/dap_chain_net_node.c new file mode 100644 index 0000000000000000000000000000000000000000..216b750f11e6e1893fe49af2333d1ce517d972e0 --- /dev/null +++ b/dap_chain_net_node.c @@ -0,0 +1,23 @@ +/* + * Authors: + * Dmitriy A. Gearasimov <naeper@demlabs.net> + * DeM Labs Inc. https://demlabs.net + + 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/>. +*/ + +#include "dap_chain_node.h" + diff --git a/dap_chain_net_node.h b/dap_chain_net_node.h new file mode 100644 index 0000000000000000000000000000000000000000..37f73f8da55ea1148d6da1698a439b6acfa01998 --- /dev/null +++ b/dap_chain_net_node.h @@ -0,0 +1,40 @@ +/* + * Authors: + * Dmitriy A. Gearasimov <naeper@demlabs.net> + * DeM Labs Inc. https://demlabs.net + + 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> +#include <stddef.h> +#include <sys/socket.h> +#include <netinet/in.h> + +typedef union dap_chain_node_addr{ + uint64_t addr_raw; + uint8_t addr_oct[sizeof(uint64_t)]; // Access to selected octects +} dap_chain_node_addr_t; + +typedef struct dap_chain_node{ + dap_chain_node_addr_t addr; + dap_chain_node_addr_t *uplinks; + dap_chain_node_addr_t *downlinks; + struct in_addr *ipv4_addrs; + struct in6_addr *ipv6_addrs; +} dap_chain_node_t;