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


Java OFActionOutput类代码示例

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


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

示例1: testIsFlowModAllowedSimple

import org.openflow.protocol.action.OFActionOutput; //导入依赖的package包/类
@Test
public void testIsFlowModAllowedSimple(){
	OFFlowMod flow = new OFFlowMod();
	OFMatch match = new OFMatch();
	match.setInputPort((short)1);
	match.setDataLayerVirtualLan((short)1000);
	match.setWildcards(match.getWildcardObj().matchOn(Flag.DL_VLAN));
	match.setWildcards(match.getWildcardObj().matchOn(Flag.IN_PORT));
	flow.setMatch(match);
	List<OFAction> actions = new ArrayList<OFAction>();
	OFActionVirtualLanIdentifier setVid = new OFActionVirtualLanIdentifier();
	setVid.setVirtualLanIdentifier((short)102);		
	OFActionOutput output = new OFActionOutput();
	output.setPort((short)2);
	actions.add(setVid);
	actions.add(output);
	flow.setActions(actions);
	
	List <OFFlowMod> flows = slicer.allowedFlows(flow);
	assertTrue("flows is the right size", flows.size() == 1);
	assertEquals("flow was allowed and matches", flow, flows.get(0));
	
}
 
开发者ID:GlobalNOC,项目名称:FlowSpaceFirewall,代码行数:24,代码来源:VLANSlicerTest.java

示例2: verifyPacketOut

import org.openflow.protocol.action.OFActionOutput; //导入依赖的package包/类
protected void verifyPacketOut(OFPacketOut po,
                               Ethernet eth,
                               int expectedBufferId,
                               int expectedInPort,
                               int expectedOutPort,
                               Short transportVlan,
                               ZoneVlanMode inVlanMode,
                               ZoneVlanMode outVlanMode)
{
    assertEquals(curTestId, expectedInPort, po.getInPort());
    assertEquals(curTestId, expectedBufferId, po.getBufferId());
    if (outVlanMode == ZoneVlanMode.UNTAGGED) 
        eth.setVlanID(Ethernet.VLAN_UNTAGGED);
    else
        eth.setVlanID(transportVlan);
    assertArrayEquals(curTestId, eth.serialize(), po.getPacketData());
    
    List<OFAction> actions = po.getActions();
    assertEquals(curTestId, 1, actions.size());
    OFActionOutput expectedAction = 
            new OFActionOutput((short)expectedOutPort, (short)0xffff);
    assertEquals(curTestId, expectedAction, actions.get(0));
}
 
开发者ID:opendaylight,项目名称:archived-net-virt-platform,代码行数:24,代码来源:PushRewriteRouteTest.java

示例3: receive

import org.openflow.protocol.action.OFActionOutput; //导入依赖的package包/类
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
    OFPacketIn pi = (OFPacketIn) msg;
    OFPacketOut po = (OFPacketOut) floodlightProvider.getOFMessageFactory()
            .getMessage(OFType.PACKET_OUT);
    po.setBufferId(pi.getBufferId())
        .setInPort(pi.getInPort());

    // set actions
    OFActionOutput action = new OFActionOutput()
        .setPort(OFPort.OFPP_FLOOD.getValue());
    po.setActions(Collections.singletonList((OFAction)action));
    po.setActionsLength((short) OFActionOutput.MINIMUM_LENGTH);

    // set data if is is included in the packetin
    if (pi.getBufferId() == OFPacketOut.BUFFER_ID_NONE) {
        byte[] packetData = pi.getPacketData();
        po.setLength(U16.t(OFPacketOut.MINIMUM_LENGTH
                + po.getActionsLength() + packetData.length));
        po.setPacketData(packetData);
    } else {
        po.setLength(U16.t(OFPacketOut.MINIMUM_LENGTH
                + po.getActionsLength()));
    }
    try {
        sw.write(po, cntx);
    } catch (IOException e) {
        log.error("Failure writing PacketOut", e);
    }

    return Command.CONTINUE;
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:32,代码来源:Hub.java

示例4: testFloodNoBufferId

