• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java OFOxm类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.projectfloodlight.openflow.protocol.oxm.OFOxm的典型用法代码示例。如果您正苦于以下问题:Java OFOxm类的具体用法?Java OFOxm怎么用?Java OFOxm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OFOxm类属于org.projectfloodlight.openflow.protocol.oxm包,在下文中一共展示了OFOxm类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: mapAction

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
@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());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:OfdpaExtensionTreatmentInterpreter.java


示例2: mapSelector

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
@Override
public OFOxm<?> mapSelector(OFFactory factory, ExtensionSelector extensionSelector) {
    ExtensionSelectorType type = extensionSelector.type();
    if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.OFDPA_MATCH_VLAN_VID.type())) {
        VlanId vlanId = ((OfdpaMatchVlanVid) extensionSelector).vlanId();
        // Special VLAN 0x0000/0x1FFF required by OFDPA
        if (vlanId.equals(VlanId.NONE)) {
            OFVlanVidMatch vid = OFVlanVidMatch.ofRawVid((short) 0x0000);
            OFVlanVidMatch mask = OFVlanVidMatch.ofRawVid((short) 0x1FFF);
            return factory.oxms().vlanVidMasked(vid, mask);
        // Normal case
        } else if (vlanId.equals(VlanId.ANY)) {
            return factory.oxms().vlanVidMasked(OFVlanVidMatch.PRESENT, OFVlanVidMatch.PRESENT);
        } else {
            return factory.oxms().vlanVid(OFVlanVidMatch.ofVlanVid(VlanVid.ofVlan(vlanId.toShort())));
        }
    }
    throw new UnsupportedOperationException(
            "Unexpected ExtensionSelector: " + extensionSelector.toString());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:OfdpaExtensionSelectorInterpreter.java


示例3: buildExtensionOxm

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
private OFOxm buildExtensionOxm(ExtensionSelector extension) {
    if (!driverService.isPresent()) {
        log.error("No driver service present");
        return null;
    }
    Driver driver = driverService.get().getDriver(deviceId);
    if (driver.hasBehaviour(ExtensionSelectorInterpreter.class)) {
        DefaultDriverHandler handler =
                new DefaultDriverHandler(new DefaultDriverData(driver, deviceId));
        ExtensionSelectorInterpreter interpreter = handler.behaviour(ExtensionSelectorInterpreter.class);

        return interpreter.mapSelector(factory(), extension);
    }

    return null;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:17,代码来源:FlowModBuilder.java


示例4: buildL1Modification

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
private OFAction buildL1Modification(Instruction i) {
    L1ModificationInstruction l1m = (L1ModificationInstruction) i;
    OFOxm<?> oxm = null;
    switch (l1m.subtype()) {
    case ODU_SIGID:
        ModOduSignalIdInstruction modOduSignalIdInstruction = (ModOduSignalIdInstruction) l1m;
        OduSignalId oduSignalId = modOduSignalIdInstruction.oduSignalId();

        OduSignalID oduSignalID = new OduSignalID((short) oduSignalId.tributaryPortNumber(),
                (short) oduSignalId.tributarySlotLength(),
                oduSignalId.tributarySlotBitmap());

        oxm = factory().oxms().expOduSigId(oduSignalID);
        break;
    default:
        log.warn("Unimplemented action type {}.", l1m.subtype());
        break;
    }

    if (oxm != null) {
        return factory().actions().buildSetField().setField(oxm).build();
    }
    return null;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:25,代码来源:FlowModBuilderVer13.java


示例5: ofList

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
public static OFOxmList ofList(Iterable<OFOxm<?>> oxmList) {
    Map<MatchFields, OFOxm<?>> map = new EnumMap<MatchFields, OFOxm<?>>(
            MatchFields.class);
    for (OFOxm<?> o : oxmList) {
        OFOxm<?> canonical = o.getCanonical();

        if(logger.isDebugEnabled() && !Objects.equal(o, canonical)) {
            logger.debug("OFOxmList: normalized non-canonical OXM {} to {}", o, canonical);
        }

        if(canonical != null)
            map.put(canonical.getMatchField().id, canonical);

    }
    return new OFOxmList(map);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:17,代码来源:OFOxmList.java


示例6: buildL1Modification

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
protected OFAction buildL1Modification(Instruction i) {
    L1ModificationInstruction l1m = (L1ModificationInstruction) i;
    OFOxm<?> oxm = null;
    switch (l1m.subtype()) {
    case ODU_SIGID:
        ModOduSignalIdInstruction modOduSignalIdInstruction = (ModOduSignalIdInstruction) l1m;
        OduSignalId oduSignalId = modOduSignalIdInstruction.oduSignalId();

        OduSignalID oduSignalID = new OduSignalID((short) oduSignalId.tributaryPortNumber(),
                (short) oduSignalId.tributarySlotLength(),
                oduSignalId.tributarySlotBitmap());

        oxm = factory().oxms().expOduSigId(oduSignalID);
        break;
    default:
        log.warn("Unimplemented action type {}.", l1m.subtype());
        break;
    }

    if (oxm != null) {
        return factory().actions().buildSetField().setField(oxm).build();
    }
    return null;
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:25,代码来源:FlowModBuilderVer13.java


示例7: mapSelector

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
@Override
public OFOxm<?> mapSelector(OFFactory factory, ExtensionSelector extensionSelector) {
    ExtensionSelectorType type = extensionSelector.type();

    if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_SPI.type())) {
        NiciraMatchNshSpi niciraNshSpi = (NiciraMatchNshSpi) extensionSelector;
        return factory.oxms().nsp(U32.of(niciraNshSpi.nshSpi().servicePathId()));
    }
    if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_SI.type())) {
        NiciraMatchNshSi niciraNshSi = (NiciraMatchNshSi) extensionSelector;
        return factory.oxms().nsi(U8.of(niciraNshSi.nshSi().serviceIndex()));
    }
    if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_ENCAP_ETH_TYPE.type())) {
        NiciraMatchEncapEthType niciraEncapEthType = (NiciraMatchEncapEthType) extensionSelector;
        return factory.oxms().encapEthType(U16.of(niciraEncapEthType.encapEthType()));
    }
    if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH1.type())) {
        // TODO
    }
    if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH2.type())) {
        // TODO
    }
    if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH3.type())) {
        // TODO
    }
    if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_CH4.type())) {
        // TODO
    }
    return null;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:31,代码来源:NiciraExtensionSelectorInterpreter.java


