Beispiel #1
0
def lisp_fix_rloc_encap_state_entry(mc, parms):
    lisp_sockets, rloc, port, hostname = parms

    addr = "{}:{}".format(rloc.print_address_no_iid(), port)
    eid = lisp.green(mc.print_eid_tuple(), False)
    msg = "Changed '{}' translated address:port to {} for EID {}, {} {}". \
        format(hostname, lisp.red(addr, False), eid, "{}", "{}")

    for rloc_entry in mc.rloc_set:
        if (rloc_entry.rle):
            for rle_node in rloc_entry.rle.rle_nodes:
                if (rle_node.rloc_name != hostname): continue
                rle_node.store_translated_rloc(rloc, port)
                old_addr = rle_node.address.print_address_no_iid() + ":" + \
                    str(rle_node.translated_port)
                lisp.lprint(msg.format("RLE", old_addr))
            #endfor
        #endif

        if (rloc_entry.rloc_name != hostname): continue

        #
        # Update lisp-crypto encap array. Put keys in new dictionary array
        # location since translated address and port changed. We don't want
        # to rekey because of a NAT change.
        #
        old_addr = rloc_entry.rloc.print_address_no_iid() + ":" + \
            str(rloc_entry.translated_port)
        if (lisp.lisp_crypto_keys_by_rloc_encap.has_key(old_addr)):
            keys = lisp.lisp_crypto_keys_by_rloc_encap[old_addr]
            lisp.lisp_crypto_keys_by_rloc_encap[addr] = keys
        #endif

        #
        # Update translated information with new information.
        #
        rloc_entry.delete_from_rloc_probe_list(mc.eid, mc.group)
        rloc_entry.store_translated_rloc(rloc, port)
        rloc_entry.add_to_rloc_probe_list(mc.eid, mc.group)
        lisp.lprint(msg.format("RLOC", old_addr))

        #
        # Trigger RLOC-probe if enabled.
        #
        if (lisp.lisp_rloc_probing):
            seid = None if (mc.group.is_null()) else mc.eid
            deid = mc.eid if (mc.group.is_null()) else mc.group
            lisp.lisp_send_map_request(lisp_sockets, 0, seid, deid, rloc_entry)
        #endif
    #endfor

    #
    # Write change to external data-plane.
    #
    lisp.lisp_write_ipc_map_cache(True, mc)
    return(True, parms)
Beispiel #2
0
def II1i1IiiIIi11(mc, parms):
    iI1Ii11iII1, Oo0O0O0ooO0O, IIIIii, O0o0 = parms
    if 71 - 71: OOooOOo + ooOoO0o % i11iIiiIii + I1ii11iIi11i - IiII
    oO0OOoO0 = "{}:{}".format(Oo0O0O0ooO0O.print_address_no_iid(), IIIIii)
    I111Ii111 = lisp.green(mc.print_eid_tuple(), False)
    i111IiI1I = "Changed '{}' translated address:port to {} for EID {}, {} {}".format(
        O0o0, lisp.red(oO0OOoO0, False), I111Ii111, "{}", "{}")
    if 70 - 70: Ii1I.Oo0Ooo / o0oOOo0O0Ooo.Ii1I - O0 / IiII
    if 62 - 62: iIii1I11I1II1 * OoOoOO00
    for i1 in mc.rloc_set:
        if (i1.rle):
            for OOO in i1.rle.rle_nodes:
                if (OOO.rloc_name != O0o0): continue
                OOO.store_translated_rloc(Oo0O0O0ooO0O, IIIIii)
                Oo0oOOo = OOO.address.print_address_no_iid() + ":" + str(
                    OOO.translated_port)
                if 58 - 58: II111iiii * OOooOOo * I1ii11iIi11i / OOooOOo
                lisp.lprint(i111IiI1I.format("RLE", Oo0oOOo))
                if 75 - 75: oO0o
                if 50 - 50: Ii1I / Oo0Ooo - oO0o - I11i % iII111i - oO0o
                if 91 - 91: OoO0O00 / I11i - II111iiii.I11i
        if (i1.rloc_name != O0o0): continue
        if 18 - 18: o0oOOo0O0Ooo
        if 98 - 98: iII111i * iII111i / iII111i + I11i
        if 34 - 34: ooOoO0o
        if 15 - 15: I11i * ooOoO0o * Oo0Ooo % i11iIiiIii % OoOoOO00 - OOooOOo
        if 68 - 68: I1Ii111 % i1IIi.IiII.I1ii11iIi11i
        if 92 - 92: iII111i.I1Ii111
        Oo0oOOo = i1.rloc.print_address_no_iid() + ":" + str(
            i1.translated_port)
        if 31 - 31: I1Ii111.OoOoOO00 / O0
        if (lisp.lisp_crypto_keys_by_rloc_encap.has_key(Oo0oOOo)):
            o000O0o = lisp.lisp_crypto_keys_by_rloc_encap[Oo0oOOo]
            lisp.lisp_crypto_keys_by_rloc_encap[oO0OOoO0] = o000O0o
            if 42 - 42: OoOoOO00
            if 41 - 41: Oo0Ooo.ooOoO0o + O0 * o0oOOo0O0Ooo % Oo0Ooo * Oo0Ooo
            if 19 - 19: iII111i
            if 46 - 46: I1ii11iIi11i - Ii1I.iIii1I11I1II1 / I1ii11iIi11i
            if 7 - 7: i1IIi / I1IiiI * I1Ii111.IiII.iIii1I11I1II1
        i1.delete_from_rloc_probe_list(mc.eid, mc.group)
        i1.store_translated_rloc(Oo0O0O0ooO0O, IIIIii)
        i1.add_to_rloc_probe_list(mc.eid, mc.group)
        lisp.lprint(i111IiI1I.format("RLOC", Oo0oOOo))
        if 13 - 13: OOooOOo / i11iIiiIii
        if 2 - 2: I1IiiI / O0 / o0oOOo0O0Ooo % OoOoOO00 % Ii1I
        if 52 - 52: o0oOOo0O0Ooo
        if 95 - 95: Ii1I
        if (lisp.lisp_rloc_probing):
            O0oOO0O = None if (mc.group.is_null()) else mc.eid
            oO = mc.eid if (mc.group.is_null()) else mc.group
            lisp.lisp_send_map_request(iI1Ii11iII1, 0, O0oOO0O, oO, i1)
            if 7 - 7: o0oOOo0O0Ooo - I1IiiI
            if 100 - 100: oO0o + I11i.OOooOOo * Ii1I
            if 73 - 73: i1IIi + I1IiiI
            if 46 - 46: OoO0O00.Oo0Ooo - OoooooooOO
            if 93 - 93: iII111i
            if 10 - 10: I11i
    lisp.lisp_write_ipc_map_cache(True, mc)
    return (True, parms)
    if 82 - 82: I1ii11iIi11i - iIii1I11I1II1 / OOooOOo + Ii1I
    if 87 - 87: oO0o * I1ii11iIi11i + OOooOOo / iIii1I11I1II1 / iII111i
    if 37 - 37: iII111i - ooOoO0o * oO0o % i11iIiiIii - I1Ii111
    if 83 - 83: I11i / I1IiiI
    if 34 - 34: IiII
    if 57 - 57: oO0o.I11i.i1IIi
    if 42 - 42: I11i + I1ii11iIi11i % O0