mirror of https://github.com/oxen-io/lokinet
Merge pull request #153 from michael-loki/cpps
Add .cpp files for all .hpp files
This commit is contained in:
commit
77eec3e380
131
CMakeLists.txt
131
CMakeLists.txt
|
@ -199,24 +199,32 @@ if(UNIX)
|
|||
add_definitions(-DPOSIX)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-unix-linux.c)
|
||||
set(EV_SRC llarp/ev_epoll.cpp)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Android")
|
||||
set(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-unix-linux.c)
|
||||
set(EV_SRC llarp/ev_epoll.cpp)
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
||||
set(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-unix-openbsd.c ${TT_ROOT}/tuntap-unix-bsd.c)
|
||||
set(EV_SRC llarp/ev_kqueue.cpp)
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
|
||||
set(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-unix-netbsd.c ${TT_ROOT}/tuntap-unix-bsd.c)
|
||||
set(EV_SRC llarp/ev_kqueue.cpp)
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "DragonFly")
|
||||
set(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-unix-freebsd.c ${TT_ROOT}/tuntap-unix-bsd.c)
|
||||
set(EV_SRC llarp/ev_kqueue.cpp)
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-unix-darwin.c ${TT_ROOT}/tuntap-unix-bsd.c)
|
||||
set(EV_SRC llarp/ev_kqueue.cpp)
|
||||
# TODO: _actually_ port to solaris/illumos (it's fairly complete...except for TUN) -rick
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
|
||||
set(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-unix-sunos.c)
|
||||
set(EV_SRC llarp/ev_epoll.cpp)
|
||||
else()
|
||||
message(FATAL_ERROR "Your operating system is not supported yet")
|
||||
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
elseif(WIN32)
|
||||
set(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-windows.c)
|
||||
set(EV_SRC llarp/ev_win32.cpp)
|
||||
add_definitions(-DWIN32_LEAN_AND_MEAN -DWIN32 -DWINVER=0x500 -D_WIN32_WINNT=0x500)
|
||||
else()
|
||||
message(FATAL_ERROR "What operating system _are_ you building on/for?")
|
||||
|
@ -428,54 +436,36 @@ if(WIN32)
|
|||
endif(WIN32)
|
||||
|
||||
set(DNSLIB_SRC
|
||||
llarp/dns/dns.cpp
|
||||
llarp/dns/message.cpp
|
||||
llarp/dns/name.cpp
|
||||
llarp/dns/query.cpp
|
||||
llarp/dns/question.cpp
|
||||
llarp/dns/rr.cpp
|
||||
llarp/dns/serialize.cpp
|
||||
llarp/dns/server.cpp
|
||||
llarp/dns/string.cpp
|
||||
)
|
||||
|
||||
|
||||
set(LIB_SRC
|
||||
${DNSLIB_SRC}
|
||||
${EV_SRC}
|
||||
${UTP_SRC}
|
||||
llarp/address_info.cpp
|
||||
llarp/aligned.cpp
|
||||
llarp/bencode.cpp
|
||||
llarp/bits.cpp
|
||||
llarp/buffer.cpp
|
||||
llarp/codel.cpp
|
||||
llarp/common.cpp
|
||||
llarp/config.cpp
|
||||
llarp/context.cpp
|
||||
llarp/crypto.cpp
|
||||
llarp/crypto_libsodium.cpp
|
||||
llarp/defaults.cpp
|
||||
llarp/dht.cpp
|
||||
llarp/dns_rectypes.cpp
|
||||
llarp/dns.cpp
|
||||
llarp/dnsc.cpp
|
||||
llarp/dnsd.cpp
|
||||
llarp/dns_iptracker.cpp
|
||||
llarp/dns_dotlokilookup.cpp
|
||||
llarp/encode.cpp
|
||||
llarp/encrypted_frame.cpp
|
||||
llarp/exit_info.cpp
|
||||
llarp/exit_route.cpp
|
||||
llarp/ip.cpp
|
||||
llarp/link_intro.cpp
|
||||
llarp/link_message.cpp
|
||||
llarp/nodedb.cpp
|
||||
llarp/path.cpp
|
||||
llarp/pathbuilder.cpp
|
||||
llarp/pathset.cpp
|
||||
llarp/profiling.cpp
|
||||
llarp/proofofwork.cpp
|
||||
llarp/relay_commit.cpp
|
||||
llarp/relay_up_down.cpp
|
||||
llarp/router_contact.cpp
|
||||
llarp/router_id.cpp
|
||||
llarp/router.cpp
|
||||
llarp/rpc.cpp
|
||||
llarp/service.cpp
|
||||
llarp/transit_hop.cpp
|
||||
llarp/testnet.c
|
||||
llarp/dht/bucket.cpp
|
||||
llarp/dht/context.cpp
|
||||
llarp/dht/decode.cpp
|
||||
llarp/dht/dht_immediate.cpp
|
||||
|
@ -483,34 +473,115 @@ set(LIB_SRC
|
|||
llarp/dht/find_router.cpp
|
||||
llarp/dht/got_intro.cpp
|
||||
llarp/dht/got_router.cpp
|
||||
llarp/dht/kademlia.cpp
|
||||
llarp/dht/key.cpp
|
||||
llarp/dht/message.cpp
|
||||
llarp/dht/messages/all.cpp
|
||||
llarp/dht/messages/findintro.cpp
|
||||
llarp/dht/messages/findrouter.cpp
|
||||
llarp/dht/messages/gotintro.cpp
|
||||
llarp/dht/messages/gotrouter.cpp
|
||||
llarp/dht/messages/pubintro.cpp
|
||||
llarp/dht/node.cpp
|
||||
llarp/dht/publish_intro.cpp
|
||||
llarp/dns.cpp
|
||||
llarp/dns_dotlokilookup.cpp
|
||||
llarp/dns_iptracker.cpp
|
||||
llarp/dns_rectypes.cpp
|
||||
llarp/dnsc.cpp
|
||||
llarp/dnsd.cpp
|
||||
llarp/encode.cpp
|
||||
llarp/encrypted.cpp
|
||||
llarp/encrypted_ack.cpp
|
||||
llarp/encrypted_frame.cpp
|
||||
llarp/endian.cpp
|
||||
llarp/establish_job.cpp
|
||||
llarp/exit.cpp
|
||||
llarp/exit/close_exit.cpp
|
||||
llarp/exit/context.cpp
|
||||
llarp/exit/endpoint.cpp
|
||||
llarp/exit/grant_exit.cpp
|
||||
llarp/exit/update_exit.cpp
|
||||
llarp/exit/obtain_exit.cpp
|
||||
llarp/exit/policy.cpp
|
||||
llarp/exit/reject_exit.cpp
|
||||
llarp/exit/session.cpp
|
||||
llarp/exit/transfer_traffic.cpp
|
||||
llarp/exit/update_exit.cpp
|
||||
llarp/exit_info.cpp
|
||||
llarp/exit_route.cpp
|
||||
llarp/fs.cpp
|
||||
llarp/handlers/exit.cpp
|
||||
llarp/handlers/null.cpp
|
||||
llarp/handlers/tun.cpp
|
||||
llarp/ini.cpp
|
||||
llarp/ip.cpp
|
||||
llarp/iwp.cpp
|
||||
llarp/link/curvecp.cpp
|
||||
llarp/link/encoder.cpp
|
||||
llarp/link/server.cpp
|
||||
llarp/link/session.cpp
|
||||
llarp/link/utp.cpp
|
||||
llarp/link_intro.cpp
|
||||
llarp/link_layer.cpp
|
||||
llarp/link_message.cpp
|
||||
llarp/messages.cpp
|
||||
llarp/messages/dht.cpp
|
||||
llarp/messages/dht_immediate.cpp
|
||||
llarp/messages/discard.cpp
|
||||
llarp/messages/exit.cpp
|
||||
llarp/messages/link_intro.cpp
|
||||
llarp/messages/path_confirm.cpp
|
||||
llarp/messages/path_latency.cpp
|
||||
llarp/messages/path_transfer.cpp
|
||||
llarp/messages/relay.cpp
|
||||
llarp/messages/relay_commit.cpp
|
||||
llarp/messages/transfer_traffic.cpp
|
||||
llarp/net_int.cpp
|
||||
llarp/nodedb.cpp
|
||||
llarp/path.cpp
|
||||
llarp/path_types.cpp
|
||||
llarp/pathbuilder.cpp
|
||||
llarp/pathset.cpp
|
||||
llarp/pow.cpp
|
||||
llarp/profiling.cpp
|
||||
llarp/proofofwork.cpp
|
||||
llarp/proto.cpp
|
||||
llarp/queue.cpp
|
||||
llarp/relay_commit.cpp
|
||||
llarp/relay_up_down.cpp
|
||||
llarp/router.cpp
|
||||
llarp/router_contact.cpp
|
||||
llarp/router_id.cpp
|
||||
llarp/routing/dht_message.cpp
|
||||
llarp/routing/handler.cpp
|
||||
llarp/routing/message.cpp
|
||||
llarp/routing/message_parser.cpp
|
||||
llarp/routing/path_confirm.cpp
|
||||
llarp/routing/path_latency.cpp
|
||||
llarp/routing/path_transfer.cpp
|
||||
llarp/routing_endpoint.cpp
|
||||
llarp/rpc.cpp
|
||||
llarp/service.cpp
|
||||
llarp/service/Identity.cpp
|
||||
llarp/service/Intro.cpp
|
||||
llarp/service/IntroSet.cpp
|
||||
llarp/service/address.cpp
|
||||
llarp/service/config.cpp
|
||||
llarp/service/context.cpp
|
||||
llarp/service/endpoint.cpp
|
||||
llarp/service/handler.cpp
|
||||
llarp/service/info.cpp
|
||||
llarp/service/lookup.cpp
|
||||
llarp/service/protocol.cpp
|
||||
llarp/service/tag.cpp
|
||||
llarp/service/info.cpp
|
||||
llarp/service/types.cpp
|
||||
llarp/service/vanity.cpp
|
||||
llarp/string_view.cpp
|
||||
llarp/testnet.c
|
||||
llarp/threading.cpp
|
||||
llarp/transit_hop.cpp
|
||||
llarp/types.cpp
|
||||
llarp/version.cpp
|
||||
)
|
||||
|
||||
set(RC_SRC
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
#include <aligned.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <bits.hpp>
|
|
@ -1,12 +1,14 @@
|
|||
#ifndef LLARP_BITS_HPP
|
||||
#define LLARP_BITS_HPP
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
namespace llarp
|
||||
{
|
||||
namespace bits
|
||||
{
|
||||
template < typename Int_t >
|
||||
constexpr size_t
|
||||
constexpr std::size_t
|
||||
count_bits(const Int_t& i)
|
||||
{
|
||||
return i == 0 ? 0
|
||||
|
@ -15,8 +17,8 @@ namespace llarp
|
|||
}
|
||||
|
||||
template < typename T >
|
||||
constexpr size_t
|
||||
__count_array_bits(const T& array, size_t idx)
|
||||
constexpr std::size_t
|
||||
__count_array_bits(const T& array, std::size_t idx)
|
||||
{
|
||||
return idx < sizeof(T)
|
||||
? count_bits(array[idx]) + __count_array_bits(array, idx + 1)
|
||||
|
@ -24,7 +26,7 @@ namespace llarp
|
|||
}
|
||||
|
||||
template < typename T >
|
||||
constexpr size_t
|
||||
constexpr std::size_t
|
||||
count_array_bits(const T& array)
|
||||
{
|
||||
return __count_array_bits(array, 0);
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
#include <codel.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <common.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <defaults.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <dht/bucket.hpp>
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef LLARP_DHT_BUCKET_HPP
|
||||
#define LLARP_DHT_BUCKET_HPP
|
||||
|
||||
#include <crypto.hpp>
|
||||
#include <dht/kademlia.hpp>
|
||||
#include <dht/key.hpp>
|
||||
#include <map>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
#include <dht/kademlia.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <dht/key.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <dht/message.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <dht/messages/all.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <dht/messages/findintro.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <dht/messages/findrouter.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <dht/messages/gotintro.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <dht/messages/gotrouter.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <dht/messages/pubintro.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <dht/node.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <dns/dns.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <dns/query.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <dns/string.hpp>
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
struct llarp_buffer_t;
|
||||
|
||||
namespace llarp
|
||||
{
|
||||
namespace dns
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
#ifndef LLARP_DTLS_H_
|
||||
#define LLARP_DTLS_H_
|
||||
|
||||
#endif
|
|
@ -1,31 +0,0 @@
|
|||
#ifndef LLARP_DTLS_HPP
|
||||
#define LLARP_DTLS_HPP
|
||||
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
namespace llarp
|
||||
{
|
||||
namespace dtls
|
||||
{
|
||||
struct Base
|
||||
{
|
||||
Base(uint16_t mtu)
|
||||
{
|
||||
_ctx = SSL_CTX_new(DTLS_with_buffers_method());
|
||||
SSL_CTX_set_custom_verify(_ctx, SSL_VERIFY_PEER, []());
|
||||
}
|
||||
|
||||
~Base()
|
||||
{
|
||||
if(_ctx)
|
||||
SSL_CTX_free(_ctx);
|
||||
}
|
||||
|
||||
SSL_CTX* _ctx = nullptr;
|
||||
};
|
||||
|
||||
} // namespace dtls
|
||||
|
||||
} // namespace llarp
|
||||
|
||||
#endif
|
|
@ -1 +0,0 @@
|
|||
#include <dtls.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <encrypted.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <encrypted_ack.hpp>
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
namespace llarp
|
||||
{
|
||||
struct Crypto;
|
||||
|
||||
struct EncryptedAck : public Encrypted
|
||||
{
|
||||
bool
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
#include <endian.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <establish_job.hpp>
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef LLARP_ESTABLISH_JOB_HPP
|
||||
#define LLARP_ESTABLISH_JOB_HPP
|
||||
|
||||
#include <router_contact.hpp>
|
||||
|
||||
namespace llarp
|
||||
{
|
||||
struct OutboundLinkEstablishJob
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
|
||||
#include <stddef.h>
|
||||
|
||||
#define EV_TICK_INTERVAL 100
|
||||
|
||||
// apparently current Solaris will emulate epoll.
|
||||
#if __linux__ || __sun__
|
||||
#include "ev_epoll.hpp"
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
* event handler (cross platform high performance event system for IO)
|
||||
*/
|
||||
|
||||
#define EV_TICK_INTERVAL 100
|
||||
|
||||
// forward declare
|
||||
struct llarp_threadpool;
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
#include <ev_epoll.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <ev_kqueue.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <ev_win32.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <exit.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <fs.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <handlers/null.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <ini.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <iwp.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <link/encoder.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <link/session.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <link_layer.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <messages.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <messages/dht.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <messages/dht_immediate.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <messages/discard.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <messages/exit.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <messages/link_intro.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <messages/path_confirm.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <messages/path_latency.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <messages/path_transfer.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <messages/relay.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <messages/relay_commit.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <messages/transfer_traffic.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <net_int.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <path_types.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <pow.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <proto.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <queue.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <routing/handler.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <routing/message.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <routing_endpoint.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <service/Identity.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <service/Intro.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <service/IntroSet.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <service/config.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <service/handler.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <service/types.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <service/vanity.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <string_view.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <threading.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <types.hpp>
|
|
@ -0,0 +1 @@
|
|||
#include <version.hpp>
|
Loading…
Reference in New Issue