-
- VatExecutor.cmd_from_template(node,
- 'lisp/del_lisp_remote_mapping.vat',
- vni=vni,
- deid=deid,
- deid_prefix=deid_prefix,
- seid=seid,
- seid_prefix=seid_prefix,
- rloc=rloc)
-class LispAdjacency(object):
+ # used only with IPs
+ is_mac = False
+
+ if not is_mac:
+ eid_type = 0 if ip_address(deid).version == 4 else 1
+ eid_packed = ip_address(deid).packed
+ seid_packed = ip_address(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(str(rloc)).version == 4 else 0,
+ addr=ip_address(str(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 = u"lisp_add_del_remote_mapping"
+ err_msg = f"Failed to delete remote mapping on host {node[u'host']}"
+
+ with PapiSocketExecutor(node) as papi_exec:
+ papi_exec.add(cmd, **args).get_reply(err_msg)
+
+class LispAdjacency: