Commit Graph

4774 Commits (f777075893944ea622dab21d0f3339bfb921c325)

Author SHA1 Message Date
Jeff Becker bf2488d9e8
zero copy compare 2 years ago
majestrate a8c0f76e1c
Merge pull request #1971 from majestrate/docs-and-such-2022-08-06
more docs
2 years ago
Jason Rhinelander ceed8e3238
Remove unused parameter names 2 years ago
Jeff 4c897f583c
fix up log statements
* make socket bind errors have a distinct message reported when caught using their own exception type
* omit printing banner in setup when we run from the lokinet executable (but not the liblokinet.so entry point)
2 years ago
Jeff badf72838e
move all code directory readmes into docs/project-structure.md 2 years ago
Jason Rhinelander 2b7b1fcc79 Working signed macOS GUI build 2 years ago
Jason Rhinelander 496c1d274c Stub out the peer stats sqlite_orm code
This avoids needing to build it and include it in static builds since we
aren't currently making use of it.
2 years ago
jeff b8896740de build gui and assemble app bundles into one singular app bundle 2 years ago
jeff 279b5710cc maker packet tunnel provider compile 2 years ago
Jason Rhinelander 09372994bb macOS system extension support
Adds support for building Lokinet as a system extension, and fixes
various problems in the macos implementation found during development of
the system extension support.
2 years ago
Jeff 61d7ff3787 on apple write packets back to interface when it is for us because that does not have a route spec for the interace ip on loopback as apple finds having sensible defaults bothersome internally 2 years ago
Jason Rhinelander e97752734d Fix `platform::is_apple` value 2 years ago
Jeff 4341b8c684 do not clear out entries that are valid from nodedb when we are a service node.
this logic was inverted.
2 years ago
Jeff 2d1645bfe1 fix up sid ci pipeline 2 years ago
Jeff 58052f5b17 macos ci fixes 2 years ago
majestrate 7a8331e79d
Merge pull request #1961 from majestrate/rc-expiration-reeanble-07-18-2022
re enable rc expiration
2 years ago
Jeff d0408a1c4e
remove invalid entries on loading nodedb 2 years ago
Jason Rhinelander f230a3f695
Add debug logging for RC removal 2 years ago
Jason Rhinelander a190c14889
Fix comment 2 years ago
Jeff cc2b4df676
kill log statements 2 years ago
Jeff 3337125110
re enable rc expiration 2 years ago
Jeff 23fd46c0db
add directory specific readmes 2 years ago
majestrate 769bc1e8df
Merge pull request #1962 from jagerman/dns-parsing-fixes
DNS message parsing fixes and cleanup
2 years ago
Jason Rhinelander 874221db70
Merge pull request #1965 from jagerman/fix-double-logging
Remove the initial sink before reconfiguring logging
2 years ago
Jason Rhinelander 841abffaf5
Make outbound wildcard default to inbound IP
outbound=:1234
    outbound=0.0.0.0:1234
    outbound=
    outbound=0.0.0.0

now all default to use the inbound= IP.  (If multiple inbound= IPs are
given, we raise an exception to abort startup).

Only applies to routers (since clients don't have inbound IPs), and
eliminates potential weird edge cases with local system IP and routing
shenanigans.
2 years ago
Jason Rhinelander f0590a9672
Remove the initial sink before reconfiguring logging
Without this, the original sink set up very early in daemon/lokinet.cpp
(which goes to stderr) is still around, and so we get double logging.
2 years ago
Jason Rhinelander 2be422fcc0
Reorganize [bind] comments
The general section comments contained all the descriptions for the
inbound/outbound settings, while inbound/outbound had no comment at all.
This moves the comments around to the individual settings, plus updates
some of the wording in the section.
2 years ago
Jason Rhinelander c9f492d85a
Fix [bind]inbound IP-omitted handling
We were failing when using `inbound=:1234`, rather than looking for a
default IP.  This fixes it to still use the default IP, and change only
the default port.

Outbound behaviour should remain unchanged: i.e. `outbound=:2345` means
bind-to-wildcard-IP with a specific port.
2 years ago
Jason Rhinelander 6df83b613d
Fix log level being forced to warning
This code shouldn't be here; the log level was already set to its proper
default value via the earlier FromConfig call.
2 years ago
Jeff 3a97acfb51
this code needs to detect the first non-existing interface by name, not the first existing one. this remidies this. sorry testnet for breaking you 2 years ago
Jeff 83f648fd87
reword message 2 years ago
Jason Rhinelander 9ea82edc07
DNS message parsing fixes and cleanup
Fixes:

- tighten reserved name detection to not match fooloki.loki, but instead
  only match "foo.loki.loki" and "loki.loki" (and similar for reserved
  name "snode.loki").
- IPv6 PTR parsing was completely broken.
- Added tests for the above two issues.

Cleanups:

- Eliminate llarp::dns::Name_t typedef for std::string
- Use optional return instead of bool + output param
- Use string_views; we were doing a *lot* of string substr's during
  parsing, each of which allocates a new string.
- Use fmt instead of stringstream
- Simplify IPv4 PTR parsing
2 years ago
Jeff f222aecc79
actually use correct variable in iteration 2 years ago
Jeff a7cfa3ea87
use info as default log level on clients as most users have continously been confused by lack of log output with warn level as default, which i predicted would happen 2 years ago
Jeff b819ed21d2
clean up build helper scripts:
* cleanup of android build shims
* cleanup of windows build shims
2 years ago
Jeff 68148e098f
* add mockable network functions
* add unit tests with ability to pretend to be different network setups
2 years ago
Jason Rhinelander f9371233ee
hive fmt/spdlog updates 2 years ago
Jason Rhinelander f6019210c3
oxen-logging update to handle level/type parsing exceptions 2 years ago
Jeff 8cde7c7e7a
fix win32 and android builds 2 years ago
Jason Rhinelander 86fd77733e
Add missing header to fix libc++ build 2 years ago
Jason Rhinelander 784f2938f1
Use more fmt 2 years ago
Jason Rhinelander eec8244a6c
Remote util::Printer and related cruft 2 years ago
Jason Rhinelander 2f9e182b20
Avoid ctor inheritance to make diagnostics better
Using constructor inheritance DRYs the code, but unfortunately confuses
GCC as to where the proper "required from here" location is, which makes
debugging formatting errors very difficult.  Avoid it (and update
oxen-logging to avoid it there as well).
2 years ago
Jason Rhinelander c82ade2d81
Make test code work with new logging 2 years ago
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
Jason Rhinelander 43191ec100
Add missing header
Needed for uint_least32_t.
2 years ago
majestrate a9a9593128
Merge pull request #1938 from jagerman/no-empty-compilations
Don't build empty cpp files
2 years ago
Jason Rhinelander 81f05d63c1
Move destructor back to .cpp file
Having it there (even defaulted, like this) means endpoint.hpp doesn't
have to include endpoint_state.hpp (which it otherwise would need,
because of the std::unique_ptr<EndpointState> default deleter
requirements).
2 years ago
Jason Rhinelander c37d6ea43b
Remove shadow testing framework
Bitrotten and apparently doesn't work with libuv event loop.
2 years ago
Jason Rhinelander 4a4f16e5c8
Remove dead code: netns, shell hooks
These haven't been activated in a long time and aren't worth
resuscitating.
2 years ago