@Test public void testLookupTopologyNode() { ServiceFunctionForwarderBuilder serviceFunctionForwarderBuilder = new ServiceFunctionForwarderBuilder(); serviceFunctionForwarderBuilder.setSffDataPlaneLocator(null); Node node = SfcOvsUtil.lookupTopologyNode(serviceFunctionForwarderBuilder.build(), executorService); assertNull("Must be null", node); serviceFunctionForwarderBuilder = new ServiceFunctionForwarderBuilder(); serviceFunctionForwarderBuilder.setSffDataPlaneLocator(createSffDataPlaneLocatorList(null, null)); node = SfcOvsUtil.lookupTopologyNode(serviceFunctionForwarderBuilder.build(), executorService); assertNull("Must be null", node); IpBuilder ipBuilder = new IpBuilder(); NodeBuilder nodeBuilder = new NodeBuilder(); nodeBuilder.setNodeId(new NodeId(ipv4Address)); ipBuilder.setIp(new IpAddress(new Ipv4Address(ipv4Address))); serviceFunctionForwarderBuilder = new ServiceFunctionForwarderBuilder(); serviceFunctionForwarderBuilder.setSffDataPlaneLocator(createSffDataPlaneLocatorList(null, ipBuilder.build())); node = SfcOvsUtil.lookupTopologyNode(serviceFunctionForwarderBuilder.build(), executorService); assertNotNull("Must not be null", node); assertEquals("Must be equal", node.getNodeId().getValue(), ipv4Address); }
public static Node lookupTopologyNode(ServiceFunctionForwarder serviceFunctionForwarder, ExecutorService executor) { List<SffDataPlaneLocator> sffDplList = serviceFunctionForwarder.getSffDataPlaneLocator(); IpAddress ip = null; if (sffDplList == null) { LOG.debug("No IP Data Plane Locator for Service Function Forwarder {}, ", serviceFunctionForwarder); return null; } for (SffDataPlaneLocator sffDpl : sffDplList) { if ((sffDpl.getDataPlaneLocator() != null) && sffDpl.getDataPlaneLocator().getLocatorType() != null) { Class<? extends DataContainer> locatorType = sffDpl.getDataPlaneLocator().getLocatorType().getImplementedInterface(); if (locatorType.isAssignableFrom(Ip.class)) { Ip ipPortLocator = (Ip) sffDpl.getDataPlaneLocator().getLocatorType(); IpAddress ipAddress = new IpAddress(ipPortLocator.getIp().getValue()); ip = ipAddress; } } } if (ip == null) { LOG.debug("Could not get IP address for Service Function Forwarder {}", serviceFunctionForwarder); return null; } return SfcOvsUtil.getManagerNodeByIp(ip, executor); }
SfcOvsUtil { public static Node lookupTopologyNode(ServiceFunctionForwarder serviceFunctionForwarder, ExecutorService executor) { List<SffDataPlaneLocator> sffDplList = serviceFunctionForwarder.getSffDataPlaneLocator(); IpAddress ip = null; if (sffDplList == null) { LOG.debug("No IP Data Plane Locator for Service Function Forwarder {}, ", serviceFunctionForwarder); return null; } for (SffDataPlaneLocator sffDpl : sffDplList) { if ((sffDpl.getDataPlaneLocator() != null) && sffDpl.getDataPlaneLocator().getLocatorType() != null) { Class<? extends DataContainer> locatorType = sffDpl.getDataPlaneLocator().getLocatorType().getImplementedInterface(); if (locatorType.isAssignableFrom(Ip.class)) { Ip ipPortLocator = (Ip) sffDpl.getDataPlaneLocator().getLocatorType(); IpAddress ipAddress = new IpAddress(ipPortLocator.getIp().getValue()); ip = ipAddress; } } } if (ip == null) { LOG.debug("Could not get IP address for Service Function Forwarder {}", serviceFunctionForwarder); return null; } return SfcOvsUtil.getManagerNodeByIp(ip, executor); } }
SfcOvsUtil { public static Node lookupTopologyNode(ServiceFunctionForwarder serviceFunctionForwarder, ExecutorService executor) { List<SffDataPlaneLocator> sffDplList = serviceFunctionForwarder.getSffDataPlaneLocator(); IpAddress ip = null; if (sffDplList == null) { LOG.debug("No IP Data Plane Locator for Service Function Forwarder {}, ", serviceFunctionForwarder); return null; } for (SffDataPlaneLocator sffDpl : sffDplList) { if ((sffDpl.getDataPlaneLocator() != null) && sffDpl.getDataPlaneLocator().getLocatorType() != null) { Class<? extends DataContainer> locatorType = sffDpl.getDataPlaneLocator().getLocatorType().getImplementedInterface(); if (locatorType.isAssignableFrom(Ip.class)) { Ip ipPortLocator = (Ip) sffDpl.getDataPlaneLocator().getLocatorType(); IpAddress ipAddress = new IpAddress(ipPortLocator.getIp().getValue()); ip = ipAddress; } } } if (ip == null) { LOG.debug("Could not get IP address for Service Function Forwarder {}", serviceFunctionForwarder); return null; } return SfcOvsUtil.getManagerNodeByIp(ip, executor); }  }
SfcOvsUtil { public static Node lookupTopologyNode(ServiceFunctionForwarder serviceFunctionForwarder, ExecutorService executor) { List<SffDataPlaneLocator> sffDplList = serviceFunctionForwarder.getSffDataPlaneLocator(); IpAddress ip = null; if (sffDplList == null) { LOG.debug("No IP Data Plane Locator for Service Function Forwarder {}, ", serviceFunctionForwarder); return null; } for (SffDataPlaneLocator sffDpl : sffDplList) { if ((sffDpl.getDataPlaneLocator() != null) && sffDpl.getDataPlaneLocator().getLocatorType() != null) { Class<? extends DataContainer> locatorType = sffDpl.getDataPlaneLocator().getLocatorType().getImplementedInterface(); if (locatorType.isAssignableFrom(Ip.class)) { Ip ipPortLocator = (Ip) sffDpl.getDataPlaneLocator().getLocatorType(); IpAddress ipAddress = new IpAddress(ipPortLocator.getIp().getValue()); ip = ipAddress; } } } if (ip == null) { LOG.debug("Could not get IP address for Service Function Forwarder {}", serviceFunctionForwarder); return null; } return SfcOvsUtil.getManagerNodeByIp(ip, executor); }  static Object submitCallable(Callable callable, ExecutorService executor); static InstanceIdentifier<Topology> buildOvsdbTopologyIID(); static InstanceIdentifier<Node> buildOvsdbNodeIID(OvsdbBridgeAugmentation ovsdbBridge); static InstanceIdentifier<Node> buildOvsdbNodeIID(String serviceFunctionForwarderName); static InstanceIdentifier<Node> buildOvsdbNodeIID(NodeId nodeId); static InstanceIdentifier<OvsdbBridgeAugmentation> buildOvsdbBridgeIID(OvsdbBridgeAugmentation ovsdbBridge); static InstanceIdentifier<OvsdbBridgeAugmentation> buildOvsdbBridgeIID(NodeId nodeId); static InstanceIdentifier<OvsdbBridgeAugmentation> buildOvsdbBridgeIID(String serviceFunctionForwarderName); static InstanceIdentifier<OvsdbTerminationPointAugmentation> buildOvsdbTerminationPointAugmentationIID(
            OvsdbBridgeAugmentation ovsdbBridge, OvsdbTerminationPointAugmentation ovsdbTerminationPoint); static InstanceIdentifier<TerminationPoint> buildOvsdbTerminationPointIID(String sffName,
            String sffDataPlaneLocatorName); static IpAddress convertStringToIpAddress(String ipAddressString); static String convertIpAddressToString(IpAddress ipAddress); static boolean putOvsdbTerminationPoints(OvsdbBridgeAugmentation ovsdbBridge,
                                                    List<SffDataPlaneLocator> sffDataPlaneLocatorList, ExecutorService executor); static boolean putOvsdbBridge(OvsdbBridgeAugmentation ovsdbBridge, ExecutorService executor); static boolean deleteOvsdbNode(InstanceIdentifier<Node> ovsdbNodeIID, ExecutorService executor); static boolean deleteOvsdbTerminationPoint(InstanceIdentifier<TerminationPoint> ovsdbTerminationPointIID,
            ExecutorService executor); static ServiceFunctionForwarder augmentSffWithOpenFlowNodeId(ServiceFunctionForwarder sff); static Ip getSffVxlanDataLocator(ServiceFunctionForwarder sff); static Node lookupTopologyNode(ServiceFunctionForwarder serviceFunctionForwarder, ExecutorService executor); static String getOpenFlowNodeIdForSff(ServiceFunctionForwarder serviceFunctionForwarder); static Node getManagerNodeByIp(IpAddress ip, ExecutorService executor); static OvsdbNodeAugmentation getOvsdbNodeAugmentation(OvsdbNodeRef nodeRef, ExecutorService executor); static Long getOfPortByName(String nodeName, String portName); static Long getVxlanOfPort(String nodeName); static Long getVxlanGpeOfPort(String nodeName); static Long getDpdkOfPort(String nodeName, String dpdkPortName); }
