Skip to content

Instantly share code, notes, and snippets.

@shahifaqeer
Created April 18, 2014 19:38
Show Gist options
  • Save shahifaqeer/11060994 to your computer and use it in GitHub Desktop.
Save shahifaqeer/11060994 to your computer and use it in GitHub Desktop.
def process_wtf(scene, datapath, outputpath):
link = scene[-6:-4]
if link != 'no':
srcip = ip[link[0]]
if scene[-1] != '/':
scene = scene + '/'
if not os.path.exists(outputpath + scene + "processed"):
os.makedirs(outputpath + scene + "processed")
skipped = []
node = 'R'
files2 = 'tcpdump_'+node+'.pcap'
cmd4 = "tcpdump -nnlr -tt src " + srcip + " -r " + datapath + scene + files2 + " > " + outputpath + scene + "processed/wtf.log"
cmd5 = "tcptrace -f'hostaddr==" + srcip + " and s_port>12865 and c_port>12865' -tt -nrl -r " + datapath + scene + files2 + " > " + outputpath + scene + "processed/rtt.log"
ry:
#subprocess.check_output(cmd2, shell=True)
subprocess.check_output(cmd4, shell=True)
subprocess.check_output(cmd5, shell=True)
except Exception:
print "Skip "+ datapath + scene + files2
traceback.print_exc()
skipped.append(scene + files2)
return skipped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment