dst_rloc = in_args.dst_rloc src_rloc = in_args.src_rloc src_eid = in_args.src_eid increment = in_args.increment seq_eids = generate_eids_sequential(in_args.base_eid, in_args.requests) seq_pkts_mreq = [] seq_pkts_mreg = [] seq_pkts_mrga = [] for eid in seq_eids: seq_pkts_mreq.append(generate_map_request(eid)) seq_pkts_mreg.append(generate_map_register(eid, eid, 0)) seq_pkts_mrga.append(generate_map_register(eid, eid, 1)) lisp.wrpcap("encapsulated-map-requests-sequential.pcap", seq_pkts_mreq) lisp.wrpcap("map-registers-sequential-no-auth.pcap", seq_pkts_mreg) lisp.wrpcap("map-registers-sequential-sha1-auth.pcap", seq_pkts_mrga) if in_args.random is True: rand_eids = generate_eids_random(in_args.base_eid, in_args.requests) rand_pkts_mreq = [] rand_pkts_mreg = [] rand_pkts_mrga = [] for eid in rand_eids: rand_pkts_mreq.append(generate_map_request(eid)) rand_pkts_mreg.append(generate_map_register(eid, eid, 0)) rand_pkts_mrga.append(generate_map_register(eid, eid, 1)) lisp.wrpcap("encapsulated-map-requests-random.pcap", rand_pkts_mreq)
help='Number of requests to create (default 1)') parser.add_argument('--increment', type=int, default=1, help='Increment EID requests (default 1)') parser.add_argument('--random', type=bool, default=False, help='Create random EID requests (default False)') in_args = parser.parse_args() dst_mac = in_args.dst_mac src_mac = in_args.src_mac dst_rloc = in_args.dst_rloc src_rloc = in_args.src_rloc src_eid = in_args.src_eid increment = in_args.increment seq_eids = generate_eids_sequential(in_args.base_eid, in_args.requests) seq_pkts = [] for eid in seq_eids: seq_pkts.append(generate_map_request(eid)) lisp.wrpcap("encapsulated-map-requests-sequential.pcap", seq_pkts) if in_args.random is True: rand_eids = generate_eids_random(in_args.base_eid, in_args.requests) rand_pkts = [] for eid in rand_eids: rand_pkts.append(generate_map_request(eid)) lisp.wrpcap("encapsulated-map-requests-random.pcap", rand_pkts)