Exemple #1
0
                    action="store_true")
parser.add_argument(
    "-L",
    "--light",
    help="don't process RTT or throughput in detail to save time",
    action="store_true")
parser.add_argument("-U",
                    "--tcpcsm",
                    help="use tcpcsm to give more info about retransmissions",
                    action="store_true")

args = parser.parse_args()

in_dir_exp = os.path.abspath(os.path.expanduser(args.input))
# ~/graphs -> /home/mptcp/graphs_lo ; ../graphs/ -> /home/mptcp/graphs_lo
trace_dir_exp = co.get_dir_from_arg(args.trace, args.pcap[0])
graph_dir_exp = co.get_dir_from_arg(args.graph, args.pcap[0])
stat_dir_exp = co.get_dir_from_arg(args.stat, args.pcap[0])
aggl_dir_exp = co.get_dir_from_arg(args.aggl, args.pcap[0])
rtt_dir_exp = co.get_dir_from_arg(args.rtt, args.pcap[0])
rtt_subflow_dir_exp = co.get_dir_from_arg(args.rtt_subflow, args.pcap[0])
failed_conns_dir_exp = co.get_dir_from_arg(args.failed_conns, args.pcap[0])
acksize_dir_exp = co.get_dir_from_arg(args.acksize, args.pcap[0])
acksize_tcp_dir_exp = acksize_dir_exp + '_tcp'

if os.path.isdir(in_dir_exp):
    # add the basename of the input dir
    base_dir = os.path.basename(
        in_dir_exp)  # 20150215-013001_d8cac271ad6d544930b0e804383c19378ed4908c
    parent_dir = os.path.basename(
        os.path.dirname(in_dir_exp))  # TCPDump or TCPDump_bad_simulation
    parser.add_argument("-i",
                        "--input", help="input directory/file of the (possibly compressed) pcap files", default=DEF_IN_DIR)
    parser.add_argument("-t",
                        "--trace", help="temporary directory that will be used to store uncompressed "
                        + "pcap files", default=DEF_TRACE_DIR)
    parser.add_argument("-p", "--pcap",
                        help="analyze only pcap files containing the given string (default any, wlan0 and rmnet0)",
                        nargs="+", default=["_" + co.DEF_IFACE + ".", "_wlan0.", "_rmnet0."])
    parser.add_argument("-P",
                        "--ports", help="directory where the ports results will be stored", default=DEF_PORTS_DIR)

    args = parser.parse_args()

    in_dir_exp = os.path.abspath(os.path.expanduser(args.input))
    # ~/graphs -> /home/mptcp/graphs_lo ; ../graphs/ -> /home/mptcp/graphs_lo
    trace_dir_exp = co.get_dir_from_arg(args.trace, args.pcap[0])
    ports_dir_exp = co.get_dir_from_arg(args.ports, args.pcap[0])

    if os.path.isdir(in_dir_exp):
        # add the basename of the input dir
        base_dir = os.path.basename(in_dir_exp)  # 20150215-013001_d8cac271ad6d544930b0e804383c19378ed4908c
        parent_dir = os.path.basename(os.path.dirname(in_dir_exp))  # TCPDump or TCPDump_bad_simulation
        trace_dir_exp = os.path.join(trace_dir_exp, parent_dir, base_dir)
        ports_dir_exp = os.path.join(ports_dir_exp, parent_dir, base_dir)

    print_out = sys.stdout

    co.check_directory_exists(ports_dir_exp)

    class TSharkError(Exception):
        pass
parser.add_argument("-M",
                    "--is-mptcp", help="don't check on filename, always process traces as MPTCP ones", action="store_true")
parser.add_argument("-T",
                    "--is-tcp", help="don't check on filename, always process traces as TCP ones", action="store_true")
parser.add_argument("-D",
                    "--use-db", help="ask IP address of each interface to the MongoDB", action="store_true")
parser.add_argument("-L",
                    "--light", help="don't process RTT or throughput in detail to save time", action="store_true")
parser.add_argument("-U",
                    "--tcpcsm", help="use tcpcsm to give more info about retransmissions", action="store_true")

args = parser.parse_args()

in_dir_exp = os.path.abspath(os.path.expanduser(args.input))
# ~/graphs -> /home/mptcp/graphs_lo ; ../graphs/ -> /home/mptcp/graphs_lo
trace_dir_exp = co.get_dir_from_arg(args.trace, args.pcap[0])
graph_dir_exp = co.get_dir_from_arg(args.graph, args.pcap[0])
stat_dir_exp = co.get_dir_from_arg(args.stat, args.pcap[0])
aggl_dir_exp = co.get_dir_from_arg(args.aggl, args.pcap[0])
rtt_dir_exp = co.get_dir_from_arg(args.rtt, args.pcap[0])
rtt_subflow_dir_exp = co.get_dir_from_arg(args.rtt_subflow, args.pcap[0])
failed_conns_dir_exp = co.get_dir_from_arg(args.failed_conns, args.pcap[0])
acksize_dir_exp = co.get_dir_from_arg(args.acksize, args.pcap[0])
acksize_tcp_dir_exp = acksize_dir_exp + '_tcp'

if os.path.isdir(in_dir_exp):
    # add the basename of the input dir
    base_dir = os.path.basename(in_dir_exp)  # 20150215-013001_d8cac271ad6d544930b0e804383c19378ed4908c
    parent_dir = os.path.basename(os.path.dirname(in_dir_exp))  # TCPDump or TCPDump_bad_simulation
    trace_dir_exp = os.path.join(trace_dir_exp, parent_dir, base_dir)
    graph_dir_exp = os.path.join(graph_dir_exp, parent_dir, base_dir)