Search in sources :

Example 11 with U64

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;
}
Also used : U64(org.projectfloodlight.openflow.types.U64)

Example 12 with U64

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()));
}
Also used : U64(org.projectfloodlight.openflow.types.U64)

Example 13 with U64

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;
}
Also used : U64(org.projectfloodlight.openflow.types.U64)

Example 14 with U64

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;
}
Also used : U64(org.projectfloodlight.openflow.types.U64)

Example 15 with U64

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;
}
Also used : U64(org.projectfloodlight.openflow.types.U64)

Aggregations

U64 (org.projectfloodlight.openflow.types.U64)16 OFPort (org.projectfloodlight.openflow.types.OFPort)6 OFVlanVidMatch (org.projectfloodlight.openflow.types.OFVlanVidMatch)5 TransportPort (org.projectfloodlight.openflow.types.TransportPort)5 HashSet (java.util.HashSet)4 Match (org.projectfloodlight.openflow.protocol.match.Match)4 EthType (org.projectfloodlight.openflow.types.EthType)4 IpProtocol (org.projectfloodlight.openflow.types.IpProtocol)4 MacAddress (org.projectfloodlight.openflow.types.MacAddress)4 OFMetadata (org.projectfloodlight.openflow.types.OFMetadata)4 List (java.util.List)3 IOFSwitch (net.floodlightcontroller.core.IOFSwitch)3 FloodlightModuleException (net.floodlightcontroller.core.module.FloodlightModuleException)3 Test (org.junit.Test)3 SwitchId (org.openkilda.model.SwitchId)3 OFFlowStatsEntry (org.projectfloodlight.openflow.protocol.OFFlowStatsEntry)3 OFFactoryVer13 (org.projectfloodlight.openflow.protocol.ver13.OFFactoryVer13)3 ImmutableList (com.google.common.collect.ImmutableList)2 ImmutableSet (com.google.common.collect.ImmutableSet)2 Lists (com.google.common.collect.Lists)2