SfcOvsUtil { public static Node lookupTopologyNode(ServiceFunctionForwarder serviceFunctionForwarder, ExecutorService executor) { List<SffDataPlaneLocator> sffDplList = serviceFunctionForwarder.getSffDataPlaneLocator(); IpAddress ip = null; if (sffDplList == null) { LOG.debug("No IP Data Plane Locator for Service Function Forwarder {}, ", serviceFunctionForwarder); return null; } for (SffDataPlaneLocator sffDpl : sffDplList) { if ((sffDpl.getDataPlaneLocator() != null) && sffDpl.getDataPlaneLocator().getLocatorType() != null) { Class<? extends DataContainer> locatorType = sffDpl.getDataPlaneLocator().getLocatorType().getImplementedInterface(); if (locatorType.isAssignableFrom(Ip.class)) { Ip ipPortLocator = (Ip) sffDpl.getDataPlaneLocator().getLocatorType(); IpAddress ipAddress = new IpAddress(ipPortLocator.getIp().getValue()); ip = ipAddress; } } } if (ip == null) { LOG.debug("Could not get IP address for Service Function Forwarder {}", serviceFunctionForwarder); return null; } return SfcOvsUtil.getManagerNodeByIp(ip, executor); }  static Object submitCallable(Callable callable, ExecutorService executor); static InstanceIdentifier<Topology> buildOvsdbTopologyIID(); static InstanceIdentifier<Node> buildOvsdbNodeIID(OvsdbBridgeAugmentation ovsdbBridge); static InstanceIdentifier<Node> buildOvsdbNodeIID(String serviceFunctionForwarderName); static InstanceIdentifier<Node> buildOvsdbNodeIID(NodeId nodeId); static InstanceIdentifier<OvsdbBridgeAugmentation> buildOvsdbBridgeIID(OvsdbBridgeAugmentation ovsdbBridge); static InstanceIdentifier<OvsdbBridgeAugmentation> buildOvsdbBridgeIID(NodeId nodeId); static InstanceIdentifier<OvsdbBridgeAugmentation> buildOvsdbBridgeIID(String serviceFunctionForwarderName); static InstanceIdentifier<OvsdbTerminationPointAugmentation> buildOvsdbTerminationPointAugmentationIID(
            OvsdbBridgeAugmentation ovsdbBridge, OvsdbTerminationPointAugmentation ovsdbTerminationPoint); static InstanceIdentifier<TerminationPoint> buildOvsdbTerminationPointIID(String sffName,
            String sffDataPlaneLocatorName); static IpAddress convertStringToIpAddress(String ipAddressString); static String convertIpAddressToString(IpAddress ipAddress); static boolean putOvsdbTerminationPoints(OvsdbBridgeAugmentation ovsdbBridge,
                                                    List<SffDataPlaneLocator> sffDataPlaneLocatorList, ExecutorService executor); static boolean putOvsdbBridge(OvsdbBridgeAugmentation ovsdbBridge, ExecutorService executor); static boolean deleteOvsdbNode(InstanceIdentifier<Node> ovsdbNodeIID, ExecutorService executor); static boolean deleteOvsdbTerminationPoint(InstanceIdentifier<TerminationPoint> ovsdbTerminationPointIID,
            ExecutorService executor); static ServiceFunctionForwarder augmentSffWithOpenFlowNodeId(ServiceFunctionForwarder sff); static Ip getSffVxlanDataLocator(ServiceFunctionForwarder sff); static Node lookupTopologyNode(ServiceFunctionForwarder serviceFunctionForwarder, ExecutorService executor); static String getOpenFlowNodeIdForSff(ServiceFunctionForwarder serviceFunctionForwarder); static Node getManagerNodeByIp(IpAddress ip, ExecutorService executor); static OvsdbNodeAugmentation getOvsdbNodeAugmentation(OvsdbNodeRef nodeRef, ExecutorService executor); static Long getOfPortByName(String nodeName, String portName); static Long getVxlanOfPort(String nodeName); static Long getVxlanGpeOfPort(String nodeName); static Long getDpdkOfPort(String nodeName, String dpdkPortName); static final String OVSDB_OPTION_LOCAL_IP; static final String OVSDB_OPTION_REMOTE_IP; static final String OVSDB_OPTION_DST_PORT; static final String OVSDB_OPTION_NSP; static final String OVSDB_OPTION_NSI; static final String OVSDB_OPTION_IN_NSP; static final String OVSDB_OPTION_IN_NSI; static final String OVSDB_OPTION_OUT_NSP; static final String OVSDB_OPTION_OUT_NSI; static final String OVSDB_OPTION_NSHC1; static final String OVSDB_OPTION_NSHC2; static final String OVSDB_OPTION_NSHC3; static final String OVSDB_OPTION_NSHC4; static final String OVSDB_OPTION_KEY; static final String OVSDB_OPTION_EXTS; static final String OVSDB_OPTION_GPE; static final String OVSDB_OPTION_VALUE_FLOW; static final String DPL_NAME_DPDK; static final String DPL_NAME_DPDKVHOST; static final String DPL_NAME_DPDKVHOSTUSER; static final String DPL_NAME_INTERNAL; static final PortNumber NSH_VXLAN_TUNNEL_PORT; }