当前位置: 首页>>代码示例>>Java>>正文


Java OFVlanVidMatch类代码示例

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


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

示例1: actionReplaceVlan

import org.projectfloodlight.openflow.types.OFVlanVidMatch; //导入依赖的package包/类
/**
 * Create an OFAction to change the outer most vlan.
 *
 * @param sw      switch object
 * @param newVlan final VLAN to be set on the packet
 * @return {@link OFAction}
 */
private OFAction actionReplaceVlan(final IOFSwitch sw, final int newVlan) {
    OFFactory factory = sw.getOFFactory();
    OFOxms oxms = factory.oxms();
    OFActions actions = factory.actions();

    if (OF_12.compareTo(factory.getVersion()) == 0) {
        return actions.buildSetField().setField(oxms.buildVlanVid()
                .setValue(OFVlanVidMatch.ofRawVid((short) newVlan))
                .build()).build();
    } else {
        return actions.buildSetField().setField(oxms.buildVlanVid()
                .setValue(OFVlanVidMatch.ofVlan(newVlan))
                .build()).build();
    }
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:23,代码来源:SwitchManager.java

示例2: transitFlowMod

import org.projectfloodlight.openflow.types.OFVlanVidMatch; //导入依赖的package包/类
default OFFlowAdd transitFlowMod(int inputPort, int outputPort, int transitVlan, long cookie) {
    return ofFactory.buildFlowAdd()
            .setCookie(U64.of(cookie & FLOW_COOKIE_MASK))
            .setHardTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setIdleTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setBufferId(OFBufferId.NO_BUFFER)
            .setPriority(FlowModUtils.PRIORITY_VERY_HIGH)
            .setMatch(ofFactory.buildMatch()
                    .setExact(MatchField.IN_PORT, OFPort.of(inputPort))
                    .setExact(MatchField.VLAN_VID, OFVlanVidMatch.ofVlan(transitVlan))
                    .build())
            .setInstructions(singletonList(
                    ofFactory.instructions().applyActions(singletonList(
                            ofFactory.actions().buildOutput()
                                    .setMaxLen(0xFFFFFFFF)
                                    .setPort(OFPort.of(outputPort))
                                    .build()))
                            .createBuilder()
                            .build()))
            .setXid(0L)
            .build();
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:23,代码来源:OutputCommands.java

示例3: oneSwitchPopFlowMod

import org.projectfloodlight.openflow.types.OFVlanVidMatch; //导入依赖的package包/类
default OFFlowAdd oneSwitchPopFlowMod(int inputPort, int outputPort, int inputVlan, long meterId, long cookie) {
    return ofFactory.buildFlowAdd()
            .setCookie(U64.of(cookie & FLOW_COOKIE_MASK))
            .setHardTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setIdleTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setBufferId(OFBufferId.NO_BUFFER)
            .setPriority(FlowModUtils.PRIORITY_VERY_HIGH)
            .setMatch(ofFactory.buildMatch()
                    .setExact(MatchField.IN_PORT, OFPort.of(inputPort))
                    .setExact(MatchField.VLAN_VID, OFVlanVidMatch.ofVlan(inputVlan))
                    .build())
            .setInstructions(Arrays.asList(
                    ofFactory.instructions().buildMeter().setMeterId(meterId).build(),
                    ofFactory.instructions().applyActions(Arrays.asList(
                            ofFactory.actions().popVlan(),
                            ofFactory.actions().buildOutput()
                                    .setMaxLen(0xFFFFFFFF)
                                    .setPort(OFPort.of(outputPort))
                                    .build()))
                            .createBuilder()
                            .build()))
            .setXid(0L)
            .build();
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:25,代码来源:OutputCommands.java

示例4: egressPopFlowMod

import org.projectfloodlight.openflow.types.OFVlanVidMatch; //导入依赖的package包/类
@Override
public OFFlowAdd egressPopFlowMod(int inputPort, int outputPort, int transitVlan, long cookie) {
    return ofFactory.buildFlowAdd()
            .setCookie(U64.of(cookie & FLOW_COOKIE_MASK))
            .setHardTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setIdleTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setBufferId(OFBufferId.NO_BUFFER)
            .setPriority(FlowModUtils.PRIORITY_VERY_HIGH)
            .setMatch(ofFactory.buildMatch()
                    .setExact(MatchField.IN_PORT, OFPort.of(inputPort))
                    .setExact(MatchField.VLAN_VID, OFVlanVidMatch.ofVlan(transitVlan))
                    .build())
            .setInstructions(singletonList(
                    ofFactory.instructions().applyActions(Arrays.asList(
                            ofFactory.actions().popVlan(),
                            ofFactory.actions().popVlan(),
                            ofFactory.actions().buildOutput()
                                    .setMaxLen(0xFFFFFFFF)
                                    .setPort(OFPort.of(outputPort))
                                    .build()))
                            .createBuilder()
                            .build()))
            .setXid(0L)
            .build();
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:26,代码来源:PushSchemeOutputCommands.java

示例5: egressNoneFlowMod

import org.projectfloodlight.openflow.types.OFVlanVidMatch; //导入依赖的package包/类
@Override
public OFFlowAdd egressNoneFlowMod(int inputPort, int outputPort, int transitVlan, long cookie) {
    return ofFactory.buildFlowAdd()
            .setCookie(U64.of(cookie & FLOW_COOKIE_MASK))
            .setHardTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setIdleTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setBufferId(OFBufferId.NO_BUFFER)
            .setPriority(FlowModUtils.PRIORITY_VERY_HIGH)
            .setMatch(ofFactory.buildMatch()
                    .setExact(MatchField.IN_PORT, OFPort.of(inputPort))
                    .setExact(MatchField.VLAN_VID, OFVlanVidMatch.ofVlan(transitVlan))
                    .build())
            .setInstructions(singletonList(
                    ofFactory.instructions().applyActions(Arrays.asList(
                            ofFactory.actions().popVlan(),
                            ofFactory.actions().buildOutput()
                                    .setMaxLen(0xFFFFFFFF)
                                    .setPort(OFPort.of(outputPort))
                                    .build()))
                            .createBuilder()
                            .build()))
            .setXid(0L)
            .build();
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:25,代码来源:PushSchemeOutputCommands.java

示例6: mapSelector

import org.projectfloodlight.openflow.types.OFVlanVidMatch; //导入依赖的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

示例7: createMatchFromPacket

import org.projectfloodlight.openflow.types.OFVlanVidMatch; //导入依赖的package包/类
protected Match createMatchFromPacket(IOFSwitch sw, OFPort inPort, FloodlightContext cntx) {
	// The packet in match will only contain the port number.
	// We need to add in specifics for the hosts we're routing between.
	Ethernet eth = IFloodlightProviderService.bcStore.get(cntx, IFloodlightProviderService.CONTEXT_PI_PAYLOAD);
	VlanVid vlan = VlanVid.ofVlan(eth.getVlanID());
	MacAddress srcMac = eth.getSourceMACAddress();
	MacAddress dstMac = eth.getDestinationMACAddress();

	Match.Builder mb = sw.getOFFactory().buildMatch();
	mb.setExact(MatchField.IN_PORT, inPort)
	.setExact(MatchField.ETH_SRC, srcMac)
	.setExact(MatchField.ETH_DST, dstMac);

	if (!vlan.equals(VlanVid.ZERO)) {
		mb.setExact(MatchField.VLAN_VID, OFVlanVidMatch.ofVlanVid(vlan));
	}

	return mb.build();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:20,代码来源:LearningSwitch.java

示例8: matchFlow

import org.projectfloodlight.openflow.types.OFVlanVidMatch; //导入依赖的package包/类
/**
 * Creates a Match based on an inputPort and VlanID.
 * NB1: that this match only matches on the outer most tag which must be of ether-type 0x8100.
 * NB2: vlanId of 0 means match on port, not vlan
 *
 * @param sw        switch object
 * @param inputPort input port for the match
 * @param vlanId    vlanID to match on; 0 means match on port
 * @return {@link Match}
 */
private Match matchFlow(final IOFSwitch sw, final int inputPort, final int vlanId) {
    Match.Builder mb = sw.getOFFactory().buildMatch();
    //
    // Extra emphasis: vlan of 0 means match on port on not VLAN.
    //
    if (vlanId > 0) {
        mb.setExact(MatchField.IN_PORT, OFPort.of(inputPort))
                .setExact(MatchField.VLAN_VID, OFVlanVidMatch.ofVlan(vlanId));
    } else {
        mb.setExact(MatchField.IN_PORT, OFPort.of(inputPort));
    }
    return mb.build();
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:24,代码来源:SwitchManager.java

示例9: oneSwitchReplaceFlowMod

import org.projectfloodlight.openflow.types.OFVlanVidMatch; //导入依赖的package包/类
default OFFlowAdd oneSwitchReplaceFlowMod(int inputPort, int outputPort, int inputVlan, int outputVlan,
                                          long meterId, long cookie) {
    return ofFactory.buildFlowAdd()
            .setCookie(U64.of(cookie & FLOW_COOKIE_MASK))
            .setHardTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setIdleTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setBufferId(OFBufferId.NO_BUFFER)
            .setPriority(FlowModUtils.PRIORITY_VERY_HIGH)
            .setMatch(ofFactory.buildMatch()
                    .setExact(MatchField.IN_PORT, OFPort.of(inputPort))
                    .setExact(MatchField.VLAN_VID, OFVlanVidMatch.ofVlan(inputVlan))
                    .build())
            .setInstructions(Arrays.asList(
                    ofFactory.instructions().buildMeter().setMeterId(meterId).build(),
                    ofFactory.instructions().applyActions(Arrays.asList(
                            ofFactory.actions().buildSetField()
                                    .setField(ofFactory.oxms().buildVlanVid()
                                            .setValue(OFVlanVidMatch.ofVlan(outputVlan))
                                            .build())
                                    .build(),
                            ofFactory.actions().buildOutput()
                                    .setMaxLen(0xFFFFFFFF)
                                    .setPort(OFPort.of(outputPort))
                                    .build()))
                            .createBuilder()
                            .build()))
            .setXid(0L)
            .build();
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:30,代码来源:OutputCommands.java

示例10: oneSwitchPushFlowMod

import org.projectfloodlight.openflow.types.OFVlanVidMatch; //导入依赖的package包/类
default OFFlowAdd oneSwitchPushFlowMod(int inputPort, int outputPort, int outputVlan, long meterId, long cookie) {
    return ofFactory.buildFlowAdd()
            .setCookie(U64.of(cookie & FLOW_COOKIE_MASK))
            .setHardTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setIdleTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setBufferId(OFBufferId.NO_BUFFER)
            .setPriority(FlowModUtils.PRIORITY_VERY_HIGH)
            .setMatch(ofFactory.buildMatch()
                    .setExact(MatchField.IN_PORT, OFPort.of(inputPort))
                    .build())
            .setInstructions(Arrays.asList(
                    ofFactory.instructions().buildMeter().setMeterId(meterId).build(),
                    ofFactory.instructions().applyActions(Arrays.asList(
                            ofFactory.actions().buildPushVlan()
                                    .setEthertype(EthType.of(ETH_TYPE))
                                    .build(),
                            ofFactory.actions().buildSetField()
                                    .setField(ofFactory.oxms().buildVlanVid()
                                            .setValue(OFVlanVidMatch.ofVlan(outputVlan))
                                            .build())
                                    .build(),
                            ofFactory.actions().buildOutput()
                                    .setMaxLen(0xFFFFFFFF)
                                    .setPort(OFPort.of(outputPort))
                                    .build()))
                            .createBuilder()
                            .build()))
            .setXid(0L)
            .build();
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:31,代码来源:OutputCommands.java

示例11: ingressMatchVlanIdFlowMod

import org.projectfloodlight.openflow.types.OFVlanVidMatch; //导入依赖的package包/类
@Override
public OFFlowAdd ingressMatchVlanIdFlowMod(int inputPort, int outputPort, int inputVlan, int transitVlan,
                                           long meterId, long cookie) {
    return ofFactory.buildFlowAdd()
            .setCookie(U64.of(cookie & FLOW_COOKIE_MASK))
            .setHardTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setIdleTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setBufferId(OFBufferId.NO_BUFFER)
            .setPriority(FlowModUtils.PRIORITY_VERY_HIGH)
            .setMatch(ofFactory.buildMatch()
                    .setExact(MatchField.IN_PORT, OFPort.of(inputPort))
                    .setExact(MatchField.VLAN_VID, OFVlanVidMatch.ofVlan(inputVlan))
                    .build())
            .setInstructions(Arrays.asList(
                    ofFactory.instructions().buildMeter().setMeterId(meterId).build(),
                    ofFactory.instructions().applyActions(Arrays.asList(
                            ofFactory.actions().buildSetField()
                                    .setField(ofFactory.oxms().buildVlanVid()
                                            .setValue(OFVlanVidMatch.ofVlan(transitVlan))
                                            .build())
                                    .build(),
                            ofFactory.actions().buildOutput()
                                    .setMaxLen(0xFFFFFFFF)
                                    .setPort(OFPort.of(outputPort))
                                    .build()))
                            .createBuilder()
                            .build()))
            .setXid(0L)
            .build();

}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:32,代码来源:ReplaceSchemeOutputCommands.java

示例12: egressPushFlowMod

import org.projectfloodlight.openflow.types.OFVlanVidMatch; //导入依赖的package包/类
@Override
public OFFlowAdd egressPushFlowMod(int inputPort, int outputPort, int transitVlan, int outputVlan, long cookie) {
    return ofFactory.buildFlowAdd()
            .setCookie(U64.of(cookie & FLOW_COOKIE_MASK))
            .setHardTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setIdleTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setBufferId(OFBufferId.NO_BUFFER)
            .setPriority(FlowModUtils.PRIORITY_VERY_HIGH)
            .setMatch(ofFactory.buildMatch()
                    .setExact(MatchField.IN_PORT, OFPort.of(inputPort))
                    .setExact(MatchField.VLAN_VID, OFVlanVidMatch.ofVlan(transitVlan))
                    .build())
            .setInstructions(singletonList(
                    ofFactory.instructions().applyActions(Arrays.asList(
                            ofFactory.actions().buildSetField()
                                    .setField(ofFactory.oxms().buildVlanVid()
                                            .setValue(OFVlanVidMatch.ofVlan(outputVlan))
                                            .build())
                                    .build(),
                            ofFactory.actions().buildOutput()
                                    .setMaxLen(0xFFFFFFFF)
                                    .setPort(OFPort.of(outputPort))
                                    .build()))
                            .createBuilder()
                            .build()))
            .setXid(0L)
            .build();
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:29,代码来源:ReplaceSchemeOutputCommands.java

示例13: ingressMatchVlanIdFlowMod

import org.projectfloodlight.openflow.types.OFVlanVidMatch; //导入依赖的package包/类
@Override
public OFFlowAdd ingressMatchVlanIdFlowMod(int inputPort, int outputPort, int inputVlan, int transitVlan,
                                           long meterId, long cookie) {
    return ofFactory.buildFlowAdd()
            .setCookie(U64.of(cookie & FLOW_COOKIE_MASK))
            .setHardTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setIdleTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setBufferId(OFBufferId.NO_BUFFER)
            .setPriority(FlowModUtils.PRIORITY_VERY_HIGH)
            .setMatch(ofFactory.buildMatch()
                    .setExact(MatchField.IN_PORT, OFPort.of(inputPort))
                    .setExact(MatchField.VLAN_VID, OFVlanVidMatch.ofVlan(inputVlan))
                    .build())
            .setInstructions(Arrays.asList(
                    ofFactory.instructions().buildMeter().setMeterId(meterId).build(),
                    ofFactory.instructions().applyActions(Arrays.asList(
                            ofFactory.actions().buildPushVlan()
                                    .setEthertype(EthType.of(ETH_TYPE))
                                    .build(),
                            ofFactory.actions().buildSetField()
                                    .setField(ofFactory.oxms().buildVlanVid()
                                            .setValue(OFVlanVidMatch.ofVlan(transitVlan))
                                            .build())
                                    .build(),
                            ofFactory.actions().buildOutput()
                                    .setMaxLen(0xFFFFFFFF)
                                    .setPort(OFPort.of(outputPort))
                                    .build()))
                            .createBuilder()
                            .build()))
            .setXid(0L)
            .build();

}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:35,代码来源:PushSchemeOutputCommands.java

示例14: ingressNoMatchVlanIdFlowMod

import org.projectfloodlight.openflow.types.OFVlanVidMatch; //导入依赖的package包/类
@Override
public OFFlowAdd ingressNoMatchVlanIdFlowMod(int inputPort, int outputPort, int transitVlan,
                                             long meterId, long cookie) {
    return ofFactory.buildFlowAdd()
            .setCookie(U64.of(cookie & FLOW_COOKIE_MASK))
            .setHardTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setIdleTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setBufferId(OFBufferId.NO_BUFFER)
            .setPriority(FlowModUtils.PRIORITY_VERY_HIGH)
            .setMatch(ofFactory.buildMatch()
                    .setExact(MatchField.IN_PORT, OFPort.of(inputPort))
                    .build())
            .setInstructions(Arrays.asList(
                    ofFactory.instructions().buildMeter().setMeterId(meterId).build(),
                    ofFactory.instructions().applyActions(Arrays.asList(
                            ofFactory.actions().buildPushVlan()
                                    .setEthertype(EthType.of(ETH_TYPE))
                                    .build(),
                            ofFactory.actions().buildSetField()
                                    .setField(ofFactory.oxms().buildVlanVid()
                                            .setValue(OFVlanVidMatch.ofVlan(transitVlan))
                                            .build())
                                    .build(),
                            ofFactory.actions().buildOutput()
                                    .setMaxLen(0xFFFFFFFF)
                                    .setPort(OFPort.of(outputPort))
                                    .build()))
                            .createBuilder()
                            .build()))
            .setXid(0L)
            .build();

}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:34,代码来源:PushSchemeOutputCommands.java

示例15: egressPushFlowMod

import org.projectfloodlight.openflow.types.OFVlanVidMatch; //导入依赖的package包/类
@Override
public OFFlowAdd egressPushFlowMod(int inputPort, int outputPort, int transitVlan, int outputVlan, long cookie) {
    return ofFactory.buildFlowAdd()
            .setCookie(U64.of(cookie & FLOW_COOKIE_MASK))
            .setHardTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setIdleTimeout(FlowModUtils.INFINITE_TIMEOUT)
            .setBufferId(OFBufferId.NO_BUFFER)
            .setPriority(FlowModUtils.PRIORITY_VERY_HIGH)
            .setMatch(ofFactory.buildMatch()
                    .setExact(MatchField.IN_PORT, OFPort.of(inputPort))
                    .setExact(MatchField.VLAN_VID, OFVlanVidMatch.ofVlan(transitVlan))
                    .build())
            .setInstructions(singletonList(
                    ofFactory.instructions().applyActions(Arrays.asList(
                            ofFactory.actions().popVlan(),
                            ofFactory.actions().buildPushVlan()
                                    .setEthertype(EthType.of(ETH_TYPE))
                                    .build(),
                            ofFactory.actions().buildSetField()
                                    .setField(ofFactory.oxms().buildVlanVid()
                                            .setValue(OFVlanVidMatch.ofVlan(outputVlan))
                                            .build())
                                    .build(),
                            ofFactory.actions().buildOutput()
                                    .setMaxLen(0xFFFFFFFF)
                                    .setPort(OFPort.of(outputPort))
                                    .build()))
                            .createBuilder()
                            .build()))
            .setXid(0L)
            .build();
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:33,代码来源:PushSchemeOutputCommands.java


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