use of org.projectfloodlight.openflow.protocol.OFLegacyMeterMod in project open-kilda by telstra.
the class SwitchManager method deleteLegacyMeter.
public long deleteLegacyMeter(final IOFSwitch sw, final DatapathId dpid, final long meterId) throws OFInstallException {
logger.debug("deleting legacy meter {} from switch {}", meterId, dpid);
OFFactory ofFactory = sw.getOFFactory();
OFLegacyMeterMod meterDelete = ofFactory.buildLegacyMeterMod().setMeterId(meterId).setMeters(emptyList()).setCommand(OFLegacyMeterModCommand.DELETE).build();
return pushFlow(sw, "--DeleteMeter--", meterDelete);
}
use of org.projectfloodlight.openflow.protocol.OFLegacyMeterMod 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);
}
Aggregations