2 * Copyright (c) 2016 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
8 package org.opendaylight.genius.interfacemanager;
11 import com.google.common.base.Optional;
12 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
13 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
14 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
15 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
16 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
17 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
18 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
19 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
20 import org.opendaylight.genius.interfacemanager.commons.InterfaceManagerCommonUtils;
21 import org.opendaylight.genius.interfacemanager.exceptions.InterfaceAlreadyExistsException;
22 import org.opendaylight.genius.interfacemanager.globals.InterfaceInfo;
23 import org.opendaylight.genius.interfacemanager.globals.InterfaceInfo.InterfaceAdminState;
24 import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
25 import org.opendaylight.genius.interfacemanager.listeners.*;
26 import org.opendaylight.genius.interfacemanager.pmcounters.NodeConnectorStatsImpl;
27 import org.opendaylight.genius.interfacemanager.rpcservice.InterfaceManagerRpcService;
28 import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.listeners.FlowBasedServicesConfigListener;
29 import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.listeners.FlowBasedServicesInterfaceStateListener;
30 import org.opendaylight.genius.interfacemanager.statusanddiag.InterfaceStatusMonitor;
31 import org.opendaylight.genius.mdsalutil.ActionInfo;
32 import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
33 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.L2vlan;
34 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
35 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces;
36 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
37 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceBuilder;
38 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey;
39 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.AdminStatus;
40 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus;
41 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsService;
42 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeIngress;
43 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
44 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
45 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceBindings;
46 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo;
47 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfoKey;
48 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices;
49 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServicesKey;
50 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsService;
51 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.AlivenessMonitorService;
52 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInput;
53 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInputBuilder;
54 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService;
55 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfL2vlan;
56 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfL2vlanBuilder;
57 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.ParentRefs;
58 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.ParentRefsBuilder;
59 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.*;
60 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
61 import org.opendaylight.yangtools.yang.common.RpcResult;
62 import org.slf4j.Logger;
63 import org.slf4j.LoggerFactory;
65 import java.math.BigInteger;
66 import java.util.ArrayList;
67 import java.util.List;
68 import java.util.concurrent.ExecutionException;
69 import java.util.concurrent.Future;
72 public class InterfacemgrProvider implements BindingAwareProvider, AutoCloseable, IInterfaceManager {
74 private static final Logger LOG = LoggerFactory.getLogger(InterfacemgrProvider.class);
75 private static final InterfaceStatusMonitor interfaceStatusMonitor = InterfaceStatusMonitor.getInstance();
77 private RpcProviderRegistry rpcProviderRegistry;
78 private IdManagerService idManager;
79 private NotificationService notificationService;
80 private AlivenessMonitorService alivenessManager;
81 private IMdsalApiManager mdsalManager;
82 private InterfaceConfigListener interfaceConfigListener;
83 private InterfaceTopologyStateListener topologyStateListener;
84 private TerminationPointStateListener terminationPointStateListener;
85 private HwVTEPTunnelsStateListener hwVTEPTunnelsStateListener;
86 private InterfaceInventoryStateListener interfaceInventoryStateListener;
87 private FlowBasedServicesInterfaceStateListener flowBasedServicesInterfaceStateListener;
88 private FlowBasedServicesConfigListener flowBasedServicesConfigListener;
89 private VlanMemberConfigListener vlanMemberConfigListener;
90 private HwVTEPConfigListener hwVTEPConfigListener;
91 private AlivenessMonitorListener alivenessMonitorListener;
92 private DataBroker dataBroker;
93 private InterfaceManagerRpcService interfaceManagerRpcService;
94 private BindingAwareBroker.RpcRegistration<OdlInterfaceRpcService> rpcRegistration;
95 private NodeConnectorStatsImpl nodeConnectorStatsManager;
97 public void setRpcProviderRegistry(RpcProviderRegistry rpcProviderRegistry) {
98 this.rpcProviderRegistry = rpcProviderRegistry;
99 interfaceStatusMonitor.registerMbean();
102 public void setMdsalManager(IMdsalApiManager mdsalManager) {
103 this.mdsalManager = mdsalManager;
106 public void setNotificationService(NotificationService notificationService) {
107 this.notificationService = notificationService;
110 public DataBroker getDataBroker(){
111 return this.dataBroker;
115 public void onSessionInitiated(ProviderContext session) {
116 LOG.info("InterfacemgrProvider Session Initiated");
117 interfaceStatusMonitor.reportStatus("STARTING");
119 dataBroker = session.getSALService(DataBroker.class);
120 idManager = rpcProviderRegistry.getRpcService(IdManagerService.class);
123 alivenessManager = rpcProviderRegistry.getRpcService(AlivenessMonitorService.class);
124 interfaceManagerRpcService = new InterfaceManagerRpcService(dataBroker, mdsalManager);
125 rpcRegistration = getRpcProviderRegistry().addRpcImplementation(
126 OdlInterfaceRpcService.class, interfaceManagerRpcService);
128 interfaceConfigListener = new InterfaceConfigListener(dataBroker, idManager, alivenessManager, mdsalManager);
129 interfaceConfigListener.registerListener(LogicalDatastoreType.CONFIGURATION, dataBroker);
131 interfaceInventoryStateListener = new InterfaceInventoryStateListener(dataBroker, idManager, mdsalManager, alivenessManager);
132 interfaceInventoryStateListener.registerListener(LogicalDatastoreType.OPERATIONAL, dataBroker);
134 topologyStateListener = new InterfaceTopologyStateListener(dataBroker);
135 topologyStateListener.registerListener(LogicalDatastoreType.OPERATIONAL, dataBroker);
137 hwVTEPTunnelsStateListener = new HwVTEPTunnelsStateListener(dataBroker);
138 hwVTEPTunnelsStateListener.registerListener(LogicalDatastoreType.OPERATIONAL, dataBroker);
140 terminationPointStateListener = new TerminationPointStateListener(dataBroker);
141 terminationPointStateListener.registerListener(LogicalDatastoreType.OPERATIONAL, dataBroker);
143 flowBasedServicesConfigListener = new FlowBasedServicesConfigListener(this);
144 flowBasedServicesConfigListener.registerListener(LogicalDatastoreType.CONFIGURATION, dataBroker);
146 flowBasedServicesInterfaceStateListener =
147 new FlowBasedServicesInterfaceStateListener(dataBroker);
148 flowBasedServicesInterfaceStateListener.registerListener(LogicalDatastoreType.OPERATIONAL, dataBroker);
150 vlanMemberConfigListener =
151 new VlanMemberConfigListener(dataBroker, idManager, alivenessManager, mdsalManager);
152 vlanMemberConfigListener.registerListener(LogicalDatastoreType.CONFIGURATION, dataBroker);
154 hwVTEPConfigListener = new HwVTEPConfigListener(dataBroker);
155 hwVTEPConfigListener.registerListener(LogicalDatastoreType.CONFIGURATION, dataBroker);
157 alivenessMonitorListener = new org.opendaylight.genius.interfacemanager.listeners.AlivenessMonitorListener(dataBroker);
158 notificationService.registerNotificationListener(alivenessMonitorListener);
160 //Initialize nodeconnectorstatsimpl
161 nodeConnectorStatsManager = new NodeConnectorStatsImpl(dataBroker, notificationService,
162 session.getRpcService(OpendaylightPortStatisticsService.class), session.getRpcService(OpendaylightFlowTableStatisticsService.class));
165 interfaceStatusMonitor.reportStatus("OPERATIONAL");
166 } catch (Exception e) {
167 LOG.error("Error initializing services", e);
168 interfaceStatusMonitor.reportStatus("ERROR");
172 private void createIdPool() {
173 CreateIdPoolInput createPool = new CreateIdPoolInputBuilder()
174 .setPoolName(IfmConstants.IFM_IDPOOL_NAME)
175 .setLow(IfmConstants.IFM_ID_POOL_START)
176 .setHigh(IfmConstants.IFM_ID_POOL_END)
178 //TODO: Error handling
179 Future<RpcResult<Void>> result = idManager.createIdPool(createPool);
181 if ((result != null) && (result.get().isSuccessful())) {
182 LOG.debug("Created IdPool for InterfaceMgr");
184 } catch (InterruptedException | ExecutionException e) {
185 LOG.error("Failed to create idPool for InterfaceMgr", e);
190 public void close() throws Exception {
191 LOG.info("InterfacemgrProvider Closed");
192 interfaceConfigListener.close();
193 rpcRegistration.close();
196 public RpcProviderRegistry getRpcProviderRegistry() {
197 return rpcProviderRegistry;
201 public Long getPortForInterface(String ifName) {
202 GetPortFromInterfaceInput input = new GetPortFromInterfaceInputBuilder().setIntfName(ifName).build();
203 Future<RpcResult<GetPortFromInterfaceOutput>> output = interfaceManagerRpcService.getPortFromInterface(input);
205 RpcResult<GetPortFromInterfaceOutput> port = output.get();
206 if (port.isSuccessful()) {
207 return port.getResult().getPortno();
209 } catch (NullPointerException | InterruptedException | ExecutionException e) {
210 LOG.warn("Exception when getting port for interface", e);
216 public Long getPortForInterface(Interface intf) {
217 GetPortFromInterfaceInput input = new GetPortFromInterfaceInputBuilder().setIntfName(intf.getName()).build();
218 Future<RpcResult<GetPortFromInterfaceOutput>> output = interfaceManagerRpcService.getPortFromInterface(input);
220 RpcResult<GetPortFromInterfaceOutput> port = output.get();
221 if (port.isSuccessful()) {
222 return port.getResult().getPortno();
224 } catch (NullPointerException | InterruptedException | ExecutionException e) {
225 LOG.warn("Exception when getting port for interface", e);
231 public InterfaceInfo getInterfaceInfo(String interfaceName) {
233 org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface
234 ifState = InterfaceManagerCommonUtils.getInterfaceStateFromOperDS(interfaceName, dataBroker);
236 if (ifState == null) {
237 LOG.error("Interface {} is not present", interfaceName);
241 Integer lportTag = ifState.getIfIndex();
242 Interface intf = InterfaceManagerCommonUtils.getInterfaceFromConfigDS(new InterfaceKey(interfaceName), dataBroker);
244 LOG.error("Interface {} doesn't exist in config datastore", interfaceName);
248 NodeConnectorId ncId = IfmUtil.getNodeConnectorIdFromInterface(intf.getName(), dataBroker);
249 InterfaceInfo.InterfaceType interfaceType = IfmUtil.getInterfaceType(intf);
250 InterfaceInfo interfaceInfo = new InterfaceInfo(interfaceName);
251 BigInteger dpId = org.opendaylight.genius.interfacemanager.globals.IfmConstants.INVALID_DPID;
252 Integer portNo = org.opendaylight.genius.interfacemanager.globals.IfmConstants.INVALID_PORT_NO;
254 dpId = new BigInteger(IfmUtil.getDpnFromNodeConnectorId(ncId));
255 portNo = Integer.parseInt(IfmUtil.getPortNoFromNodeConnectorId(ncId));
257 if (interfaceType == InterfaceInfo.InterfaceType.VLAN_INTERFACE) {
258 interfaceInfo = IfmUtil.getVlanInterfaceInfo(interfaceName, intf, dpId);
259 } else if (interfaceType == InterfaceInfo.InterfaceType.VXLAN_TRUNK_INTERFACE ||
260 interfaceType == InterfaceInfo.InterfaceType.GRE_TRUNK_INTERFACE) {
261 // TODO : since there is no logical grouping for tunnel interfaces, there is no need
262 // for this code as of now. will be revisited once the support comes
265 LOG.error("Type of Interface {} is unknown", interfaceName);
268 interfaceInfo.setDpId(dpId);
269 interfaceInfo.setPortNo(portNo);
270 interfaceInfo.setAdminState((intf.isEnabled() == true) ? InterfaceAdminState.ENABLED : InterfaceAdminState.DISABLED);
271 interfaceInfo.setInterfaceName(interfaceName);
272 interfaceInfo.setInterfaceTag(lportTag);
273 interfaceInfo.setInterfaceType(interfaceType);
274 interfaceInfo.setGroupId(IfmUtil.getGroupId(lportTag, interfaceType));
275 interfaceInfo.setOpState((ifState.getOperStatus() == OperStatus.Up) ? InterfaceInfo.InterfaceOpState.UP : InterfaceInfo.InterfaceOpState.DOWN);
278 return interfaceInfo;
283 public InterfaceInfo getInterfaceInfoFromOperationalDataStore(String interfaceName, InterfaceInfo.InterfaceType interfaceType) {
284 InterfaceInfo interfaceInfo = new InterfaceInfo(interfaceName);
285 org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState = InterfaceManagerCommonUtils
286 .getInterfaceStateFromOperDS(interfaceName, dataBroker);
287 if (ifState == null) {
288 LOG.error("Interface {} is not present", interfaceName);
291 Integer lportTag = ifState.getIfIndex();
292 NodeConnectorId ncId = IfmUtil.getNodeConnectorIdFromInterface(ifState);
294 interfaceInfo.setDpId(new BigInteger(IfmUtil.getDpnFromNodeConnectorId(ncId)));
295 interfaceInfo.setPortNo(Integer.parseInt(IfmUtil.getPortNoFromNodeConnectorId(ncId)));
297 interfaceInfo.setAdminState((ifState.getAdminStatus() == AdminStatus.Up) ? InterfaceAdminState.ENABLED : InterfaceAdminState.DISABLED);
298 interfaceInfo.setInterfaceName(interfaceName);
299 interfaceInfo.setInterfaceTag(lportTag);
300 interfaceInfo.setInterfaceType(interfaceType);
301 interfaceInfo.setGroupId(IfmUtil.getGroupId(lportTag, interfaceType));
302 interfaceInfo.setOpState((ifState.getOperStatus() == OperStatus.Up) ? InterfaceInfo.InterfaceOpState.UP : InterfaceInfo.InterfaceOpState.DOWN);
305 return interfaceInfo;
309 public InterfaceInfo getInterfaceInfoFromOperationalDataStore(String interfaceName) {
310 org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState = InterfaceManagerCommonUtils
311 .getInterfaceStateFromOperDS(interfaceName, dataBroker);
312 if (ifState == null) {
313 LOG.error("Interface {} is not present", interfaceName);
316 Integer lportTag = ifState.getIfIndex();
317 InterfaceInfo interfaceInfo = new InterfaceInfo(interfaceName);
318 NodeConnectorId ncId = IfmUtil.getNodeConnectorIdFromInterface(ifState);
320 interfaceInfo.setPortName(IfmUtil.getPortName(dataBroker, ncId));
321 interfaceInfo.setDpId(new BigInteger(IfmUtil.getDpnFromNodeConnectorId(ncId)));
322 interfaceInfo.setPortNo(Integer.parseInt(IfmUtil.getPortNoFromNodeConnectorId(ncId)));
324 interfaceInfo.setAdminState((ifState.getAdminStatus() == AdminStatus.Up) ? InterfaceAdminState.ENABLED : InterfaceAdminState.DISABLED);
325 interfaceInfo.setInterfaceName(interfaceName);
326 interfaceInfo.setInterfaceTag(lportTag);
327 interfaceInfo.setOpState((ifState.getOperStatus() == OperStatus.Down) ? InterfaceInfo.InterfaceOpState.DOWN :
328 ifState.getOperStatus() == OperStatus.Unknown ? InterfaceInfo.InterfaceOpState.UNKNOWN : InterfaceInfo.InterfaceOpState.UP);
329 return interfaceInfo;
333 public Interface getInterfaceInfoFromConfigDataStore(String interfaceName) {
334 Interface intf = InterfaceManagerCommonUtils.getInterfaceFromConfigDS(new InterfaceKey(interfaceName), dataBroker);
339 public void createVLANInterface(String interfaceName, String portName, BigInteger dpId, Integer vlanId,
340 String description, IfL2vlan.L2vlanMode l2vlanMode) throws InterfaceAlreadyExistsException {
342 LOG.info("Create VLAN interface : {}", interfaceName);
343 InstanceIdentifier<Interface> interfaceInstanceIdentifier = InterfaceManagerCommonUtils.getInterfaceIdentifier(new InterfaceKey(interfaceName));
344 Interface interfaceOptional = InterfaceManagerCommonUtils.getInterfaceFromConfigDS(new InterfaceKey(interfaceName), dataBroker);
345 if (interfaceOptional != null) {
346 LOG.debug("VLAN interface is already exist", interfaceOptional.getDescription());
347 throw new InterfaceAlreadyExistsException(interfaceOptional.getName());
349 IfL2vlanBuilder l2vlanBuilder = new IfL2vlanBuilder().setL2vlanMode(l2vlanMode);
351 l2vlanBuilder.setVlanId(new VlanId(vlanId));
353 ParentRefs parentRefs = new ParentRefsBuilder().setParentInterface(portName).build();
354 Interface inf = new InterfaceBuilder().setEnabled(true).setName(interfaceName).setType(L2vlan.class).
355 addAugmentation(IfL2vlan.class, l2vlanBuilder.build()).addAugmentation(ParentRefs.class, parentRefs).
356 setDescription(description).build();
357 WriteTransaction t = dataBroker.newWriteOnlyTransaction();
358 t.put(LogicalDatastoreType.CONFIGURATION, interfaceInstanceIdentifier, inf, true);
362 public void bindService(String interfaceName, BoundServices serviceInfo) {
363 LOG.info("Binding Service : {}", interfaceName);
364 WriteTransaction t = dataBroker.newWriteOnlyTransaction();
365 InstanceIdentifier<BoundServices> boundServicesInstanceIdentifier = InstanceIdentifier.builder(ServiceBindings.class)
366 .child(ServicesInfo.class, new ServicesInfoKey(interfaceName, ServiceModeIngress.class))
367 .child(BoundServices.class, new BoundServicesKey(serviceInfo.getServicePriority())).build();
368 t.put(LogicalDatastoreType.CONFIGURATION, boundServicesInstanceIdentifier, serviceInfo, true);
373 public void unbindService(String interfaceName, BoundServices serviceInfo) {
374 LOG.info("Unbinding Service : {}", interfaceName);
375 WriteTransaction t = dataBroker.newWriteOnlyTransaction();
376 InstanceIdentifier<BoundServices> boundServicesInstanceIdentifier = InstanceIdentifier.builder(ServiceBindings.class)
377 .child(ServicesInfo.class, new ServicesInfoKey(interfaceName, ServiceModeIngress.class))
378 .child(BoundServices.class, new BoundServicesKey(serviceInfo.getServicePriority())).build();
379 t.delete(LogicalDatastoreType.CONFIGURATION, boundServicesInstanceIdentifier);
384 public BigInteger getDpnForInterface(String ifName) {
385 GetDpidFromInterfaceInput input = new GetDpidFromInterfaceInputBuilder().setIntfName(ifName).build();
386 Future<RpcResult<GetDpidFromInterfaceOutput>> output = interfaceManagerRpcService.getDpidFromInterface(input);
388 RpcResult<GetDpidFromInterfaceOutput> dpn = output.get();
389 if (dpn.isSuccessful()) {
390 return dpn.getResult().getDpid();
392 } catch (NullPointerException | InterruptedException | ExecutionException e) {
393 LOG.warn("Exception when getting port for interface", e);
399 public String getEndpointIpForDpn(BigInteger dpnId) {
400 GetEndpointIpForDpnInput input = new GetEndpointIpForDpnInputBuilder().setDpid(dpnId).build();
401 Future<RpcResult<GetEndpointIpForDpnOutput>> output = interfaceManagerRpcService.getEndpointIpForDpn(input);
403 RpcResult<GetEndpointIpForDpnOutput> ipForDpnOutputRpcResult = output.get();
404 if (ipForDpnOutputRpcResult.isSuccessful()) {
405 List<IpAddress> localIps = ipForDpnOutputRpcResult.getResult().getLocalIps();
406 if (!localIps.isEmpty()) {
407 return localIps.get(0).getIpv4Address().getValue();
410 } catch (NullPointerException | InterruptedException | ExecutionException e) {
411 LOG.warn("Exception when getting port for interface", e);
417 public List<ActionInfo> getInterfaceEgressActions(String ifName) {
418 return IfmUtil.getEgressActionInfosForInterface(ifName, 0, dataBroker);
422 public BigInteger getDpnForInterface(Interface intrf) {
423 return getDpnForInterface(intrf.getName());
427 public List<Interface> getVlanInterfaces() {
428 List<Interface> vlanList = new ArrayList<Interface>();
429 InstanceIdentifier<Interfaces> interfacesInstanceIdentifier = InstanceIdentifier.builder(Interfaces.class).build();
430 Optional<Interfaces> interfacesOptional = IfmUtil.read(LogicalDatastoreType.CONFIGURATION, interfacesInstanceIdentifier, dataBroker);
431 if (!interfacesOptional.isPresent()) {
434 Interfaces interfaces = interfacesOptional.get();
435 List<Interface> interfacesList = interfaces.getInterface();
436 for (Interface iface : interfacesList) {
437 if (IfmUtil.getInterfaceType(iface) == InterfaceInfo.InterfaceType.VLAN_INTERFACE) {
445 public List<Interface> getVxlanInterfaces() {
446 return InterfaceManagerCommonUtils.getAllTunnelInterfaces(dataBroker,
447 InterfaceInfo.InterfaceType.VXLAN_TRUNK_INTERFACE);