Commit Graph

255 Commits (61c580876505e2b5b1103a8b79c65f1800143384)

Author SHA1 Message Date
Jeff Becker 1899debfb5
unfug transit hops 4 years ago
Jeff Becker 9fb681eb7c
typo 4 years ago
Jeff Becker fe1dae8f30
fix transit hop job queuing 4 years ago
Jeff Becker acecb23eb3
make libuv event loop logic queue size configurable.
remove logic constructor that is no-op.
add constant for default logic queue size
add constant for transit hop queue size
4 years ago
Jeff Becker f25e9bb01f
use std::list here too 4 years ago
Jeff Becker 25a4bbd5ca
use std::swap 4 years ago
Jeff Becker eb0abbf1ff
add eraseif to decaying hashset 4 years ago
Jeff Becker c826d0a0b1
increase transit hop limits 4 years ago
Jeff Becker a45f92dca7
use random good path for outbound traffic so that it uses an even spread accross
all paths
4 years ago
Jeff Becker 382e4215a8
path testing interval increase to reduce bandwidth use 4 years ago
Jeff Becker 00143e63f4
put replay filters on transit hops to reduce retransmissions. 4 years ago
Jeff Becker 6af498092b
exit traffic via loki addresses 4 years ago
Jason Rhinelander 3bb24580a4 make format 4 years ago
Jason Rhinelander ebd2142114 Don't use std::optional::value() because f u macos
This replaces all use of std::optional's `opt.value()` with `*opt`
because macOS is great and the ghost of Steve Jobs says that actually
supporting std::optional's value() method is not for chumps before macOS
10.14.  So don't use it because Apple is great.

Pretty much all of our use of it actually is done better with operator*
anyway (since operator* doesn't do a check that the optional has a
value).

Also replaced *most* of the `has_value()` calls with direct bool
context, except for one in the config section which looked really
confusing at a glance without a has_value().
4 years ago
Stephen Shelton aee96e53a3
Refactor Addr -> IpAddress/SockAddr 4 years ago
Jason Rhinelander 1697bf90fe C++17
Compiles with C++17, replaces ghc::filesystem with std::filesystem,
nonstd::optional with std::optional, and llarp::string_view with
std::string_view.
4 years ago
Stephen Shelton 273270916e
The Great Wall of Blame
This commit reflects changes to clang-format rules. Unfortunately,
these rule changes create a massive change to the codebase, which
causes an apparent rewrite of git history.

Git blame's --ignore-rev flag can be used to ignore this commit when
attempting to `git blame` some code.
5 years ago
Jeff d3091cf9fc
Merge pull request #1167 from tewinget/tooling
RouterHive initial PR
5 years ago
Stephen Shelton 4c6be3c8d1
Add PathBuildRejectedEvent to RouterHive 5 years ago
Stephen Shelton ea835405c5
Refactor NotifyRouterEvent() to forward args, event code cleanup
This template-ifies Router::NotifyRouterEvent() up so that it accepts
the arguments to instantiate the specified event type, forwarding them
to std::make_unique. This would allow (in the future) the function to
no-op the call and avoid memory allocation. It also slightly reduces
the amount of code required to fire an event.

This commit also simplifies some of the RouterEvent code to reduce
redundancy.
5 years ago
Thomas Winget 84a1d7dbcc clang format....... 5 years ago
Thomas Winget c8c66f0a5f some refactoring of tooling code, added RCGossipReceivedEvent 5 years ago
Thomas Winget a9882ad475 PathRequestReceivedEvent implemented 5 years ago
Thomas Winget c9a278c0de some more changes to pybind/hive code, read below
hive.py is currently largely for testing the pybind stuff, so changes to it will likely
be frequent and arbitrary for now.

Added pybind for llarp::path::PathHopConfig, but not every member -- just rc and upstream routerID

Hive now uses std::queue with mutex instead of our lockless queue.

