Skip to content

Commit

Permalink
Fix reading of mapped IP from list_file, fix error with clean
Browse files Browse the repository at this point in the history
  • Loading branch information
Bansod, Deven committed Nov 18, 2018
1 parent cab427d commit fddcfff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions examples/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,13 @@ def getArgParser():
'orig_ports': args.orig_ports,
}

pToD = pcap_to_ditg.pcap_to_ditg(
args.pcap_file, # Pcap file to read
args.mapper_file, # File with mapping of IPs to topology hosts
args.list_file, # File with list of IPs
options
)

if args.print_all_ips:
pToD = pcap_to_ditg.pcap_to_ditg(
args.pcap_file, # Pcap file to read
args.mapper_file, # File with mapping of IPs to topology hosts
args.list_file, # File with list of IPs
options
)
ips = pToD.getAllDistinctIPs()
print
print('\nThe list of distinct IPs appearing in \'' + args.pcap_file + '\' are:')
Expand All @@ -66,6 +65,12 @@ def getArgParser():
os.system('rm -rf *_ditg_files')
print('\nThe generated files and folders have been cleaned.')
else:
pToD = pcap_to_ditg.pcap_to_ditg(
args.pcap_file, # Pcap file to read
args.mapper_file, # File with mapping of IPs to topology hosts
args.list_file, # File with list of IPs
options
)
pToD.generateDITGFlowFiles()

print('\nThe flow scripts and the IDT files have been generated' + \
Expand Down
2 changes: 1 addition & 1 deletion pcap_to_ditg/pcap_to_ditg.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def __readPartitions(self):
endPoints = []
endPoints.append(line.split(',')[1]) # start
endPoints.append(line.split(',')[2]) # end
endPoints.append(line.split(',')[4][:-1]) # ip
endPoints.append(line.split(',')[4].strip()) # ip
Partitions[host] = endPoints
return Partitions
except Exception, e:
Expand Down

0 comments on commit fddcfff

Please sign in to comment.