+ if not is_mac:
+ eid_type = 0 if ip_address(unicode(deid)).version == 4 else 1
+ eid_packed = ip_address(unicode(deid)).packed
+ seid_packed = ip_address(unicode(seid)).packed
+ eid_len = deid_prefix
+ seid_len = seid_prefix
+ else:
+ eid_type = 2
+ eid_packed = L2Util.mac_to_bin(deid)
+ seid_packed = L2Util.mac_to_bin(seid)
+ eid_len = 0
+ seid_len = 0
+
+ rlocs = [dict(is_ip4=1 if ip_address(unicode(rloc)).version == 4 else 0,
+ addr=ip_address(unicode(rloc)).packed)]
+
+ args = dict(is_add=0,
+ is_src_dst=1,
+ vni=int(vni),
+ eid_type=eid_type,
+ eid=eid_packed,
+ eid_len=eid_len,
+ seid=seid_packed,
+ seid_len=seid_len,
+ rloc_num=1,
+ rlocs=rlocs)
+
+ cmd = 'lisp_add_del_remote_mapping'
+ err_msg = "Failed to delete remote mapping on host {host}".format(
+ host=node['host'])
+
+ with PapiSocketExecutor(node) as papi_exec:
+ papi_exec.add(cmd, **args).get_reply(err_msg)