Move net components into a distinct folder

pull/214/head
Michael 5 years ago
parent 317e29b777
commit a3463120cc
No known key found for this signature in database
GPG Key ID: 2D51757B47E2434C

@ -311,9 +311,9 @@ set(LIB_UTIL_SRC
set(LIB_PLATFORM_SRC
# for networking
llarp/ev/ev.cpp
llarp/net.cpp
llarp/net_addr.cpp
llarp/net_inaddr.cpp
llarp/net/net.cpp
llarp/net/net_addr.cpp
llarp/net/net_inaddr.cpp
# for android shim
${ANDROID_PLATFORM_SRC}
# process isolation implementation
@ -522,7 +522,6 @@ set(LIB_SRC
llarp/exit/transfer_traffic.cpp
llarp/exit/update_exit.cpp
llarp/exit_info.cpp
llarp/exit_route.cpp
llarp/handlers/exit.cpp
llarp/handlers/null.cpp
llarp/handlers/tun.cpp
@ -547,7 +546,7 @@ set(LIB_SRC
llarp/messages/relay.cpp
llarp/messages/relay_commit.cpp
llarp/messages/transfer_traffic.cpp
llarp/net_int.cpp
llarp/net/net_int.cpp
llarp/nodedb.cpp
llarp/path/path.cpp
llarp/path/path_types.cpp
@ -599,27 +598,27 @@ set(DNS_SRC
llarp/dns_iptracker.cpp
llarp/dns_dotlokilookup.cpp
llarp/dns_rectypes.cpp
llarp/net.cpp
llarp/net/net.cpp
daemon/dns.cpp
)
set(TEST_SRC
test/dht/test_llarp_dht_key.cpp
test/dht/test_llarp_dht.cpp
test/dns/test_llarp_dns_dns.cpp
test/exit/test_llarp_exit_context.cpp
test/link/test_llarp_link.cpp
test/main.cpp
test/net/test_llarp_net_inaddr.cpp
test/net/test_llarp_net.cpp
test/routing/llarp_routing_transfer_traffic.cpp
test/routing/test_llarp_routing_obtainexitmessage.cpp
test/service/test_llarp_service_address.cpp
test/service/test_llarp_service_identity.cpp
test/test_llarp_crypto.cpp
test/test_llarp_dht_key.cpp
test/test_llarp_dns.cpp
test/test_llarp_dnsd.cpp
test/test_llarp_encrypted_frame.cpp
test/test_llarp_net_inaddr.cpp
test/test_llarp_net.cpp
test/test_llarp_router_contact.cpp
test/util/test_llarp_util_aligned.cpp
test/util/test_llarp_util_bencode.cpp

@ -2,11 +2,11 @@
#ifndef _WIN32
#include <arpa/inet.h>
#endif
#include <net/net.hpp>
#include <util/bencode.h>
#include <util/mem.h>
#include <string.h>
#include <net.hpp>
namespace llarp
{

@ -2,7 +2,7 @@
#define LLARP_AI_HPP
#include <crypto.hpp>
#include <net.h>
#include <net/net.h>
#include <util/bencode.hpp>
#include <util/mem.h>

@ -2,7 +2,7 @@
#include <config.hpp>
#include <constants/defaults.hpp>
#include <net.hpp>
#include <net/net.hpp>
#include <util/fs.hpp>
#include <util/ini.hpp>
#include <util/logger.hpp>
@ -141,7 +141,7 @@ llarp_generic_ensure_config(std::ofstream &f, std::string basepath)
f << "bind=127.0.0.1:1190" << std::endl;
f << std::endl << std::endl;
f << "# system settings for priviledges and such" << std::endl;
f << "# system settings for privileges and such" << std::endl;
f << "[system]" << std::endl;
#ifdef _WIN32
f << "# ";

@ -9,7 +9,7 @@
#endif
#include <dns/rectypes.hpp>
#include <net.hpp> // for llarp::Addr , llarp::huint32_t
#include <net/net.hpp> // for llarp::Addr , llarp::huint32_t
#include <map>
#include <string>

@ -2,7 +2,7 @@
#define LLARP_DNSIPTRACKER_HPP
#include <dns/dotlokilookup.hpp>
#include <net.hpp>
#include <net/net.hpp>
#include <service/address.hpp>
#include <map>

@ -1,5 +1,5 @@
#include <dns/name.hpp>
#include <net.hpp>
#include <net/net.hpp>
#include <algorithm>
#include <sstream>

@ -1,7 +1,7 @@
#ifndef LLARP_DNS_NAME_HPP
#define LLARP_DNS_NAME_HPP
#include <net_int.hpp>
#include <net/net_int.hpp>
#include <util/buffer.h>
#include <string>

@ -3,7 +3,7 @@
#include <dns/serialize.hpp>
#include <dns/name.hpp>
#include <net_int.hpp>
#include <net/net_int.hpp>
namespace llarp
{

@ -1,7 +1,7 @@
#ifndef LLARP_DNS_REC_TYPES_HPP
#define LLARP_DNS_REC_TYPES_HPP
#include <net.hpp> // for llarp::Addr , llarp::huint32_t
#include <net/net.hpp> // for llarp::Addr , llarp::huint32_t
#include <util/buffer.h> // for byte_t
#include <vector>

@ -3,7 +3,7 @@
#include <dns/name.hpp>
#include <dns/serialize.hpp>
#include <net_int.hpp>
#include <net/net_int.hpp>
#include <memory>
#include <vector>

@ -1,5 +1,5 @@
#include <dns/serialize.hpp>
#include <net_int.hpp>
#include <net/net_int.hpp>
namespace llarp
{

@ -3,7 +3,7 @@
#include <dns/message.hpp>
#include <ev/ev.h>
#include <net.hpp>
#include <net/net.hpp>
#include <util/string_view.hpp>
#include <unordered_map>

@ -1,5 +1,5 @@
#include <dnsc.hpp>
#include <net.hpp> // for llarp::Addr
#include <net/net.hpp> // for llarp::Addr
#include <util/logger.hpp>
#ifndef _WIN32

@ -1,5 +1,5 @@
#include <dnsd.hpp>
#include <net.hpp>
#include <net/net.hpp>
extern dns_tracker dns_udp_tracker;

@ -2,8 +2,8 @@
#define EV_EPOLL_HPP
#include <ev/ev.hpp>
#include <net.h>
#include <net.hpp>
#include <net/net.h>
#include <net/net.hpp>
#include <util/buffer.h>
#include <util/buffer.hpp>
#include <util/logger.hpp>

@ -2,8 +2,8 @@
#define EV_KQUEUE_HPP
#include <ev/ev.hpp>
#include <net.h>
#include <net.hpp>
#include <net/net.h>
#include <net/net.hpp>
#include <util/buffer.h>
#include <util/logger.hpp>

@ -4,8 +4,8 @@
#include <buffer.h>
#include <ev/ev.hpp>
#include <util/logger.hpp>
#include <net.h>
#include <net.hpp>
#include <net/net.h>
#include <net/net.hpp>
#include <windows.h>
#include <process.h>

@ -2,7 +2,7 @@
#define LLARP_XI_HPP
#include <crypto.hpp>
#include <net.hpp>
#include <net/net.hpp>
#include <util/bencode.hpp>
#include <util/bits.hpp>

@ -1,58 +0,0 @@
#ifndef _WIN32
#include <arpa/inet.h>
#endif
#include <exit_route.h>
#include <util/bencode.h>
#include <llarp/string.h>
bool
llarp_xr_bencode(struct llarp_xr* xr, llarp_buffer_t* buff)
{
char addr_buff[128] = {0};
const char* addr;
if(!bencode_start_dict(buff))
return false;
/** gateway */
addr = inet_ntop(AF_INET6, &xr->gateway, addr_buff, sizeof(addr_buff));
if(!addr)
return false;
if(!bencode_write_bytestring(buff, "a", 1))
return false;
if(!bencode_write_bytestring(buff, addr, strnlen(addr, sizeof(addr_buff))))
return false;
/** netmask */
addr = inet_ntop(AF_INET6, &xr->netmask, addr_buff, sizeof(addr_buff));
if(!addr)
return false;
if(!bencode_write_bytestring(buff, "b", 1))
return false;
if(!bencode_write_bytestring(buff, addr, strnlen(addr, sizeof(addr_buff))))
return false;
/** source */
addr = inet_ntop(AF_INET6, &xr->source, addr_buff, sizeof(addr_buff));
if(!addr)
return false;
if(!bencode_write_bytestring(buff, "c", 1))
return false;
if(!bencode_write_bytestring(buff, addr, strnlen(addr, sizeof(addr_buff))))
return false;
/** lifetime */
if(!bencode_write_bytestring(buff, "l", 1))
return false;
if(!bencode_write_uint64(buff, xr->lifetime))
return false;
/** version */
if(!bencode_write_version_entry(buff))
return false;
/* end */
return bencode_end(buff);
}

@ -1,22 +0,0 @@
#ifndef LLARP_XR_H
#define LLARP_XR_H
#include <net.h>
#include <util/buffer.h>
#include <stdint.h>
struct llarp_xr
{
struct in6_addr gateway;
struct in6_addr netmask;
struct in6_addr source;
uint64_t lifetime;
};
bool
llarp_xr_bencode(struct llarp_xr* xr, llarp_buffer_t* buff);
bool
llarp_xr_bdecode(struct llarp_xr* xr, llarp_buffer_t* buff);
#endif

@ -1,7 +1,7 @@
#include <handlers/exit.hpp>
#include <dns/dns.hpp>
#include <net.hpp>
#include <net/net.hpp>
#include <router.hpp>
#include <util/str.hpp>

@ -5,7 +5,7 @@
#include <dns/server.hpp>
#include <ev/ev.h>
#include <ip.hpp>
#include <net.hpp>
#include <net/net.hpp>
#include <service/endpoint.hpp>
#include <util/threading.hpp>

@ -2,7 +2,7 @@
#define LLARP_IP_HPP
#include <ev/ev.h>
#include <net.hpp>
#include <net/net.hpp>
#include <util/buffer.h>
#include <util/time.hpp>

@ -4,7 +4,7 @@
#include <crypto.hpp>
#include <ev/ev.h>
#include <link/session.hpp>
#include <net.hpp>
#include <net/net.hpp>
#include <router_contact.hpp>
#include <util/logic.hpp>
#include <util/threading.hpp>

@ -2,7 +2,7 @@
#define LLARP_LINK_SESSION_HPP
#include <crypto.hpp>
#include <net.hpp>
#include <net/net.hpp>
#include <router_contact.hpp>
#include <util/types.hpp>

@ -1,4 +1,4 @@
#include <net.hpp>
#include <net/net.hpp>
#ifdef ANDROID
#include "android/ifaddrs.h"
#endif
@ -9,7 +9,7 @@
#endif
#include <net/if.h>
#endif
#include <net_addr.hpp>
#include <net/net_addr.hpp>
#include <util/logger.hpp>
#include <util/str.hpp>

@ -2,8 +2,8 @@
#define LLARP_NET_HPP
#include <address_info.hpp>
#include <net_int.hpp>
#include <net.h>
#include <net/net_int.hpp>
#include <net/net.h>
#include <util/logger.hpp>
#include <util/mem.hpp>
#include <util/string_view.hpp>
@ -147,7 +147,7 @@ namespace llarp
} // namespace llarp
#include <net_addr.hpp>
#include <net_inaddr.hpp>
#include <net/net_addr.hpp>
#include <net/net_inaddr.hpp>
#endif

@ -1,5 +1,5 @@
#include <net.hpp>
#include <net_addr.hpp>
#include <net/net.hpp>
#include <net/net_addr.hpp>
#include <util/string_view.hpp>
// for addrinfo

@ -2,8 +2,8 @@
#define LLARP_NET_ADDR_HPP
#include <address_info.hpp>
#include <net.h>
#include <net.hpp>
#include <net/net.h>
#include <net/net.hpp>
#include <util/string_view.hpp>
#include <string>

@ -1,4 +1,4 @@
#include <net_inaddr.hpp>
#include <net/net_inaddr.hpp>
std::ostream&
operator<<(std::ostream& out, const llarp::inAddr& a)

@ -1,7 +1,7 @@
#ifndef LLARP_NET_INADDR_HPP
#define LLARP_NET_INADDR_HPP
#include <net.hpp>
#include <net/net.hpp>
namespace llarp
{

@ -0,0 +1 @@
#include <net/net_int.hpp>

@ -12,7 +12,7 @@
#define inet_aton(x, y) inet_pton(AF_INET, x, y)
#endif
#include <net.h>
#include <net/net.h>
#include <stdlib.h> // for itoa
#include <iostream>

@ -1 +0,0 @@
#include <net_int.hpp>

@ -7,7 +7,7 @@
#include <link/iwp.hpp>
#include <link/server.hpp>
#include <link/utp.hpp>
#include <net.hpp>
#include <net/net.hpp>
#include <rpc.hpp>
#include <util/buffer.hpp>
#include <util/encode.hpp>
@ -127,7 +127,7 @@ llarp_findOrCreateEncryption(llarp::Crypto *crypto, const fs::path &path,
llarp::SecretKey &encryption)
{
std::string fpath = path.string();
llarp::LogDebug("find or create ",fpath);
llarp::LogDebug("find or create ", fpath);
std::error_code ec;
if(!fs::exists(path, ec))
{
@ -1041,7 +1041,7 @@ namespace llarp
{
if(!link->Start(logic))
{
llarp::LogWarn("outbound link '", link->Name(),"' failed to start");
llarp::LogWarn("outbound link '", link->Name(), "' failed to start");
return false;
}
}

@ -2,7 +2,7 @@
#include <constants/version.hpp>
#include <crypto.hpp>
#include <net.hpp>
#include <net/net.hpp>
#include <util/bencode.hpp>
#include <util/buffer.hpp>
#include <util/logger.hpp>

@ -2,7 +2,7 @@
#define LLARP_SERVICE_CONTEXT_HPP
#include <handlers/tun.hpp>
#include <net.hpp>
#include <net/net.hpp>
#include <service/config.hpp>
#include <service/endpoint.hpp>

@ -4,7 +4,7 @@
#include <codel.hpp>
#include <ev/ev.h>
#include <exit/session.hpp>
#include <net.hpp>
#include <net/net.hpp>
#include <path/path.hpp>
#include <path/pathbuilder.hpp>
#include <service/address.hpp>

@ -4,7 +4,8 @@
#include <dns/message.hpp>
#include <dns/name.hpp>
#include <dns/rr.hpp>
#include <net.hpp>
#include <net/net.hpp>
#include <util/buffer.hpp>
#include <algorithm>

@ -1,7 +1,7 @@
#include <gtest/gtest.h>
#include <net.hpp>
#include <net_inaddr.hpp>
#include <net/net.hpp>
#include <net/net_inaddr.hpp>
struct TestNet : public ::testing::Test
{

@ -1,6 +1,6 @@
#include <gtest/gtest.h>
#include <net_inaddr.hpp>
#include <net/net_inaddr.hpp>
struct TestNetInAddr : public ::testing::Test
{

@ -3,7 +3,7 @@
#include <dns.hpp>
#include <dnsc.hpp>
#include <llarp.h> // for llarp_main_init
#include <net.hpp> // for llarp::Addr
#include <net/net.hpp> // for llarp::Addr
#include <util/logic.hpp> // for threadpool/llarp::Logic
struct DNSTest : public ::testing::Test

@ -3,7 +3,7 @@
#include <dnsd.hpp>
#include <llarp.h> // for llarp_main_init
#include <net.hpp> // for llarp::Addr
#include <net/net.hpp> // for llarp::Addr
#include <util/logic.hpp> // for threadpool/llarp::Logic
unsigned int g_length = 0;

Loading…
Cancel
Save