+ # Exclude devices in the exclusion list
+ if eth_src in exc_list:
+ print "[ WARNING: Source ", eth_src, " is excluded from graph! ]"
+ continue
+ if eth_dst in exc_list:
+ print "[ WARNING: Destination ", eth_dst, " is excluded from graph! ]"
+ continue
+
+ # Fetch timestamp of packet (router's timestamp)
+ timestamp = Decimal(layers[JSON_KEY_FRAME][JSON_KEY_FRAME_TIME_EPOCH])
+ # Get the protocol and strip just the name of it
+ long_protocol = layers[JSON_KEY_FRAME][JSON_KEY_FRAME_PROTOCOLS]
+ # Split once starting from the end of the string and get it
+ protocol = long_protocol.rsplit(':', 1)[1]
+ print "timestamp: ", timestamp, "\n"
+
+ # Store protocol into the set (source)
+ src_protocols = None
+ dst_protocols = None
+ if eth_src not in node2prot:
+ node2prot[eth_src] = set()
+ src_protocols = node2prot[eth_src]
+ src_protocols.add(protocol)
+ src_protocols_str = ', '.join(src_protocols)
+ print "source protocols: ", src_protocols_str, "\n"
+ # Store protocol into the set (destination)
+ if eth_dst not in node2prot:
+ node2prot[eth_dst] = set()
+ dst_protocols = node2prot[eth_dst]
+ dst_protocols.add(protocol)
+ dst_protocols_str = ', '.join(dst_protocols)
+ print "destination protocols: ", dst_protocols_str, "\n"