use of org.onosproject.net.behaviour.ExtensionTreatmentResolver in project onos by opennetworkinglab.
the class OpenstackVtapManager method buildResubmitExtension.
private ExtensionTreatment buildResubmitExtension(DeviceId deviceId, int tableId) {
Device device = deviceService.getDevice(deviceId);
if (device == null || !device.is(ExtensionTreatmentResolver.class)) {
log.warn("Nicira extension treatment is not supported");
return null;
}
ExtensionTreatmentResolver resolver = device.as(ExtensionTreatmentResolver.class);
ExtensionTreatment treatment = resolver.getExtensionInstruction(NICIRA_RESUBMIT_TABLE.type());
try {
treatment.setPropertyValue(TABLE_EXTENSION, ((short) tableId));
return treatment;
} catch (ExtensionPropertyException e) {
log.error("Failed to set nicira resubmit extension treatment for {}", deviceId);
return null;
}
}
use of org.onosproject.net.behaviour.ExtensionTreatmentResolver in project onos by opennetworkinglab.
the class RulePopulatorUtil method buildResubmitExtension.
/**
* Returns the nicira resubmit extension treatment with given table ID.
*
* @param device device instance
* @param tableId table identifier
* @return resubmit extension treatment
*/
public static ExtensionTreatment buildResubmitExtension(Device device, int tableId) {
if (!checkTreatmentResolver(device)) {
return null;
}
ExtensionTreatmentResolver resolver = device.as(ExtensionTreatmentResolver.class);
ExtensionTreatment treatment = resolver.getExtensionInstruction(NICIRA_RESUBMIT_TABLE.type());
try {
treatment.setPropertyValue(TABLE_EXTENSION, ((short) tableId));
return treatment;
} catch (ExtensionPropertyException e) {
log.error("Failed to set nicira resubmit extension treatment for {}", device.id());
return null;
}
}
Aggregations