+ with PapiSocketExecutor(node) as papi_exec:
+ reply = papi_exec.add(cmd).get_reply(err_msg)
+
+ data = dict()
+ data[u"state"] = u"enabled" if reply[u"is_enabled"] else u"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 = u"show_lisp_map_request_mode"
+ err_msg = f"Failed to get LISP map request mode on host {node[u'host']}"
+
+ with PapiSocketExecutor(node) as papi_exec:
+ reply = papi_exec.add(cmd).get_reply(err_msg)
+
+ data = dict()
+ data[u"map_request_mode"] = u"src-dst" if reply[u"mode"] \
+ else u"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 = u"lisp_map_server_dump"
+ err_msg = f"Failed to get LISP map server on host {node[u'host']}"
+
+ with PapiSocketExecutor(node) as papi_exec:
+ details = papi_exec.add(cmd).get_details(err_msg)
+
+ data = list()
+ for server in details:
+ address = u"Bad is_ipv6 flag"
+ if server[u"is_ipv6"] == 0:
+ address = str(IPv4Address(server[u"ip_address"][0:4]))
+ elif server[u"is_ipv6"] == 1:
+ address = str(IPv6Address(server[u"ip_address"]))
+ data.append({u"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 = u"show_lisp_use_petr"
+ err_msg = f"Failed to get LISP petr config on host {node[u'host']}"
+
+ with PapiSocketExecutor(node) as papi_exec:
+ reply = papi_exec.add(cmd).get_reply(err_msg)
+
+ data = dict()
+ data[u"status"] = u"enabled" if reply[u"status"] else u"disabled"
+ address = u"Bad is_ip4 flag"
+ if reply[u"is_ip4"] == 0:
+ address = str(IPv6Address(reply[u"address"]))
+ elif reply[u"is_ip4"] == 1:
+ address = str(IPv4Address(reply[u"address"][0:4]))
+ data[u"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 = u"show_lisp_rloc_probe_state"
+ err_msg = f"Failed to get LISP rloc config on host {node[u'host']}"
+
+ with PapiSocketExecutor(node) as papi_exec:
+ reply = papi_exec.add(cmd).get_reply(err_msg)
+
+ data = dict()
+ data[u"state"] = u"enabled" if reply[u"is_enabled"] else u"disabled"
+ logger.info(data)
+ return data