示例8: buildL0Modification

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
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;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:28,代码来源:FlowModBuilderVer13.java


示例9: of

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
public static OFOxmList of(OFOxm<?>... oxms) {
    Map<MatchFields, OFOxm<?>> map = new EnumMap<MatchFields, OFOxm<?>>(
            MatchFields.class);
    for (OFOxm<?> o : oxms) {
        OFOxm<?> canonical = o.getCanonical();

        if(logger.isDebugEnabled() && !Objects.equal(o, canonical)) {
            logger.debug("OFOxmList: normalized non-canonical OXM {} to {}", o, canonical);
        }

        if(canonical != null)
            map.put(canonical.getMatchField().id, canonical);
    }
    return new OFOxmList(map);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:16,代码来源:OFOxmList.java


示例10: mapSelector

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
@Override
public OFOxm<?> mapSelector(OFFactory factory, ExtensionSelector extensionSelector) {
    ExtensionSelectorType type = extensionSelector.type();
    if (type.equals(ExtensionSelectorTypes.OFDPA_MATCH_OVID.type())) {
        VlanId vlanId = ((Ofdpa3MatchOvid) extensionSelector).vlanId();
        if (vlanId.equals(VlanId.NONE)) {
            throw new UnsupportedOperationException(
                    "Unexpected ExtensionSelector: " + extensionSelector.toString());
        } else if (vlanId.equals(VlanId.ANY)) {
            throw new UnsupportedOperationException(
                    "Unexpected ExtensionSelector: " + extensionSelector.toString());
        } else {
            short mask = (short) 0x1000;
            short oVid = (short) (mask | vlanId.toShort());
            return factory.oxms().ofdpaOvid(U16.ofRaw(oVid));
        }
    } else if (type.equals(ExtensionSelectorTypes.OFDPA_MATCH_MPLS_L2_PORT.type())) {
        int mplsL2Port = ((Ofdpa3MatchMplsL2Port) extensionSelector).mplsL2Port();
        /*
         * 0x0000XXXX UNI Interface.
         * 0x0002XXXX NNI Interface
         */
        if ((mplsL2Port >= 0 && mplsL2Port <= 0x0000FFFF) ||
                (mplsL2Port >= 0x00020000 && mplsL2Port <= 0x0002FFFF)) {
            return factory.oxms().ofdpaMplsL2Port(U32.ofRaw(mplsL2Port));
        }
        throw new UnsupportedOperationException(
                    "Unexpected ExtensionSelector: " + extensionSelector.toString());
    }
    throw new UnsupportedOperationException(
            "Unexpected ExtensionSelector: " + extensionSelector.toString());
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:33,代码来源:Ofdpa3ExtensionSelectorInterpreter.java


示例11: mapOxm

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
@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());
        }
    }
    throw new UnsupportedOperationException(
            "Unexpected OXM: " + oxm.toString());
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:41,代码来源:Ofdpa3ExtensionSelectorInterpreter.java