Removed some functions from Hive that will not be necessary as things are being handled from python.
5 years ago
Thomas Winget 1e04decb66 can ping on lokinet running in python context! 5 years ago
Jeff Becker add305b9f4
use size / 2 as the number of transit paths 5 years ago
Jeff Becker 05082e2507
fix status line 5 years ago
Jason Rhinelander 76608b6b90 Logic simplification 5 years ago
Stephen Shelton f61cd1a7da
Add some notes/comments about DHT message handling 5 years ago
Jason Rhinelander f1aa27e616 fix speeling mistack 5 years ago
Jeff Becker 9d5dbbc0ad
remove uneeded members 5 years ago
Jeff Becker 66181d8a8f
systemd status 5 years ago
Jeff Becker fdcd19662f
remove trailing "ms" 5 years ago
Jeff Becker bf0416cab8
remove Time_t, add operator overload for printing llarp_time_t and add to_json function for serializing llarp_time_t to json 5 years ago
Jeff Becker d2d109e92c
llarp_time_t is now using std::chrono 5 years ago
Jeff Becker f4520ac920
make decaying hashset use llarp::Time_t and move unit tests to use catch2 5 years ago
Jason Rhinelander 089056ca5b Remove all ABSL_ATTRIBUTE_UNUSED uses 5 years ago
Jason Rhinelander f84ce61d66 Removed empty cpp files
These aren't needed: CMake already knows how to follow #includes and
rebuild when headers change as long as the headers are included
*somewhere*.  The extra .cpp files here just require building a bunch of
.cpp files with just header content that we just end up throw away
during linking (since the same things will also be compiled in whatever
other compilation units include the same headers).
5 years ago
Jason Rhinelander b4440094b0 De-abseil, part 2: mutex, locks, (most) time
- util::Mutex is now a std::shared_timed_mutex, which is capable of
  exclusive and shared locks.

- util::Lock is still present as a std::lock_guard<util::Mutex>.

- the locking annotations are preserved, but updated to the latest
  supported by clang rather than using abseil's older/deprecated ones.

- ACQUIRE_LOCK macro is gone since we don't pass mutexes by pointer into
  locks anymore (WTF abseil).

- ReleasableLock is gone.  Instead there are now some llarp::util helper
  methods to obtain unique and/or shared locks:
    - `auto lock = util::unique_lock(mutex);` gets an RAII-but-also
      unlockable object (std::unique_lock<T>, with T inferred from
      `mutex`).
    - `auto lock = util::shared_lock(mutex);` gets an RAII shared (i.e.
      "reader") lock of the mutex.
    - `auto lock = util::unique_locks(mutex1, mutex2, mutex3);` can be
      used to atomically lock multiple mutexes at once (returning a
      tuple of the locks).
  This are templated on the mutex which makes them a bit more flexible
  than using a concrete type: they can be used for any type of lockable
  mutex, not only util::Mutex.  (Some of the code here uses them for
  getting locks around a std::mutex).  Until C++17, using the RAII types
  is painfully verbose:

  ```C++
  // pre-C++17 - needing to figure out the mutex type here is annoying:
  std::unique_lock<util::Mutex> lock(mutex);
  // pre-C++17 and even more verbose (but at least the type isn't needed):
  std::unique_lock<decltype(mutex)> lock(mutex);
  // our compromise:
  auto lock = util::unique_lock(mutex);
  // C++17:
  std::unique_lock lock(mutex);
  ```

  All of these functions will also warn (under gcc or clang) if you
  discard the return value.  You can also do fancy things like
  `auto l = util::unique_lock(mutex, std::adopt_lock)` (which lets a
  lock take over an already-locked mutex).

- metrics code is gone, which also removes a big pile of code that was
  only used by metrics:
  - llarp::util::Scheduler
  - llarp:🧵:TimerQueue
  - llarp::util::Stopwatch
5 years ago
Stephen Shelton ea97a8f2ac
Make format 5 years ago
Thomas Winget fae86281e9 make path short name look nicer 5 years ago
Thomas Winget 145efaf0bb should probably build before committing... 5 years ago
Thomas Winget 74d421ac2d PathBuildNumber -> NextPathBuildNumber because increment side-effect 5 years ago
Thomas Winget ad3465ee66 std move better 5 years ago
Thomas Winget 893ef2b874 const-y-ness and move-y-ness 5 years ago
Thomas Winget fc56a018e5 path builder prints hops, rest print short name 5 years ago
Jason Rhinelander ac1486d0be Replace absl::optional with optional-lite
Step 1 of removing abseil from lokinet.

For the most part this is a drop-in replacement, but there are also a
few changes here to the JSONRPC layer that were needed to work around
current gcc 10 dev snapshot:

- JSONRPC returns a json now instead of an optional<json>.  It doesn't
  make any sense to have a json rpc call that just closes the connection
  with returning anything.  Invoked functions can return a null (default
  constructed) result now if they don't have anything to return (such a
  null value won't be added as "result").
5 years ago
Jeff Becker e35d17764a * add path::Path::UniqueEndpointSet_t
* start using check2 for new unit tests
* unit test for path::Path::UniqueEndpointSet_t
5 years ago
Jeff Becker 7374f8f0fd
update lokinetmon 5 years ago
Jeff Becker e8b84fcfbd
add path speed metrics for lokinetmon 5 years ago