本文整理汇总了Java中org.openflow.protocol.OFPacketOut.setActionFactory方法的典型用法代码示例。如果您正苦于以下问题:Java OFPacketOut.setActionFactory方法的具体用法?Java OFPacketOut.setActionFactory怎么用?Java OFPacketOut.setActionFactory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openflow.protocol.OFPacketOut
的用法示例。
在下文中一共展示了OFPacketOut.setActionFactory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPacketOut
import org.openflow.protocol.OFPacketOut; //导入方法依赖的package包/类
private OFPacketOut createPacketOut() {
//["packet", {"outport": 1, "protocol": 2, "header_len": 14, "inport": 2,
// "dstip": [49, 48, 46, 48, 46, 48, 46, 49],
// "srcmac": [99, 101, 58, 97, 56, 58, 100, 100, 58, 99, 102, 58, 49, 99, 58, 97, 101], "dstmac": [99, 101, 58, 97, 54, 58, 99, 51, 58, 100, 100, 58, 56, 57, 58, 99, 51],
// "raw": [206, 166, 195, 221, 137, 195, 206, 168, 221, 207, 28, 174, 8, 6, 0, 1, 8, 0, 6, 4, 0, 2, 206, 168, 221, 207, 28, 174, 10, 0, 0, 2, 206, 166, 195, 221, 137, 195, 10, 0, 0, 1],
// "payload_len": 42, "switch": 1, "ethtype": 2054, "srcip": [49, 48, 46, 48, 46, 48, 46, 50] }] + TERM_CHAR
OFPacketOut packetOut = new OFPacketOut();
packetOut.setBufferId(10);
packetOut.setInPort((short)2);
packetOut.setPacketData(new byte[] {28, 8, 6, 0, 1, 8, 0, 6, 4, 0, 2, 28, 10, 0, 0, 2, 10, 0, 0, 1});
BasicFactory factory = new BasicFactory();
packetOut.setActionFactory(factory.getActionFactory());
List<OFAction> actions = new ArrayList<OFAction>();
OFAction action = new OFActionOutput((short)3);
actions.add(action);
packetOut.setActions(actions);
return packetOut;
}