Search in sources :

Example 1 with NodeConnectorId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project netvirt by opendaylight.

the class TestOdlInterfaceRpcService method getNodeconnectorIdFromInterface.

@Override
public Future<RpcResult<GetNodeconnectorIdFromInterfaceOutput>> getNodeconnectorIdFromInterface(GetNodeconnectorIdFromInterfaceInput input) {
    String ifName = input.getIntfName();
    // if the ifName is INTERFACE_NAME_NO_EXIST, then an empty response will be returned
    GetNodeconnectorIdFromInterfaceOutputBuilder builder = new GetNodeconnectorIdFromInterfaceOutputBuilder();
    if (ifName == GeniusProviderTestParams.INTERFACE_NAME) {
        builder.setNodeconnectorId(new NodeConnectorId(GeniusProviderTestParams.NODE_CONNECTOR_ID_PREFIX + GeniusProviderTestParams.INTERFACE_NAME));
    } else if (ifName == GeniusProviderTestParams.INTERFACE_NAME_INVALID) {
        return Futures.immediateFuture(RpcResultBuilder.<GetNodeconnectorIdFromInterfaceOutput>failed().withError(ErrorType.APPLICATION, "Invalid data.").build());
    }
    return Futures.immediateFuture(RpcResultBuilder.<GetNodeconnectorIdFromInterfaceOutput>success(builder.build()).build());
}
Also used : NodeConnectorId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId) GetNodeconnectorIdFromInterfaceOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetNodeconnectorIdFromInterfaceOutputBuilder) GetNodeconnectorIdFromInterfaceOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetNodeconnectorIdFromInterfaceOutput)

Example 2 with NodeConnectorId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project netvirt by opendaylight.

the class StatisticsImpl method getNodeConnectorResult.

private boolean getNodeConnectorResult(List<CounterResult> counters, BigInteger dpId, String portNumber) {
    CounterResultDataStructure counterResultDS = counterRetriever.getNodeConnectorCountersDirect(new NodeId(CountersUtils.getNodeId(dpId)), new NodeConnectorId(CountersUtils.getNodeConnectorId(dpId, portNumber)));
    if (counterResultDS == null) {
        return false;
    }
    CounterResultBuilder crb = new CounterResultBuilder();
    String resultId = CountersUtils.getNodeConnectorId(dpId, portNumber);
    crb.setId(resultId);
    createGroups(counters, counterResultDS, crb, resultId);
    return !counters.isEmpty();
}
Also used : CounterResultBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.result.CounterResultBuilder) NodeConnectorId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId) NodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId)

Example 3 with NodeConnectorId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project netvirt by opendaylight.

the class InterfaceUtils method getDpIdFromInterface.

public static BigInteger getDpIdFromInterface(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState) {
    String lowerLayerIf = ifState.getLowerLayerIf().get(0);
    NodeConnectorId nodeConnectorId = new NodeConnectorId(lowerLayerIf);
    return new BigInteger(getDpnFromNodeConnectorId(nodeConnectorId));
}
Also used : NodeConnectorId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId) BigInteger(java.math.BigInteger)

Example 4 with NodeConnectorId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project netvirt by opendaylight.

the class IfMgr method transmitRouterAdvertisement.

private void transmitRouterAdvertisement(VirtualPort intf, Ipv6RtrAdvertType advType) {
    Ipv6RouterAdvt ipv6RouterAdvert = new Ipv6RouterAdvt(packetService);
    LOG.debug("in transmitRouterAdvertisement for {}", advType);
    VirtualNetwork vnet = getNetwork(intf.getNetworkID());
    if (vnet != null) {
        String nodeName;
        String outPort;
        Collection<VirtualNetwork.DpnInterfaceInfo> dpnIfaceList = vnet.getDpnIfaceList();
        for (VirtualNetwork.DpnInterfaceInfo dpnIfaceInfo : dpnIfaceList) {
            nodeName = Ipv6Constants.OPENFLOW_NODE_PREFIX + dpnIfaceInfo.getDpId();
            List<NodeConnectorRef> ncRefList = new ArrayList<>();
            for (Long ofPort : dpnIfaceInfo.ofPortList) {
                outPort = nodeName + ":" + ofPort;
                LOG.debug("Transmitting RA {} for node {}, port {}", advType, nodeName, outPort);
                InstanceIdentifier<NodeConnector> outPortId = InstanceIdentifier.builder(Nodes.class).child(Node.class, new NodeKey(new NodeId(nodeName))).child(NodeConnector.class, new NodeConnectorKey(new NodeConnectorId(outPort))).build();
                ncRefList.add(new NodeConnectorRef(outPortId));
            }
            if (!ncRefList.isEmpty()) {
                ipv6RouterAdvert.transmitRtrAdvertisement(advType, intf, ncRefList, null);
            }
        }
    }
}
Also used : NodeConnectorRef(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef) NodeConnector(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector) NodeConnectorId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId) ArrayList(java.util.ArrayList) Nodes(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes) IVirtualNetwork(org.opendaylight.netvirt.ipv6service.api.IVirtualNetwork) NodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId) NodeKey(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey) NodeConnectorKey(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey)

Example 5 with NodeConnectorId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId in project netvirt by opendaylight.

the class IfMgr method updateInterfaceDpidOfPortInfo.

public void updateInterfaceDpidOfPortInfo(Uuid portId) {
    LOG.debug("In updateInterfaceDpidOfPortInfo portId {}", portId);
    Interface interfaceState = ipv6ServiceUtils.getInterfaceStateFromOperDS(portId.getValue());
    if (interfaceState == null) {
        LOG.warn("In updateInterfaceDpidOfPortInfo, port info not found in Operational Store {}.", portId);
        return;
    }
    List<String> ofportIds = interfaceState.getLowerLayerIf();
    NodeConnectorId nodeConnectorId = new NodeConnectorId(ofportIds.get(0));
    BigInteger dpId = BigInteger.valueOf(MDSALUtil.getDpnIdFromPortName(nodeConnectorId));
    if (!dpId.equals(Ipv6Constants.INVALID_DPID)) {
        Long ofPort = MDSALUtil.getOfPortNumberFromPortName(nodeConnectorId);
        updateDpnInfo(portId, dpId, ofPort);
    }
}
Also used : NodeConnectorId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId) BigInteger(java.math.BigInteger) Interface(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface)

Aggregations

NodeConnectorId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId)86 BigInteger (java.math.BigInteger)31 NodeConnectorKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey)19 NodeConnector (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector)17 NodeId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId)16 NodeKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)15 FlowCapableNodeConnector (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector)12 Test (org.junit.Test)11 Nodes (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes)11 ArrayList (java.util.ArrayList)10 Collections (java.util.Collections)10 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)9 Node (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node)9 PhysAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress)8 NodeConnectorStatisticsAndPortNumberMap (org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMap)8 NodeConnectorRef (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef)7 MultipartReply (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply)7 List (java.util.List)6 ExecutionException (java.util.concurrent.ExecutionException)6 Xid (org.opendaylight.openflowplugin.api.openflow.device.Xid)5