aboutsummaryrefslogtreecommitdiffstats
path: root/src/config
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-31 20:53:22 +0100
committertv <tv@krebsco.de>2026-10-31 20:53:22 +0100
commit9fa1c4601f3c62555903e549e976915169602b26 (patch)
treec005ac09f07f2959f69bae56f9343f9d8ffde6b5 /src/config
parenta08c430100edfba7b924c957f98294fd79de0e1b (diff)
libp2p: add prefer option
Diffstat (limited to 'src/config')
-rw-r--r--src/config/mod.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 2dfefcf..c45f1d0 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -296,6 +296,13 @@ pub(crate) const OPTIONS: &[OptionSpec] = &[
"With the libp2p transport: address ranges libp2p leaves out, e.g. 10.244.0.0/16 and 42::/16 (VPNs): addresses there are neither published (but announced ones) nor offered for hole punching nor dialled, and connections there are refused, whoever dials.",
),
option(
+ "libp2p-prefer",
+ Kind::List,
+ "RANGE,[RANGE...]",
+ None,
+ "With the libp2p transport: address ranges that matter most, best first, e.g. the LAN's 10.23.0.0/16: of the many addresses a node listening everywhere has, those there are published first, and of a peer's, kept first and dialled with the others. Without, public addresses come first.",
+ ),
+ option(
"libp2p-relay",
Kind::Flag,
"BOOL",
@@ -507,6 +514,9 @@ pub(crate) struct Settings {
pub(crate) libp2p_ignore: Vec<String>,
#[serde(default)]
#[cfg_attr(not(feature = "libp2p"), allow(dead_code))]
+ pub(crate) libp2p_prefer: Vec<String>,
+ #[serde(default)]
+ #[cfg_attr(not(feature = "libp2p"), allow(dead_code))]
pub(crate) libp2p_public: bool,
#[cfg_attr(not(feature = "libp2p"), allow(dead_code))]
pub(crate) libp2p_key_file: Option<PathBuf>,