- VatExecutor.cmd_from_template(node,
- 'lisp/del_lisp_locator_set.vat',
- lisp_name=name)
-
-
-class LispSetup(object):
- """Lisp setup in topology."""
-
- def __init__(self):
- pass
-
- @staticmethod
- def vpp_set_lisp_locator_set(node, locator_set_list):
- """Set lisp locator_sets on VPP node in topology.
-
- :param node: VPP node.
- :param locator_set_list: List of locator_set.
- :type node: dict
- :type locator_set_list: list
- """
-
- if node['type'] != NodeType.DUT:
- raise ValueError('Node is not DUT')
-
- lisp_locator = LispLocator()
- lisp_locator_set = LispLocatorSet()
- for locator_set in locator_set_list:
- locator_set_name = locator_set.get('locator-set')
- locator_list = locator_set.get('locator')
- lisp_locator_set.vpp_add_lisp_locator_set(node,
- locator_set_name)
- for locator in locator_list:
- sw_if_index = locator.get('locator-index')
- priority = locator.get('priority')
- weight = locator.get('weight')
- lisp_locator.vpp_add_lisp_locator(node,
- locator_set_name,
- sw_if_index,
- priority,
- weight)
-
- @staticmethod
- def vpp_unset_lisp_locator_set(node, locator_set_list):
- """Unset lisp locator_sets on VPP node in topology.
-
- :param node: VPP node.
- :param locator_set_list: List of locator_set.
- :type node: dict
- :type locator_set_list: list
- """
-
- if node['type'] != NodeType.DUT:
- raise ValueError('Lisp locator set, node is not DUT')
-
- lisp_locator = LispLocator()
- lisp_locator_set = LispLocatorSet()
- for locator_set in locator_set_list:
- locator_set_name = locator_set.get('locator-set')
- locator_list = locator_set.get('locator')
- for locator in locator_list:
- sw_if_index = locator.get('locator-index')
- priority = locator.get('priority')
- weight = locator.get('weight')
- lisp_locator.vpp_del_lisp_locator(node,
- locator_set_name,
- sw_if_index,
- priority,
- weight)
-
- lisp_locator_set.vpp_del_lisp_locator_set(node,
- locator_set_name)
-
- @staticmethod
- def vpp_set_lisp_eid_table(node, eid_table):
- """Set lisp eid tables on VPP node in topology.
-
- :param node: VPP node.
- :param eid_table: Dictionary containing information of eid_table.
- :type node: dict
- :type eid_table: dict
- """
-
- if node['type'] != NodeType.DUT:
- raise ValueError('Node is not DUT')
-
- lisp_locator_set = LispLocatorSet()
- lisp_eid = LispLocalEid()
- for eid in eid_table:
- vni = eid.get('vni')
- eid_address = eid.get('eid')
- eid_prefix_len = eid.get('eid-prefix-len')
- locator_set_name = eid.get('locator-set')
- lisp_locator_set.vpp_add_lisp_locator_set(node, locator_set_name)
- lisp_eid.vpp_add_lisp_local_eid(node,
- locator_set_name,
- vni,
- eid_address,
- eid_prefix_len)