Commit 35e585dc authored by Guillaume Bury's avatar Guillaume Bury

Script starts babel

parent aa7588d7
#!/usr/bin/python -S #!/usr/bin/python -S
import os, sys import os, sys
import pdb; pdb.set_trace()
os.write(int(sys.argv[1]), 'CLIENT_CONNECTED ' + os.environ['trusted_ip'] + '\n') os.write(int(sys.argv[1]), 'CLIENT_CONNECTED ' + os.environ['trusted_ip'] + '\n')
...@@ -43,16 +43,15 @@ class PeersDB: ...@@ -43,16 +43,15 @@ class PeersDB:
self.db.execute("UPDATE peers SET used = 0 WHERE id = ?", (id,)) self.db.execute("UPDATE peers SET used = 0 WHERE id = ?", (id,))
def startBabel():
def babel(network_ip, network_mask):
args = ['babeld', args = ['babeld',
'-C', 'redistribute local ip %s/%s' % (network_ip, network_mask), '-C', 'redistribute local ip %s' % (config.ip),
'-C', 'redistribute local deny', '-C', 'redistribute local deny',
# Route VIFIB ip adresses # Route VIFIB ip adresses
'-C', 'in ip %s' % VIFIB_NET, '-C', 'in ip %s' % VIFIB_NET,
# Route only addresse in the 'local' network, # Route only addresse in the 'local' network,
# or other entire networks # or other entire networks
'-C', 'in ip %s/%s' % (network_ip,network_mask), #'-C', 'in ip %s' % (config.ip),
#'-C', 'in ip ::/0 le %s' % network_mask, #'-C', 'in ip ::/0 le %s' % network_mask,
# Don't route other addresses # Don't route other addresses
'-C', 'in ip deny', '-C', 'in ip deny',
...@@ -169,6 +168,10 @@ def main(): ...@@ -169,6 +168,10 @@ def main():
global peers_db # stop using global variables for everything ? global peers_db # stop using global variables for everything ?
peers_db = PeersDB(config.db) peers_db = PeersDB(config.db)
# Launch babel on all interfaces
log_message('Starting babel', 3)
babel = startBabel()
# Create and open read_only pipe to get connect/disconnect events from openvpn # Create and open read_only pipe to get connect/disconnect events from openvpn
log_message('Creating pipe for openvpn events', 3) log_message('Creating pipe for openvpn events', 3)
r_pipe, write_pipe = os.pipe() r_pipe, write_pipe = os.pipe()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment