2 * Copyright (c) 2016, 2017 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.genius.interfacemanager.interfaces;
11 import java.math.BigInteger;
12 import java.util.List;
14 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
15 import org.opendaylight.genius.interfacemanager.exceptions.InterfaceAlreadyExistsException;
16 import org.opendaylight.genius.interfacemanager.globals.InterfaceInfo;
17 import org.opendaylight.genius.mdsalutil.ActionInfo;
18 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfL2vlan;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeBase;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
26 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
27 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
29 public interface IInterfaceManager {
31 Long getPortForInterface(String ifName);
33 Long getPortForInterface(Interface intf);
35 BigInteger getDpnForInterface(String ifName);
37 BigInteger getDpnForInterface(Interface intrf);
39 String getEndpointIpForDpn(BigInteger dpnId);
41 List<ActionInfo> getInterfaceEgressActions(String ifName);
43 InterfaceInfo getInterfaceInfo(String intInfo);
45 InterfaceInfo getInterfaceInfoFromOperationalDataStore(String interfaceName,
46 InterfaceInfo.InterfaceType interfaceType);
48 InterfaceInfo getInterfaceInfoFromOperationalDataStore(String interfaceName);
51 * This API is currently used only for CLI usage. Please be careful that this API
52 * can return stale entries since it is just a cache read.
54 InterfaceInfo getInterfaceInfoFromOperationalDSCache(String interfaceName);
56 Interface getInterfaceInfoFromConfigDataStore(String interfaceName);
58 void createVLANInterface(String interfaceName, String portName, BigInteger dpId, Integer vlanId, String description,
59 IfL2vlan.L2vlanMode l2vlanMode) throws InterfaceAlreadyExistsException;
61 void createVLANInterface(String interfaceName, String portName, BigInteger dpId, Integer vlanId, String description,
62 IfL2vlan.L2vlanMode l2vlanMode, boolean isExternal) throws InterfaceAlreadyExistsException;
64 boolean isServiceBoundOnInterfaceForIngress(short servicePriority, String interfaceName);
66 boolean isServiceBoundOnInterfaceForEgress(short servicePriority, String interfaceName);
68 void bindService(String interfaceName, Class<? extends ServiceModeBase> serviceMode, BoundServices serviceInfo);
70 void bindService(String interfaceName, Class<? extends ServiceModeBase> serviceMode, BoundServices serviceInfo,
73 void unbindService(String interfaceName, Class<? extends ServiceModeBase> serviceMode, BoundServices serviceInfo);
75 List<Interface> getVlanInterfaces();
77 List<Interface> getVxlanInterfaces();
79 List<Interface> getChildInterfaces(String parentInterface);
81 boolean isExternalInterface(String interfaceName);
83 String getPortNameForInterface(NodeConnectorId nodeConnectorId, String interfaceName);
85 String getPortNameForInterface(String dpnId, String interfaceName);
87 String getParentRefNameForInterface(String interfaceName);
89 Map<String, OvsdbTerminationPointAugmentation> getTerminationPointCache();
91 OvsdbTerminationPointAugmentation getTerminationPointForInterface(String interfaceName);
93 OvsdbBridgeAugmentation getOvsdbBridgeForInterface(String interfaceName);
95 OvsdbBridgeAugmentation getOvsdbBridgeForNodeIid(InstanceIdentifier<Node> nodeIid);
97 List<OvsdbTerminationPointAugmentation> getPortsOnBridge(BigInteger dpnId);
99 List<OvsdbTerminationPointAugmentation> getTunnelPortsOnBridge(BigInteger dpnId);
101 Map<Class<? extends InterfaceTypeBase>, List<OvsdbTerminationPointAugmentation>>
102 getPortsOnBridgeByType(BigInteger dpnId);
104 void updateInterfaceParentRef(String interfaceName, String parentInterface);
106 void updateInterfaceParentRef(String interfaceName, String parentInterface, boolean readInterfaceBeforeWrite);
108 long getLogicalTunnelSelectGroupId(int lportTag);