Commit Graph

28 Commits

Author SHA1 Message Date
dr7ana
0e451db77f Compilation fixes
- almost all errors have been commented out for refactor or already refactored
- committing this prior to sorting out the cmake structure
- upcoming include-what-you-use application
2023-10-24 08:40:18 -07:00
dr7ana
206bd0b85e wawaweewa 2023-10-03 13:11:51 -07: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 Becker
108b8e089e
HandleTimeout can touch iterators so do all handling of lookup timeouts outside of loop iteration 2021-06-08 14:36:32 -04:00
Jeff Becker
a94c100e7b
improve log messages about expiring convotags 2021-06-08 14:36:30 -04:00
Jeff Becker
8dd1358cc6
* tweak introset handover timeouts
* introset path haodver tweaks
* improve warn/error messages to convey more information
* dont block on queue insertion
* reset convotag on decrypt/verify fail
* add multiple ready hooks on outbound context
* lookup introsets from close routers on dht
* continue to tick dead sessions so they expire their paths
* introset spacing
* reduce lns lookup diversity requirement for speed
* add a function to send reset convotag message
* only have 1 outbound context at a time
2021-06-08 14:36:30 -04:00
Jeff Becker
4889b8cddf
fix up client to snode codepath 2021-04-19 07:02:45 -04:00
Jeff Becker
7098f46d60
rpc endpoint for triggering quic tunnel 2021-04-19 06:58:37 -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
Jeff
21930cf667
LNS (#1342)
* initial relay side lns

* fix typo

* add reserved names and refactor test for dns

* lns name decryption

* all wired up (allegedly)

* refact to use service::EncryptedName for LNS responses to include nonce with ciphertext

* fully rwemove tag_lookup_job

* replace lns cache with DecayingHashTable

* check for lns name validity against the following rules:

* not localhost.loki, loki.loki, or snode.loki

* if it contains no dash then max 32 characters long, not including the .loki tld (and also assuming a leading subdomain has been stripped)

* These are from general DNS requirements, and also enforced in
registrations:

* Must be all [A-Za-z0-9-]. (A-Z will be lower-cased by the RPC call).

* cannot start or end with a -

* max 63 characters long if it does contain a dash

* cannot contain -- in the third and fourth characters unless it starts with xn--

* handle timeout in name lookup job by calling the right handler with std::nullopt
2020-09-17 15:18:08 -04: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
79746e3719
remote lookup limiting of 500ms per address 2020-03-02 12:02:21 -05:00
Jeff Becker
ce335dc47d
remove convotags on dead outbound context 2020-02-27 11:54:54 -05:00
jeff
32ed821763 Merge remote-tracking branch 'upstream/dev' into multithreaded-cryptography 2019-10-01 10:51:28 -04:00
jeff
f9fb40f590 final touches 2019-09-20 12:56:19 -04:00
jeff
7c691cf334 handover should be fixed now 2019-09-19 16:28:12 -04:00
jeff
6c2ebbb925 try fixing handover and add snapp traffic to multithreaded crypto workers 2019-09-19 10:41:31 -04:00
Michael
1aec0dfa2b
Move logging to subdirectory 2019-09-03 20:52:27 +01:00
Michael
e52492911d
Refactor endpoint state management to a new class 2019-07-15 10:15:51 +01:00
Jeff Becker
d6ec528a72
start work on seperating ips out of endpoint 2019-07-01 10:56:56 -04:00
Jeff Becker
a323003824
differentiate between inbound and outbound convos 2019-06-14 08:49:45 -04:00
Michael
1744ae7686
Tidy up service endpoint a bit more 2019-05-07 09:29:47 +01:00
Jeff Becker
b02a3715df
call hook on timeout 2019-05-05 10:42:13 -04:00
Jeff Becker
fc3db98e66
change log priority 2019-05-05 10:15:48 -04:00
Jeff
59e6a4bc3d make snode work again probably 2019-04-30 17:36:27 -04:00
Jeff Becker
cde4fcc00a
queue pending traffic 2019-04-30 12:49:34 -04:00
Jeff Becker
0b68d3db5d
move stuff arround so that flushing queues are done in the correct event loops
TODO: locking
2019-04-30 11:09:42 -04:00
Michael
725ee293c1
Refactor well named functionality in service::Endpoint into new struct 2019-04-30 02:06:31 +01:00