use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress in project genius by opendaylight.
the class OvsInterfaceStateAddHelper method addState.
private List<ListenableFuture<Void>> addState(NodeConnectorId nodeConnectorId, String interfaceName, long portNo, PhysAddress physAddress) {
LOG.info("Adding Interface State to Oper DS for interface: {}", interfaceName);
if (portNo == IfmConstants.INVALID_PORT_NO) {
LOG.trace("Cannot derive port number, not proceeding with Interface State " + "addition for interface: {}", interfaceName);
return null;
}
List<ListenableFuture<Void>> futures = new ArrayList<>();
Interface.OperStatus operStatus = Interface.OperStatus.Up;
Interface.AdminStatus adminStatus = Interface.AdminStatus.Up;
// Fetch the interface from config DS if exists
InterfaceKey interfaceKey = new InterfaceKey(interfaceName);
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface iface = interfaceManagerCommonUtils.getInterfaceFromConfigDS(interfaceKey);
if (InterfaceManagerCommonUtils.isTunnelPort(interfaceName) && !validateTunnelPortAttributes(nodeConnectorId, iface)) {
return futures;
}
futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
Interface ifState = interfaceManagerCommonUtils.addStateEntry(iface, interfaceName, tx, physAddress, operStatus, adminStatus, nodeConnectorId);
// flow,and start tunnel monitoring
if (InterfaceManagerCommonUtils.isTunnelInterface(iface)) {
handleTunnelMonitoringAddition(futures, nodeConnectorId, ifState.getIfIndex(), iface, interfaceName, portNo);
return;
}
// install ingress flow if this is an l2vlan interface
if (InterfaceManagerCommonUtils.isVlanInterface(iface) && iface.isEnabled() && ifState.getOperStatus() == org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus.Up) {
BigInteger dpId = IfmUtil.getDpnFromNodeConnectorId(nodeConnectorId);
FlowBasedServicesUtils.installLportIngressFlow(dpId, portNo, iface, futures, txRunner, ifState.getIfIndex());
futures.add(FlowBasedServicesUtils.bindDefaultEgressDispatcherService(txRunner, iface, Long.toString(portNo), interfaceName, ifState.getIfIndex()));
}
}));
return futures;
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress in project genius by opendaylight.
the class OvsInterfaceStateAddHelper method addState.
public List<ListenableFuture<Void>> addState(NodeConnectorId nodeConnectorId, String interfaceName, FlowCapableNodeConnector fcNodeConnectorNew) {
long portNo = IfmUtil.getPortNumberFromNodeConnectorId(nodeConnectorId);
PhysAddress physAddress = IfmUtil.getPhyAddress(portNo, fcNodeConnectorNew);
return addState(nodeConnectorId, interfaceName, portNo, physAddress);
}
Aggregations