Search in sources :

Example 1 with OFOxmOfdpaActsetOutput

use of org.projectfloodlight.openflow.protocol.oxm.OFOxmOfdpaActsetOutput in project onos by opennetworkinglab.

the class OvsOfdpaExtensionSelectorInterpreter method mapOxm.

@Override
public ExtensionSelector mapOxm(OFOxm<?> oxm) {
    if (oxm.getMatchField().equals(MatchField.OFDPA_ACTSET_OUTPUT)) {
        U32 portNumberU32 = ((OFOxmOfdpaActsetOutput) oxm).getValue();
        PortNumber portNumber = PortNumber.portNumber(portNumberU32.getValue());
        return new OfdpaMatchActsetOutput(portNumber);
    }
    throw new UnsupportedOperationException("Unexpected OXM: " + oxm.toString());
}
Also used : OFOxmOfdpaActsetOutput(org.projectfloodlight.openflow.protocol.oxm.OFOxmOfdpaActsetOutput) U32(org.projectfloodlight.openflow.types.U32) PortNumber(org.onosproject.net.PortNumber)

Example 2 with OFOxmOfdpaActsetOutput

use of org.projectfloodlight.openflow.protocol.oxm.OFOxmOfdpaActsetOutput in project onos by opennetworkinglab.

the class Ofdpa3ExtensionSelectorInterpreter method mapOxm.

@Override
public ExtensionSelector mapOxm(OFOxm<?> oxm) {
    if (oxm.getMatchField().equals(MatchField.OFDPA_OVID)) {
        VlanId vlanId;
        if (oxm.isMasked()) {
            throw new UnsupportedOperationException("Unexpected OXM: " + oxm.toString());
        } else {
            OFOxmOfdpaOvid ovid = ((OFOxmOfdpaOvid) oxm);
            short mask = (short) 0x0FFF;
            short oVid = (short) (mask & ovid.getValue().getRaw());
            vlanId = VlanId.vlanId(oVid);
        }
        return new Ofdpa3MatchOvid(vlanId);
    } else if (oxm.getMatchField().equals(MatchField.OFDPA_MPLS_L2_PORT)) {
        Integer mplsL2Port;
        /*
             * Supported but not used for now.
             */
        if (oxm.isMasked()) {
            throw new UnsupportedOperationException("Unexpected OXM: " + oxm.toString());
        } else {
            OFOxmOfdpaMplsL2Port mplsl2port = ((OFOxmOfdpaMplsL2Port) oxm);
            mplsL2Port = mplsl2port.getValue().getRaw();
            /*
                 * 0x0000XXXX UNI Interface.
                 * 0x0002XXXX NNI Interface
                 */
            if ((mplsL2Port >= 0 && mplsL2Port <= 0x0000FFFF) || (mplsL2Port >= 0x00020000 && mplsL2Port <= 0x0002FFFF)) {
                return new Ofdpa3MatchMplsL2Port(mplsL2Port);
            }
            throw new UnsupportedOperationException("Unexpected OXM: " + oxm.toString());
        }
    } else if (oxm.getMatchField().equals(MatchField.OFDPA_ACTSET_OUTPUT)) {
        U32 portNumberU32 = ((OFOxmOfdpaActsetOutput) oxm).getValue();
        PortNumber portNumber = PortNumber.portNumber(portNumberU32.getValue());
        return new OfdpaMatchActsetOutput(portNumber);
    } else if (oxm.getMatchField().equals(MatchField.OFDPA_ALLOW_VLAN_TRANSLATION)) {
        U8 value = ((OFOxmOfdpaAllowVlanTranslation) oxm).getValue();
        return new OfdpaMatchAllowVlanTranslation(value.getValue());
    }
    throw new UnsupportedOperationException("Unexpected OXM: " + oxm.toString());
}
Also used : OFOxmOfdpaOvid(org.projectfloodlight.openflow.protocol.oxm.OFOxmOfdpaOvid) OFOxmOfdpaActsetOutput(org.projectfloodlight.openflow.protocol.oxm.OFOxmOfdpaActsetOutput) U8(org.projectfloodlight.openflow.types.U8) U32(org.projectfloodlight.openflow.types.U32) OFOxmOfdpaMplsL2Port(org.projectfloodlight.openflow.protocol.oxm.OFOxmOfdpaMplsL2Port) PortNumber(org.onosproject.net.PortNumber) VlanId(org.onlab.packet.VlanId)

Aggregations

PortNumber (org.onosproject.net.PortNumber)2 OFOxmOfdpaActsetOutput (org.projectfloodlight.openflow.protocol.oxm.OFOxmOfdpaActsetOutput)2 U32 (org.projectfloodlight.openflow.types.U32)2 VlanId (org.onlab.packet.VlanId)1 OFOxmOfdpaMplsL2Port (org.projectfloodlight.openflow.protocol.oxm.OFOxmOfdpaMplsL2Port)1 OFOxmOfdpaOvid (org.projectfloodlight.openflow.protocol.oxm.OFOxmOfdpaOvid)1 U8 (org.projectfloodlight.openflow.types.U8)1