Java 类org.projectfloodlight.openflow.protocol.oxm.OFOxmVlanVid 实例源码

项目:athena    文件:OfdpaExtensionTreatmentInterpreter.java   
@Override
public ExtensionTreatment mapAction(OFAction action) throws UnsupportedOperationException {
    if (action.getType().equals(OFActionType.SET_FIELD)) {
        OFActionSetField setFieldAction = (OFActionSetField) action;
        OFOxm<?> oxm = setFieldAction.getField();
        switch (oxm.getMatchField().id) {
            case VLAN_VID:
                OFOxmVlanVid vlanVid = (OFOxmVlanVid) oxm;
                return new OfdpaSetVlanVid(VlanId.vlanId(vlanVid.getValue().getRawVid()));
            default:
                throw new UnsupportedOperationException(
                        "Driver does not support extension type " + oxm.getMatchField().id);
        }
    }
    throw new UnsupportedOperationException(
            "Unexpected OFAction: " + action.toString());
}
项目:onos    文件:OfdpaExtensionTreatmentInterpreter.java   
@Override
public ExtensionTreatment mapAction(OFAction action) throws UnsupportedOperationException {
    if (action.getType().equals(OFActionType.SET_FIELD)) {
        OFActionSetField setFieldAction = (OFActionSetField) action;
        OFOxm<?> oxm = setFieldAction.getField();
        switch (oxm.getMatchField().id) {
            case VLAN_VID:
                OFOxmVlanVid vlanVid = (OFOxmVlanVid) oxm;
                return new OfdpaSetVlanVid(VlanId.vlanId(vlanVid.getValue().getRawVid()));
            default:
                throw new UnsupportedOperationException(
                        "Driver does not support extension type " + oxm.getMatchField().id);
        }
    }
    throw new UnsupportedOperationException(
            "Unexpected OFAction: " + action.toString());
}