Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GNS3_unikernel_testbed
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NGUYEN Do Duc Anh
GNS3_unikernel_testbed
Commits
131ebca7
Commit
131ebca7
authored
8 months ago
by
NGUYEN Do Duc Anh
Browse files
Options
Downloads
Patches
Plain Diff
add passing node id
parent
6d629d07
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ubuntu_base/opportunistic_node.py
+1
-1
1 addition, 1 deletion
ubuntu_base/opportunistic_node.py
ubuntu_base/vc_node.py
+2
-2
2 additions, 2 deletions
ubuntu_base/vc_node.py
with
3 additions
and
3 deletions
ubuntu_base/opportunistic_node.py
+
1
−
1
View file @
131ebca7
...
@@ -10,7 +10,7 @@ MARK_TO_INTERFACE = {}
...
@@ -10,7 +10,7 @@ MARK_TO_INTERFACE = {}
for
index
in
range
(
MIN_INTER_NUMBER
,
MAX_INTER_NUMBER
):
for
index
in
range
(
MIN_INTER_NUMBER
,
MAX_INTER_NUMBER
):
MARK_TO_INTERFACE
[
index
]
=
name_interface
+
str
(
index
)
MARK_TO_INTERFACE
[
index
]
=
name_interface
+
str
(
index
)
my_id
=
1
my_id
=
int
(
sys
.
argv
[
1
])
def
process_packet
(
new_packet
):
def
process_packet
(
new_packet
):
...
...
This diff is collapsed.
Click to expand it.
ubuntu_base/vc_node.py
+
2
−
2
View file @
131ebca7
...
@@ -2,8 +2,8 @@ import socket, struct, threading
...
@@ -2,8 +2,8 @@ import socket, struct, threading
import
math
,
queue
import
math
,
queue
import
time
import
time
from
scapy.all
import
sendp
,
sniff
,
Raw
,
get_if_hwaddr
from
scapy.all
import
sendp
,
sniff
,
Raw
,
get_if_hwaddr
import
subprocess
,
netifaces
,
sys
from
scapy.layers.l2
import
Ether
from
scapy.layers.l2
import
Ether
import
subprocess
,
netifaces
,
sys
# Configuration
# Configuration
LISTEN_PORT
=
12346
# Specify the port number to listen on
LISTEN_PORT
=
12346
# Specify the port number to listen on
...
@@ -239,7 +239,7 @@ def proceed_simple_VC():
...
@@ -239,7 +239,7 @@ def proceed_simple_VC():
if
node
.
state
==
State
.
DECIDED_IN_VC
:
if
node
.
state
==
State
.
DECIDED_IN_VC
:
subprocess
.
Popen
([
sys
.
executable
,
'
/home/node/Desktop/gns3_unikernel_testbed/ubuntu_base/opportunistic_monitor.py
'
])
subprocess
.
Popen
([
sys
.
executable
,
'
/home/node/Desktop/gns3_unikernel_testbed/ubuntu_base/opportunistic_monitor.py
'
])
elif
node
.
state
==
State
.
DECIDED_NOT_VC
:
elif
node
.
state
==
State
.
DECIDED_NOT_VC
:
subprocess
.
Popen
([
sys
.
executable
,
'
/home/node/Desktop/gns3_unikernel_testbed/ubuntu_base/opportunistic_node.py
'
])
subprocess
.
Popen
([
sys
.
executable
,
'
/home/node/Desktop/gns3_unikernel_testbed/ubuntu_base/opportunistic_node.py
'
,
str
(
node
.
myid
)
])
else
:
else
:
print
(
"
Error I cannot decide!!
"
)
print
(
"
Error I cannot decide!!
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment