Skip to content

Instantly share code, notes, and snippets.

@notlesh
Created April 23, 2020 20:04
Show Gist options
  • Save notlesh/4d31baf8893cd37d38f0089f3d74f2a8 to your computer and use it in GitHub Desktop.
Save notlesh/4d31baf8893cd37d38f0089f3d74f2a8 to your computer and use it in GitHub Desktop.
Notes and a table attempting to describe config options related to endpoints of various flavors
There are multiple config sections which all trickle down into endpoint config options (SetOption()).
These SetOption() functions appear in multiple places (which are used to group the options enumerated
below). These are:
- ExitEndpoint::SetOption()
- TunEndpoint::SetOption()
- Endpoint::SetOption()
- EndpointState::SetOption()
The config sections that are interrelated are:
- [network]
- [dns]
- [<some-snapp>]
There is also Router::netOptions, which is a multimap of options. Various things shit into this map:
- [network] is merged into it
- [dns] is merged into it
- Router::EnsureNetConfigDefaultsSane() adds several fields if they don't exist:
- "ifname" -> llarp::FindFreeTun()
- "ifaddr" -> llarp::FindFreeRange()
- "local-dns" -> "127.0.0.1:53"
- Router::FromConfig() adds "strict-connect" from [network]'s "strict-connect" (isn't this redundant?)
After the above mods, netOptions is passed indirectly to the above-mentioned SetOption() calls, with one
exception: when adding a SNApp, it is first merged into the SNapp's config.
The following is a table of all the options I could find related to the config areas they appear in. They
are grouped by the area in the codebase (e.g. function) in which they appear. There are further notes on
options that are missing or are duplicated in one way or another.
========================================================================================================
========================================================================================================
Appears explicitly in multiple configs sections -----------------------------------------+
Does not appear explicitly in any config ------------------------------+ |
Appears in DnsConfig ------------------------+ | |
Appears in NetworkConfig --------------+ | | |
Appears in EndpointConfig (previously snapp conf) ---+ | | | |
| | | | |
[duplicated? (used in miltple places) [endpoint] [network] [dns] [missing?] [duplicated?]
ExitEndpoint::SetOption
[ ] "type" && v == "null" [ ] [ ] [ ] [x] [ ]
[ ] "exit" [ ] [x] [ ] [ ] [ ]
[x] "local-dns" [x] [ ] [ ] [ ] [ ]
[x] "upstream-dns" [x] [ ] [ ] [ ] [ ]
[x] "ifaddr" [ ] [x] [ ] [ ] [ ]
[x] "ifname" [ ] [x] [ ] [ ] [ ]
[ ] "exit-whitelist" [ ] [x] [ ] [ ] [ ]
[ ] "exit-blacklist" [ ] [x] [ ] [ ] [ ]
TunEndpoint::SetOption
[ ] "reachable" [x] [ ] [ ] [ ] [ ]
[ ] "isolate-network" && IsTrueValue(v.c_str()) [ ] [ ] [ ] [x] [ ]
[ ] "strict-connect" [ ] [x] [ ] [ ] [ ]
[ ] "exit-node" [x] [x] [ ] [ ] [x]
[x] "local-dns"
[x] "upstream-dns"
[ ] "mapaddr" [x] [ ] [ ] [ ] [ ]
[x] "ifname"
[x] "ifaddr"
Endpoint::SetOption
[x] "paths" [x] [ ] [ ] [ ] [ ]
[x] "hops" [x] [ ] [ ] [ ] [ ]
m_state->SetOption()
EndpointState
[ ] "keyfile" [x] [ ] [ ] [ ] [ ]
[ ] "tag" [x] [ ] [ ] [ ] [ ]
[ ] "prefetch-tag" [x] [ ] [ ] [ ] [ ]
[ ] "prefetch-addr" [x] [ ] [ ] [ ] [ ]
[ ] "min-latency" [x] [ ] [ ] [ ] [ ]
[x] "paths"
[x] "hops"
[ ] "bundle-rc" [x] [ ] [ ] [ ] [ ]
[ ] "blacklist-snode" [x] [ ] [ ] [ ] [ ]
[ ] "on-up" [ ] [ ] [ ] [x] [ ]
[ ] "on-down" [ ] [ ] [ ] [x] [ ]
[ ] "on-ready" [ ] [ ] [ ] [x] [ ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment