+ if not is_mac:
+ eid_type = 0 if ip_address(unicode(deid)).version == 4 else 1
+ reid = ip_address(unicode(deid)).packed
+ leid = ip_address(unicode(seid)).packed
+ reid_len = deid_prefix
+ leid_len = seid_prefix
+ else:
+ eid_type = 2
+ reid = L2Util.mac_to_bin(deid)
+ leid = L2Util.mac_to_bin(seid)
+ reid_len = 0
+ leid_len = 0
+
+ args = dict(is_add=1,
+ vni=int(vni),
+ eid_type=eid_type,
+ reid=reid,
+ reid_len=reid_len,
+ leid=leid,
+ leid_len=leid_len)
+
+ cmd = 'lisp_add_del_adjacency'
+ err_msg = "Failed to add lisp adjacency on host {host}".format(
+ host=node['host'])
+
+ with PapiSocketExecutor(node) as papi_exec:
+ papi_exec.add(cmd, **args).get_reply(err_msg)
+
+ @staticmethod
+ def vpp_del_lisp_adjacency(node, vni, deid, deid_prefix, seid,
+ seid_prefix):
+ """Delete lisp adjacency on the VPP node in topology.
+
+ :param node: VPP node.
+ :param vni: Vni.
+ :param deid: Destination eid address.
+ :param deid_prefix: Destination eid address prefix_len.
+ :param seid: Source eid address.
+ :param seid_prefix: Source eid address prefix_len.
+ :type node: dict
+ :type vni: int
+ :type deid: str
+ :type deid_prefix: int
+ :type seid: str
+ :type seid_prefix: int
+ """
+
+ # used only with IPs
+ is_mac = False
+
+ if not is_mac:
+ eid_type = 0 if ip_address(unicode(deid)).version == 4 else 1
+ reid = ip_address(unicode(deid)).packed
+ leid = ip_address(unicode(seid)).packed
+ reid_len = deid_prefix
+ leid_len = seid_prefix
+ else:
+ eid_type = 2
+ reid = L2Util.mac_to_bin(deid)
+ leid = L2Util.mac_to_bin(seid)
+ reid_len = 0
+ leid_len = 0
+
+ args = dict(is_add=0,
+ vni=int(vni),
+ eid_type=eid_type,
+ reid=reid,
+ reid_len=reid_len,
+ leid=leid,
+ leid_len=leid_len)
+
+ cmd = 'lisp_add_del_adjacency'
+ err_msg = "Failed to delete lisp adjacency on host {host}".format(
+ host=node['host'])
+
+ with PapiSocketExecutor(node) as papi_exec:
+ papi_exec.add(cmd, **args).get_reply(err_msg)
+
+class LispGpeStatus(object):
+ """Clas for LISP GPE status manipulation."""