#!/usr/bin/env python3 #-*- mode: Python;-*- import sys import os import time import random import tempfile import argparse import socket import json try: import requests except: sys.stderr.write('ERROR: Could not import requests module. Ensure it is installed.\n') sys.stderr.write(' Under Debian, the package name is "python3-requests"\n.') sys.exit(1) VERSION = "{DEVELOPMENT}" if VERSION == "{DEVELOPMENT}": script_dir = '.' try: script_dir = os.path.dirname(os.path.realpath(__file__)) except: try: script_dir = os.path.dirname(os.path.abspath(sys.argv[0])) except: pass sys.path.append("%s/../lib" % script_dir) from nanownlib import * import nanownlib.storage parser = argparse.ArgumentParser( description="") parser.add_argument('db_file', default=None, help='') options = parser.parse_args() db = nanownlib.storage.db(options.db_file) start = time.time() num_probes = analyzeProbes(db) end = time.time() print("analyzed %d probes' packets in: %f" % (num_probes, end-start))