+ cmd = 'lisp_map_resolver_dump'
+ err_msg = "Failed to get LISP map resolver on host {host}".format(
+ host=node['host'])
+
+ with PapiSocketExecutor(node) as papi_exec:
+ details = papi_exec.add(cmd).get_details(err_msg)
+
+ data = []
+ for resolver in details:
+ address = 'Bad is_ipv6 flag'
+ if resolver["is_ipv6"] == 0:
+ address = str(IPv4Address(resolver["ip_address"][0:4]))
+ elif resolver["is_ipv6"] == 1:
+ address = str(IPv6Address(resolver["ip_address"]))
+ data.append({"map resolver": address})
+ return data
+
+ @staticmethod
+ def vpp_show_lisp_map_register(node):
+ """Get LISP Map Register from VPP node.
+
+ :param node: VPP node.
+ :type node: dict
+ :returns: LISP Map Register as python dict.
+ :rtype: dict
+ """
+
+ cmd = 'show_lisp_map_register_state'
+ err_msg = "Failed to get LISP map register state 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_map_request_mode(node):
+ """Get LISP Map Request mode from VPP node.
+
+ :param node: VPP node.
+ :type node: dict
+ :returns: LISP Map Request mode as python dict.
+ :rtype: dict
+ """
+
+ cmd = 'show_lisp_map_request_mode'
+ err_msg = "Failed to get LISP map request mode 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["map_request_mode"] = "src-dst" if reply["mode"] else "dst-only"
+ logger.info(data)
+ return data
+
+ @staticmethod
+ def vpp_show_lisp_map_server(node):
+ """Get LISP Map Server from VPP node.
+
+ :param node: VPP node.
+ :type node: dict
+ :returns: LISP Map Server as python list.
+ :rtype: list
+ """
+
+ 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