Command to run to create and communicate with local network
interface. Passed to sh -c. Must speak SLIP on stdin/stdout.
The following interpolations aare substituted:
- %(local)s %(peer)s %(rnets)s %(ifname)s
+ %{local} %{peer} %{rnets} %{ifname}
on server <vaddr> <vrelay> <vnetwork> <ifname_server>
on client <client> <vaddr> <vroutes> <ifname_client>
- Plus %(mtu)s (and %% to indicate a literal %).
- ["userv root ipif %(local)s,%(peer)s,%(mtu)s,slip '%(rnets)s'"]
+ Plus %{mtu} and %% to indicate a literal %.
+ (For compatibility with older hippotat, %(var)s is supported too
+ but this is deprecated since the extra `s` is confusing.)
+ ["userv root ipif %{local},%{peer},%{mtu},slip '%{rnets}'"]
On server: applies to all clients; not looked up in
client-specific sections.
ifname_server = shippo%d
max_clock_skew = 300
-ipif = userv root ipif %(local)s,%(peer)s,%(mtu)s,slip,%(ifname)s '%(rnets)s'
+ipif = userv root ipif %{local},%{peer},%{mtu},slip,%{ifname} '%{rnets}'
mtu = 1500
.collect::<HashMap<String, String>>();
let bad = parking_lot::Mutex::new(vec![]);
*var = regex_replace_all!(
- r#"%(?:%|\((\w+)\)s|.)"#,
+ r#"%(?:%|\((\w+)\)s|\{(\w+)\}|.)"#,
&var,
- |whole, k| (|| Ok::<_,String>({
+ |whole, k1, k2| (|| Ok::<_,String>({
if whole == "%%" { "%" }
- else if k != "" {
+ else if let Some(&k) = [k1,k2].iter().find(|&&s| s != "") {
substs.get(k).ok_or_else(
|| format!("unknown key %({})s", k)
)?