def lisp_ddt_root_command(kv_pair): global lisp_ddt_roots # # Create instance to store in ddt-roots list. # ddt_root = lisp.lisp_ddt_root() # # Create instance to store in the referral cache. # referral = lisp.lisp_referral() # # Get command input. # for kw in kv_pair.keys(): if (kw == "address"): addr_str = kv_pair[kw] ddt_root.root_address.store_address(addr_str) #endif if (kw == "public-key"): value = kv_pair[kw] ddt_root.public_key = value #endif if (kw == "priority"): value = kv_pair[kw] ddt_root.priority = value #endif if (kw == "weight"): value = kv_pair[kw] ddt_root.weight = value #endif #endfor # # Add new instance to ddt-roots list. # lisp_ddt_roots[addr_str] = ddt_root # # Now take all roots configured so far and make the referral nodes for # EID-prefix [*]. Store new referral instance in the referral-cache. # Prepend (and not sort) since we want the [*] entry to be first. # for ddt_root in lisp_ddt_roots.values(): referral_node = lisp.lisp_referral_node() referral_node.referral_address = ddt_root.root_address referral_node.priority = ddt_root.priority referral_node.weight = ddt_root.weight addr_str = referral_node.referral_address.print_address() referral.referral_set[addr_str] = referral_node #endfor referral.eid.afi = lisp.LISP_AFI_ULTIMATE_ROOT # # Add to referral-cache. # referral.add_cache() return
def OoooooOoo(kv_pair): global II1Ii1iI1i if 70 - 70: OoO0O00.OoO0O00 - OoO0O00 / I1ii11iIi11i * OOooOOo if 86 - 86: i11iIiiIii + Ii1I + ooOoO0o * I11i + o0oOOo0O0Ooo if 61 - 61: OoO0O00 / i11iIiiIii if 34 - 34: OoooooooOO + iIii1I11I1II1 + i11iIiiIii - I1ii11iIi11i + i11iIiiIii ooOoo0O = lisp.lisp_ddt_root() if 76 - 76: O0 / o0oOOo0O0Ooo.I1IiiI * Ii1I - OOooOOo if 76 - 76: i11iIiiIii / iIii1I11I1II1.I1ii11iIi11i % OOooOOo / OoooooooOO % oO0o if 75 - 75: iII111i if 97 - 97: i11iIiiIii II1i1Ii11Ii11 = lisp.lisp_referral() if 35 - 35: o0oOOo0O0Ooo + iII111i + iII111i if 11 - 11: iII111i - OoO0O00 % ooOoO0o % iII111i / OoOoOO00 - OoO0O00 if 74 - 74: iII111i * O0 if 89 - 89: oO0o + Oo0Ooo for Ii1IOo0o0 in kv_pair.keys(): if (Ii1IOo0o0 == "address"): III1ii1iII = kv_pair[Ii1IOo0o0] ooOoo0O.root_address.store_address(III1ii1iII) if 54 - 54: I1IiiI % II111iiii % II111iiii if (Ii1IOo0o0 == "public-key"): iI1 = kv_pair[Ii1IOo0o0] ooOoo0O.public_key = iI1 if 19 - 19: I11i + ooOoO0o if (Ii1IOo0o0 == "priority"): iI1 = kv_pair[Ii1IOo0o0] ooOoo0O.priority = iI1 if 53 - 53: OoooooooOO.i1IIi if (Ii1IOo0o0 == "weight"): iI1 = kv_pair[Ii1IOo0o0] ooOoo0O.weight = iI1 if 18 - 18: o0oOOo0O0Ooo if 28 - 28: OOooOOo - IiII.IiII + OoOoOO00 - OoooooooOO + O0 if 95 - 95: OoO0O00 % oO0o.O0 if 15 - 15: ooOoO0o / Ii1I.Ii1I - i1IIi if 53 - 53: IiII + I1IiiI * oO0o if 61 - 61: i1IIi * OOooOOo / OoooooooOO.i11iIiiIii.OoOoOO00 II1Ii1iI1i[III1ii1iII] = ooOoo0O if 60 - 60: I11i / I11i if 46 - 46: Ii1I * OOooOOo - OoO0O00 * oO0o - I1Ii111 if 83 - 83: OoooooooOO if 31 - 31: II111iiii - OOooOOo.I1Ii111 % OoOoOO00 - O0 if 4 - 4: II111iiii / ooOoO0o.iII111i if 58 - 58: OOooOOo * i11iIiiIii / OoOoOO00 % I1Ii111 - I1ii11iIi11i / oO0o for ooOoo0O in II1Ii1iI1i.values(): ii11i1 = lisp.lisp_referral_node() ii11i1.referral_address = ooOoo0O.root_address ii11i1.priority = ooOoo0O.priority ii11i1.weight = ooOoo0O.weight III1ii1iII = ii11i1.referral_address.print_address() II1i1Ii11Ii11.referral_set[III1ii1iII] = ii11i1 if 29 - 29: I1ii11iIi11i % I1IiiI + ooOoO0o / o0oOOo0O0Ooo + OOooOOo * o0oOOo0O0Ooo II1i1Ii11Ii11.eid.afi = lisp.LISP_AFI_ULTIMATE_ROOT if 42 - 42: Ii1I + oO0o if 76 - 76: I1Ii111 - OoO0O00 if 70 - 70: ooOoO0o if 61 - 61: I1ii11iIi11i.I1ii11iIi11i II1i1Ii11Ii11.add_cache() return if 10 - 10: OoOoOO00 * iII111i.I11i + II111iiii - ooOoO0o * i1IIi if 56 - 56: o0oOOo0O0Ooo * IiII * II111iiii if 80 - 80: o0oOOo0O0Ooo * II111iiii % II111iiii if 59 - 59: iIii1I11I1II1 + I1IiiI - o0oOOo0O0Ooo - I1IiiI + OOooOOo / I1ii11iIi11i if 24 - 24: I11i.iII111i % OOooOOo + ooOoO0o % OoOoOO00 if 4 - 4: IiII - OoO0O00 * OoOoOO00 - I11i if 41 - 41: OoOoOO00.I1IiiI * oO0o % IiII
def Oo000o(kv_pair): if 7 - 7: ooOoO0o * OoO0O00 % oO0o.IiII Ii1iIiII1ii1 = [] if (lispconfig.lisp_clause_syntax_error(kv_pair, "eid-prefix", "prefix")): return for ooOooo000oOO in range(len(kv_pair["eid-prefix"])): II1i1Ii11Ii11 = lisp.lisp_referral() Ii1iIiII1ii1.append(II1i1Ii11Ii11) if 59 - 59: II111iiii + OoooooooOO * OoOoOO00 + i1IIi if 58 - 58: II111iiii * OOooOOo * I1ii11iIi11i / OOooOOo oO0o0OOOO = [] if (lispconfig.lisp_clause_syntax_error(kv_pair, "address", "referral")): return for ooOooo000oOO in range(len(kv_pair["address"])): O0O0OoOO0 = lisp.lisp_referral_node() oO0o0OOOO.append(O0O0OoOO0) if 10 - 10: OoooooooOO % iIii1I11I1II1 if 54 - 54: I1Ii111 - II111iiii % OoOoOO00 % I11i % iIii1I11I1II1 + ooOoO0o for Ii1IOo0o0 in kv_pair.keys(): iI1 = kv_pair[Ii1IOo0o0] if (Ii1IOo0o0 == "instance-id"): for ooOooo000oOO in range(len(Ii1iIiII1ii1)): II1i1Ii11Ii11 = Ii1iIiII1ii1[ooOooo000oOO] I1111I1iII11 = iI1[ooOooo000oOO] if (I1111I1iII11 == ""): I1111I1iII11 = "0" II1i1Ii11Ii11.eid.instance_id = int(I1111I1iII11) II1i1Ii11Ii11.group.instance_id = int(I1111I1iII11) if 59 - 59: iIii1I11I1II1 * i11iIiiIii / I1ii11iIi11i * i1IIi * O0 if 83 - 83: OoO0O00 / I1Ii111.OoOoOO00 / IiII.OoOoOO00.OOooOOo if (Ii1IOo0o0 == "eid-prefix"): for ooOooo000oOO in range(len(Ii1iIiII1ii1)): II1i1Ii11Ii11 = Ii1iIiII1ii1[ooOooo000oOO] I1111I1iII11 = iI1[ooOooo000oOO] if (I1111I1iII11 != ""): II1i1Ii11Ii11.eid.store_prefix(I1111I1iII11) if 75 - 75: I11i + OoO0O00.OoOoOO00.ooOoO0o + Oo0Ooo.OoO0O00 if 96 - 96: OOooOOo.ooOoO0o - Oo0Ooo + iIii1I11I1II1 / OoOoOO00 * OOooOOo if (Ii1IOo0o0 == "group-prefix"): for ooOooo000oOO in range(len(Ii1iIiII1ii1)): II1i1Ii11Ii11 = Ii1iIiII1ii1[ooOooo000oOO] I1111I1iII11 = iI1[ooOooo000oOO] if (I1111I1iII11 != ""): II1i1Ii11Ii11.group.store_prefix(I1111I1iII11) if 65 - 65: Ii1I.iIii1I11I1II1 / O0 - Ii1I if 21 - 21: I1IiiI * iIii1I11I1II1 if 91 - 91: IiII if (Ii1IOo0o0 == "priority"): for ooOooo000oOO in range(len(oO0o0OOOO)): O0O0OoOO0 = oO0o0OOOO[ooOooo000oOO] I1111I1iII11 = iI1[ooOooo000oOO] if (I1111I1iII11 == ""): I1111I1iII11 = "0" O0O0OoOO0.priority = int(I1111I1iII11) if 15 - 15: II111iiii if 18 - 18: i11iIiiIii.i1IIi % OoooooooOO / O0 if (Ii1IOo0o0 == "weight"): for ooOooo000oOO in range(len(oO0o0OOOO)): O0O0OoOO0 = oO0o0OOOO[ooOooo000oOO] I1111I1iII11 = iI1[ooOooo000oOO] if (I1111I1iII11 == ""): I1111I1iII11 = "0" O0O0OoOO0.weight = int(I1111I1iII11) if 75 - 75: OoOoOO00 % o0oOOo0O0Ooo % o0oOOo0O0Ooo.I1Ii111 if 5 - 5: o0oOOo0O0Ooo * ooOoO0o + OoOoOO00.OOooOOo + OoOoOO00 if (Ii1IOo0o0 == "address"): for ooOooo000oOO in range(len(oO0o0OOOO)): O0O0OoOO0 = oO0o0OOOO[ooOooo000oOO] I1111I1iII11 = iI1[ooOooo000oOO] if (I1111I1iII11 != ""): O0O0OoOO0.referral_address.store_address(I1111I1iII11) if 91 - 91: O0 if 61 - 61: II111iiii if 64 - 64: ooOoO0o / OoOoOO00 - O0 - I11i if 86 - 86: I11i % OoOoOO00 / I1IiiI / OoOoOO00 if 42 - 42: OoO0O00 if 67 - 67: I1Ii111.iII111i.O0 if 10 - 10: I1ii11iIi11i % I1ii11iIi11i - iIii1I11I1II1 / OOooOOo + Ii1I for II1i1Ii11Ii11 in Ii1iIiII1ii1: for O0O0OoOO0 in oO0o0OOOO: III1ii1iII = O0O0OoOO0.referral_address.print_address() II1i1Ii11Ii11.referral_set[III1ii1iII] = O0O0OoOO0 if 87 - 87: oO0o * I1ii11iIi11i + OOooOOo / iIii1I11I1II1 / iII111i II1i1Ii11Ii11.add_cache() if 37 - 37: iII111i - ooOoO0o * oO0o % i11iIiiIii - I1Ii111 return if 83 - 83: I11i / I1IiiI if 34 - 34: IiII if 57 - 57: oO0o.I11i.i1IIi if 42 - 42: I11i + I1ii11iIi11i % O0 if 6 - 6: oO0o if 68 - 68: OoOoOO00 - OoO0O00 if 28 - 28: OoO0O00.OOooOOo / OOooOOo + Oo0Ooo.I1ii11iIi11i
def lisp_referral_cache_command(kv_pair): prefix_set = [] for i in range(len(kv_pair["eid-prefix"])): referral = lisp.lisp_referral() prefix_set.append(referral) #endfor referral_set = [] if (kv_pair.has_key("address")): for i in range(len(kv_pair["address"])): ref_node = lisp.lisp_referral_node() referral_set.append(ref_node) #endfor #endif for kw in kv_pair.keys(): value = kv_pair[kw] if (kw == "instance-id"): for i in range(len(prefix_set)): referral = prefix_set[i] v = value[i] if (v == ""): v = "0" referral.eid.instance_id = int(v) referral.group.instance_id = int(v) #endfor #endif if (kw == "eid-prefix"): for i in range(len(prefix_set)): referral = prefix_set[i] v = value[i] if (v != ""): referral.eid.store_prefix(v) #endfor #endif if (kw == "group-prefix"): for i in range(len(prefix_set)): referral = prefix_set[i] v = value[i] if (v != ""): referral.group.store_prefix(v) #endfor #endif if (kw == "priority"): for i in range(len(referral_set)): ref_node = referral_set[i] v = value[i] if (v == ""): v = "0" ref_node.priority = int(v) #endfor #endif if (kw == "weight"): for i in range(len(referral_set)): ref_node = referral_set[i] v = value[i] if (v == ""): v = "0" ref_node.weight = int(v) #endfor #endif if (kw == "address"): for i in range(len(referral_set)): ref_node = referral_set[i] v = value[i] if (v != ""): ref_node.referral_address.store_address(v) #endfor #endif #endfor # # Store in map-cache data structures. # for referral in prefix_set: for ref_node in referral_set: addr_str = ref_node.referral_address.print_address() referral.referral_set[addr_str] = ref_node #endfor referral.add_cache() #endfor return
def oOOOO(kv_pair): global oo00 if 45 - 45: I1Ii111 + Ii1I if 17 - 17: o0oOOo0O0Ooo if 64 - 64: Ii1I % i1IIi % OoooooooOO if 3 - 3: iII111i + O0 I1Ii = lisp.lisp_ddt_root() if 66 - 66: Ii1I if 78 - 78: OoO0O00 if 18 - 18: O0 - iII111i / iII111i + ooOoO0o % ooOoO0o - IiII if 62 - 62: iII111i - IiII - OoOoOO00 % i1IIi / oO0o OoooooOoo = lisp.lisp_referral() if 70 - 70: OoO0O00.OoO0O00 - OoO0O00 / I1ii11iIi11i * OOooOOo if 86 - 86: i11iIiiIii + Ii1I + ooOoO0o * I11i + o0oOOo0O0Ooo if 61 - 61: OoO0O00 / i11iIiiIii if 34 - 34: OoooooooOO + iIii1I11I1II1 + i11iIiiIii - I1ii11iIi11i + i11iIiiIii for ooOoo0O in list(kv_pair.keys()): if (ooOoo0O == "address"): OooO0 = kv_pair[ooOoo0O] I1Ii.root_address.store_address(OooO0) if 35 - 35: OOooOOo % I1Ii111 % i11iIiiIii / OoooooooOO if (ooOoo0O == "public-key"): Ii11iI1i = kv_pair[ooOoo0O] I1Ii.public_key = Ii11iI1i if 82 - 82: i11iIiiIii.OOooOOo / Oo0Ooo * O0 % oO0o % iIii1I11I1II1 if (ooOoo0O == "priority"): Ii11iI1i = kv_pair[ooOoo0O] I1Ii.priority = Ii11iI1i if 78 - 78: iIii1I11I1II1 - Ii1I * OoO0O00 + o0oOOo0O0Ooo + iII111i + iII111i if (ooOoo0O == "weight"): Ii11iI1i = kv_pair[ooOoo0O] I1Ii.weight = Ii11iI1i if 11 - 11: iII111i - OoO0O00 % ooOoO0o % iII111i / OoOoOO00 - OoO0O00 if 74 - 74: iII111i * O0 if 89 - 89: oO0o + Oo0Ooo if 3 - 3: i1IIi / I1IiiI % I11i * i11iIiiIii / O0 * I11i if 49 - 49: oO0o % Ii1I + i1IIi.I1IiiI % I1ii11iIi11i if 48 - 48: I11i + I11i / II111iiii / iIii1I11I1II1 oo00[OooO0] = I1Ii if 20 - 20: o0oOOo0O0Ooo if 77 - 77: OoOoOO00 / I11i if 98 - 98: iIii1I11I1II1 / i1IIi / i11iIiiIii / o0oOOo0O0Ooo if 28 - 28: OOooOOo - IiII.IiII + OoOoOO00 - OoooooooOO + O0 if 95 - 95: OoO0O00 % oO0o.O0 if 15 - 15: ooOoO0o / Ii1I.Ii1I - i1IIi for I1Ii in list(oo00.values()): o00oOO0 = lisp.lisp_referral_node() o00oOO0.referral_address = I1Ii.root_address o00oOO0.priority = I1Ii.priority o00oOO0.weight = I1Ii.weight OooO0 = o00oOO0.referral_address.print_address() OoooooOoo.referral_set[OooO0] = o00oOO0 if 95 - 95: OOooOOo / OoooooooOO OoooooOoo.eid.afi = lisp.LISP_AFI_ULTIMATE_ROOT if 18 - 18: i11iIiiIii if 46 - 46: i1IIi / I11i % OOooOOo + I1Ii111 if 79 - 79: I1Ii111 - o0oOOo0O0Ooo + I1Ii111 - iII111i if 8 - 8: I1IiiI OoooooOoo.add_cache() return if 75 - 75: iIii1I11I1II1 / OOooOOo % o0oOOo0O0Ooo * OoOoOO00 if 9 - 9: OoO0O00 if 33 - 33: ooOoO0o.iII111i if 58 - 58: OOooOOo * i11iIiiIii / OoOoOO00 % I1Ii111 - I1ii11iIi11i / oO0o if 50 - 50: I1IiiI if 34 - 34: I1IiiI * II111iiii % iII111i * OoOoOO00 - I1IiiI if 33 - 33: o0oOOo0O0Ooo + OOooOOo * OoO0O00 - Oo0Ooo / oO0o % Ii1I
def II1i1IiiIIi11(kv_pair): if 47 - 47: iII111i Ii11iII1 = [] if (lispconfig.lisp_clause_syntax_error(kv_pair, "eid-prefix", "prefix")): return for Oo0O0O0ooO0O in range(len(kv_pair["eid-prefix"])): OoooooOoo = lisp.lisp_referral() Ii11iII1.append(OoooooOoo) if 15 - 15: I1ii11iIi11i + OoOoOO00 - OoooooooOO / OOooOOo if 58 - 58: i11iIiiIii % I11i OO00Oo = [] if (lispconfig.lisp_clause_syntax_error(kv_pair, "address", "referral")): return for Oo0O0O0ooO0O in range(len(kv_pair["address"])): O0OOO0OOoO0O = lisp.lisp_referral_node() OO00Oo.append(O0OOO0OOoO0O) if 70 - 70: IiII * Oo0Ooo * I11i / Ii1I if 88 - 88: O0 for ooOoo0O in list(kv_pair.keys()): Ii11iI1i = kv_pair[ooOoo0O] if (ooOoo0O == "instance-id"): for Oo0O0O0ooO0O in range(len(Ii11iII1)): OoooooOoo = Ii11iII1[Oo0O0O0ooO0O] O0OoO0O00o0oO = Ii11iI1i[Oo0O0O0ooO0O] if (O0OoO0O00o0oO == ""): O0OoO0O00o0oO = "0" OoooooOoo.eid.instance_id = int(O0OoO0O00o0oO) OoooooOoo.group.instance_id = int(O0OoO0O00o0oO) if 15 - 15: Ii1I - O0 / oO0o * i1IIi if 92 - 92: OoOoOO00 if (ooOoo0O == "eid-prefix"): for Oo0O0O0ooO0O in range(len(Ii11iII1)): OoooooOoo = Ii11iII1[Oo0O0O0ooO0O] O0OoO0O00o0oO = Ii11iI1i[Oo0O0O0ooO0O] if (O0OoO0O00o0oO != ""): OoooooOoo.eid.store_prefix(O0OoO0O00o0oO) if 26 - 26: iII111i.I1Ii111 if 68 - 68: OoO0O00 if (ooOoo0O == "group-prefix"): for Oo0O0O0ooO0O in range(len(Ii11iII1)): OoooooOoo = Ii11iII1[Oo0O0O0ooO0O] O0OoO0O00o0oO = Ii11iI1i[Oo0O0O0ooO0O] if (O0OoO0O00o0oO != ""): OoooooOoo.group.store_prefix(O0OoO0O00o0oO) if 35 - 35: OoO0O00 - iII111i / Oo0Ooo / OoOoOO00 if 24 - 24: ooOoO0o - ooOoO0o / II111iiii - I1ii11iIi11i if 69 - 69: oO0o.I1Ii111 + Ii1I / Oo0Ooo - oO0o if (ooOoo0O == "priority"): for Oo0O0O0ooO0O in range(len(OO00Oo)): O0OOO0OOoO0O = OO00Oo[Oo0O0O0ooO0O] O0OoO0O00o0oO = Ii11iI1i[Oo0O0O0ooO0O] if (O0OoO0O00o0oO == ""): O0OoO0O00o0oO = "0" O0OOO0OOoO0O.priority = int(O0OoO0O00o0oO) if 63 - 63: OOooOOo % oO0o * oO0o * OoO0O00 / I1ii11iIi11i if 74 - 74: II111iiii if (ooOoo0O == "weight"): for Oo0O0O0ooO0O in range(len(OO00Oo)): O0OOO0OOoO0O = OO00Oo[Oo0O0O0ooO0O] O0OoO0O00o0oO = Ii11iI1i[Oo0O0O0ooO0O] if (O0OoO0O00o0oO == ""): O0OoO0O00o0oO = "0" O0OOO0OOoO0O.weight = int(O0OoO0O00o0oO) if 75 - 75: o0oOOo0O0Ooo.ooOoO0o if 54 - 54: II111iiii % OoOoOO00 % I11i % iIii1I11I1II1 + iIii1I11I1II1 * ooOoO0o if (ooOoo0O == "address"): for Oo0O0O0ooO0O in range(len(OO00Oo)): O0OOO0OOoO0O = OO00Oo[Oo0O0O0ooO0O] O0OoO0O00o0oO = Ii11iI1i[Oo0O0O0ooO0O] if (O0OoO0O00o0oO != ""): O0OOO0OOoO0O.referral_address.store_address(O0OoO0O00o0oO) if 87 - 87: ooOoO0o * Oo0Ooo % i11iIiiIii % OoOoOO00 - OOooOOo if 68 - 68: I1Ii111 % i1IIi.IiII.I1ii11iIi11i if 92 - 92: iII111i.I1Ii111 if 31 - 31: I1Ii111.OoOoOO00 / O0 if 89 - 89: OoOoOO00 if 68 - 68: OoO0O00 * OoooooooOO % O0 + OoO0O00 + ooOoO0o if 4 - 4: ooOoO0o + O0 * OOooOOo for OoooooOoo in Ii11iII1: for O0OOO0OOoO0O in OO00Oo: OooO0 = O0OOO0OOoO0O.referral_address.print_address() OoooooOoo.referral_set[OooO0] = O0OOO0OOoO0O if 55 - 55: Oo0Ooo + iIii1I11I1II1 / OoOoOO00 * oO0o - i11iIiiIii - Ii1I OoooooOoo.add_cache() if 25 - 25: I1ii11iIi11i return 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 if 95 - 95: Ii1I if 87 - 87: ooOoO0o + OoOoOO00.OOooOOo + OoOoOO00 if 91 - 91: O0