Commit Graph

69 Commits (b81f7025c9a619409bb1c3f39e0c56e2084fd7be)

Author SHA1 Message Date
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).
2 years ago
Jeff 1eba0f836e
replace LLARP_PROTO_VERSION macro 2 years ago
Jason Rhinelander d02558350a
Crank oxen-mq to (1.2.)11; switch to oxen-encoding
- Update oxen-mq submodule to latest stable
- Add oxen-encoding submodule
- Convert all oxenmq encoding usage to oxenc
- Modernize cmake handling of oxenmq/oxenc
2 years ago
Jason Rhinelander 52492c6253 make format 3 years ago
Jason Rhinelander 1e22417ade Add missing deprecated copy assignment operator
Clang-13 warns (and -Werror dies) without it.
3 years ago
Jeff Becker 25e338d621
srv records
* add srv records in RCs if we have any
* add mechanism to add SRV records for plainquic exposed ports
* resign and republish rc or introset on srv record changes
3 years ago
Jason Rhinelander 181953b4a6 Replace ::Hash nested structs with std::hash specializations 3 years ago
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.
3 years ago
Jeff Becker df4ea34a56
nodedb refactor
* bump zmq static dep
* lokimq -> oxenmq
* llarp_nodedb -> llarp::NodeDB
* remove all crufty api parts of NodeDB
* make NodeDB rc selection api not suck
* make path builder api not suck
* propagate all above changes so that unit tests work and it all compiles
3 years ago
Jeff 5b5bd6b44e
dns features (#1404)
* add some dns txt records for stuff we want to expose

* fix txt records

* txt records for snode info

* dont send cname as it mangles the response

* check for 3 parts not 3 characters
4 years ago
Jeff 8943be6c3a
serialize auth codes in rpc (#1369)
* serialize auth codes in rpc

* format

* format

* config and route fixups

* bump lokimq

* fix compile

* discard unknown members in service keys

* format
4 years ago
Jeff 53598ec0e9
dont serialize ephemeral members of service identity (#1370)
* prepare for keytool script

* dont serialize ephemeral members in service key file
* regnerate ephemeral members in service identity on load

* add keygen script

* use nacl for generating keys

* format
4 years ago
Thomas Winget 15229ea7ff
New RC format (#1368)
* initial work for RC SRVs.

Needs tests for new RC format.

Needs SRVs added to new RC, and associated tests.

* convert rc sign/verify test to catch2, add test for new rc

Also fixes a mistake in new rc serialization

* bump loki-mq submodule

need support for viewing bt deserialize consumer buffer so we
know how much it has consumed.

* fix some behavior errors

need to advance llarp_buffer_t after consuming data from it

only rewind and modify size of llarp_buffer_t in owning context.

* Add test for router contact (de-)serialization

Adds a test that makes a list of RouterContact with mixed
versions and ensures it serializes and deserializes correctly.
4 years ago
jeff 2aaed895f3
disable exits in RCs 4 years ago
Rick V 5529371637 RouterContact::[Read|Write] now take a fs::path const ref 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.
4 years ago
Thomas Winget c8c66f0a5f some refactoring of tooling code, added RCGossipReceivedEvent 4 years ago
Jeff Becker d2d109e92c
llarp_time_t is now using std::chrono 4 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").
4 years ago
jeff f728e6016b router version 4 years ago
Stephen Shelton a0699ad229 Undo adding of crypto version to RouterContact, other fixes 5 years ago
Stephen Shelton 0c02ea8d2e Add "keyfile version" to RouterContact 5 years ago
Michael 70937ab503
Fix docker-compose isolated network 5 years ago
Michael 094b697b01
Replace StatusObject with underlying JSON type 5 years ago
Michael 0a1620aff2
make format 5 years ago
Michael de21a2f687
Include json output 5 years ago
Michael 4763888d2c
Add fail-able docker build for gcc trunk 5 years ago
Thomas Winget baf8019fe5 Refactor Router code into more classes
This commit refactors functionality from the Router class into separate,
dedicated classes.
There are a few behavior changes that came as a result of discussion on
what the correct behavior should be.
In addition, many things Router was previously doing can now be provided
callback functions to alert the calling point when the asynchronous
action completes, successfully or otherwise.
5 years ago
Jeff Becker 16e20a9e79
try fixing bootstrap 5 years ago
Jeff Becker 58005c5f81
Merge remote-tracking branch 'origin/master' into ipv6-tun 5 years ago
Michael a2326efa37
Revert "Merge pull request #679 from tewinget/revert-config-refactor"
This reverts commit 2996a7f29c, reversing
changes made to 10df3bd4b3.
5 years ago
Thomas Winget d044d60101 Reverts #678 #677 and #669 with hashes:
10df3bd
766ece8
979f095

See those commits for further details
5 years ago
Michael b51f7d8015
Convert to load config in config loader 5 years ago
Jeff Becker 389c414ee3
add handover window to router contact updating 5 years ago
Jeff Becker 9ec41b8831
update RC expiration logic, lookup more often and remove stale entries 5 years ago
Jeff Becker cacc73db7b
add rc expiration (again) 5 years ago
Michael 491fee206b
Port code to use CryptoManager over passing Crypto pointers 5 years ago
Michael 3f53965b71
Remove all use of IBEncodeMessage 5 years ago
Michael c39c931d03
Remove IStateful virtual inheritance 5 years ago
Jeff Becker 5d3833ef1a
fix dumb as shit path building that causes premature termiantion because of duplicate hops 5 years ago
Jeff Becker 159415c363
delay dns resolution for snode until we have a session with it 5 years ago
Jeff Becker 71302ee48b
Merge remote-tracking branch 'origin/staging' into fix-libabyss-352 5 years ago
Jeff Becker f8d6becce8
make whitelist happy 5 years ago
Jeff e8fb7d34c0
Merge pull request #349 from michael-loki/printer
Create Printer - A general-purpose, stateful printer class
5 years ago
Jeff Becker 08d70e6d14
track client rcs 5 years ago
Michael e4cf1f245c
Convert most of llarp to use Printer 5 years ago
Jeff Becker 46222df421
refactor 5 years ago
Jeff Becker e1522faeaa
add introspection rpc endpoint 5 years ago
Jeff Becker e24b595191
more dht fixing, only pick the most up to date entity for reply 5 years ago