Commit Graph

13 Commits (8b321612da4e129b8eee4e02af755184d2405fe9)

Author SHA1 Message Date
Jason Rhinelander c9d928950a
C-cast to work around gross enum==int assumption in windows API 2 years ago
Jeff Becker 7f27760c97
disable lokinet-bootstrap on windows builds 2 years ago
Jeff 871c3e3281
changeset for windows port
* wintun vpn platform for windows
* bundle config snippets into nsis installer for exit node, keyfile persisting, reduced hops mode.
* use wintun for vpn platform
* isolate all windows platform specific code into their own compilation units and libraries
* split up internal libraries into more specific components
* rename liblokinet.a target to liblokinet-amalgum.a to elimiate ambiguity with liblokinet.so
* DNS platform for win32
* rename llarp/ev/ev_libuv.{c,h}pp to llarp/ev/libuv.{c,h}pp as the old name was idiotic
* split up net platform into win32 and posix specific compilation units
* rename lokinet_init.c to easter_eggs.cpp as that is what they are for and it does not need to be a c compilation target
* add cmake option STRIP_SYMBOLS for seperating out debug symbols for windows builds
* intercept dns traffic on all interfaces on windows using windivert and feed it into lokinet
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 8cde7c7e7a
fix win32 and android builds 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
Jeff 2772a32907
* fix up lokinet cli help opts
* document doxygen
2 years ago
Jeff Becker 4c5b90fb03
handle exceptions on setup and config load without aborting 3 years ago
Jeff Becker 5c457ff486
refactor logging to use std::source_location
* use std::source_location instead of godawful macros in logging
* remove unused/absolutely haram af json logstream
* fix bug in android logger where it doesn't respect eLogNone
3 years ago
Jason Rhinelander 488ed47cda Remove duplicate handling of jemalloc
We were linking/loading it in different ways, one with cmake option
`USE_JELLOC` and the other, older version `WITH_JEMALLOC`.  This removes
the latter (which was default OFF) and keeps the former (which was added
and has been default ON since 0.9.4 or so).

Also removes the `ifdef`ed JEMALLOC code in lokinet.cpp because we don't
need it; just linking to jemalloc is enough to get the malloc/free
replacements.
3 years ago
Jason Rhinelander 2ca7ef7f5f
Rename isRouter -> isSNode
The isRouter wording was quite confusing, especially in a call such as:

    router->Configure(config, opts.isRouter, nodedb)
3 years ago
Jason Rhinelander 1d6ad7284c
Fix cursed formatting 3 years ago
Jeff Becker 0c37cc7f60
lokinet-bootstrap native binary 3 years ago