Commit Graph

255 Commits

Author SHA1 Message Date
Jeff
60f4d96ba5
proper route poking (#1330)
* route poking:

* remove popen() call, replace with reading /proc/net/route for getting default route
* dynamically poke and unpoke routes on runtime

* swap intros and fix rpc endpoint for version to return what the ui expects

* use std::string::find_first_not_of instead of using a lambda
2020-09-01 17:22:22 -04:00
jeff
b6d63968c4
* correct unit tests for exit context so they pass
* when providing an ip address for inbound links dont throw if they are valid
2020-08-24 20:19:52 -04:00
Stephen Shelton
b2a72dd46a
Initial test_peer_stats hive test 2020-07-02 10:16:19 -06:00
Stephen Shelton
cb8e5354f5
Add some breadcrumbs about how ILinkLayer's callbacks are used 2020-07-02 10:13:26 -06:00
Stephen Shelton
54017652d6
log-- 2020-07-02 10:13:24 -06:00
Stephen Shelton
d897099e1d
Track traffic peerstats 2020-07-02 10:13:24 -06:00
Jeff Becker
f4971a88fd
use lokimq workers instead of llarp:🧵:ThreadPool 2020-07-02 11:07:34 -04:00
Stephen Shelton
91a2af0eda
Sanity checks around shared_from_this() 2020-06-01 14:56:58 -06:00
Jeff Becker
3eb006f78c
iwp/libuv cleanup: remove llarp_pkt_list and all users of it as it's broke 2020-05-23 16:07:19 -04:00
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().
2020-05-20 19:18:28 -03:00
Stephen Shelton
aee96e53a3
Refactor Addr -> IpAddress/SockAddr 2020-05-06 14:38:44 -06:00
Jeff Becker
f1edca9fa1
additional cleanup of cruft 2020-05-04 14:39:14 -04:00
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.
2020-05-01 17:43:27 -03:00
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.
2020-04-07 12:38:56 -06:00
Jeff Becker
7ba30eec25
squash commits 2020-03-11 16:55:12 -04:00
Jeff Becker
d2d109e92c
llarp_time_t is now using std::chrono 2020-02-24 15:25:03 -05:00
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).
2020-02-21 23:39:11 -04:00
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
2020-02-21 23:22:47 -04:00
Jeff Becker
9efd796145
initial wack at 0.7.0 dht fixes 2020-01-27 11:54:51 -05:00
Jeff Becker
8b8d636ded
make format 2019-12-22 09:16:28 -05:00
Thomas Winget
55b44cfc13 fix derp nested function call and derp merge error 2019-12-18 13:35:01 -05:00
Thomas Winget
50118c3127 Change ILinkLayer::ScheduleTick to use new timer 2019-12-18 13:11:25 -05:00
Stephen Shelton
68a604070b
Merge pull request #945 from notlesh/key_manager_cleanup
Key manager cleanup (post 0.6-rc1)
2019-12-06 12:54:40 -07:00
Stephen Shelton
11410a2748 Avoid trivial getters/setters in KeyManager 2019-12-06 10:31:19 -07:00
Stephen Shelton
66a058a2af Make format 2019-12-06 10:13:09 -07:00
Jeff Becker
32da9e0817
reduce window 2019-12-05 14:58:24 -05:00
Jeff Becker
9be4092a2a
more close changes 2019-12-05 11:31:58 -05:00
Jeff Becker
3410f25fd0
close links lazy 2019-12-05 11:12:26 -05:00
Jeff Becker
87eab87b7f
only close outbound links 2019-12-05 11:05:10 -05:00
Jeff Becker
98d7116ffb
fix typo 2019-12-05 10:11:20 -05:00
Jeff Becker
39ab82ed8c
close sessions to non essential nodes 2019-12-05 09:54:44 -05:00
Jeff
27b1e36039
Merge pull request #936 from majestrate/dev
last changes before 0.6.0 version bump
2019-12-03 15:58:22 -05:00
Stephen Shelton
93b8832026
Merge branch 'dev' into private-keys-backup-support 2019-12-03 11:20:45 -07:00
Stephen Shelton
521ef9b5bb Handle link transport key in KeyManager 2019-12-03 10:58:53 -07:00
Jeff Becker
01b24c7090
limit connections 2019-12-03 12:49:29 -05:00
Jeff Becker
f5ede2d875 ammend previous commit 2019-11-29 19:11:14 -04:00
Jeff Becker
3489753d5a remove jenky call to logic thread in link server 2019-11-29 19:11:14 -04:00
Jeff Becker
1a06da9c3d reduce calls in link pump 2019-11-29 19:11:14 -04:00
Jeff Becker
56dce90de9
add trace log level for tracking logic thread jobs 2019-11-22 16:23:19 -05:00
Stephen Shelton
ef2670dfb4 Drop new inbound IWP sessions when the first packet can't be handled 2019-11-19 09:24:29 -07:00
Jeff Becker
0d89f1170b
make it compile 2019-11-04 13:53:53 -05:00
Jeff Becker
c9f26c4911
call Router::PumpLL after every batch of packets from a link session 2019-11-04 13:49:08 -05:00
jeff
c59487014a fix #865 by not using logic if it is null in udp_tick 2019-10-16 10:10:11 -04:00
jeff
3c1d5518d8 fix windows port and make it compile 2019-10-02 09:06:14 -04:00
jeff
14c9ef15ed try calling stuff in logic thread from event loop 2019-09-16 06:21:12 -04:00
jeff
ac2a2aed1d gut libutp and finish making things compile and pass tests 2019-09-12 14:19:25 -04:00
Jeff Becker
d04762ab49
unstaged changed 2019-09-12 10:34:27 -04:00
Jeff Becker
e3bb59707e
more 2019-09-05 17:28:50 -04:00
Jeff Becker
3c0245f8b3
Merge remote-tracking branch 'github/master' into iwp-multi-ack 2019-09-05 13:40:04 -04:00
Jeff Becker
4bf6882c8a
more async cryptography 2019-09-05 13:39:09 -04:00