Skip to content
Snippets Groups Projects
Select Git revision
  • 2454c8abb7938b768b0ac0c8eaa55f44d416dac2
  • v2018.2.x default
  • experimental
  • master
  • v2021.1.2-ffs
  • v2021.1.1-ffs
  • nrb/gluon-master-cpe510
  • v2021.1-ffs
  • v2020.2.3-ffs
  • nrbffs/fastd-remove-delay
  • v2020.2.2-ffs
  • v2020.2.1-ffs
  • v2020.2-ffs
  • v2020.2.x
  • v2020.1.3-ffs
  • v2020.1.1-ffs
  • v2020.1-ffs
  • v2019.1.2-ffs
  • v2019.1.1-ffs
  • nrb/test-radv-filter
  • v2019.1-ffs
  • nrbffs/netgear-ex6120
  • v2021.1.2-ffs0.2
  • v2021.1.2-ffs0.1
  • v2021.1.1-ffs0.4
  • v2021.1.1-ffs0.3
  • v2021.1.1-ffs0.2
  • v2021.1.1-ffs0.1
  • v2021.1-ffs0.1
  • v2020.2.3-ffs0.3
  • v2020.2.3-ffs0.2
  • v2020.2.3-ffs0.1
  • v2020.2.2-ffs0.1
  • v2020.2.1-ffs0.1
  • v2020.2-ffs0.1
  • v2020.2
  • v2020.2.x-ffs0.1
  • v2020.1.3-ffs0.1
  • v2020.1.1-ffs0.1
  • v2020.1-ffs0.1
  • v2019.1.2-ffs0.1
  • v2019.1.1-ffs0.1
42 results

fastd.pl

Blame
  • Forked from firmware / FFS Gluon
    Source project has a limited visibility.
    fastd.pl 2.09 KiB
    my $cfg = $CONFIG->{fastd_mesh_vpn};
    my $backbone = $cfg->{backbone};
    
    my $add_methods = '';
    for (@{$cfg->{methods}}) {
    	$add_methods .= "uci add_list fastd.mesh_vpn.method='$_'\n";
    }
    
    my $set_peer_limit;
    if ($backbone->{limit}) {
    	$set_peer_limit = "uci_set fastd mesh_vpn_backbone peer_limit '$backbone->{limit}'\n";
    }
    else {
    	$set_peer_limit = "uci_remove fastd mesh_vpn_backbone peer_limit\n";
    }
    
    print <<END;
    #/bin/sh
    
    . /lib/functions.sh
    . /lib/gluon/functions/sysconfig.sh
    . /lib/gluon/functions/users.sh
    
    add_user gluon-fastd 800
    
    uci_add fastd fastd mesh_vpn
    
    uci_set fastd mesh_vpn user 'gluon-fastd'
    uci_set fastd mesh_vpn syslog_level 'verbose'
    uci_set fastd mesh_vpn interface 'mesh-vpn'
    uci_set fastd mesh_vpn mode 'tap'
    uci_set fastd mesh_vpn mtu '$cfg->{mtu}'
    uci_set fastd mesh_vpn secure_handshakes '1'
    
    uci_remove fastd mesh_vpn method
    $add_methods
    
    uci_remove fastd mesh_vpn_backbone
    uci_add fastd peer_group mesh_vpn_backbone
    uci_set fastd mesh_vpn_backbone enabled '1'
    uci_set fastd mesh_vpn_backbone net 'mesh_vpn'
    $set_peer_limit
    END
    
    foreach my $name (sort keys %{$backbone->{peers}}) {
    	my $peer = $backbone->{peers}->{$name};
    	print <<EOF;
    uci_remove fastd 'mesh_vpn_backbone_peer_$name'
    uci_add fastd peer 'mesh_vpn_backbone_peer_$name'
    uci_set fastd 'mesh_vpn_backbone_peer_$name' enabled '1'
    uci_set fastd 'mesh_vpn_backbone_peer_$name' net 'mesh_vpn'
    uci_set fastd 'mesh_vpn_backbone_peer_$name' group 'mesh_vpn_backbone'
    uci_set fastd 'mesh_vpn_backbone_peer_$name' key '$peer->{key}'
    EOF
    
    	for (@{$peer->{remotes}}) {
    		print "uci add_list fastd.mesh_vpn_backbone_peer_$name.remote='$_'\n";
    	}
    }
    
    print <<'END';
    
    uci_add network interface mesh_vpn
    uci_set network mesh_vpn ifname 'mesh-vpn'
    uci_set network mesh_vpn proto 'batadv'
    uci_set network mesh_vpn mesh 'bat0'
    uci_set network mesh_vpn mesh_no_rebroadcast '1'
    
    mainaddr=$(sysconfig primary_mac)
    oIFS="$IFS"; IFS=":"; set -- $mainaddr; IFS="$oIFS"