+ cmd = 'lisp_map_server_dump'
+ err_msg = "Failed to get LISP map server on host {host}".format(
+ host=node['host'])
+
+ with PapiSocketExecutor(node) as papi_exec:
+ details = papi_exec.add(cmd).get_details(err_msg)
+
+ data = []
+ for server in details:
+ address = 'Bad is_ipv6 flag'
+ if server["is_ipv6"] == 0:
+ address = str(IPv4Address(server["ip_address"][0:4]))
+ elif server["is_ipv6"] == 1:
+ address = str(IPv6Address(server["ip_address"]))
+ data.append({"map-server": address})
+ logger.info(data)
+ return data
+
+ @staticmethod
+ def vpp_show_lisp_petr_config(node):
+ """Get LISP PETR configuration from VPP node.
+
+ :param node: VPP node.
+ :type node: dict
+ :returns: LISP PETR configuration as python dict.
+ :rtype: dict
+ """
+
+# Note: VAT is returning ipv6 address instead of ipv4
+
+ cmd = 'show_lisp_use_petr'
+ err_msg = "Failed to get LISP petr config on host {host}".format(
+ host=node['host'])
+
+ with PapiSocketExecutor(node) as papi_exec:
+ reply = papi_exec.add(cmd).get_reply(err_msg)
+
+ data = dict()
+ data["status"] = "enabled" if reply["status"] else "disabled"
+ address = 'Bad is_ip4 flag'
+ if reply["is_ip4"] == 0:
+ address = str(IPv6Address(reply["address"]))
+ elif reply["is_ip4"] == 1:
+ address = str(IPv4Address(reply["address"][0:4]))
+ data["address"] = address
+ logger.info(data)
+ return data
+
+ @staticmethod
+ def vpp_show_lisp_rloc_config(node):
+ """Get LISP RLOC configuration from VPP node.
+
+ :param node: VPP node.
+ :type node: dict
+ :returns: LISP RLOC configuration as python dict.
+ :rtype: dict
+ """
+
+ cmd = 'show_lisp_rloc_probe_state'
+ err_msg = "Failed to get LISP rloc config on host {host}".format(
+ host=node['host'])
+
+ with PapiSocketExecutor(node) as papi_exec:
+ reply = papi_exec.add(cmd).get_reply(err_msg)
+
+ data = dict()
+ data["state"] = "enabled" if reply["is_enabled"] else "disabled"
+ logger.info(data)
+ return data
+
+ @staticmethod
+ def vpp_show_lisp_pitr(node):
+ """Get Lisp PITR feature config from VPP node.
+
+ :param node: VPP node.
+ :type node: dict
+ :returns: Lisp PITR config data.
+ :rtype: dict
+ """
+
+ cmd = 'show_lisp_pitr'
+ err_msg = "Failed to get LISP pitr on host {host}".format(
+ host=node['host'])
+
+ with PapiSocketExecutor(node) as papi_exec:
+ reply = papi_exec.add(cmd).get_reply(err_msg)
+
+ data = dict()
+ data["status"] = "enabled" if reply["status"] else "disabled"
+ return data