cols = line.split(',') if len(cols) >= 2: a = int(cols[0].strip()) b = int(cols[1].strip()) noMercy.add((a,b)) noMercy.add((b,a)) return noMercy alltrace = at.readTraceJSON(MES_TRACE_FILE) valid_id = read_pdid(PROBE_ID_VALID_FILE) pbAct = alltrace.keys() pbVal = list(set(valid_id) & set(pbAct)) clean_trace = {k: alltrace[k] for k in pbVal} ipDictCY = pt.loadIPDict(DIC_IP_2_ASN) ipDictMG = pt.loadIPDict(DIC_IP_2_ASN_MERG) pbASN = read_pbMeta(PROBE_META_FILE) noMercy = readNoMercy(PAIR_NO_MERCY) countLoopCY = 0 countLoopMG = 0 pathCountTotal = 0 pathEq = 0 pathNq = 0 localASNMiss = 0 localMissAS = set() localFL = 0 looppath = {} pathNqdist = [] diffAS = set()
import atlasTools as at import pathTools as pt from globalConfig import * import os cymruDict = pt.loadIPDict(DIC_IP_2_ASN) arinDict = pt.loadIPDict(DIC_IP_2_ASN_ARIN) EqcYaY = 0 NqcYaY = 0 cYaN = 0 cNaY = 0 cNaN = 0 diffIP = [] for ip in cymruDict: asnCY = cymruDict[ip]['asn'] asnAR = arinDict[ip]['asn'] if asnCY >0 and asnAR > 0: if asnCY == asnAR: EqcYaY += 1 else: NqcYaY += 1 diffIP.append(ip) elif asnCY == -2 and asnAR == -2: cNaN += 1 elif asnCY == -2: cNaY += 1 cymruDict[ip]['asn'] = asnAR cymruDict[ip]['as_name'] = arinDict[ip]['as_name']