# Copyright (C) 2014 INRIA
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation;
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# \ nid3.log
#
+from __future__ import print_function
+
import collections
import functools
import networkx
try:
size = int((cols[6]).replace('(',''))
except:
- print "interest_expiry without face id!", line
+ print("interest_expiry without face id!", line)
continue
# If no external IP address was identified for this face
""" Adds CCN content history for each node in the topology graph.
"""
+
# Make a copy of the graph to ensure integrity
graph = graph.copy()
# Each dirpath correspond to a different node
nid = os.path.basename(dirpath)
+
+ # Cast to numeric nid if necessary
+ if int(nid) in graph.nodes():
+ nid = int(nid)
content_history = dict()
graph = annotate_cn_graph(logs_dir, graph,
parse_ping_logs = parse_ping_logs)
except:
- print "Skipping: Error parsing ccnd logs", logs_dir
+ print("Skipping: Error parsing ccnd logs", logs_dir)
raise
source = ccn_consumers(graph)[0]
interest_count,
content_count) = process_content_history(graph)
except:
- print "Skipping: Error processing ccn data", logs_dir
+ print("Skipping: Error processing ccn data", logs_dir)
raise
return (graph,