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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
re6stnet
Commits
54db7632
Commit
54db7632
authored
Jul 20, 2012
by
Guillaume Bury
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
File can be passed to command line
parent
f233c4d7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
vifibnet.py
vifibnet.py
+3
-4
No files found.
vifibnet.py
View file @
54db7632
...
@@ -4,7 +4,7 @@ from argparse import ArgumentParser
...
@@ -4,7 +4,7 @@ from argparse import ArgumentParser
from
OpenSSL
import
crypto
from
OpenSSL
import
crypto
import
db
,
plib
,
upnpigd
,
utils
,
tunnel
import
db
,
plib
,
upnpigd
,
utils
,
tunnel
def
ArgParser
(
ArgumentParser
):
class
ArgParser
(
ArgumentParser
):
def
convert_arg_line_to_args
(
self
,
arg_line
):
def
convert_arg_line_to_args
(
self
,
arg_line
):
for
arg
in
(
'--'
+
arg_line
.
strip
()).
split
():
for
arg
in
(
'--'
+
arg_line
.
strip
()).
split
():
...
@@ -22,7 +22,7 @@ def ovpnArgs(optional_args, ca_path, cert_path):
...
@@ -22,7 +22,7 @@ def ovpnArgs(optional_args, ca_path, cert_path):
return
optional_args
return
optional_args
def
getConfig
():
def
getConfig
():
parser
=
argparse
.
ArgumentParser
(
parser
=
ArgParser
(
fromfile_prefix_chars
=
'@'
,
description
=
'Resilient virtual private network application'
)
description
=
'Resilient virtual private network application'
)
_
=
parser
.
add_argument
_
=
parser
.
add_argument
# Server address SHOULD be a vifib address ( else requests will be denied )
# Server address SHOULD be a vifib address ( else requests will be denied )
...
@@ -91,14 +91,13 @@ def main():
...
@@ -91,14 +91,13 @@ def main():
if
manual
:
if
manual
:
utils
.
log
(
'Manual external configuration'
,
3
)
utils
.
log
(
'Manual external configuration'
,
3
)
else
:
else
:
utils
.
log
(
'Attempting automatic configuration via UPnP'
,
3
)
utils
.
log
(
'Attempting automatic configuration via UPnP'
,
4
)
try
:
try
:
external_ip
,
external_port
=
upnpigd
.
ForwardViaUPnP
(
config
.
internal_port
)
external_ip
,
external_port
=
upnpigd
.
ForwardViaUPnP
(
config
.
internal_port
)
config
.
address
=
[[
external_ip
,
external_port
,
'udp'
],
config
.
address
=
[[
external_ip
,
external_port
,
'udp'
],
[
external_ip
,
external_port
,
'tcp-client'
]]
[
external_ip
,
external_port
,
'tcp-client'
]]
except
Exception
:
except
Exception
:
utils
.
log
(
'An atempt to forward a port via UPnP failed'
,
4
)
utils
.
log
(
'An atempt to forward a port via UPnP failed'
,
4
)
#raise RuntimeError => this shouldn't raise an error since upnp is not mandatory
peer_db
=
db
.
PeerManager
(
config
.
db
,
config
.
server
,
config
.
server_port
,
peer_db
=
db
.
PeerManager
(
config
.
db
,
config
.
server
,
config
.
server_port
,
config
.
peers_db_refresh
,
config
.
address
,
internal_ip
,
prefix
,
manual
,
200
)
config
.
peers_db_refresh
,
config
.
address
,
internal_ip
,
prefix
,
manual
,
200
)
...
...
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