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


Java OFMessage.getXid方法代码示例

本文整理汇总了Java中org.projectfloodlight.openflow.protocol.OFMessage.getXid方法的典型用法代码示例。如果您正苦于以下问题:Java OFMessage.getXid方法的具体用法?Java OFMessage.getXid怎么用?Java OFMessage.getXid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.projectfloodlight.openflow.protocol.OFMessage的用法示例。


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

示例1: setupSwitchSendRoleRequestAndVerify

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
/**
 * Setup the mock switch and write capture for a role request, set the
 * role and verify mocks.
 * @param supportsNxRole whether the switch supports role request messages
 * to setup the attribute. This must be null (don't yet know if roles
 * supported: send to check) or true.
 * @param role The role to send
 * @throws IOException
 */
private long setupSwitchSendRoleRequestAndVerify(Boolean supportsNxRole,
		OFControllerRole role) throws IOException {
	assertTrue("This internal test helper method most not be called " +
			"with supportsNxRole==false. Test setup broken",
			supportsNxRole == null || supportsNxRole == true);
	reset(sw);
	expect(sw.getAttribute(IOFSwitch.SWITCH_SUPPORTS_NX_ROLE))
	.andReturn(supportsNxRole).atLeastOnce();
	replay(sw);

	switchHandler.sendRoleRequest(role);

	OFMessage msg = connection.retrieveMessage();
	verifyRoleRequest(msg, role);
	verify(sw);
	return msg.getXid();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:27,代码来源:OFSwitchHandlerTestBase.java

示例2: setupSwitchSendRoleRequestAndVerify

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
/**
 * Setup the mock switch and write capture for a role request, set the
 * role and verify mocks.
 * @param supportsNxRole whether the switch supports role request messages
 * to setup the attribute. This must be null (don't yet know if roles
 * supported: send to check) or true.
 * @param role The role to send
 * @throws IOException
 */
private long setupSwitchSendRoleRequestAndVerify(Boolean supportsNxRole,
                                       OFControllerRole role) throws IOException {
    assertTrue("This internal test helper method most not be called " +
               "with supportsNxRole==false. Test setup broken",
               supportsNxRole == null || supportsNxRole == true);
    reset(sw);
    expect(sw.getAttribute(IOFSwitch.SWITCH_SUPPORTS_NX_ROLE))
            .andReturn(supportsNxRole).atLeastOnce();
    replay(sw);

    switchHandler.sendRoleRequest(role);

    OFMessage msg = connection.retrieveMessage();
    verifyRoleRequest(msg, role);
    verify(sw);
    return msg.getXid();
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:27,代码来源:OFSwitchHandlerTestBase.java

示例3: processDriverHandshakeMessage

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public void processDriverHandshakeMessage(OFMessage m) {
    if (!startDriverHandshakeCalled) {
        throw new SwitchDriverSubHandshakeNotStarted();
    }
    if (handshakeComplete.get()) {
        throw new SwitchDriverSubHandshakeCompleted(m);
    }
    if (m.getType() == OFType.BARRIER_REPLY &&
            m.getXid() == barrierXid) {
        handshakeComplete.set(true);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:14,代码来源:CorsaSwitchHandshaker.java

示例4: verifyUniqueXids

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
/** make sure that the transaction ids in the given messages are
 * not 0 and differ between each other.
 * While it's not a defect per se if the xids are we want to ensure
 * we use different ones for each message we send.
 */
void verifyUniqueXids(List<OFMessage> msgs) {
	if (seenXids == null)
		seenXids = new HashSet<Long>();
	for (OFMessage m: msgs)  {
		long xid = m.getXid();
		assertTrue("Xid in messags is 0", xid != 0);
		assertFalse("Xid " + xid + " has already been used",
				seenXids.contains(xid));
		seenXids.add(xid);
	}
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:17,代码来源:OFChannelHandlerVer13Test.java

示例5: verifyUniqueXids

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
/** make sure that the transaction ids in the given messages are
 * not 0 and differ between each other.
 * While it's not a defect per se if the xids are we want to ensure
 * we use different ones for each message we send.
 */
void verifyUniqueXids(List<OFMessage> msgs) {
    if (seenXids == null)
        seenXids = new HashSet<Long>();
    for (OFMessage m: msgs)  {
        long xid = m.getXid();
        assertTrue("Xid in messags is 0", xid != 0);
        assertFalse("Xid " + xid + " has already been used",
                    seenXids.contains(xid));
        seenXids.add(xid);
    }
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:17,代码来源:OFChannelHandlerVer10Test.java

示例6: processDriverHandshakeMessage

import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public void processDriverHandshakeMessage(OFMessage m) {
    if (!startDriverHandshakeCalled) {
        throw new SwitchDriverSubHandshakeNotStarted();
    }
    if (driverHandshakeComplete.get()) {
        throw new SwitchDriverSubHandshakeCompleted(m);
    }

    switch (m.getType()) {
        case BARRIER_REPLY:
            if (m.getXid() == barrierXidToWaitFor) {
                log.debug("LINC-OE Received barrier response");
            }
            break;
        case ERROR:
            log.error("Switch {} Error {}", getStringId(), m);
            break;
        case FEATURES_REPLY:
            break;
        case FLOW_REMOVED:
            break;
        case GET_ASYNC_REPLY:
            break;
        case PACKET_IN:
            break;
        case PORT_STATUS:
            log.warn("****LINC-OE Port Status {} {}", getStringId(), m);
            processOFPortStatus((OFCircuitPortStatus) m);
            break;
        case QUEUE_GET_CONFIG_REPLY:
            break;
        case ROLE_REPLY:
            break;
        case STATS_REPLY:
            OFStatsReply stats = (OFStatsReply) m;
            if (stats.getStatsType() == OFStatsType.EXPERIMENTER) {
                log.warn("LINC-OE : Received stats reply message {}", m);
                createOpticalPortList((OFCircuitPortsReply) m);
                driverHandshakeComplete.set(true);
            }
            break;
        default:
            log.warn("Received message {} during switch-driver " +
                             "subhandshake " + "from switch {} ... " +
                             "Ignoring message", m,
                     getStringId());

    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:51,代码来源:OfOpticalSwitchImplLinc13.java


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