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);
}
Aggregations