Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
zhifan huang
re6stnet
Commits
35e585dc
Commit
35e585dc
authored
Jul 06, 2012
by
Guillaume Bury
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Script starts babel
parent
aa7588d7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
client-connect
client-connect
+1
-0
main.py
main.py
+9
-6
No files found.
client-connect
View file @
35e585dc
#!/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
'
)
main.py
View file @
35e585dc
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment