Java 类org.projectfloodlight.openflow.types.CircuitSignalID 实例源码

项目:athena    文件:OfOpticalSwitchImplLinc13.java   
/**
 * Rewrite match object to use LINC OF optical extensions.
 *
 * @param match original match
 * @return rewritten match
 */
private Match rewriteMatch(Match match) {
    Match.Builder mBuilder = factory().buildMatch();
    for (MatchField mf : match.getMatchFields()) {
        if (mf == MatchField.EXP_OCH_SIG_ID) {
            mBuilder.setExact(MatchField.OCH_SIGID, (CircuitSignalID) match.get(mf));
            continue;
        }
        if (mf == MatchField.EXP_OCH_SIGTYPE) {
            mBuilder.setExact(MatchField.OCH_SIGTYPE, (U8) match.get(mf));
            continue;
        }
        mBuilder.setExact(mf, match.get(mf));
    }

    return mBuilder.build();
}
项目:athena    文件:OfOpticalSwitchImplLinc13.java   
/**
 * Rewrite actions to use LINC OF optical extensions.
 *
 * @param actions original actions
 * @return rewritten actions
 */
private List<OFAction> rewriteActions(List<OFAction> actions) {
    List<OFAction> newActions = new LinkedList<>();

    for (OFAction action : actions) {
        if (!(action instanceof OFActionSetField)) {
            newActions.add(action);
            continue;
        }

        OFActionSetField sf = (OFActionSetField) action;
        if (!(sf.getField() instanceof OFOxmExpOchSigId)) {
            newActions.add(action);
            continue;
        }

        OFOxmExpOchSigId oxm = (OFOxmExpOchSigId) sf.getField();
        CircuitSignalID signalId = oxm.getValue();

        newActions.add(
                factory().actions().circuit(factory().oxms().ochSigid(signalId)));
    }

    return newActions;
}
项目:onos    文件:OfOpticalSwitchImplLinc13.java   
/**
 * Rewrite match object to use LINC OF optical extensions.
 *
 * @param match original match
 * @return rewritten match
 */
private Match rewriteMatch(Match match) {
    Match.Builder mBuilder = factory().buildMatch();
    for (MatchField mf : match.getMatchFields()) {
        if (mf == MatchField.EXP_OCH_SIG_ID) {
            mBuilder.setExact(MatchField.OCH_SIGID, (CircuitSignalID) match.get(mf));
            continue;
        }
        if (mf == MatchField.EXP_OCH_SIGTYPE) {
            mBuilder.setExact(MatchField.OCH_SIGTYPE, (U8) match.get(mf));
            continue;
        }
        mBuilder.setExact(mf, match.get(mf));
    }

    return mBuilder.build();
}
项目:onos    文件:OfOpticalSwitchImplLinc13.java   
/**
 * Rewrite actions to use LINC OF optical extensions.
 *
 * @param actions original actions
 * @return rewritten actions
 */
