use of org.projectfloodlight.openflow.types.U64 in project open-kilda by telstra.
the class RoutingMetadata method makeValue.
private static U64 makeValue(Boolean lldpFlag, Boolean arpFlag, Boolean oneSwitchFlowFlag, Integer outerVlanId, Integer inputPort) {
U64 result = U64.ZERO;
if (lldpFlag != null) {
result = setField(result, lldpFlag ? 1 : 0, LLDP_MARKER_FLAG);
}
if (arpFlag != null) {
result = setField(result, arpFlag ? 1 : 0, ARP_MARKER_FLAG);
}
if (oneSwitchFlowFlag != null) {
result = setField(result, oneSwitchFlowFlag ? 1 : 0, ONE_SWITCH_FLOW_FLAG);
}
if (outerVlanId != null) {
result = setField(result, 1, OUTER_VLAN_PRESENCE_FLAG);
result = setField(result, outerVlanId, OUTER_VLAN_FIELD);
}
if (inputPort != null) {
if (inputPort < 0 || inputPort > MAX_INPUT_PORT) {
throw new IllegalArgumentException(format("Invalid inputPort %s. Valid range [0, %d]", inputPort, MAX_INPUT_PORT));
}
result = setField(result, inputPort, INPUT_PORT_FIELD);
}
return result;
}
Aggregations