mirror of https://github.com/oxen-io/lokinet
Merge branch 'master' into dev
This commit is contained in:
commit
b543d6243d
|
@ -4,7 +4,7 @@
|
|||
#include "logger.hpp"
|
||||
|
||||
#include <llarp/router_contact.hpp>
|
||||
#include <llarp/time.h>
|
||||
#include <llarp/time.hpp>
|
||||
|
||||
#include <fstream>
|
||||
#include "buffer.hpp"
|
||||
|
@ -14,9 +14,6 @@
|
|||
#include "router.hpp"
|
||||
|
||||
#include <llarp/messages/dht.hpp>
|
||||
//#include <llarp/dht/messages/findintro.hpp>
|
||||
//#include <llarp/routing_endpoint.hpp>
|
||||
//#include <llarp/crypt.hpp> // for llarp::pubkey
|
||||
|
||||
struct llarp_main *ctx = 0;
|
||||
|
||||
|
@ -391,7 +388,7 @@ main(int argc, char *argv[])
|
|||
printf("Creating [%s]\n", rcfname);
|
||||
// if we zero it out then
|
||||
// set updated timestamp
|
||||
rc.last_updated = llarp_time_now_ms();
|
||||
rc.last_updated = llarp::time_now_ms();
|
||||
// load longterm identity
|
||||
llarp_crypto crypt;
|
||||
llarp_crypto_init(&crypt);
|
||||
|
@ -440,7 +437,7 @@ main(int argc, char *argv[])
|
|||
// llarp_rc_read(rcfname, &rc);
|
||||
|
||||
// set updated timestamp
|
||||
rc.last_updated = llarp_time_now_ms();
|
||||
rc.last_updated = llarp::time_now_ms();
|
||||
// load longterm identity
|
||||
llarp_crypto crypt;
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
#define LLARP_H_
|
||||
#include <llarp/dht.h>
|
||||
#include <llarp/ev.h>
|
||||
#include <llarp/logic.h>
|
||||
#include <llarp/logic.hpp>
|
||||
#include <llarp/mem.h>
|
||||
#include <llarp/version.h>
|
||||
#include <llarp/version.hpp>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <llarp/service/address.hpp> // for service::address
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef LLARP_BENCODE_H
|
||||
#define LLARP_BENCODE_H
|
||||
#include <llarp/buffer.h>
|
||||
#include <llarp/common.h>
|
||||
#include <llarp/proto.h>
|
||||
#include <llarp/common.hpp>
|
||||
#include <llarp/proto.hpp>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef LLARP_BUFFER_H_
|
||||
#define LLARP_BUFFER_H_
|
||||
#include <llarp/common.h>
|
||||
#include <llarp/common.hpp>
|
||||
#include <llarp/mem.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef LLARP_CODEL_QUEUE_HPP
|
||||
#define LLARP_CODEL_QUEUE_HPP
|
||||
#include <llarp/time.h>
|
||||
#include <llarp/time.hpp>
|
||||
#include <llarp/logger.hpp>
|
||||
#include <llarp/mem.hpp>
|
||||
#include <llarp/threading.hpp>
|
||||
|
@ -105,9 +105,14 @@ namespace llarp
|
|||
void
|
||||
Process(Visit visitor, Filter f)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
llarp_time_t lowest = std::numeric_limits< llarp_time_t >::max();
|
||||
if(_getNow() < nextTickAt)
|
||||
return;
|
||||
=======
|
||||
llarp_time_t lowest = 0xFFFFFFFFFFFFFFFFUL;
|
||||
// auto start = time_now_ms();
|
||||
>>>>>>> master
|
||||
// llarp::LogInfo("CoDelQueue::Process - start at ", start);
|
||||
Lock_t lock(m_QueueMutex);
|
||||
auto start = firstPut;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef LLARP_COMMON_H
|
||||
#define LLARP_COMMON_H
|
||||
#ifndef LLARP_COMMON_HPP
|
||||
#define LLARP_COMMON_HPP
|
||||
#ifdef __STRICT_ANSI__
|
||||
#define INLINE __inline__
|
||||
#else
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef LLARP_CRYPTO_H_
|
||||
#define LLARP_CRYPTO_H_
|
||||
#include <llarp/buffer.h>
|
||||
#include <llarp/common.h>
|
||||
#include <llarp/common.hpp>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef LLARP_DEFAULTS_H
|
||||
#define LLARP_DEFAULTS_H
|
||||
#ifndef LLARP_DEFAULTS_HPP
|
||||
#define LLARP_DEFAULTS_HPP
|
||||
|
||||
#ifndef DEFAULT_RESOLVER_US
|
||||
#define DEFAULT_RESOLVER_US "1.1.1.1"
|
||||
|
@ -27,4 +27,4 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -2,13 +2,14 @@
|
|||
#define LLARP_DHT_CONTEXT_HPP
|
||||
|
||||
#include <llarp/dht.h>
|
||||
#include <llarp/router.h>
|
||||
#include <llarp/dht/bucket.hpp>
|
||||
#include <llarp/dht/key.hpp>
|
||||
#include <llarp/dht/message.hpp>
|
||||
#include <llarp/dht/messages/findintro.hpp>
|
||||
#include <llarp/dht/node.hpp>
|
||||
#include <llarp/router.h>
|
||||
#include <llarp/service/IntroSet.hpp>
|
||||
#include <llarp/time.hpp>
|
||||
|
||||
#include <set>
|
||||
|
||||
|
@ -302,7 +303,7 @@ namespace llarp
|
|||
if(itr == timeouts.end())
|
||||
{
|
||||
timeouts.insert(
|
||||
std::make_pair(k, llarp_time_now_ms() + requestTimeoutMS));
|
||||
std::make_pair(k, time_now_ms() + requestTimeoutMS));
|
||||
}
|
||||
t->Start(askpeer);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef LLARP_ENDIAN_H
|
||||
#define LLARP_ENDIAN_H
|
||||
#ifndef LLARP_ENDIAN_HPP
|
||||
#define LLARP_ENDIAN_HPP
|
||||
|
||||
// adapted from libi2pd
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <tuntap.h>
|
||||
#include <llarp/time.h>
|
||||
#include <llarp/time.hpp>
|
||||
|
||||
/**
|
||||
* ev.h
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef LLARP_EXIT_ENDPOINT_HPP
|
||||
#define LLARP_EXIT_ENDPOINT_HPP
|
||||
#include <llarp/time.h>
|
||||
#include <llarp/time.hpp>
|
||||
#include <llarp/crypto.hpp>
|
||||
#include <llarp/router.h>
|
||||
#include <llarp/path.hpp>
|
||||
|
@ -97,4 +97,4 @@ namespace llarp
|
|||
} // namespace exit
|
||||
} // namespace llarp
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace llarp
|
|||
return out;
|
||||
out << std::string("/");
|
||||
#if defined(ANDROID) || defined(RPI)
|
||||
snprintf(tmp, sizeof(tmp), "%u",
|
||||
snprintf(tmp, sizeof(tmp), "%lu",
|
||||
llarp::bits::count_array_bits(xi.netmask.s6_addr));
|
||||
return out << tmp;
|
||||
#else
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef LLARP_IP_HPP
|
||||
#define LLARP_IP_HPP
|
||||
#include <llarp/buffer.h>
|
||||
#include <llarp/time.h>
|
||||
#include <llarp/time.hpp>
|
||||
#include <llarp/net.hpp>
|
||||
#include <llarp/ev.h>
|
||||
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
#include <llarp/net.hpp>
|
||||
#include <llarp/ev.h>
|
||||
#include <llarp/link/session.hpp>
|
||||
#include <llarp/logic.h>
|
||||
#include <llarp/time.h>
|
||||
#include <llarp/logic.hpp>
|
||||
#include <list>
|
||||
|
||||
struct llarp_router;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <llarp/crypto.hpp>
|
||||
#include <llarp/net.hpp>
|
||||
#include <llarp/router_contact.hpp>
|
||||
#include <llarp/types.h>
|
||||
#include <llarp/types.hpp>
|
||||
#include <functional>
|
||||
|
||||
namespace llarp
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#endif
|
||||
#ifdef RPI
|
||||
#include <cstdio>
|
||||
#include <llarp/time.h>
|
||||
#endif
|
||||
|
||||
namespace llarp
|
||||
|
@ -103,7 +102,7 @@ namespace llarp
|
|||
{
|
||||
#if defined(ANDROID) || defined(RPI)
|
||||
(void)ts;
|
||||
return out << llarp_time_now_ms();
|
||||
return out << time_now_ms();
|
||||
#else
|
||||
auto now = llarp::Clock_t::to_time_t(llarp::Clock_t::now());
|
||||
return out << std::put_time(std::localtime(&now), ts.format);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef LLARP_LOGIC_H
|
||||
#define LLARP_LOGIC_H
|
||||
#ifndef LLARP_LOGIC_HPP
|
||||
#define LLARP_LOGIC_HPP
|
||||
#include <llarp/mem.h>
|
||||
#include <llarp/threadpool.h>
|
||||
#include <llarp/timer.h>
|
||||
#include <llarp/timer.hpp>
|
||||
|
||||
struct llarp_logic
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef LLARP_NODEDB_HPP
|
||||
#define LLARP_NODEDB_HPP
|
||||
#include <llarp/common.h>
|
||||
#include <llarp/common.hpp>
|
||||
#include <llarp/crypto.h>
|
||||
#include <llarp/router_contact.hpp>
|
||||
#include <llarp/router_id.hpp>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef LLARP_PATH_HPP
|
||||
#define LLARP_PATH_HPP
|
||||
#include <llarp/router.h>
|
||||
#include <llarp/time.h>
|
||||
#include <llarp/time.hpp>
|
||||
#include <llarp/aligned.hpp>
|
||||
#include <llarp/crypto.hpp>
|
||||
#include <llarp/dht.hpp>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef LLARP_PATHSET_HPP
|
||||
#define LLARP_PATHSET_HPP
|
||||
#include <llarp/time.h>
|
||||
#include <llarp/time.hpp>
|
||||
#include <functional>
|
||||
#include <list>
|
||||
#include <llarp/path_types.hpp>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef LLARP_PROTO_H
|
||||
#define LLARP_PROTO_H
|
||||
#ifndef LLARP_PROTO_HPP
|
||||
#define LLARP_PROTO_HPP
|
||||
|
||||
#ifndef LLARP_PROTO_VERSION
|
||||
#define LLARP_PROTO_VERSION (0)
|
|
@ -2,7 +2,7 @@
|
|||
#define LLARP_ROUTER_H_
|
||||
#include <llarp/config.h>
|
||||
#include <llarp/ev.h>
|
||||
#include <llarp/logic.h>
|
||||
#include <llarp/logic.hpp>
|
||||
#include <llarp/threadpool.h>
|
||||
#include <llarp/buffer.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef LLARP_RPC_HPP
|
||||
#define LLARP_RPC_HPP
|
||||
#include <llarp/time.h>
|
||||
#include <llarp/time.hpp>
|
||||
#include <llarp/ev.h>
|
||||
#include <string>
|
||||
#include <functional>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef LLARP_SERVICE_INTROSET_HPP
|
||||
#define LLARP_SERVICE_INTROSET_HPP
|
||||
#include <llarp/time.h>
|
||||
#include <llarp/time.hpp>
|
||||
#include <iostream>
|
||||
#include <llarp/bencode.hpp>
|
||||
#include <llarp/crypto.hpp>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef LLARP_SERVICE_PROTOCOL_HPP
|
||||
#define LLARP_SERVICE_PROTOCOL_HPP
|
||||
#include <llarp/time.h>
|
||||
#include <llarp/time.hpp>
|
||||
#include <llarp/bencode.hpp>
|
||||
#include <llarp/crypto.hpp>
|
||||
#include <llarp/encrypted.hpp>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef LLARP_STRING_H
|
||||
#define LLARP_STRING_H
|
||||
#include <llarp/common.h>
|
||||
#include <llarp/common.hpp>
|
||||
|
||||
#ifndef __FreeBSD__
|
||||
#if !(__APPLE__ && __MACH__)
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
#ifndef LLARP_TIME_H
|
||||
#define LLARP_TIME_H
|
||||
#include <llarp/types.h>
|
||||
|
||||
llarp_time_t
|
||||
llarp_time_now_ms();
|
||||
|
||||
#endif
|
|
@ -1,11 +1,16 @@
|
|||
#ifndef LLARP_TIME_HPP
|
||||
#define LLARP_TIME_HPP
|
||||
|
||||
#include <llarp/types.hpp>
|
||||
|
||||
#include <chrono>
|
||||
|
||||
namespace llarp
|
||||
{
|
||||
typedef std::chrono::system_clock Clock_t;
|
||||
}
|
||||
using Clock_t = std::chrono::system_clock;
|
||||
|
||||
llarp_time_t
|
||||
time_now_ms();
|
||||
} // namespace llarp
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
#ifndef LLARP_TIMER_H
|
||||
#define LLARP_TIMER_H
|
||||
#include <llarp/common.h>
|
||||
#ifndef LLARP_TIMER_HPP
|
||||
#define LLARP_TIMER_HPP
|
||||
|
||||
#include <llarp/common.hpp>
|
||||
#include <llarp/threadpool.h>
|
||||
#include <llarp/time.h>
|
||||
#include <llarp/time.hpp>
|
||||
|
||||
/** called with userptr, original timeout, left */
|
||||
typedef void (*llarp_timer_handler_func)(void *, uint64_t, uint64_t);
|
|
@ -1,9 +0,0 @@
|
|||
#ifndef LLARP_TYPES_H
|
||||
#define LLARP_TYPES_H
|
||||
#include <stdint.h>
|
||||
|
||||
typedef uint8_t llarp_proto_version_t;
|
||||
typedef uint64_t llarp_time_t;
|
||||
typedef uint64_t llarp_seconds_t;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef LLARP_TYPES_H
|
||||
#define LLARP_TYPES_H
|
||||
#include <cstdint>
|
||||
|
||||
using llarp_proto_version_t = std::uint8_t;
|
||||
using llarp_time_t = std::uint64_t;
|
||||
using llarp_seconds_t = std::uint64_t;
|
||||
|
||||
#endif
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef LLARP_VERSION_H
|
||||
#define LLARP_VERSION_H
|
||||
#ifndef LLARP_VERSION_HPP
|
||||
#define LLARP_VERSION_HPP
|
||||
|
||||
#ifndef LLARP_VERSION_MAJ
|
||||
#define LLARP_VERSION_MAJ "0"
|
||||
|
@ -28,4 +28,5 @@
|
|||
#ifndef LLARP_RELEASE_MOTTO
|
||||
#define LLARP_RELEASE_MOTTO "(dev build)"
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -2,12 +2,12 @@
|
|||
#define __ABYSS_SERVER_HPP__
|
||||
|
||||
#include <llarp/ev.h>
|
||||
#include <llarp/logic.h>
|
||||
#include <llarp/time.h>
|
||||
#include <llarp/logic.hpp>
|
||||
#include <llarp/string_view.hpp>
|
||||
#include <llarp/time.hpp>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <llarp/string_view.hpp>
|
||||
#include <abyss/json.hpp>
|
||||
#include <unordered_map>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <abyss/server.hpp>
|
||||
#include <abyss/http.hpp>
|
||||
#include <llarp/time.h>
|
||||
#include <llarp/time.hpp>
|
||||
#include <sstream>
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <llarp/buffer.h>
|
||||
#include <llarp/endian.h>
|
||||
#include <llarp/endian.hpp>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "config.hpp"
|
||||
#include <llarp/config.h>
|
||||
#include <llarp/defaults.h>
|
||||
#include <llarp/defaults.hpp>
|
||||
#include <llarp/net.hpp>
|
||||
#include "fs.hpp"
|
||||
#include "ini.hpp"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <llarp/endian.h>
|
||||
#include <llarp/endian.hpp>
|
||||
#include <llarp/dnsd.hpp> // for llarp_handle_dnsd_recvfrom, dnsc
|
||||
#include <llarp/logger.hpp>
|
||||
|
||||
|
@ -212,7 +212,7 @@ extern "C"
|
|||
}
|
||||
*/
|
||||
question->name = m_qName;
|
||||
|
||||
|
||||
question->type = get16bits(moveable);
|
||||
(*pos) += 2;
|
||||
// printf("Now1 at [%d]\n", buffer - start);
|
||||
|
@ -244,7 +244,7 @@ extern "C"
|
|||
|
||||
//hexDump(moveable, 12);
|
||||
//hexDumpAt(buffer, *pos, 12);
|
||||
|
||||
|
||||
if(*moveable == '\xc0')
|
||||
{
|
||||
// hexDump(moveable, 2);
|
||||
|
|
|
@ -230,19 +230,19 @@ ReverseHandlerIter(struct llarp::service::Context::endpoint_iter *endpointCfg)
|
|||
llarp::LogDebug(searchIp, " vs ", checkIp);
|
||||
|
||||
llarp::IPRange range = llarp::iprange_ipv4(
|
||||
stoi(tokensCheck[0]), stoi(tokensCheck[1]), stoi(tokensCheck[2]),
|
||||
stoi(tokensCheck[3]), tunEndpoint->tunif.netmask); // create range
|
||||
std::stoi(tokensCheck[0]), std::stoi(tokensCheck[1]), std::stoi(tokensCheck[2]),
|
||||
std::stoi(tokensCheck[3]), tunEndpoint->tunif.netmask); // create range
|
||||
// hack atm to work around limitations in ipaddr_ipv4_bits and llarp::IPRange
|
||||
llarp::huint32_t searchIPv4_fixed = llarp::ipaddr_ipv4_bits(
|
||||
stoi(tokensSearch[searchTokens - 6]),
|
||||
stoi(tokensSearch[searchTokens - 5]),
|
||||
stoi(tokensSearch[searchTokens - 4]),
|
||||
stoi(tokensSearch[searchTokens - 3])); // create ip
|
||||
std::stoi(tokensSearch[searchTokens - 6]),
|
||||
std::stoi(tokensSearch[searchTokens - 5]),
|
||||
std::stoi(tokensSearch[searchTokens - 4]),
|
||||
std::stoi(tokensSearch[searchTokens - 3])); // create ip
|
||||
llarp::huint32_t searchIPv4_search = llarp::ipaddr_ipv4_bits(
|
||||
stoi(tokensSearch[searchTokens - 3]),
|
||||
stoi(tokensSearch[searchTokens - 4]),
|
||||
stoi(tokensSearch[searchTokens - 5]),
|
||||
stoi(tokensSearch[searchTokens - 6])); // create ip
|
||||
std::stoi(tokensSearch[searchTokens - 3]),
|
||||
std::stoi(tokensSearch[searchTokens - 4]),
|
||||
std::stoi(tokensSearch[searchTokens - 5]),
|
||||
std::stoi(tokensSearch[searchTokens - 6])); // create ip
|
||||
|
||||
// bool inRange = range.Contains(searchAddr.xtohl());
|
||||
bool inRange = range.Contains(searchIPv4_search);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <llarp/ev.h>
|
||||
#include <llarp/logic.h>
|
||||
#include <llarp/logic.hpp>
|
||||
#include <llarp/string_view.hpp>
|
||||
|
||||
#include <stddef.h>
|
||||
|
@ -34,7 +34,7 @@ llarp_ev_loop_alloc(struct llarp_ev_loop **ev)
|
|||
#error no event loop subclass
|
||||
#endif
|
||||
(*ev)->init();
|
||||
(*ev)->_now = llarp_time_now_ms();
|
||||
(*ev)->_now = llarp::time_now_ms();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -49,7 +49,7 @@ llarp_ev_loop_run(struct llarp_ev_loop *ev, struct llarp_logic *logic)
|
|||
{
|
||||
while(ev->running())
|
||||
{
|
||||
ev->_now = llarp_time_now_ms();
|
||||
ev->_now = llarp::time_now_ms();
|
||||
ev->tick(EV_TICK_INTERVAL);
|
||||
if(ev->running())
|
||||
llarp_logic_tick(logic, ev->_now);
|
||||
|
@ -64,7 +64,7 @@ llarp_ev_loop_run_single_process(struct llarp_ev_loop *ev,
|
|||
{
|
||||
while(ev->running())
|
||||
{
|
||||
ev->_now = llarp_time_now_ms();
|
||||
ev->_now = llarp::time_now_ms();
|
||||
ev->tick(EV_TICK_INTERVAL);
|
||||
if(ev->running())
|
||||
{
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#if __FreeBSD__ || __OpenBSD__ || __NetBSD__ || (__APPLE__ && __MACH__)
|
||||
// kqueue / kevent
|
||||
#include <sys/event.h>
|
||||
#include <sys/time.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <llarp/endian.h>
|
||||
#include <llarp/endian.hpp>
|
||||
#include <algorithm>
|
||||
#include <llarp/ip.hpp>
|
||||
#include "llarp/buffer.hpp"
|
||||
|
@ -6,7 +6,6 @@
|
|||
#ifndef _WIN32
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#include <llarp/endian.h>
|
||||
#include <map>
|
||||
#include <algorithm>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <llarp/messages/link_intro.hpp>
|
||||
#include <llarp/messages/discard.hpp>
|
||||
#include <llarp/buffer.hpp>
|
||||
#include <llarp/endian.h>
|
||||
#include <llarp/endian.hpp>
|
||||
#include <utp.h>
|
||||
#include <cassert>
|
||||
#include <tuple>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <llarp/logic.h>
|
||||
#include <llarp/logic.hpp>
|
||||
#include <llarp/mem.h>
|
||||
#include "logger.hpp"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <llarp/logic.h>
|
||||
#include <llarp/logic.hpp>
|
||||
#include <llarp/nodedb.hpp>
|
||||
#include <llarp/router_contact.hpp>
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#include <llarp/time.h>
|
||||
#include <cmath>
|
||||
#include <llarp/pow.hpp>
|
||||
#include "buffer.hpp"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "router.hpp"
|
||||
#include <llarp/proto.h>
|
||||
#include <llarp/threadpool.h>
|
||||
#include <llarp/proto.hpp>
|
||||
#include <llarp/iwp.hpp>
|
||||
#include <llarp/link_message.hpp>
|
||||
#include <llarp/link/utp.hpp>
|
||||
#include <llarp/rpc.hpp>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include <llarp/bencode.hpp>
|
||||
#include <llarp/router_contact.hpp>
|
||||
#include <llarp/version.h>
|
||||
#include <llarp/crypto.hpp>
|
||||
#include <llarp/time.h>
|
||||
#include <llarp/net.hpp>
|
||||
#include <llarp/router_contact.hpp>
|
||||
#include <llarp/time.hpp>
|
||||
#include <llarp/version.hpp>
|
||||
#include "buffer.hpp"
|
||||
#include "logger.hpp"
|
||||
#include "mem.hpp"
|
||||
|
@ -156,7 +156,7 @@ namespace llarp
|
|||
byte_t tmp[MAX_RC_SIZE] = {0};
|
||||
auto buf = llarp::StackBuffer< decltype(tmp) >(tmp);
|
||||
signature.Zero();
|
||||
last_updated = llarp_time_now_ms();
|
||||
last_updated = time_now_ms();
|
||||
if(!BEncode(&buf))
|
||||
return false;
|
||||
buf.sz = buf.cur - buf.base;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <llarp/time.h>
|
||||
#include <llarp/bencode.hpp>
|
||||
#include <llarp/messages/path_confirm.hpp>
|
||||
|
||||
#include <llarp/time.hpp>
|
||||
#include <llarp/bencode.hpp>
|
||||
#include <llarp/routing/handler.hpp>
|
||||
|
||||
namespace llarp
|
||||
|
@ -12,7 +13,7 @@ namespace llarp
|
|||
}
|
||||
|
||||
PathConfirmMessage::PathConfirmMessage(uint64_t lifetime)
|
||||
: pathLifetime(lifetime), pathCreated(llarp_time_now_ms())
|
||||
: pathLifetime(lifetime), pathCreated(time_now_ms())
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -56,4 +57,4 @@ namespace llarp
|
|||
}
|
||||
|
||||
} // namespace routing
|
||||
} // namespace llarp
|
||||
} // namespace llarp
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <llarp/path.hpp>
|
||||
#include <llarp/service/endpoint.hpp>
|
||||
#include <llarp/service/lookup.hpp>
|
||||
#include <llarp/time.hpp>
|
||||
|
||||
namespace llarp
|
||||
{
|
||||
|
@ -10,7 +11,7 @@ namespace llarp
|
|||
const std::string &n)
|
||||
: parent(p), txid(tx), name(n)
|
||||
{
|
||||
m_created = llarp_time_now_ms();
|
||||
m_created = time_now_ms();
|
||||
p->PutLookup(this, tx);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "threadpool.hpp"
|
||||
#include <cstring>
|
||||
|
||||
#include <llarp/time.h>
|
||||
#include <llarp/time.hpp>
|
||||
#include <functional>
|
||||
#include <queue>
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#include <llarp/time.h>
|
||||
#include <llarp/time.hpp>
|
||||
|
||||
namespace llarp
|
||||
|
@ -12,14 +11,13 @@ namespace llarp
|
|||
.count();
|
||||
}
|
||||
|
||||
// use std::chrono because otherwise the network breaks with Daylight Savings
|
||||
// this time, it doesn't get truncated -despair
|
||||
// that concern is what drove me back to the POSIX C time functions
|
||||
// in the first place
|
||||
llarp_time_t
|
||||
time_now_ms()
|
||||
{
|
||||
return llarp::time_since_epoch< std::chrono::milliseconds >();
|
||||
}
|
||||
} // namespace llarp
|
||||
|
||||
// use std::chrono because otherwise the network breaks with Daylight Savings
|
||||
// this time, it doesn't get truncated -despair
|
||||
// that concern is what drove me back to the POSIX C time functions
|
||||
// in the first place
|
||||
llarp_time_t
|
||||
llarp_time_now_ms()
|
||||
{
|
||||
return llarp::time_since_epoch< std::chrono::milliseconds >();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <llarp/time.h>
|
||||
#include <llarp/timer.h>
|
||||
#include <llarp/time.hpp>
|
||||
#include <llarp/timer.hpp>
|
||||
#include <atomic>
|
||||
#include <condition_variable>
|
||||
#include <list>
|
||||
|
@ -66,7 +66,7 @@ struct llarp_timer_context
|
|||
|
||||
llarp_timer_context()
|
||||
{
|
||||
m_Now = llarp_time_now_ms();
|
||||
m_Now = llarp::time_now_ms();
|
||||
}
|
||||
|
||||
uint32_t ids = 0;
|
||||
|
@ -193,7 +193,7 @@ void
|
|||
llarp_timer_set_time(struct llarp_timer_context* t, llarp_time_t now)
|
||||
{
|
||||
if(now == 0)
|
||||
now = llarp_time_now_ms();
|
||||
now = llarp::time_now_ms();
|
||||
t->m_Now = now;
|
||||
}
|
||||
|
||||
|
@ -261,7 +261,7 @@ llarp_timer_run(struct llarp_timer_context* t, struct llarp_threadpool* pool)
|
|||
{
|
||||
llarp::util::Lock lock(t->timersMutex);
|
||||
// we woke up
|
||||
llarp_timer_tick_all_async(t, pool, llarp_time_now_ms());
|
||||
llarp_timer_tick_all_async(t, pool, llarp::time_now_ms());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include <gtest/gtest.h>
|
||||
|
||||
#include <llarp/service.hpp>
|
||||
#include <llarp/time.hpp>
|
||||
|
||||
struct HiddenServiceTest : public ::testing::Test
|
||||
{
|
||||
|
@ -31,7 +33,7 @@ TEST_F(HiddenServiceTest, TestGenerateIntroSet)
|
|||
llarp::service::Address addr;
|
||||
ASSERT_TRUE(ident.pub.CalculateAddress(addr.data()));
|
||||
llarp::service::IntroSet I;
|
||||
auto now = llarp_time_now_ms();
|
||||
auto now = llarp::time_now_ms();
|
||||
I.T = now;
|
||||
while(I.I.size() < 10)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include <llarp.h> // for llarp_main_init
|
||||
#include <llarp/logic.h> // for threadpool/llarp_logic
|
||||
#include <llarp/logic.hpp> // for threadpool/llarp_logic
|
||||
#include "llarp/net.hpp" // for llarp::Addr
|
||||
#include "llarp/dns.hpp"
|
||||
#include "llarp/dnsc.hpp"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include <llarp.h> // for llarp_main_init
|
||||
#include <llarp/logic.h> // for threadpool/llarp_logic
|
||||
#include <llarp/logic.hpp> // for threadpool/llarp_logic
|
||||
#include "llarp/net.hpp" // for llarp::Addr
|
||||
#include "llarp/dnsc.hpp"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include <llarp.h> // for llarp_main_init
|
||||
#include <llarp/logic.h> // for threadpool/llarp_logic
|
||||
#include <llarp/logic.hpp> // for threadpool/llarp_logic
|
||||
#include "llarp/net.hpp" // for llarp::Addr
|
||||
#include "llarp/dnsd.hpp"
|
||||
|
||||
|
|
Loading…
Reference in New Issue