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
Xiaowu Zhang
re6stnet
Commits
8d0aabf2
Commit
8d0aabf2
authored
Jul 25, 2012
by
Guillaume Bury
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Random choice among bootstrap peers
parent
938da7ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
TODO
TODO
+1
-4
registry.py
registry.py
+10
-5
No files found.
TODO
View file @
8d0aabf2
Name ideas :
URGENT =>
Name ideas :
resnet ( for Resiliable NET )
rsnet ( Resiliable Scalable NET )
To be done :
use the server as a bootstrap node -> switch peer discovery to be done
by vifibnet directly ?
Use an algorithm to choose which connections to keep and/or establish
instead of pure randomness
number of routes / tunnel
...
...
registry.py
View file @
8d0aabf2
...
...
@@ -53,9 +53,9 @@ class main(object):
help
=
'Path to certificate key'
)
_
(
'--mailhost'
,
required
=
True
,
help
=
'SMTP server mail host'
)
_
(
'--bootstrap'
,
required
=
True
,
nargs
=
4
,
help
=
'''VPN prefix, ip address, port and protocol to send as
bootstrap peer'''
)
_
(
'--bootstrap'
,
nargs
=
4
,
action
=
"append"
,
help
=
'''VPN prefix, ip address, port and protocol to send as
bootstrap peer
s, instead of random ones
'''
)
self
.
config
=
parser
.
parse_args
()
# Database initializing
...
...
@@ -181,8 +181,13 @@ class main(object):
# TODO: Insert a flag column for bootstrap ready servers in peers
# ( servers which shouldn't go down or change ip and port as opposed to servers owned by particulars )
# that way, we also ascertain that the server sent is not the new node....
prefix
=
self
.
config
.
bootstrap
[
0
]
address
=
','
.
join
(
self
.
config
.
bootstrap
[
1
:])
if
self
.
config
.
bootstrap
:
bootpeer
=
random
.
choice
(
self
.
config
.
bootstrap
)
prefix
=
bootpeer
[
0
]
address
=
','
.
join
(
bootpeer
[
1
:])
else
:
prefix
,
address
=
self
.
db
.
execute
(
"""SELECT prefix, address
FROM peers ORDER BY random() LIMIT 1"""
)
print
"Sending bootstrap peer (%s, %s)"
%
(
prefix
,
str
(
address
))
return
prefix
,
address
...
...
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