Search in sources :

Example 21 with Dpid

use of org.onosproject.openflow.controller.Dpid in project onos by opennetworkinglab.

the class OpenFlowMeterProvider method performMeterOperation.

@Override
public void performMeterOperation(DeviceId deviceId, MeterOperation meterOp) {
    Dpid dpid = Dpid.dpid(deviceId.uri());
    OpenFlowSwitch sw = controller.getSwitch(dpid);
    if (sw == null) {
        log.error("Unknown device {}", deviceId);
        providerService.meterOperationFailed(meterOp, MeterFailReason.UNKNOWN_DEVICE);
        return;
    }
    performOperation(sw, meterOp);
    if (forceStatsAfterMeterRemoval && meterOp.type().equals(MeterOperation.Type.REMOVE)) {
        forceMeterStats(deviceId);
    }
}
Also used : Dpid(org.onosproject.openflow.controller.Dpid) OpenFlowSwitch(org.onosproject.openflow.controller.OpenFlowSwitch)

Example 22 with Dpid

use of org.onosproject.openflow.controller.Dpid in project onos by opennetworkinglab.

the class OpenFlowLambdaQuery method getPortDescs.

private List<OFPortDesc> getPortDescs() {
    final Dpid dpid = dpid(handler().data().deviceId().uri());
    OpenFlowSwitch sw = handler().get(OpenFlowController.class).getSwitch(dpid);
    return sw.getPorts();
}
Also used : Dpid(org.onosproject.openflow.controller.Dpid) OpenFlowSwitch(org.onosproject.openflow.controller.OpenFlowSwitch) OpenFlowController(org.onosproject.openflow.controller.OpenFlowController)

Aggregations

Dpid (org.onosproject.openflow.controller.Dpid)22 OpenFlowSwitch (org.onosproject.openflow.controller.OpenFlowSwitch)17 OpenFlowController (org.onosproject.openflow.controller.OpenFlowController)5 DeviceId (org.onosproject.net.DeviceId)4 GroupId (org.onosproject.core.GroupId)3 OFPortDesc (org.projectfloodlight.openflow.protocol.OFPortDesc)3 ByteBuf (io.netty.buffer.ByteBuf)2 DefaultDriverData (org.onosproject.net.driver.DefaultDriverData)2 DefaultDriverHandler (org.onosproject.net.driver.DefaultDriverHandler)2 Driver (org.onosproject.net.driver.Driver)2 DriverHandler (org.onosproject.net.driver.DriverHandler)2 GroupBuckets (org.onosproject.net.group.GroupBuckets)2 Preconditions.checkNotNull (com.google.common.base.Preconditions.checkNotNull)1 Strings.isNullOrEmpty (com.google.common.base.Strings.isNullOrEmpty)1 Cache (com.google.common.cache.Cache)1 CacheBuilder (com.google.common.cache.CacheBuilder)1 RemovalCause (com.google.common.cache.RemovalCause)1 RemovalNotification (com.google.common.cache.RemovalNotification)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 Lists (com.google.common.collect.Lists)1