Commit Graph

38 Commits (7caa87862ee8eaf3c93609d1f7d31bada3517361)

Author SHA1 Message Date
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 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
4 years ago
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().
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
Stephen Shelton 9be8050854
Make format 4 years ago
Stephen Shelton 886a981997
Consolidate introset publishing constants 4 years ago
Stephen Shelton bbee45118e
Remove redundant lookup logic from relays 4 years ago
Stephen Shelton 63c3106db2
Make format 4 years ago
Stephen Shelton 66cb30fa58
Refactor: remove recursionDepth from DHT lookups 4 years ago
Stephen Shelton 45a36fcfee
Rework FindIntro logic per redundant strategy 4 years ago
Stephen Shelton 9dfcfbc3ac Bencode/decode relayOrder in lexigraphical order, make it uint64_t 4 years ago
Stephen Shelton 127e7ef31b Make format 4 years ago
Stephen Shelton 6ca2c11e59 Serialize / deserialize relayOrder @ FindIntroMessage 4 years ago
Stephen Shelton 906803e387 Refactor DHT introset lookups to use redundant lookup strategy 4 years ago
Jeff Becker 00260555bd
logic simplification 4 years ago
Jeff Becker e4a16dfdd5
fix comment 4 years ago
Jeff Becker b211450cc8
always recurse to second closest if we don't have it 4 years ago
Jeff Becker 19d91a440f
move declaration of peer 4 years ago
Jeff Becker 3bea7327cb
handle end case by telling requester that it's not there 4 years ago
Jeff Becker 7e1a6236be
if relayed try closer router if we don't have an intro 4 years ago
Jeff Becker 99eb7726ff
initial dht key blinding 4 years ago
Jeff Becker 626b2a6196
return true 4 years ago
Jeff Becker e87b754906
fix recursion depth on introset lookup 4 years ago
Jeff Becker 2c0dc12f39
refactor single char variables in DHT (mostly) 4 years ago
Jeff Becker 49f696de9c
connect to closer nodes for introset lookups 4 years ago
Jeff Becker 3b66cf6e75
dht fixes, disable iterative lookups on clients, revert "fixes" from 0.6.3, pass in recursion depth from introset lookup 4 years ago
Stephen Shelton 66a058a2af Make format 5 years ago
Stephen Shelton db56e17c23 Rename bencode function for clarity 5 years ago
Michael 16cdfbd5f0
clang-tidy modernize pass 5 years ago
Michael 488695047f
Remove redundant else blocks 5 years ago
Jeff Becker d423ee02d2
use shared_ptr 5 years ago
Michael 13a9f65520
Fully define interface for dht::Context 5 years ago
Ryan Tharp 4bf4faa956 make format 5 years ago
Michael 2de621b0ad
Disable copy constructing llarp_buffer_t 5 years ago
Michael 03d56c1591
Add test suites for dht bucket, kademlia and key 5 years ago
Michael 7296ebcbe8
Tidy dht code 5 years ago
Michael 4257b62e88
Add .cpp files for all .hpp files 6 years ago