Commit Graph

94 Commits (af6caf776a4a7a8580d96d5e72cb9e037708e3c4)

Author SHA1 Message Date
Jeff Becker 0f21eeccb0
* rework exit codepath to allow multiple exits
* rework net code for ip ranges to be cleaner
* clean up endpoint auth code
* refactor config to validate network configs before setting up endpoints
* remove buildone from path/pathbuilder.cpp so we don't spam connection attempts
4 years ago
Jeff Becker f4971a88fd
use lokimq workers instead of llarp:🧵:ThreadPool 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.
4 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.
4 years ago
Thomas Winget 84a1d7dbcc clang format....... 4 years ago
Thomas Winget c8c66f0a5f some refactoring of tooling code, added RCGossipReceivedEvent 4 years ago
Thomas Winget a9882ad475 PathRequestReceivedEvent implemented 4 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.
4 years ago
Thomas Winget 1e04decb66 can ping on lokinet running in python context! 4 years ago
Jason Rhinelander 76608b6b90 Logic simplification 4 years ago
Jason Rhinelander f1aa27e616 fix speeling mistack 4 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 4 years ago
Jeff Becker d2d109e92c
llarp_time_t is now using std::chrono 4 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
4 years ago
Stephen Shelton ea97a8f2ac
Make format 4 years ago
Thomas Winget fae86281e9 make path short name look nicer 4 years ago
Thomas Winget 74d421ac2d PathBuildNumber -> NextPathBuildNumber because increment side-effect 4 years ago
Thomas Winget 893ef2b874 const-y-ness and move-y-ness 4 years ago
Thomas Winget fc56a018e5 path builder prints hops, rest print short name 4 years ago
Jeff Becker 499e346da6
notify delivery of path builds 4 years ago
Jeff Becker 56dce90de9
add trace log level for tracking logic thread jobs 5 years ago
Thomas Winget ef1a5652ef
remove our paths from outbound queues 5 years ago
Jeff Becker 7ee026fa50
make path builds work again 5 years ago
jeff 14c9ef15ed try calling stuff in logic thread from event loop 5 years ago
Jeff Becker bcf9135da6
testnet 5 years ago
Jeff Becker 1adae338ce
Merge remote-tracking branch 'origin/master' 5 years ago
Michael edd0ec398f
Move thread stuff to subdirectory 5 years ago
Michael 4d8fe2a8a8
Move meta programming to subdirectory 5 years ago
Jeff Becker c01112e4b7
tracy lock contention testing and other fun things 5 years ago
Michael 094b697b01
Replace StatusObject with underlying JSON type 5 years ago
Michael a270fe5f33
fixup! Fix gcc trunk warnings 5 years ago
Michael f9e9227e19
Fix gcc trunk warnings 5 years ago
Jeff Becker aa0a795689
call path build fail stuff in logic thread 5 years ago
Jeff Becker 60fbeca9d4
const correctness 5 years ago
Jeff Becker db2206664a
fix crashes in testnet 5 years ago
Jeff Becker f48754c45d
make hop count and length configurable 5 years ago
Jeff Becker b9bcc2b775
make threadpool consice 5 years ago
Jeff Becker d6ec528a72
start work on seperating ips out of endpoint 5 years ago
Jeff Becker 64e9622270
start seperating tun and endpoint 5 years ago
Michael b6b400baef
Tidy up pathbuilder code 5 years ago
Michael b89689fec3
Refactor path build code 5 years ago
Jeff 674f272a46
Merge pull request #630 from majestrate/master
recent stability stuff
5 years ago
Michael 491fee206b
Port code to use CryptoManager over passing Crypto pointers 5 years ago
Jeff Becker 068fec82fb
set lifetime of paths 5 years ago
Jeff Becker 64c7ed42fc
make format 5 years ago
Jeff Becker 9c96aecf3f
move llarp::Logic to std::shared_ptr
add sequence numbers to HSD messages

begin work on network isolation code

add more docs
5 years ago
Michael dd8a93a400
Apply rule of zero to code base 5 years ago
Jeff Becker a4e90ee769
hax to make it work. 5 years ago
Jeff Becker d3a98db267
don't resize frames 5 years ago
Jeff Becker 486042511c
log hops 5 years ago