private List<OFAction> rewriteActions(List<OFAction> actions) {
    List<OFAction> newActions = new LinkedList<>();

    for (OFAction action : actions) {
        if (!(action instanceof OFActionSetField)) {
            newActions.add(action);
            continue;
        }

        OFActionSetField sf = (OFActionSetField) action;
        if (!(sf.getField() instanceof OFOxmExpOchSigId)) {
            newActions.add(action);
            continue;
        }

        OFOxmExpOchSigId oxm = (OFOxmExpOchSigId) sf.getField();
        CircuitSignalID signalId = oxm.getValue();

        newActions.add(
                factory().actions().circuit(factory().oxms().ochSigid(signalId)));
    }

    return newActions;
}
项目:athena    文件:FlowModBuilderVer13.java   
private OFAction buildL0Modification(Instruction i) {
    L0ModificationInstruction l0m = (L0ModificationInstruction) i;
    OFOxm<?> oxm = null;
    switch (l0m.subtype()) {
        case OCH:
            try {
                ModOchSignalInstruction modOchSignalInstruction = (ModOchSignalInstruction) l0m;
                OchSignal signal = modOchSignalInstruction.lambda();
                byte gridType = OpenFlowValueMapper.lookupGridType(signal.gridType());
                byte channelSpacing = OpenFlowValueMapper.lookupChannelSpacing(signal.channelSpacing());
                oxm = factory().oxms().expOchSigId(
                        new CircuitSignalID(gridType, channelSpacing,
                                (short) signal.spacingMultiplier(), (short) signal.slotGranularity()));
            } catch (NoMappingFoundException e) {
                log.warn(e.getMessage());
                break;
            }
            break;
        default:
            log.warn("Unimplemented action type {}.", l0m.subtype());
            break;
    }
    if (oxm != null) {
        return factory().actions().buildSetField().setField(oxm).build();
    }
    return null;
}
项目:athena    文件:FlowModBuilderVer13.java   
private OFAction buildModOchSignalInstruction(ModOchSignalInstruction instruction) {
    OchSignal signal = instruction.lambda();
    byte gridType = OpenFlowValueMapper.lookupGridType(signal.gridType());
    byte channelSpacing = OpenFlowValueMapper.lookupChannelSpacing(signal.channelSpacing());

    return factory().actions().circuit(factory().oxms().expOchSigId(
            new CircuitSignalID(gridType, channelSpacing,
                    (short) signal.spacingMultiplier(), (short) signal.slotGranularity())
    ));
}
项目:ravikumaran201504    文件:FlowModBuilderVer13.java   
private OFAction buildL0Modification(Instruction i) {
    L0ModificationInstruction l0m = (L0ModificationInstruction) i;
    switch (l0m.subtype()) {
    case LAMBDA:
        ModLambdaInstruction ml = (ModLambdaInstruction) i;
        return factory().actions().circuit(factory().oxms().ochSigidBasic(
                new CircuitSignalID((byte) 1, (byte) 2, ml.lambda(), (short) 1)));
    default:
        log.warn("Unimplemented action type {}.", l0m.subtype());
        break;
    }
    return null;
}
项目:ravikumaran201504    文件:GroupModBuilder.java   
private OFAction buildL0Modification(Instruction i) {
    L0ModificationInstruction l0m = (L0ModificationInstruction) i;
    switch (l0m.subtype()) {
        case LAMBDA:
            L0ModificationInstruction.ModLambdaInstruction ml =
                    (L0ModificationInstruction.ModLambdaInstruction) i;
            return factory.actions().circuit(factory.oxms().ochSigidBasic(
                    new CircuitSignalID((byte) 1, (byte) 2, ml.lambda(), (short) 1)));
        default:
            log.warn("Unimplemented action type {}.", l0m.subtype());
            break;
    }
    return null;
}
项目:Engine    文件:FlowModBuilderVer13.java   
private OFAction buildL0Modification(Instruction i) {
    L0ModificationInstruction l0m = (L0ModificationInstruction) i;
    OFOxm<?> oxm = null;
    switch (l0m.subtype()) {
        case OCH:
            try {
                ModOchSignalInstruction modOchSignalInstruction = (ModOchSignalInstruction) l0m;
                OchSignal signal = modOchSignalInstruction.lambda();
                byte gridType = OpenFlowValueMapper.lookupGridType(signal.gridType());
                byte channelSpacing = OpenFlowValueMapper.lookupChannelSpacing(signal.channelSpacing());
                oxm = factory().oxms().expOchSigId(
                        new CircuitSignalID(gridType, channelSpacing,
                                (short) signal.spacingMultiplier(), (short) signal.slotGranularity()));
            } catch (NoMappingFoundException e) {
                log.warn(e.getMessage());
                break;
            }
            break;
        default:
            log.warn("Unimplemented action type {}.", l0m.subtype());
            break;
    }
    if (oxm != null) {
        return factory().actions().buildSetField().setField(oxm).build();
    }
    return null;
}
项目:Engine    文件:FlowModBuilderVer13.java   
private OFAction buildModOchSignalInstruction(ModOchSignalInstruction instruction) {
    OchSignal signal = instruction.lambda();
    byte gridType = OpenFlowValueMapper.lookupGridType(signal.gridType());
    byte channelSpacing = OpenFlowValueMapper.lookupChannelSpacing(signal.channelSpacing());

    return factory().actions().circuit(factory().oxms().expOchSigId(
            new CircuitSignalID(gridType, channelSpacing,
                    (short) signal.spacingMultiplier(), (short) signal.slotGranularity())
    ));
}
项目:onos    文件:FlowModBuilderVer13.java   
protected OFAction buildL0Modification(Instruction i) {
    L0ModificationInstruction l0m = (L0ModificationInstruction) i;
    OFOxm<?> oxm = null;
    switch (l0m.subtype()) {
        case OCH:
            try {
                ModOchSignalInstruction modOchSignalInstruction = (ModOchSignalInstruction) l0m;
                OchSignal signal = modOchSignalInstruction.lambda();
                byte gridType = OpenFlowValueMapper.lookupGridType(signal.gridType());
                byte channelSpacing = OpenFlowValueMapper.lookupChannelSpacing(signal.channelSpacing());
                oxm = factory().oxms().expOchSigId(
                        new CircuitSignalID(gridType, channelSpacing,
                                (short) signal.spacingMultiplier(), (short) signal.slotGranularity()));
            } catch (NoMappingFoundException e) {
                log.warn(e.getMessage());
                break;
            }
            break;
        default:
            log.warn("Unimplemented action type {}.", l0m.subtype());
            break;
    }
    if (oxm != null) {
        return factory().actions().buildSetField().setField(oxm).build();
    }
    return null;
}