def o0(packet, source_str, sport): if 30 - 30: O0 * OoooooooOO I1iIIIi1 = lisp.lisp_control_header() if (I1iIIIi1.decode(packet) == None): lisp.lprint("Could not decode control header") return if 17 - 17: iIii1I11I1II1.OoooooooOO / I11i % II111iiii % i1IIi / i11iIiiIii if 58 - 58: Oo0Ooo.II111iiii + oO0o - i11iIiiIii / II111iiii / O0 if 85 - 85: OoOoOO00 + OOooOOo if 10 - 10: IiII / OoO0O00 + OoOoOO00 / i1IIi if 27 - 27: Ii1I oO0OO0 = lisp.lisp_address(lisp.LISP_AFI_NONE, "", 0, 0) oO0OO0.store_address(source_str) if 82 - 82: IiII - IiII + OoOoOO00 if 8 - 8: o0oOOo0O0Ooo % iII111i * oO0o % Ii1I.ooOoO0o / ooOoO0o if 81 - 81: OoO0O00 if 99 - 99: oO0o * II111iiii * I1Ii111 if 92 - 92: Oo0Ooo if 40 - 40: OoOoOO00 / IiII if (I1iIIIi1.type == lisp.LISP_ECM): OOOoO000 = (len(II1Ii1iI1i) > 0) if (lisp.lisp_is_running("lisp-ms") and OOOoO000 == False): packet = lisp.lisp_packet_ipc(packet, source_str, sport) lisp.lisp_ipc(packet, i111I, "lisp-ms") return if 57 - 57: II111iiii if 54 - 54: Oo0Ooo + oO0o + i11iIiiIii if 28 - 28: oO0o if 70 - 70: IiII if 34 - 34: I1Ii111 % IiII if (OOOoO000): lisp.lisp_process_ecm(II1iII1i, packet, oO0OO0, sport) return if 3 - 3: II111iiii / OOooOOo + IiII.ooOoO0o.OoO0O00 lisp.lprint("Map-Resolver dropping ECM, DDT or Map-Server not " + "configured") if 83 - 83: oO0o + OoooooooOO return if 22 - 22: Ii1I % iII111i * OoooooooOO - o0oOOo0O0Ooo / iIii1I11I1II1 if 86 - 86: OoooooooOO.iII111i % OoOoOO00 / I11i * iII111i / o0oOOo0O0Ooo if 64 - 64: i11iIiiIii if 38 - 38: IiII / I1IiiI - IiII.I11i if 69 - 69: OoooooooOO + I1ii11iIi11i if (I1iIIIi1.type == lisp.LISP_MAP_REFERRAL): lisp.lisp_process_map_referral(II1iII1i, packet, oO0OO0) return if 97 - 97: OOooOOo - OoO0O00 / Ii1I.i11iIiiIii % oO0o * oO0o if 1 - 1: I1IiiI % ooOoO0o if 65 - 65: I1IiiI + OoOoOO00 / OOooOOo if 83 - 83: o0oOOo0O0Ooo.iII111i - Oo0Ooo if 65 - 65: iIii1I11I1II1 / ooOoO0o.IiII - II111iiii lisp.lprint( "Map-Resolver received an unexpected LISP packet, type: {}".format( I1iIIIi1.type)) if 72 - 72: iIii1I11I1II1 / IiII % iII111i % OOooOOo - I11i % OOooOOo return if 100 - 100: Oo0Ooo + i11iIiiIii if 71 - 71: I11i / o0oOOo0O0Ooo / I1Ii111 % OOooOOo if 51 - 51: IiII * O0 / II111iiii.Ii1I % OOooOOo / I1IiiI if 9 - 9: I1IiiI % I1IiiI % II111iiii if 30 - 30: IiII + I1Ii111 - IiII.IiII - II111iiii + O0 if 86 - 86: i1IIi if 41 - 41: OoOoOO00 * I11i / OoOoOO00 % oO0o
def lisp_ms_show_site_detail_command(eid_key, group_key): eid = lisp.lisp_address(lisp.LISP_AFI_NONE, "", 0, 0) if (eid_key): if (eid_key == "[0]/0"): eid.store_iid_range(0, 0) else: eid.store_prefix(eid_key) #endif #endif group = lisp.lisp_address(lisp.LISP_AFI_NONE, "", 0, 0) if (group_key): group.store_prefix(group_key) eid_str = lisp.lisp_print_eid_tuple(eid, group) eid_str = lisp.lisp_print_cour(eid_str) # # Do longest match lookup. We do this so prefix slashes are not in URLs. # site_eid = lisp.lisp_site_eid_lookup(eid, group, True) if (site_eid == None): output = "Could not find EID {} in site cache".format(eid_str) return(output) #endif indent4 = lisp.space(4) indent8 = lisp.space(8) indent12 = lisp.space(12) yesno = lisp.green("yes", True) if site_eid.registered else \ lisp.red("no", True) output = '<font face="Sans-Serif">' sn = lisp.lisp_print_cour(site_eid.site.site_name) si = lisp.lisp_print_cour(str(site_eid.site_id)) xi = "0" if site_eid.xtr_id == 0 else lisp.lisp_hex_string(site_eid.xtr_id) xi = lisp.lisp_print_cour("0x" + xi) fr = lisp.lisp_print_elapsed(site_eid.first_registered) lr = lisp.lisp_print_elapsed(site_eid.last_registered) if (time.time() - site_eid.last_registered >= (site_eid.register_ttl / 2) and lr != "never"): lr = lisp.red(lr, True) #endif if (site_eid.last_registerer.afi == lisp.LISP_AFI_NONE): reger = "none" else: reger = site_eid.last_registerer.print_address() #endif reger = lisp.lisp_print_cour(reger) shutdown = ", " + lisp.lisp_print_cour("site is in admin-shutdown") if \ site_eid.site.shutdown else "" ams = ", accepting more specifics" if site_eid.accept_more_specifics \ else "" if (ams == "" and site_eid.dynamic): ams = ", dynamic" output += '''Site name: {}, EID-prefix: {}, registered: {}{}{} <br>'''.format(sn, eid_str, yesno, ams, shutdown) output += "{}Description: {}<br>".format(indent4, lisp.lisp_print_cour(site_eid.site.description)) output += "{}Last registerer: {}, xTR-ID: {}, site-ID: {}<br>".format( \ indent4, reger, xi, si) flags = site_eid.print_flags(False) flags = lisp.lisp_print_cour(flags) auth_type = "none" if (site_eid.registered): auth_type = "sha1" if (site_eid.auth_sha1_or_sha2) else "sha2" #endif output += ("{}First registered: {}, last registered: {}, auth-type: " + \ "{}, registration flags: {}<br>").format(indent4, lisp.lisp_print_cour(fr), lisp.lisp_print_cour(lr), lisp.lisp_print_cour(auth_type), flags) ttl = lisp.lisp_print_cour(str(site_eid.register_ttl) + " seconds") output += "{}{} registration timeout TTL: {}<br>".format( \ indent4, "Registered" if site_eid.use_register_ttl_requested else \ "Default", ttl) # # First print a policy line, if one is configured for this site-eid. # if (site_eid.policy): p = lisp.lisp_print_cour(site_eid.policy) output += "{}Apply policy: '{}'<br>".format(indent4, p) #endif # # Show proxy-reply settings. # yesno = "yes" if site_eid.force_proxy_reply else "no" yesno = lisp.lisp_print_cour(yesno) output += "{}Forcing proxy Map-Reply: {}<br>".format(indent4, yesno) if (site_eid.force_ttl != None): ttl = lisp.lisp_print_cour(str(site_eid.force_ttl) + " seconds") output += "{}Forced proxy Map-Reply TTL: {}<br>".format( \ indent4, ttl) #endif yesno = "yes" if site_eid.force_nat_proxy_reply else "no" yesno = lisp.lisp_print_cour(yesno) output += "{}Forcing proxy Map-Reply for xTRs behind NATs: {}<br>". \ format(indent4, yesno) yesno = "yes" if site_eid.pitr_proxy_reply_drop else "no" yesno = lisp.lisp_print_cour(yesno) output += "{}Send drop-action proxy Map-Reply to PITR: {}<br>".format( \ indent4, yesno) action = "not configured" if site_eid.proxy_reply_action == "" else \ site_eid.proxy_reply_action action = lisp.lisp_print_cour(action) output += "{}Proxy Map-Reply action: {}<br>".format(indent4, action) if (site_eid.force_proxy_reply and site_eid.echo_nonce_capable): yes = lisp.lisp_print_cour("yes") output += "{}RLOCs are echo-nonce capable: {}<br>".format(indent4, yes) #endif yesno = "yes" if site_eid.require_signature else "no" yesno = lisp.lisp_print_cour(yesno) output += "{}Require signatures: {}<br>".format(indent4, yesno) yesno = "yes" if site_eid.encrypt_json else "no" yesno = lisp.lisp_print_cour(yesno) output += "{}Encrypt JSON RLOC-records: {}<br>".format(indent4, yesno) # # Print configured allowed RLOC-sets, if any. # any_rloc = "any" if len(site_eid.site.allowed_rlocs) == 0 else "" if (any_rloc != ""): any_rloc = lisp.lisp_print_cour(any_rloc) output += "{}Allowed RLOC-set: {}<br>".format(indent4, any_rloc) if (any_rloc == ""): for rloc in site_eid.site.allowed_rlocs.values(): a = lisp.lisp_print_cour(rloc.rloc.print_address()) s = lisp.lisp_print_cour(rloc.print_state()) up = lisp.lisp_print_cour(str(rloc.priority)) uw = lisp.lisp_print_cour(str(rloc.weight)) mp = lisp.lisp_print_cour(str(rloc.mpriority)) mw = lisp.lisp_print_cour(str(rloc.mweight)) rn = rloc.print_rloc_name(True) if (rn != "") : rn = ", " + rn output += '''{}{}, state: {}, up/uw/mp/mw: {}/{}/{}/{}{}<br>'''. \ format(indent8, a, s, up, uw, mp, mw, rn) #endfor #endif none = "none" if len(site_eid.registered_rlocs) == 0 else "" if (none != ""): none = lisp.lisp_print_cour(none) output += "<br>Registered RLOC-set ({}): {}<br>".format("merge-semantics" \ if (site_eid.merge_register_requested) else "replacement-semantics", none) if (none == ""): for rloc in site_eid.registered_rlocs: a = lisp.lisp_print_cour(rloc.rloc.print_address()) s = lisp.lisp_print_cour(rloc.print_state()) up = lisp.lisp_print_cour(str(rloc.priority)) uw = lisp.lisp_print_cour(str(rloc.weight)) mp = lisp.lisp_print_cour(str(rloc.mpriority)) mw = lisp.lisp_print_cour(str(rloc.mweight)) rn = rloc.print_rloc_name(True) if (rn != "") : rn = ", " + rn output += '''{}{}, state: {}, up/uw/mp/mw: {}/{}/{}/{}{}<br>'''.\ format(indent4, a, s, up, uw, mp, mw, rn) if (rloc.geo): geo = lisp.lisp_print_cour(rloc.geo.print_geo_url()) output += "{}geo: {}<br>".format(indent12, geo) #endif if (rloc.elp): elp = lisp.lisp_print_cour(rloc.elp.print_elp(False)) output += "{}elp: {}<br>".format(indent12, elp) #endif if (rloc.rle): rle = lisp.lisp_print_cour(rloc.rle.print_rle(True, True)) output += "{}rle: {}<br>".format(indent12, rle) #endif if (rloc.json): json = lisp.lisp_print_cour(rloc.json.print_json(True)) output += "{}json: {}<br>".format(indent12, json) #endif #endfor #endif none = "none" if len(site_eid.individual_registrations) == 0 else "" if (none == "none"): none = lisp.lisp_print_cour(none) elif (site_eid.inconsistent_registration): none = lisp.red("inconsistent registrations", True) none = lisp.lisp_print_cour(none) #endif output += "<br>Individual registrations: {}<br>".format(none) for site_eid in site_eid.individual_registrations.values(): yesno = lisp.green("yes", True) if site_eid.registered else \ lisp.red("no", True) auth_type = "sha1" if (site_eid.auth_sha1_or_sha2) else "sha2" auth_type = lisp.lisp_print_cour(auth_type) flags = site_eid.print_flags(False) flags = lisp.lisp_print_cour(flags) a = lisp.lisp_print_cour(site_eid.last_registerer.print_address()) fr = lisp.lisp_print_elapsed(site_eid.first_registered) fr = lisp.lisp_print_cour(fr) lr = lisp.lisp_print_elapsed(site_eid.last_registered) if (time.time() - site_eid.last_registered >= (site_eid.register_ttl / 2) and lr != "never"): lr = lisp.red(lr, True) #endif lr = lisp.lisp_print_cour(lr) si = lisp.lisp_print_cour(str(site_eid.site_id)) xi = lisp.lisp_print_cour(lisp.lisp_hex_string(site_eid.xtr_id)) output += ''' {}Registerer: {}, xTR-ID: 0x{}, site-id: {}, registered: {}<br> {}First registered: {}, last registered: {}, auth-type: {}, registration flags: {}<br> '''.format(indent4, a, xi, si, yesno, indent4, fr, lr, auth_type, flags) none = "none" if len(site_eid.registered_rlocs) == 0 else "" none = lisp.lisp_print_cour(none) output += "{}Registered RLOC-set: {}<br>".format(indent4, none) for rloc in site_eid.registered_rlocs: a = lisp.lisp_print_cour(rloc.rloc.print_address()) s = lisp.lisp_print_cour(rloc.print_state()) up = lisp.lisp_print_cour(str(rloc.priority)) uw = lisp.lisp_print_cour(str(rloc.weight)) mp = lisp.lisp_print_cour(str(rloc.mpriority)) mw = lisp.lisp_print_cour(str(rloc.mweight)) rn = rloc.print_rloc_name(True) if (rn != "") : rn = ", " + rn output += '''{}{}, state: {}, up/uw/mp/mw: {}/{}/{}/{}{}<br>'''.\ format(indent8, a, s, up, uw, mp, mw, rn) if (rloc.geo): geo = lisp.lisp_print_cour(rloc.geo.print_geo_url()) output += "{}geo: {}<br>".format(indent12, geo) #endif if (rloc.elp): elp = lisp.lisp_print_cour(rloc.elp.print_elp(False)) output += "{}elp: {}<br>".format(indent12, elp) #endif if (rloc.rle): rle = lisp.lisp_print_cour(rloc.rle.print_rle(True, True)) output += "{}rle: {}<br>".format(indent12, rle) #endif if (rloc.json): json = lisp.lisp_print_cour(rloc.json.print_json(True)) output += "{}json: {}<br>".format(indent12, json) #endif #endfor output += "<br>" #endif output += "</font>" return(output)
def lisp_rtr_glean_mapping_command(kv_pair): entry = { "rloc-probe" : False } for kw in kv_pair.keys(): value = kv_pair[kw] if (kw == "instance-id"): v = value.split("-") entry["instance-id"] = [0, 0] if (len(v) == 1): entry["instance-id"][0] = int(v[0]) entry["instance-id"][1] = int(v[0]) else: entry["instance-id"][0] = int(v[0]) entry["instance-id"][1] = int(v[1]) #endif #endif if (kw == "eid-prefix"): eid = lisp.lisp_address(lisp.LISP_AFI_NONE, "", 0, 0) eid.store_prefix(value) entry["eid-prefix"] = eid #endif if (kw == "group-prefix"): geid = lisp.lisp_address(lisp.LISP_AFI_NONE, "", 0, 0) geid.store_prefix(value) entry["group-prefix"] = geid #endif if (kw == "rloc-prefix"): rloc = lisp.lisp_address(lisp.LISP_AFI_NONE, "", 0, 0) rloc.store_prefix(value) entry["rloc-prefix"] = rloc #endif if (kw == "rloc-probe"): entry["rloc-probe"] = (value == "yes") #endif #endfor # # Check if entry already exists. If so, just return. # for e in lisp.lisp_glean_mappings: if (e.has_key("eid-prefix") ^ entry.has_key("eid-prefix")): continue if (e.has_key("eid-prefix") and entry.has_key("eid-prefix")): old = e["eid-prefix"] new = entry["eid-prefix"] if (old.is_exact_match(new) == False): continue #endif if (e.has_key("group-prefix") ^ entry.has_key("group-prefix")): continue #endif if (e.has_key("group-prefix") and entry.has_key("group-prefix")): old = e["group-prefix"] new = entry["group-prefix"] if (old.is_exact_match(new) == False): continue #endif if (e.has_key("rloc-prefix") ^ entry.has_key("rloc-prefix")): continue if (e.has_key("rloc-prefix") and entry.has_key("rloc-prefix")): old = e["rloc-prefix"] new = entry["rloc-prefix"] if (old.is_exact_match(new) == False): continue #endif if (e.has_key("instance-id") ^ entry.has_key("instance-id")): continue if (e.has_key("instance-id") and entry.has_key("instance-id")): old = e["instance-id"] new = entry["instance-id"] if (old != new): continue #endif # # Found a match. Do not append existing entry to array. # return #endfor # # Add dictionary array to array. # lisp.lisp_glean_mappings.append(entry)
else: print("Invalid EID address {}".format(dest_eid)) lisp_lig_close_sockets(lisp_sockets) exit(1) #endif if (lisp.lisp_valid_address_format("address", dest_eid) == False): print("Invalid address syntax '{}'".format(dest_eid)) lisp_lig_close_sockets(lisp_sockets) exit(1) #endif # # Store just a destination address unless S->G was specified. # map_request.target_eid = lisp.lisp_address(afi, "", ml, iid) if (sg): map_request.target_eid.store_address(sg) map_request.target_group.store_address(dest_eid) target_eid_str = map_request.target_eid.print_sg(map_request.target_group) else: map_request.target_eid.store_address(dest_eid) target_eid_str = map_request.target_eid.print_address() #endif # # Fill in source-eid field. # if (source_eid == ""): map_request.source_eid.afi = lisp.LISP_AFI_NONE else:
ml = 48 else: lisp_close_all_sockets() print("Invalid EID address {}".format(dest_eid)) exit(1) #endif if (lisp.lisp_valid_address_format("address", dest_eid) == False): print("Invalid address syntax '{}'".format(dest_eid)) exit(1) #endif # # Store just a destination address unless S->G was specified. # map_request.target_eid = lisp.lisp_address(afi, "", ml, iid) if (sg): map_request.target_eid.store_address(sg) map_request.target_group.store_address(dest_eid) target_eid_str = map_request.target_eid.print_sg(map_request.target_group) else: map_request.target_eid.store_address(dest_eid) target_eid_str = map_request.target_eid.print_address() #endif # # Fill in source-eid field. # map_request.source_eid.afi = lisp.LISP_AFI_NONE if (lisp.lisp_get_local_addresses() == False):
# # This is a python fast data plane that is limited in features and process # packets in a raw manner. That is, there are no library calls and no byte # swaps done. It is designed to make the gleaning RTR data-plane with LISP # to non-LISP interworking go faster. # # Any non-fast operations returns False to allow lisp_rtr_data_plane() to # process the packet normally. # # The first byte of 'packet' is assumed to be either the first byte of the # LISP encapsulated packet (coming from an ITR) or a regular IP packet # (arriving from a non-LISP source). All other packets (like LISP control-plane # packets that can come in the form of both encapsulated or non encapsulated, # return False, for lisp_rtr_data_plane() to process. # lisp_seid_cached = lisp.lisp_address(lisp.LISP_AFI_IPV4, "", 32, 0) lisp_deid_cached = lisp.lisp_address(lisp.LISP_AFI_IPV4, "", 32, 0) def lisp_rtr_fast_data_plane(packet): global lisp_map_cache, lisp_raw_socket ts = lisp_latency_debug(None, "Fast") # # Check if UDP ports for any type of LISP packet. Strict outer headers # if LISP encapsulated packet. # iid = 0 srloc = None if (packet[9] == '\x11'): if (packet[20:22] == '\x10\xf6'): return(False)
ooOO00O00oo = 48 else: i11() print("Invalid EID address {}".format(O000oo)) exit(1) if 3 - 3: I1Ii111 - O0 / I1Ii111 % OoO0O00 / I1Ii111.I1IiiI if 50 - 50: IiII if (lisp.lisp_valid_address_format("address", O000oo) == False): print("Invalid address syntax '{}'".format(O000oo)) exit(1) if 14 - 14: I11i % OoO0O00 * I11i if 16 - 16: OoOoOO00.ooOoO0o + i11iIiiIii if 38 - 38: IiII * OOooOOo.o0oOOo0O0Ooo if 98 - 98: OoooooooOO + iII111i.OoOoOO00 if 67 - 67: i11iIiiIii - i1IIi % I1ii11iIi11i.O0 OOO0o.target_eid = lisp.lisp_address(IIi1i11111, "", ooOO00O00oo, III1ii1iII) if (ooO0o0Oo): OOO0o.target_eid.store_address(ooO0o0Oo) OOO0o.target_group.store_address(O000oo) o0oo = OOO0o.target_eid.print_sg(OOO0o.target_group) else: OOO0o.target_eid.store_address(O000oo) o0oo = OOO0o.target_eid.print_address() if 91 - 91: IiII if 15 - 15: II111iiii if 18 - 18: i11iIiiIii.i1IIi % OoooooooOO / O0 if 75 - 75: OoOoOO00 % o0oOOo0O0Ooo % o0oOOo0O0Ooo.I1Ii111 if 5 - 5: o0oOOo0O0Ooo * ooOoO0o + OoOoOO00.OOooOOo + OoOoOO00 OOO0o.source_eid.afi = lisp.LISP_AFI_NONE if 91 - 91: O0 if (lisp.lisp_get_local_addresses() == False):
def lisp_ms_scale_inject(): global lisp_inject_mode_count # # Only do it once or never. # if (lisp_inject_mode_count == 0): return count = lisp_inject_mode_count i = lisp.bold("Injecting", False) lisp.fprint("{} {} entries into mapping system for scale testing". \ format(i, count)) # # Create EID-record info. # iid = 1300 phone = 9990000000 eid = lisp.lisp_address(lisp.LISP_AFI_NAME, "ct", 0, iid) group = lisp.lisp_address(lisp.LISP_AFI_NONE, "", 0, 0) parent_site = lisp.lisp_site_eid_lookup(eid, group, False) if (parent_site == None): lisp.fprint("No site found for instance-ID {}".format(iid)) return #endif if (parent_site.accept_more_specifics == False): lisp.fprint("Site must be configured with accept-more-specifics") return #endif # # Create RLOC-record info. # rloc = lisp.lisp_rloc() gps_record = ' "phone" : "{}", "text-interval" : "10", ' + \ '"gps" : "(37.623322,-122.384974579)" ' hs_record = ' "phone" : "{}", "health-state" : "not-tested" ' # # Now loop. # ts = lisp.lisp_get_timestamp() mem = 0 for i in range(1, count + 1): site_eid = lisp.lisp_site_eid(parent_site.site) site_eid.eid = copy.deepcopy(eid) site_eid.eid.address = hmac.new(b"ct", str(phone), hashlib.sha256).hexdigest() site_eid.dynamic = True site_eid.parent_for_more_specifics = parent_site site_eid.add_cache() site_eid.inherit_from_ams_parent() parent_site.more_specific_registrations.append(site_eid) # # Add GPS and HS RLOC records for EID entry. # gr = copy.deepcopy(rloc) json_string = "{" + gps_record.format(phone) + "}" gr.json = lisp.lisp_json(site_eid.eid.address, json_string) hr = copy.deepcopy(rloc) json_string = "{" + hs_record.format(phone) + "}" hr.json = lisp.lisp_json(site_eid.eid.address, json_string) site_eid.registered_rlocs = [gr, hr] mem += sys.getsizeof(site_eid) # # Print every 100 added. # if (i % 100 == 0): lisp.fprint("Added {} site-eid entries".format(i)) #endif # # Pause after 10000. # if (i % 10000 == 0 and i != count): lisp.fprint("Sleeping for 100ms ...") time.sleep(.1) #endif phone += 1 #endfor # # Compute and print elapsed time. # ts = time.time() - ts if (ts < 60): lisp.fprint("Finished in {} secs, memory {}".format(round(ts, 3), mem)) else: ts = old_div(ts, 60) lisp.fprint("Finished in {} mins, memory {}".format(round(ts, 1), mem)) #endif lisp_inject_mode_count = 0
I1I1iIiII1 = 48 else: o000o0o00o0Oo() print("Invalid EID address {}".format(ii11iIi1I)) exit(1) if 4 - 4: ooOoO0o + O0 * OOooOOo if 55 - 55: Oo0Ooo + iIii1I11I1II1 / OoOoOO00 * oO0o - i11iIiiIii - Ii1I if (lisp.lisp_valid_address_format("address", ii11iIi1I) == False): print("Invalid address syntax '{}'".format(ii11iIi1I)) exit(1) if 25 - 25: I1ii11iIi11i if 7 - 7: i1IIi / I1IiiI * I1Ii111.IiII.iIii1I11I1II1 if 13 - 13: OOooOOo / i11iIiiIii if 2 - 2: I1IiiI / O0 / o0oOOo0O0Ooo % OoOoOO00 % Ii1I if 52 - 52: o0oOOo0O0Ooo o0.target_eid = lisp.lisp_address(i1i, "", I1I1iIiII1, i11Iiii) if (o0o00o0): o0.target_eid.store_address(o0o00o0) o0.target_group.store_address(ii11iIi1I) o0OO0oOO0O0 = o0.target_eid.print_sg(o0.target_group) else: o0.target_eid.store_address(ii11iIi1I) o0OO0oOO0O0 = o0.target_eid.print_address() if 8 - 8: oO0o if 7 - 7: o0oOOo0O0Ooo - I1IiiI if 100 - 100: oO0o + I11i.OOooOOo * Ii1I if 73 - 73: i1IIi + I1IiiI if 46 - 46: OoO0O00.Oo0Ooo - OoooooooOO o0.source_eid.afi = lisp.LISP_AFI_NONE if 93 - 93: iII111i if (lisp.lisp_get_local_addresses() == False):
def II11iI111i1(packet, source_str, sport): if 95 - 95: OoooooooOO - IiII * I1IiiI + OoOoOO00 iIi1 = lisp.lisp_control_header() if (iIi1.decode(packet) == None): lisp.lprint("Could not decode control header") return if 21 - 21: I11i if 92 - 92: i11iIiiIii / I1Ii111 - iII111i % ooOoO0o * I1Ii111 + Oo0Ooo if 11 - 11: OoooooooOO.I1Ii111 if 80 - 80: OoooooooOO - OOooOOo * Ii1I * I1ii11iIi11i / I1IiiI / OOooOOo if 13 - 13: I1Ii111 * ooOoO0o + i11iIiiIii * I1Ii111 - ooOoO0o Ii1i1i1i1I1Ii = lisp.lisp_address(lisp.LISP_AFI_NONE, "", 0, 0) Ii1i1i1i1I1Ii.store_address(source_str) if 25 - 25: II111iiii if 11 - 11: Oo0Ooo if 74 - 74: OoOoOO00 * o0oOOo0O0Ooo + OoOoOO00.OOooOOo * OoooooooOO % O0 if 85 - 85: ooOoO0o / O0 if 18 - 18: o0oOOo0O0Ooo % O0 * I1ii11iIi11i if 62 - 62: I1Ii111.IiII.OoooooooOO if (iIi1.type == lisp.LISP_ECM): i111 = (len(oo00) > 0) if (lisp.lisp_is_running("lisp-ms") and i111 == False): packet = lisp.lisp_packet_ipc(packet, source_str, sport) lisp.lisp_ipc(packet, o0oO0, "lisp-ms") return if 27 - 27: i11iIiiIii / I1ii11iIi11i if 84 - 84: Oo0Ooo if 43 - 43: oO0o - OoooooooOO if 3 - 3: O0 / iII111i if 31 - 31: OOooOOo + o0oOOo0O0Ooo.OoooooooOO if (i111): lisp.lisp_process_ecm(i1I1ii1II1iII, packet, Ii1i1i1i1I1Ii, sport) return if 89 - 89: II111iiii + i1IIi + II111iiii lisp.lprint("Map-Resolver dropping ECM, DDT or Map-Server not " + "configured") if 7 - 7: O0 % o0oOOo0O0Ooo + I1ii11iIi11i * iII111i - iII111i return if 42 - 42: OoOoOO00 * OoOoOO00 * I1Ii111.I11i if 51 - 51: OOooOOo % iIii1I11I1II1 - OoooooooOO % ooOoO0o * iIii1I11I1II1 % OoO0O00 if 99 - 99: oO0o * II111iiii * I1Ii111 if 92 - 92: Oo0Ooo if 40 - 40: OoOoOO00 / IiII if (iIi1.type == lisp.LISP_MAP_REFERRAL): lisp.lisp_process_map_referral(i1I1ii1II1iII, packet, Ii1i1i1i1I1Ii) return if 79 - 79: OoO0O00 - iIii1I11I1II1 + Ii1I - I1Ii111 if 93 - 93: II111iiii.I1IiiI - Oo0Ooo + OoOoOO00 if 61 - 61: II111iiii if 15 - 15: i11iIiiIii % I1IiiI * I11i / I1Ii111 if 90 - 90: iII111i lisp.lprint( "Map-Resolver received an unexpected LISP packet, type: {}".format( iIi1.type)) if 31 - 31: OOooOOo + O0 return if 87 - 87: ooOoO0o if 45 - 45: OoO0O00 / OoooooooOO - iII111i / Ii1I % IiII if 83 - 83: I1IiiI.iIii1I11I1II1 - IiII * i11iIiiIii if 20 - 20: i1IIi * I1Ii111 + II111iiii % o0oOOo0O0Ooo % oO0o if 13 - 13: Oo0Ooo if 60 - 60: I1ii11iIi11i * I1IiiI if 17 - 17: OOooOOo % Oo0Ooo / I1ii11iIi11i.IiII * OOooOOo - II111iiii
else: print("Invalid EID address {}".format(IIi)) Ii11Ii1I(Oo0oO0oo0oO00) exit(1) if 62 - 62: I1IiiI if 100 - 100: Ii1I - O0 % oO0o * OOooOOo + I1IiiI if (lisp.lisp_valid_address_format("address", IIi) == False): print("Invalid address syntax '{}'".format(IIi)) Ii11Ii1I(Oo0oO0oo0oO00) exit(1) if 88 - 88: OoooooooOO - OoO0O00 * O0 * OoooooooOO.OoooooooOO if 33 - 33: I1Ii111 + iII111i * oO0o / iIii1I11I1II1 - I1IiiI if 54 - 54: I1Ii111 / OOooOOo.oO0o % iII111i if 57 - 57: i11iIiiIii.I1ii11iIi11i - Ii1I - oO0o + OoOoOO00 if 63 - 63: OoOoOO00 * iII111i oO0o0.target_eid = lisp.lisp_address(iI1Ii11iIiI1, "", OO0Oooo0oOO0O, iIIiIi1iIII1) if (iIIi1i1): oO0o0.target_eid.store_address(iIIi1i1) oO0o0.target_group.store_address(IIi) oo = oO0o0.target_eid.print_sg(oO0o0.target_group) else: oO0o0.target_eid.store_address(IIi) oo = oO0o0.target_eid.print_address() if 44 - 44: oO0o / I11i / I11i if 87 - 87: Oo0Ooo.I1IiiI - II111iiii + O0 / Oo0Ooo / oO0o if 25 - 25: I1IiiI.I1IiiI - OoOoOO00 % OoOoOO00 - i11iIiiIii / I1Ii111 if 51 - 51: Oo0Ooo / OoOoOO00.OOooOOo * o0oOOo0O0Ooo + OoO0O00 * IiII if 73 - 73: OoO0O00 + OoooooooOO - O0 - Ii1I - II111iiii if (iiII1i1 == ""): oO0o0.source_eid.afi = lisp.LISP_AFI_NONE else: