use of org.onosproject.net.pi.runtime.PiLpmFieldMatch in project up4 by omec-project.
the class Up4TranslatorUtil method getFieldPrefix.
static Ip4Prefix getFieldPrefix(PiTableEntry entry, PiMatchFieldId fieldId) {
Optional<PiFieldMatch> optField = entry.matchKey().fieldMatch(fieldId);
if (optField.isEmpty()) {
return null;
}
PiLpmFieldMatch field = (PiLpmFieldMatch) optField.get();
Ip4Address address = Ip4Address.valueOf(field.value().asArray());
return Ip4Prefix.valueOf(address, field.prefixLength());
}
Aggregations