import org.openflow.protocol.action.OFActionOutput; //导入依赖的package包/类
@Test
public void testFloodNoBufferId() throws Exception {
    // build our expected flooded packetOut
    OFPacketOut po = ((OFPacketOut) mockFloodlightProvider.getOFMessageFactory().getMessage(OFType.PACKET_OUT))
        .setActions(Arrays.asList(new OFAction[] {new OFActionOutput().setPort(OFPort.OFPP_FLOOD.getValue())}))
        .setActionsLength((short) OFActionOutput.MINIMUM_LENGTH)
        .setBufferId(-1)
        .setInPort((short) 1)
        .setPacketData(this.testPacketSerialized);
    po.setLengthU(OFPacketOut.MINIMUM_LENGTH + po.getActionsLengthU()
            + this.testPacketSerialized.length);

    // Mock up our expected behavior
    IOFSwitch mockSwitch = createMock(IOFSwitch.class);
    
    Capture<OFMessage> wc1 = new Capture<OFMessage>(CaptureType.ALL);
    Capture<FloodlightContext> bc1 = new Capture<FloodlightContext>(CaptureType.ALL);
    
    mockSwitch.write(capture(wc1), capture(bc1));

    // Start recording the replay on the mocks
    replay(mockSwitch);
    // Get the listener and trigger the packet in
    IOFMessageListener listener = mockFloodlightProvider.getListeners().get(
            OFType.PACKET_IN).get(0);
    listener.receive(mockSwitch, this.packetIn,
                     parseAndAnnotate(this.packetIn));

    // Verify the replay matched our expectations
    verify(mockSwitch);
    
    assertTrue(wc1.hasCaptured());
    OFMessage m = wc1.getValue();
    assertEquals(po, m);
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:36,代码来源:HubTest.java

示例5: testFloodBufferId

import org.openflow.protocol.action.OFActionOutput; //导入依赖的package包/类
@Test
public void testFloodBufferId() throws Exception {
    MockFloodlightProvider mockFloodlightProvider = getMockFloodlightProvider();
    this.packetIn.setBufferId(10);

    // build our expected flooded packetOut
    OFPacketOut po = ((OFPacketOut) mockFloodlightProvider.getOFMessageFactory().getMessage(OFType.PACKET_OUT))
        .setActions(Arrays.asList(new OFAction[] {new OFActionOutput().setPort(OFPort.OFPP_FLOOD.getValue())}))
        .setActionsLength((short) OFActionOutput.MINIMUM_LENGTH)
        .setBufferId(10)
        .setInPort((short) 1);
    po.setLengthU(OFPacketOut.MINIMUM_LENGTH + po.getActionsLengthU());

    // Mock up our expected behavior
    IOFSwitch mockSwitch = createMock(IOFSwitch.class);
    Capture<OFMessage> wc1 = new Capture<OFMessage>(CaptureType.ALL);
    Capture<FloodlightContext> bc1 = new Capture<FloodlightContext>(CaptureType.ALL);
    
    mockSwitch.write(capture(wc1), capture(bc1));

    // Start recording the replay on the mocks
    replay(mockSwitch);
    // Get the listener and trigger the packet in
    IOFMessageListener listener = mockFloodlightProvider.getListeners().get(
            OFType.PACKET_IN).get(0);
    listener.receive(mockSwitch, this.packetIn,
                     parseAndAnnotate(this.packetIn));

    // Verify the replay matched our expectations
    verify(mockSwitch);
    
    assertTrue(wc1.hasCaptured());
    OFMessage m = wc1.getValue();
    assertEquals(po, m);
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:36,代码来源:HubTest.java

示例6: testFlood

import org.openflow.protocol.action.OFActionOutput; //导入依赖的package包/类
@Test
public void testFlood() throws Exception {
    // build our expected flooded packetOut
    OFPacketOut po = new OFPacketOut()
        .setActions(Arrays.asList(new OFAction[] {new OFActionOutput().setPort(OFPort.OFPP_FLOOD.getValue())}))
        .setActionsLength((short) OFActionOutput.MINIMUM_LENGTH)
        .setBufferId(-1)
        .setInPort((short)1)
        .setPacketData(this.testPacketSerialized);
    po.setLengthU(OFPacketOut.MINIMUM_LENGTH + po.getActionsLengthU()
            + this.testPacketSerialized.length);

    // Mock up our expected behavior
    IOFSwitch mockSwitch = createMock(IOFSwitch.class);
    expect(mockSwitch.getStringId()).andReturn("00:11:22:33:44:55:66:77").anyTimes();
    mockSwitch.write(po, null);

    // Start recording the replay on the mocks
    replay(mockSwitch);
    // Get the listener and trigger the packet in
    IOFMessageListener listener = mockFloodlightProvider.getListeners().get(
            OFType.PACKET_IN).get(0);
    // Make sure it's the right listener
    listener.receive(mockSwitch, this.packetIn, parseAndAnnotate(this.packetIn));

    // Verify the replay matched our expectations
    short result = learningSwitch.getFromPortMap(mockSwitch, Ethernet.toLong(Ethernet.toMACAddress("00:44:33:22:11:00")), (short) 42).shortValue();
    verify(mockSwitch);

    // Verify the MAC table inside the switch
    assertEquals(1, result);
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:33,代码来源:LearningSwitchTest.java

示例7: receive

import org.openflow.protocol.action.OFActionOutput; //导入依赖的package包/类
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
    OFPacketIn pi = (OFPacketIn) msg;
    OFPacketOut po = (OFPacketOut) floodlightProvider.getOFMessageFactory()
            .getMessage(OFType.PACKET_OUT);
    po.setBufferId(pi.getBufferId())
        .setInPort(pi.getInPort());

    // set actions
    OFActionOutput action = new OFActionOutput()
        .setPort((short) OFPort.OFPP_FLOOD.getValue());
    po.setActions(Collections.singletonList((OFAction)action));
    po.setActionsLength((short) OFActionOutput.MINIMUM_LENGTH);

    // set data if is is included in the packetin
    if (pi.getBufferId() == 0xffffffff) {
        byte[] packetData = pi.getPacketData();
        po.setLength(U16.t(OFPacketOut.MINIMUM_LENGTH
                + po.getActionsLength() + packetData.length));
        po.setPacketData(packetData);
    } else {
        po.setLength(U16.t(OFPacketOut.MINIMUM_LENGTH
                + po.getActionsLength()));
    }
    try {
        sw.write(po, cntx);
    } catch (IOException e) {
        log.error("Failure writing PacketOut", e);
    }

    return Command.CONTINUE;
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:32,代码来源:Hub.java

示例8: testFloodNoBufferId

import org.openflow.protocol.action.OFActionOutput; //导入依赖的package包/类
@Test
public void testFloodNoBufferId() throws Exception {
    // build our expected flooded packetOut
    OFPacketOut po = ((OFPacketOut) mockFloodlightProvider.getOFMessageFactory().getMessage(OFType.PACKET_OUT))
        .setActions(Arrays.asList(new OFAction[] {new OFActionOutput().setPort(OFPort.OFPP_FLOOD.getValue())}))
        .setActionsLength((short) OFActionOutput.MINIMUM_LENGTH)
        .setBufferId(-1)
        .setInPort((short) 1)
        .setPacketData(this.testPacketSerialized);
    po.setLengthU(OFPacketOut.MINIMUM_LENGTH + po.getActionsLengthU()
            + this.testPacketSerialized.length);

    // Mock up our expected behavior
    IOFSwitch mockSwitch = createMock(IOFSwitch.class);
    
    Capture<OFMessage> wc1 = new Capture<OFMessage>(CaptureType.ALL);
    Capture<FloodlightContext> bc1 = new Capture<FloodlightContext>(CaptureType.ALL);
    
    mockSwitch.write(capture(wc1), capture(bc1));

    // Start recording the replay on the mocks
    replay(mockSwitch);
    // Get the listener and trigger the packet in
    IOFMessageListener listener = mockFloodlightProvider.getListeners().get(
            OFType.PACKET_IN).get(0);
    listener.receive(mockSwitch, this.packetIn,
                     parseAndAnnotate(this.packetIn));

    // Verify the replay matched our expectations
    verify(mockSwitch);
    
    assertTrue(wc1.hasCaptured());
    OFMessage m = wc1.getValue();
    assert(m.equals(po));
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:36,代码来源:HubTest.java

示例9: testFloodBufferId

import org.openflow.protocol.action.OFActionOutput; //导入依赖的package包/类
@Test
public void testFloodBufferId() throws Exception {
    MockFloodlightProvider mockFloodlightProvider = getMockFloodlightProvider();
    this.packetIn.setBufferId(10);

    // build our expected flooded packetOut
    OFPacketOut po = ((OFPacketOut) mockFloodlightProvider.getOFMessageFactory().getMessage(OFType.PACKET_OUT))
        .setActions(Arrays.asList(new OFAction[] {new OFActionOutput().setPort(OFPort.OFPP_FLOOD.getValue())}))
        .setActionsLength((short) OFActionOutput.MINIMUM_LENGTH)
        .setBufferId(10)
        .setInPort((short) 1);
    po.setLengthU(OFPacketOut.MINIMUM_LENGTH + po.getActionsLengthU());

    // Mock up our expected behavior
    IOFSwitch mockSwitch = createMock(IOFSwitch.class);
    Capture<OFMessage> wc1 = new Capture<OFMessage>(CaptureType.ALL);
    Capture<FloodlightContext> bc1 = new Capture<FloodlightContext>(CaptureType.ALL);
    
    mockSwitch.write(capture(wc1), capture(bc1));

    // Start recording the replay on the mocks
    replay(mockSwitch);
    // Get the listener and trigger the packet in
    IOFMessageListener listener = mockFloodlightProvider.getListeners().get(
            OFType.PACKET_IN).get(0);
    listener.receive(mockSwitch, this.packetIn,
                     parseAndAnnotate(this.packetIn));

    // Verify the replay matched our expectations
    verify(mockSwitch);
    
    assertTrue(wc1.hasCaptured());
    OFMessage m = wc1.getValue();
    assert(m.equals(po));
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:36,代码来源:HubTest.java

示例10: testFlood

import org.openflow.protocol.action.OFActionOutput; //导入依赖的package包/类
@Test
public void testFlood() throws Exception {
    // build our expected flooded packetOut
    OFPacketOut po = new OFPacketOut()
        .setActions(Arrays.asList(new OFAction[] {new OFActionOutput().setPort(OFPort.OFPP_FLOOD.getValue())}))
        .setActionsLength((short) OFActionOutput.MINIMUM_LENGTH)
        .setBufferId(-1)
        .setInPort((short)1)
        .setPacketData(this.testPacketSerialized);
    po.setLengthU(OFPacketOut.MINIMUM_LENGTH + po.getActionsLengthU()
            + this.testPacketSerialized.length);

    // Mock up our expected behavior
    IOFSwitch mockSwitch = createMock(IOFSwitch.class);
    expect(mockSwitch.getStringId()).andReturn("00:11:22:33:44:55:66:77").anyTimes();
    mockSwitch.write(po, null);

    // Start recording the replay on the mocks
    replay(mockSwitch);
    // Get the listener and trigger the packet in
    IOFMessageListener listener = mockFloodlightProvider.getListeners().get(
            OFType.PACKET_IN).get(0);
    // Make sure it's the right listener
    listener.receive(mockSwitch, this.packetIn, parseAndAnnotate(this.packetIn));

    // Verify the replay matched our expectations      
    short result = learningSwitch.getFromPortMap(mockSwitch, Ethernet.toLong(Ethernet.toMACAddress("00:44:33:22:11:00")), (short) 42).shortValue();
    verify(mockSwitch);

    // Verify the MAC table inside the switch
    assertEquals(1, result);
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:33,代码来源:LearningSwitchTest.java

示例11: testExpandedFlowStats

import org.openflow.protocol.action.OFActionOutput; //导入依赖的package包/类
@Test
public void testExpandedFlowStats(){
	cache = new FlowStatCache(fsfw);
	
	OFFlowMod mod = new OFFlowMod();
	OFMatch match = new OFMatch();
	match.setDataLayerVirtualLan((short)300);
	match.setWildcards(match.getWildcardObj().matchOn(Flag.DL_VLAN));
	mod.setMatch(match);
	List<OFAction> actions = new ArrayList<OFAction>();
	OFActionOutput output = new OFActionOutput();
	output.setPort((short)65533);
	actions.add(output);
	mod.setActions(actions);
	
	List<OFFlowMod> mods = slicerExpanded.allowedFlows(mod);
	cache.addFlowMod(sw.getId(), slicerExpanded.getSliceName(), mod, mods);
	log.error("Sending: " + expandedStats.size() + " flow stats!");
	cache.setFlowCache(sw.getId(), expandedStats);
	List<OFStatistics> slicedStats = cache.getSlicedFlowStats(sw.getId(), slicerExpanded.getSliceName());	
	assertNotNull("Sliced Stats with no allowed stats returend ok", slicedStats);
	assertEquals("Sliced stats", 6, slicedStats.size());
	log.error(slicedStats.get(0).toString());
	OFFlowStatisticsReply flowStat = (OFFlowStatisticsReply) slicedStats.get(0);
	assertEquals("flowStat byte count is correct", 4L,flowStat.getByteCount());
	assertEquals("flowStat packet count is correct", 4L,flowStat.getPacketCount());
}
 
开发者ID:GlobalNOC,项目名称:FlowSpaceFirewall,代码行数:28,代码来源:FlowStatSlicerTest.java

示例12: init

import org.openflow.protocol.action.OFActionOutput; //导入依赖的package包/类
/**
 * Adds flow for given switch, outgoing port, and DC switch port. Constructs {@link OFMatch} and instructs switch 
 * to send all packets from the given interface to dcPort interface
 * @param sw
 * @param floodlightProvider
 * @param cntx
 * @param dcPort
 * @param inetPort 
 */
public static void init(IOFSwitch sw, IFloodlightProviderService floodlightProvider, FloodlightContext cntx, short dcPort, short inetPort) {
    logger.debug("init(IOFSwitch,IFloodlightProviderService,FloodlightContext,short OFPacketIn) begin");

    //floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this);
    OFFlowMod flowMod = (OFFlowMod) floodlightProvider.getOFMessageFactory().getMessage(OFType.FLOW_MOD);

    // Create new match
    OFMatch match = new OFMatch();
    match.setInputPort(inetPort);
    match.setWildcards(OFMatch.OFPFW_ALL & ~OFMatch.OFPFW_IN_PORT);
    flowMod.setMatch(match);

    flowMod.setCommand(OFFlowMod.OFPFC_ADD);
    flowMod.setIdleTimeout((short) 0);
    flowMod.setHardTimeout((short) 0);
    flowMod.setPriority((short) 10);
    flowMod.setBufferId(OFPacketOut.BUFFER_ID_NONE);
    flowMod.setFlags((short) 1);

    List<OFAction> actions = new ArrayList<>();
    actions.add(new OFActionOutput().setPort(dcPort));
    flowMod.setActions(actions);
    flowMod.setLengthU(OFFlowMod.MINIMUM_LENGTH + OFActionOutput.MINIMUM_LENGTH);

    logger.debug("Modyfing to rule {}", flowMod.toString());

    try {
        sw.write(flowMod, cntx);
        sw.flush();
        logger.debug(String.format("Added return rule from port %d to port %d (to switch %s)", inetPort, dcPort, sw.getStringId()));
    } catch (IOException ex) {
        logger.error(String.format("Error while adding return flow rule (in port %d, out port %d) to switch %s", inetPort, dcPort, sw.getStringId()), ex);
    }
    logger.debug("init(IOFSwitch,IFloodlightProviderService,FloodlightContext,short OFPacketIn) end");
}
 
开发者ID:smartenit-eu,项目名称:smartenit,代码行数:45,代码来源:Flows.java

示例13: testAllowedPacketOut

import org.openflow.protocol.action.OFActionOutput; //导入依赖的package包/类
/**
 * tests packetOut event slicing
 */
@Test
public void testAllowedPacketOut(){
	
	OFPacketOut out = new OFPacketOut();
	List<OFAction> actions = new ArrayList<OFAction>();
	OFActionOutput output = new OFActionOutput();
	output.setType(OFActionType.OUTPUT);
	output.setPort((short)1);
	actions.add(output);
	out.setActions(actions);
	
	Ethernet pkt = new Ethernet();
	pkt.setVlanID((short)1000);
	pkt.setDestinationMACAddress("aa:bb:cc:dd:ee:ff");
	pkt.setSourceMACAddress("ff:ee:dd:cc:bb:aa");
	pkt.setEtherType((short)35020);
	out.setPacketData(pkt.serialize());
	
	List<OFMessage> outPackets = slicer.allowedPacketOut(out);
	assertTrue("OutPacket size is correct, expected 1 got " + outPackets.size(), outPackets.size() == 1);
	
	pkt.setVlanID((short)2000);
	out.setPacketData(pkt.serialize());
	outPackets = slicer.allowedPacketOut(out);
	assertTrue("Packet out was denied", outPackets.size() == 0);
}
 
开发者ID:GlobalNOC,项目名称:FlowSpaceFirewall,代码行数:30,代码来源:VLANSlicerTest.java

示例14: revertApplyFm

import org.openflow.protocol.action.OFActionOutput; //导入依赖的package包/类
private Tuple<Tuple<OVXFlowMod, List<PlumbingFlowMod>>, Integer> revertApplyFm(
Tuple<Tuple<OVXFlowMod, List<PlumbingFlowMod>>, Integer> fmTuple,
PlumbingFlowMod pmod) {
OVXFlowMod ofm = fmTuple.first.first;
Integer hop = fmTuple.second;

// match
OFMatch newMatch =
    PolicyCompositionUtil.
    intersectMatchIgnoreInport(pmod.getMatch(),
			       PolicyCompositionUtil.
			       actRevertMatch(ofm.getMatch(),
					      pmod.getActions()));
ofm.setMatch(newMatch);

// action
for (OFAction action : pmod.getActions()) {
    if (action instanceof OFActionOutput) {
	continue;
    }
    ofm.getActions().add(action);
    ofm.setLengthU(ofm.getLengthU() + action.getLengthU());
}

// priority
ofm.setPriority(
    (short) (pmod.getPriority() * vanillaPow(PolicyCompositionUtil.SEQUENTIAL_SHIFT, hop)
	     + ofm.getPriority()));

return new Tuple<Tuple<OVXFlowMod, List<PlumbingFlowMod>>, Integer>(fmTuple.first, hop + 1);
   }
 
开发者ID:CoVisor,项目名称:CoVisor,代码行数:32,代码来源:PlumbingSwitch.java

示例15: actApplyMatchWithInportChange

import org.openflow.protocol.action.OFActionOutput; //导入依赖的package包/类
private OFMatch actApplyMatchWithInportChange(OFMatch match,
					  List<OFAction> actions) {
OFMatch m = match.clone();
for (OFAction action : actions) {
    if (action instanceof OFActionNetworkLayerDestination) {
	OFActionNetworkLayerDestination modNwDst =
	    (OFActionNetworkLayerDestination) action;
	m.setWildcards(m.getWildcards() & ~OFMatch.OFPFW_NW_DST_MASK);
	m.setNetworkDestination(modNwDst.getNetworkAddress());
    } else if (action instanceof OFActionDataLayerSource) {
	OFActionDataLayerSource modDataSrc =
	    (OFActionDataLayerSource) action;
	m.setWildcards(m.getWildcards() & ~OFMatch.OFPFW_DL_SRC);
	m.setDataLayerSource(modDataSrc.getDataLayerAddress());
    } else if (action instanceof OFActionDataLayerDestination) {
	OFActionDataLayerDestination modDataDst =
	    (OFActionDataLayerDestination) action;
	m.setWildcards(m.getWildcards() & ~OFMatch.OFPFW_DL_DST);
	m.setDataLayerDestination(modDataDst.getDataLayerAddress());
    } else if (action instanceof OFActionOutput) {
	short outport = ((OFActionOutput) action).getPort();
	m.setWildcards(m.getWildcards() & ~OFMatch.OFPFW_IN_PORT);
	m.setInputPort(this.nextHopPortMap.get(outport));
    }
}
return m;
   }
 
开发者ID:CoVisor,项目名称:CoVisor,代码行数:28,代码来源:PlumbingSwitch.java


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