Commit Graph

36 Commits

Author SHA1 Message Date
dr7ana
46ad8d4058 Clang format include sorting + CMake
- includes are now sorted in consistent, logical order; first step in an attempt to fix the tomfoolery (no relation to Tom) brought in by include-what-you-use
- shuffled around some cmake linking to simplify dependency graph
- superfluous files removed
2023-10-24 12:11:51 -07:00
Jason Rhinelander
f4f5ab0109 "Refactor" aka delete Crypto/CryptoManager
- Get rid of CryptoManager.
- Get rid of Crypto.
- Move all the Crypto instance methods to llarp::crypto functions.
  (None of them needed to be methods at all, so this is simple).
- Move sodium/ntru initialization into static initialization.
- Add llarp::csrng, which is an available llarp::CSRNG instance which is
  a bit easier than needing to construct a `CSRNG rng{};` in various
  places.
- Various related small simplifications/cleanups.
2023-10-24 08:40:18 -07:00
dr7ana
e710cfea47 Review commit 2023-10-24 08:40:18 -07:00
dr7ana
206bd0b85e wawaweewa 2023-10-03 13:11:51 -07:00
dr7ana
d9ead7d0f6 crypto and message encoding
- libsodium calls streamlined and moved away from stupid typedefs
- buffer handling taken away from buffer_t and towards ustrings and strings
- lots of stuff deleted
- team is working well
- re-implementing message handling in proper link_manager methods
2023-09-29 10:29:05 -07:00
dr7ana
11e54f6552 More message refactoring
- routing messages and surrounding code
- shim code in place for iteration and optimization after deciding what to do with buffer, string handling, and subsequent function calls
2023-08-31 09:28:16 -07:00
Jason Rhinelander
eec8244a6c
Remote util::Printer and related cruft 2022-07-18 14:56:09 -03:00
Jason Rhinelander
b81f7025c9
Replace logging with oxen-logger
Replaces custom logging system with spdlog-based oxen logging.  This
commit mainly replaces the backend logging with the spdlog-based system,
but doesn't (yet) convert all the existing LogWarn, etc. to use the new
format-based logging.

New logging statements will look like:

    llarp::log::warning(cat, "blah: {}", val);

where `cat` should be set up in each .cpp or cluster of .cpp files, as
described in the oxen-logging README.

As part of spdlog we get fmt, which gives us nice format strings, where
are applied generously in this commit.

Making types printable now requires two steps:
- add a ToString() method
- add this specialization:

      template <>
      constexpr inline bool llarp::IsToStringFormattable<llarp::Whatever> = true;

This will then allow the type to be printed as a "{}" value in a
fmt::format string.  This is applied to all our printable types here,
and all of the `operator<<` are removed.

This commit also:
- replaces various uses of `operator<<` to ToString()
- replaces various uses of std::stringstream with either fmt::format or
  plain std::string
- Rename some to_string and toString() methods to ToString() for
  consistency (and to work with fmt)
- Replace `stringify(...)` and `make_exception` usage with fmt::format
  (and remove stringify/make_exception from util/str.hpp).
2022-07-15 22:17:59 -03:00
Jeff
1eba0f836e
replace LLARP_PROTO_VERSION macro 2022-05-28 13:18:43 -04:00
Thomas Winget
7caa87862e standardize include format and pragma once
All #ifndef guards on headers have been removed, I think,
in favor of #pragma once

Headers are now included as `#include "filename"` if the included file
resides in the same directory as the file including it, or any
subdirectory therein.  Otherwise they are included as
`#include <project/top/dir/relative/path/filename>`

The above does not include system/os headers.
2021-03-09 19:01:41 -05:00
Jason Rhinelander
3bb24580a4 make format 2020-05-20 19:48:13 -03: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
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
e6174efa21
don't derive x25519 key from ed25519 key 2020-02-03 17:21:31 -05:00
Jeff Becker
99eb7726ff
initial dht key blinding 2020-01-27 16:30:41 -05:00
Jeff Becker
8b8d636ded
make format 2019-12-22 09:16:28 -05:00
Thomas Winget
71bb0dd520 implement timers using libuv
So far only a bit of the code using timers has been modified to use
the new libuv-based timers.  Also only the non-Windows case has been
implemented.  Seems to be working though, so it's a good time to commit.
2019-12-18 13:11:13 -05:00
Jeff Becker
7f6d1ebb92
fix slow start bug 2019-12-14 13:50:52 -05:00
Jeff Becker
1a864832c8
make format 2019-11-14 10:07:40 -05:00
Thomas Winget
23a9773e1e
remove our paths from outbound queues 2019-11-07 13:23:14 -05:00
Michael
491fee206b
Port code to use CryptoManager over passing Crypto pointers 2019-05-28 20:45:08 +01:00
Michael
98e691f315
Tidy up more parts of the service/ directory 2019-04-22 22:28:10 +01:00
Michael
e4cf1f245c
Convert most of llarp to use Printer 2019-02-24 23:46:44 +00:00
Michael
f3b0af9d2f
Create CopyableBuffer type 2019-02-02 23:21:35 +00:00
Michael
2de621b0ad
Disable copy constructing llarp_buffer_t 2019-02-01 01:58:13 +00:00
Michael
79157414f3
Split crypto.hpp into 3 different files 2019-01-13 16:32:51 +00:00
Michael
e5eda0fb8f
Move lokinet unspecific components to a util/ library 2019-01-10 20:07:24 +00:00
Michael
334161c9bb
Remove data() conversions from llarp::AlignedBuffer 2019-01-02 01:03:53 +00:00
Michael
037cb87523
Convert llarp::AlignedBuffer to be backed by std::array 2018-12-20 16:16:18 +00:00
Michael
e887b4e9c7
Move service* to llarp/ 2018-12-12 02:53:01 +00:00
Jeff Becker
4411d85040
fix headers 2018-10-23 08:40:34 -04:00
Jeff Becker
c262f8b5e3
bundle relevent libsodium parts 2018-10-23 07:29:37 -04:00
Jeff Becker
e79708c1dc
hidden services sorta work 2018-08-10 17:34:11 -04:00
Jeff Becker
dbe4a35230 add sequence numbers to routing messages 2018-07-24 07:59:43 +10:00
Jeff Becker
5d5757cbec more dht stuff 2018-07-18 13:10:21 +10:00
Jeff Becker
0242e293c9 more 2018-07-16 13:32:13 +10:00