本文整理汇总了Java中org.openflow.protocol.OFHello.setXid方法的典型用法代码示例。如果您正苦于以下问题:Java OFHello.setXid方法的具体用法?Java OFHello.setXid怎么用?Java OFHello.setXid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openflow.protocol.OFHello
的用法示例。
在下文中一共展示了OFHello.setXid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import org.openflow.protocol.OFHello; //导入方法依赖的package包/类
@Before
public void setUp() throws IOException {
factory = BasicFactory.getInstance();
cntx = new FloodlightContext();
sw1 = new OFMessageDamperMockSwitch();
sw2 = new OFMessageDamperMockSwitch();
echoRequst1 = (OFEchoRequest)factory.getMessage(OFType.ECHO_REQUEST);
echoRequst1.setPayload(new byte[] { 1 });
echoRequst1Clone = (OFEchoRequest)
factory.getMessage(OFType.ECHO_REQUEST);
echoRequst1Clone.setPayload(new byte[] { 1 });
echoRequst2 = (OFEchoRequest)factory.getMessage(OFType.ECHO_REQUEST);
echoRequst2.setPayload(new byte[] { 2 });
hello1 = (OFHello)factory.getMessage(OFType.HELLO);
hello1.setXid(1);
hello2 = (OFHello)factory.getMessage(OFType.HELLO);
hello2.setXid(2);
}
示例2: setUp
import org.openflow.protocol.OFHello; //导入方法依赖的package包/类
@Before
public void setUp() throws IOException {
factory = new BasicFactory();
cntx = new FloodlightContext();
sw1 = new OFMessageDamperMockSwitch();
sw2 = new OFMessageDamperMockSwitch();
echoRequst1 = (OFEchoRequest)factory.getMessage(OFType.ECHO_REQUEST);
echoRequst1.setPayload(new byte[] { 1 });
echoRequst1Clone = (OFEchoRequest)
factory.getMessage(OFType.ECHO_REQUEST);
echoRequst1Clone.setPayload(new byte[] { 1 });
echoRequst2 = (OFEchoRequest)factory.getMessage(OFType.ECHO_REQUEST);
echoRequst2.setPayload(new byte[] { 2 });
hello1 = (OFHello)factory.getMessage(OFType.HELLO);
hello1.setXid(1);
hello2 = (OFHello)factory.getMessage(OFType.HELLO);
hello2.setXid(2);
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:23,代码来源:OFMessageDamperTest.java
示例3: setUp
import org.openflow.protocol.OFHello; //导入方法依赖的package包/类
@Before
public void setUp() throws IOException {
factory = new BasicFactory();
cntx = new ListenerContext();
sw1 = new OFMessageDamperMockSwitch();
sw2 = new OFMessageDamperMockSwitch();
echoRequst1 = (OFEchoRequest)factory.getMessage(OFType.ECHO_REQUEST);
echoRequst1.setPayload(new byte[] { 1 });
echoRequst1Clone = (OFEchoRequest)
factory.getMessage(OFType.ECHO_REQUEST);
echoRequst1Clone.setPayload(new byte[] { 1 });
echoRequst2 = (OFEchoRequest)factory.getMessage(OFType.ECHO_REQUEST);
echoRequst2.setPayload(new byte[] { 2 });
hello1 = (OFHello)factory.getMessage(OFType.HELLO);
hello1.setXid(1);
hello2 = (OFHello)factory.getMessage(OFType.HELLO);
hello2.setXid(2);
}
示例4: testTranslate
import org.openflow.protocol.OFHello; //导入方法依赖的package包/类
public void testTranslate() {
final OVXSwitch vsw = new OVXSingleSwitch(1, 1);
// make a south-bound message....something simple.
final OFHello ofh = new OFHello();
ofh.setXid(0);
final int newXid = this.translator.translate(ofh.getXid(), vsw);
Assert.assertEquals(newXid, XidTranslator.MIN_XID);
}
示例5: testUntranslate
import org.openflow.protocol.OFHello; //导入方法依赖的package包/类
public void testUntranslate() {
final OVXSwitch vsw = new OVXSingleSwitch(1, 1);
final OFHello ofh = new OFHello();
ofh.setXid(0);
this.translator.translate(ofh.getXid(), vsw);
final XidPair<OVXSwitch> pair = this.translator
.untranslate(XidTranslator.MIN_XID);
Assert.assertEquals(pair.getSwitch().getSwitchId(), vsw.getSwitchId());
Assert.assertEquals(pair.getXid(), ofh.getXid());
}