Search in sources :

Example 1 with OFLegacyMeterFlags

use of org.projectfloodlight.openflow.protocol.OFLegacyMeterFlags in project open-kilda by telstra.

the class SwitchManager method installLegacyMeter.

private long installLegacyMeter(final IOFSwitch sw, final DatapathId dpid, final long bandwidth, final long burstSize, final long meterId) throws OFInstallException {
    logger.debug("installing legacy meter {} on OVS switch {} width bandwidth {}", meterId, dpid, bandwidth);
    Set<OFLegacyMeterFlags> flags = new HashSet<>(asList(OFLegacyMeterFlags.KBPS, OFLegacyMeterFlags.BURST));
    OFFactory ofFactory = sw.getOFFactory();
    OFLegacyMeterBandDrop.Builder bandBuilder = ofFactory.legacyMeterBandDrop(bandwidth, burstSize).createBuilder();
    OFLegacyMeterMod meterMod = ofFactory.buildLegacyMeterMod().setMeterId(meterId).setCommand(OFLegacyMeterModCommand.ADD).setMeters(singletonList(bandBuilder.build())).setFlags(flags).build();
    return pushFlow(sw, "--InstallMeter", meterMod);
}
Also used : OFLegacyMeterFlags(org.projectfloodlight.openflow.protocol.OFLegacyMeterFlags) OFFactory(org.projectfloodlight.openflow.protocol.OFFactory) OFLegacyMeterBandDrop(org.projectfloodlight.openflow.protocol.OFLegacyMeterBandDrop) OFLegacyMeterMod(org.projectfloodlight.openflow.protocol.OFLegacyMeterMod) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 OFFactory (org.projectfloodlight.openflow.protocol.OFFactory)1 OFLegacyMeterBandDrop (org.projectfloodlight.openflow.protocol.OFLegacyMeterBandDrop)1 OFLegacyMeterFlags (org.projectfloodlight.openflow.protocol.OFLegacyMeterFlags)1 OFLegacyMeterMod (org.projectfloodlight.openflow.protocol.OFLegacyMeterMod)1