示例12: mapAction

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
@Override
public ExtensionTreatment mapAction(OFAction action) throws UnsupportedOperationException {
    if (action.getType().equals(OFActionType.EXPERIMENTER)) {
        OFActionExperimenter actionExp = (OFActionExperimenter) action;
        if (actionExp.getExperimenter() == ATTENUATION_EXP) {
            OFActionOplinkAtt actionAtt = (OFActionOplinkAtt) action;
            return new OplinkAttenuation(((OFOxm<U32>) actionAtt.getField()).getValue().getRaw());
        }
    }
    return null;
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:12,代码来源:OplinkExtensionTreatmentInterpreter.java


示例13: buildL0Modification

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
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;
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:28,代码来源:FlowModBuilderVer13.java


示例14: testGetCanonicalNoMask

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
@Test
public void testGetCanonicalNoMask() {
    IPv4AddressWithMask fullIp = IPv4AddressWithMask.of("1.2.3.4/32");
    assertEquals(IPv4Address.NO_MASK, fullIp.getMask());
    OFOxmIpv4SrcMasked ipv4SrcMasked = oxms.ipv4SrcMasked(fullIp.getValue(), fullIp.getMask());
    assertTrue(ipv4SrcMasked.isMasked());
    assertEquals(IPv4Address.NO_MASK, ipv4SrcMasked.getMask());

    // canonicalize should convert the masked oxm to the non-masked one
    OFOxm<IPv4Address> canonical = ipv4SrcMasked.getCanonical();
    assertThat(canonical, CoreMatchers.instanceOf(OFOxmIpv4Src.class));
    assertFalse(canonical.isMasked());
}
 
开发者ID:floodlight,项目名称:loxigen-artifacts,代码行数:14,代码来源:OFOxmTest.java


示例15: testGetCanonicalNormalMask

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
@Test
public void testGetCanonicalNormalMask() {
    IPv4AddressWithMask ip = IPv4AddressWithMask.of("1.2.3.0/24");
    OFOxmIpv4SrcMasked ipv4SrcMasked = oxms.ipv4SrcMasked(ip.getValue(), ip.getMask());
    assertTrue(ipv4SrcMasked.isMasked());

    // canonicalize should convert the masked oxm to the non-masked one
    OFOxm<IPv4Address> canonical = ipv4SrcMasked.getCanonical();
    assertEquals(ipv4SrcMasked, canonical);
}
 
开发者ID:floodlight,项目名称:loxigen-artifacts,代码行数:11,代码来源:OFOxmTest.java


示例16: buildL2Modification

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
private OFAction buildL2Modification(Instruction i) {
    L2ModificationInstruction l2m = (L2ModificationInstruction) i;
    L2ModificationInstruction.ModEtherInstruction eth;
    OFOxm<?> oxm = null;
    switch (l2m.subtype()) {
        case ETH_DST:
            eth = (L2ModificationInstruction.ModEtherInstruction) l2m;
            oxm = factory.oxms().ethDst(MacAddress.of(eth.mac().toLong()));
            break;
        case ETH_SRC:
            eth = (L2ModificationInstruction.ModEtherInstruction) l2m;
            oxm = factory.oxms().ethSrc(MacAddress.of(eth.mac().toLong()));
            break;
        case VLAN_ID:
            L2ModificationInstruction.ModVlanIdInstruction vlanId =
                    (L2ModificationInstruction.ModVlanIdInstruction) l2m;
            oxm = factory.oxms().vlanVid(OFVlanVidMatch.ofVlan(vlanId.vlanId().toShort()));
            break;
        case VLAN_PCP:
            L2ModificationInstruction.ModVlanPcpInstruction vlanPcp =
                    (L2ModificationInstruction.ModVlanPcpInstruction) l2m;
            oxm = factory.oxms().vlanPcp(VlanPcp.of(vlanPcp.vlanPcp()));
            break;
        case VLAN_POP:
            return factory.actions().popVlan();
        case VLAN_PUSH:
            L2ModificationInstruction.PushHeaderInstructions pushVlanInstruction
                    = (L2ModificationInstruction.PushHeaderInstructions) l2m;
            return factory.actions().pushVlan(
                    EthType.of(pushVlanInstruction.ethernetType().toShort()));
        case MPLS_PUSH:
            L2ModificationInstruction.PushHeaderInstructions pushHeaderInstructions =
                    (L2ModificationInstruction.PushHeaderInstructions) l2m;
            return factory.actions().pushMpls(EthType.of(pushHeaderInstructions
                                                         .ethernetType().toShort()));
        case MPLS_POP:
            L2ModificationInstruction.PushHeaderInstructions popHeaderInstructions =
                    (L2ModificationInstruction.PushHeaderInstructions) l2m;
            return factory.actions().popMpls(EthType.of(popHeaderInstructions
                                                        .ethernetType().toShort()));
        case MPLS_LABEL:
            L2ModificationInstruction.ModMplsLabelInstruction mplsLabel =
                    (L2ModificationInstruction.ModMplsLabelInstruction) l2m;
            oxm = factory.oxms().mplsLabel(U32.of(mplsLabel.label().toInt()));
            break;
        case MPLS_BOS:
            L2ModificationInstruction.ModMplsBosInstruction mplsBos =
                    (L2ModificationInstruction.ModMplsBosInstruction) l2m;
            oxm = factory.oxms()
                    .mplsBos(mplsBos.mplsBos() ? OFBooleanValue.TRUE
                                               : OFBooleanValue.FALSE);
            break;
        case DEC_MPLS_TTL:
            return factory.actions().decMplsTtl();
        case TUNNEL_ID:
            L2ModificationInstruction.ModTunnelIdInstruction tunnelId =
                    (L2ModificationInstruction.ModTunnelIdInstruction) l2m;
            oxm = factory.oxms().tunnelId(U64.of(tunnelId.tunnelId()));
            break;
        default:
            log.warn("Unimplemented action type {}.", l2m.subtype());
            break;
    }

    if (oxm != null) {
        return factory.actions().buildSetField().setField(oxm).build();
    }
    return null;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:70,代码来源:GroupModBuilder.java


示例17: buildL3Modification

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
private OFAction buildL3Modification(Instruction i) {
    L3ModificationInstruction l3m = (L3ModificationInstruction) i;
    L3ModificationInstruction.ModIPInstruction ip;
    Ip4Address ip4;
    Ip6Address ip6;
    OFOxm<?> oxm = null;
    switch (l3m.subtype()) {
        case IPV4_SRC:
            ip = (L3ModificationInstruction.ModIPInstruction) i;
            ip4 = ip.ip().getIp4Address();
            oxm = factory.oxms().ipv4Src(IPv4Address.of(ip4.toInt()));
            break;
        case IPV4_DST:
            ip = (L3ModificationInstruction.ModIPInstruction) i;
            ip4 = ip.ip().getIp4Address();
            oxm = factory.oxms().ipv4Dst(IPv4Address.of(ip4.toInt()));
            break;
        case IPV6_SRC:
            ip = (L3ModificationInstruction.ModIPInstruction) i;
            ip6 = ip.ip().getIp6Address();
            oxm = factory.oxms().ipv6Src(IPv6Address.of(ip6.toOctets()));
            break;
        case IPV6_DST:
            ip = (L3ModificationInstruction.ModIPInstruction) i;
            ip6 = ip.ip().getIp6Address();
            oxm = factory.oxms().ipv6Dst(IPv6Address.of(ip6.toOctets()));
            break;
        case IPV6_FLABEL:
            L3ModificationInstruction.ModIPv6FlowLabelInstruction flowLabelInstruction =
                (L3ModificationInstruction.ModIPv6FlowLabelInstruction) i;
            int flowLabel = flowLabelInstruction.flowLabel();
            oxm = factory.oxms().ipv6Flabel(IPv6FlowLabel.of(flowLabel));
            break;
        case DEC_TTL:
            return factory.actions().decNwTtl();
        case TTL_IN:
            return factory.actions().copyTtlIn();
        case TTL_OUT:
            return factory.actions().copyTtlOut();
        default:
            log.warn("Unimplemented action type {}.", l3m.subtype());
            break;
    }

    if (oxm != null) {
        return factory.actions().buildSetField().setField(oxm).build();
    }
    return null;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:50,代码来源:GroupModBuilder.java


示例18: buildL2Modification

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
private OFAction buildL2Modification(Instruction i) {
    L2ModificationInstruction l2m = (L2ModificationInstruction) i;
    L2ModificationInstruction.ModEtherInstruction eth;
    OFOxm<?> oxm = null;
    switch (l2m.subtype()) {
        case ETH_DST:
            eth = (L2ModificationInstruction.ModEtherInstruction) l2m;
            oxm = factory.oxms().ethDst(MacAddress.of(eth.mac().toLong()));
            break;
        case ETH_SRC:
            eth = (L2ModificationInstruction.ModEtherInstruction) l2m;
            oxm = factory.oxms().ethSrc(MacAddress.of(eth.mac().toLong()));
            break;
        case VLAN_ID:
            L2ModificationInstruction.ModVlanIdInstruction vlanId =
                    (L2ModificationInstruction.ModVlanIdInstruction) l2m;
            oxm = factory.oxms().vlanVid(OFVlanVidMatch.ofVlan(vlanId.vlanId().toShort()));
            break;
        case VLAN_PCP:
            L2ModificationInstruction.ModVlanPcpInstruction vlanPcp =
                    (L2ModificationInstruction.ModVlanPcpInstruction) l2m;
            oxm = factory.oxms().vlanPcp(VlanPcp.of(vlanPcp.vlanPcp()));
            break;
        case VLAN_POP:
            return factory.actions().popVlan();
        case VLAN_PUSH:
            L2ModificationInstruction.PushHeaderInstructions pushVlanInstruction
                    = (L2ModificationInstruction.PushHeaderInstructions) l2m;
            return factory.actions().pushVlan(
                    EthType.of(pushVlanInstruction.ethernetType()));
        case MPLS_PUSH:
            L2ModificationInstruction.PushHeaderInstructions pushHeaderInstructions =
                    (L2ModificationInstruction.PushHeaderInstructions) l2m;
            return factory.actions().pushMpls(EthType.of(pushHeaderInstructions
                                                         .ethernetType()));
        case MPLS_POP:
            L2ModificationInstruction.PushHeaderInstructions popHeaderInstructions =
                    (L2ModificationInstruction.PushHeaderInstructions) l2m;
            return factory.actions().popMpls(EthType.of(popHeaderInstructions
                                                        .ethernetType()));
        case MPLS_LABEL:
            L2ModificationInstruction.ModMplsLabelInstruction mplsLabel =
                    (L2ModificationInstruction.ModMplsLabelInstruction) l2m;
            oxm = factory.oxms().mplsLabel(U32.of(mplsLabel.label()
                    .longValue()));
            break;
        case DEC_MPLS_TTL:
            return factory.actions().decMplsTtl();
        default:
            log.warn("Unimplemented action type {}.", l2m.subtype());
            break;
    }

    if (oxm != null) {
        return factory.actions().buildSetField().setField(oxm).build();
    }
    return null;
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:59,代码来源:GroupModBuilder.java


示例19: OFOxmList

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
private OFOxmList(Map<MatchFields, OFOxm<?>> oxmMap) {
    this.oxmMap = oxmMap;
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:4,代码来源:OFOxmList.java


示例20: get

import org.projectfloodlight.openflow.protocol.oxm.OFOxm; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public <T extends OFValueType<T>> OFOxm<T> get(MatchField<T> matchField) {
    return (OFOxm<T>) oxmMap.get(matchField.id);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:5,代码来源:OFOxmList.java



注:本文中的org.projectfloodlight.openflow.protocol.oxm.OFOxm类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SCMRevisionState类代码示例发布时间:2022-05-21
下一篇:
Java DefaultConfigurationFactory类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap