projects
/
pingpong.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Creating a proper command line and script for signature generation.
[pingpong.git]
/
base_gexf_generator.py
diff --git
a/base_gexf_generator.py
b/base_gexf_generator.py
index
5874b21
..
ad677ec
100644
(file)
--- a/
base_gexf_generator.py
+++ b/
base_gexf_generator.py
@@
-106,7
+106,7
@@
def traverse_and_merge_nodes(G, dev_list_file):
dev_list = create_device_list(DEVICE_MAC_LIST)
# Traverse every node
# Check that the node is not a smarthome device
dev_list = create_device_list(DEVICE_MAC_LIST)
# Traverse every node
# Check that the node is not a smarthome device
- for node in
nodes
:
+ for node in
list(nodes)
:
neighbors = G[node] #G.neighbors(node)
#print "Neighbors: ", neighbors, "\n"
# Skip if the node is a smarthome device
neighbors = G[node] #G.neighbors(node)
#print "Neighbors: ", neighbors, "\n"
# Skip if the node is a smarthome device
@@
-254,7
+254,7
@@
def parse_json(file_path):
# Create an exclusion list
exc_list = create_device_list(EXCLUSION_MAC_LIST)
# First parse the file once, constructing a map that contains information about individual devices' DNS resolutions.
# Create an exclusion list
exc_list = create_device_list(EXCLUSION_MAC_LIST)
# First parse the file once, constructing a map that contains information about individual devices' DNS resolutions.
- device_dns_mappings = parser.parse_dns.parse_json_dns(file_path)
# "./json/eth1.dump.json"
+ device_dns_mappings = parser.parse_dns.parse_json_dns(file_path)
# Init empty graph
G = nx.DiGraph()
# Mapping from edge to a set of protocols
# Init empty graph
G = nx.DiGraph()
# Mapping from edge to a set of protocols
@@
-262,6
+262,7
@@
def parse_json(file_path):
# Mapping from edge to traffic volume
edge_to_vol = dict()
# Parse file again, this time constructing a graph of device<->server and device<->device communication.
# Mapping from edge to traffic volume
edge_to_vol = dict()
# Parse file again, this time constructing a graph of device<->server and device<->device communication.
+ i = 0
with open(file_path) as jf:
# Read JSON; data becomes reference to root JSON object (or in our case json array)
data = json.load(jf)
with open(file_path) as jf:
# Read JSON; data becomes reference to root JSON object (or in our case json array)
data = json.load(jf)