use of org.projectfloodlight.openflow.types.U64 in project open-kilda by telstra.
the class AppsMetadata method makeValue.
private static U64 makeValue(Integer encapsulationId, boolean isForward) {
U64 value = U64.ZERO;
if (encapsulationId != null) {
value = setField(value, encapsulationId, ENCAPSULATION_ID_FIELD);
value = setField(value, isForward ? 1 : 0, FORWARD_REVERSE_FLAG);
}
return value;
}
use of org.projectfloodlight.openflow.types.U64 in project open-kilda by telstra.
the class MetadataBase method setField.
protected static U64 setField(U64 target, long value, BitField field) {
U64 result = target.and(U64.of(~field.getMask()));
value <<= field.getOffset();
return result.or(U64.of(value & field.getMask()));
}
use of org.projectfloodlight.openflow.types.U64 in project open-kilda by telstra.
the class OfInput method extractSwitchLatency.
private static Long extractSwitchLatency(IOFSwitch sw) {
U64 swLatency = sw.getLatency();
Long result = null;
if (swLatency != null) {
result = swLatency.getValue();
}
return result;
}
use of org.projectfloodlight.openflow.types.U64 in project open-kilda by telstra.
the class AppsMetadata method makeMask.
private static U64 makeMask(Integer encapsulationId) {
U64 mask = U64.ZERO;
if (encapsulationId != null) {
mask = setField(mask, -1, ENCAPSULATION_ID_FIELD);
mask = setField(mask, -1, FORWARD_REVERSE_FLAG);
}
return mask;
}
use of org.projectfloodlight.openflow.types.U64 in project open-kilda by telstra.
the class RoutingMetadata method makeMask.
private static U64 makeMask(Boolean lldpFlag, Boolean arpFlag, Boolean oneSwitchFlowFlag, Integer outerVlanId, Integer inputPort) {
U64 result = U64.ZERO;
if (lldpFlag != null) {
result = setField(result, -1, LLDP_MARKER_FLAG);
}
if (arpFlag != null) {
result = setField(result, -1, ARP_MARKER_FLAG);
}
if (oneSwitchFlowFlag != null) {
result = setField(result, -1, ONE_SWITCH_FLOW_FLAG);
}
if (outerVlanId != null) {
result = setField(result, -1, OUTER_VLAN_PRESENCE_FLAG);
result = setField(result, -1, OUTER_VLAN_FIELD);
}
if (inputPort != null) {
result = setField(result, -1, INPUT_PORT_FIELD);
}
return result;
}
Aggregations