@Test
public void test() {
ByteBuf bb = BufferHelper.buildBuffer(
- "01 " + //reason
- "00 00 00 00 00 00 00 " + //padding
- "00 01 02 03 " + //port no
- "00 00 00 00 " + //padding in ofp_port1
- "08 00 27 00 B0 EB " + //mac address
- "00 00 " + //padding in ofp_port2
- "73 31 2d 65 74 68 31 00 00 00 00 00 00 00 00 00 " + // port name, String "s1-eth1"
- "00 00 00 41 " + //port config
- "00 00 00 05 " + //port state
- "00 00 00 81 " + //current features
- "00 00 00 A1 " + //advertised features
- "00 00 00 B1 " + //supported features
- "00 00 00 81 " + //peer features
- "00 00 00 81 " + //curr speed
- "00 00 00 80"); //max speed
+ "01 " //reason
+ + "00 00 00 00 00 00 00 " //padding
+ + "00 01 02 03 " //port no
+ + "00 00 00 00 " //padding in ofp_port1
+ + "08 00 27 00 B0 EB " //mac address
+ + "00 00 " //padding in ofp_port2
+ + "73 31 2d 65 74 68 31 00 00 00 00 00 00 00 00 00 " // port name, String "s1-eth1"
+ + "00 00 00 41 " //port config
+ + "00 00 00 05 " //port state
+ + "00 00 00 81 " //current features
+ + "00 00 00 A1 " //advertised features
+ + "00 00 00 B1 " //supported features
+ + "00 00 00 81 " //peer features
+ + "00 00 00 81 " //curr speed
+ + "00 00 00 80"); //max speed
PortStatusMessage builtByFactory = BufferHelper.deserialize(statusFactory, bb);
@Test
public void testWithDifferentBitmaps() {
ByteBuf bb = BufferHelper.buildBuffer(
- "01 00 00 00 00 00 00 00 " + //reason, padding
- "00 01 02 03 00 00 00 00 " + //port no, padding
- "08 00 27 00 B0 EB 00 00 " + //mac address, padding
- "73 31 2d 65 74 68 31 00 00 00 00 00 00 00 00 00 " + // port name, String "s1-eth1"
- "00 00 00 24 " + //port config
- "00 00 00 02 " + //port state
- "00 00 00 81 00 00 00 A1 " + //current + advertised features
- "00 00 FF FF 00 00 00 00 " + //supported + peer features
- "00 00 00 81 00 00 00 80"); //curr speed, max speed
+ "01 00 00 00 00 00 00 00 " //reason, padding
+ + "00 01 02 03 00 00 00 00 " //port no, padding
+ + "08 00 27 00 B0 EB 00 00 " //mac address, padding
+ + "73 31 2d 65 74 68 31 00 00 00 00 00 00 00 00 00 " // port name, String "s1-eth1"
+ + "00 00 00 24 " //port config
+ + "00 00 00 02 " //port state
+ + "00 00 00 81 00 00 00 A1 " //current + advertised features
+ + "00 00 FF FF 00 00 00 00 " //supported + peer features
+ + "00 00 00 81 00 00 00 80"); //curr speed, max speed
PortStatusMessage message = BufferHelper.deserialize(statusFactory, bb);
*/
@Test
public void test() {
- ByteBuf bb = BufferHelper.buildBuffer("00 01 02 03 " + // port
- "00 00 00 00 " + // padding
- "00 00 00 01 " + // queueId
- "00 00 00 01 " + // port
- "00 20 " + // length
- "00 00 00 00 00 00 " + // pad
- "00 02 " + // property
- "00 10 " + // length
- "00 00 00 00 " + // pad
- "00 05 " + // rate
- "00 00 00 00 00 00 " + // pad
- "00 00 00 02 " + // queueId
- "00 00 00 02 " + // port
- "00 20 " + // length
- "00 00 00 00 00 00 " + // pad
- "00 02 " + // property
- "00 10 " + // length
- "00 00 00 00 " + // pad
- "00 05 " + // rate
- "00 00 00 00 00 00" // pad
+ ByteBuf bb = BufferHelper.buildBuffer("00 01 02 03 " // port
+ + "00 00 00 00 " // padding
+ + "00 00 00 01 " // queueId
+ + "00 00 00 01 " // port
+ + "00 20 " // length
+ + "00 00 00 00 00 00 " // pad
+ + "00 02 " // property
+ + "00 10 " // length
+ + "00 00 00 00 " // pad
+ + "00 05 " // rate
+ + "00 00 00 00 00 00 " // pad
+ + "00 00 00 02 " // queueId
+ + "00 00 00 02 " // port
+ + "00 20 " // length
+ + "00 00 00 00 00 00 " // pad
+ + "00 02 " // property
+ + "00 10 " // length
+ + "00 00 00 00 " // pad
+ + "00 05 " // rate
+ + "00 00 00 00 00 00" // pad
);
GetQueueConfigOutput builtByFactory = BufferHelper.deserialize(
*/
@Test
public void testMultipartReplyFlowBody() {
- ByteBuf bb = BufferHelper.buildBuffer("00 01 00 01 00 00 00 00 " + //
+ ByteBuf bb = BufferHelper.buildBuffer("00 01 00 01 00 00 00 00 " //
// first flow stat
- "00 48 08 00 " + // length, tableId, padding
- "00 00 00 09 " + //durationSec
- "00 00 00 07 " + //durationNsec
- "00 0C 00 0E 00 0F 00 1F " + //priority, idleTimeout, hardTimeout, flags
- "00 00 00 00 " + //pad_02
- "FF 01 01 01 01 01 01 01 " + //cookie
- "EF 01 01 01 01 01 01 01 " + //packetCount
- "7F 01 01 01 01 01 01 01 " + //byteCount
- "00 01 00 04 00 00 00 00 " + //empty match
- "00 01 00 08 06 00 00 00 " + //
- "00 01 00 08 06 00 00 00 " + //
+ + "00 48 08 00 " // length, tableId, padding
+ + "00 00 00 09 " //durationSec
+ + "00 00 00 07 " //durationNsec
+ + "00 0C 00 0E 00 0F 00 1F " //priority, idleTimeout, hardTimeout, flags
+ + "00 00 00 00 " //pad_02
+ + "FF 01 01 01 01 01 01 01 " //cookie
+ + "EF 01 01 01 01 01 01 01 " //packetCount
+ + "7F 01 01 01 01 01 01 01 " //byteCount
+ + "00 01 00 04 00 00 00 00 " //empty match
+ + "00 01 00 08 06 00 00 00 " //
+ + "00 01 00 08 06 00 00 00 " //
// second flow stat
- "00 48 08 00 " + // length, tableId, padding
- "00 00 00 09 " + //durationSec
- "00 00 00 07 " + //durationNsec
- "00 0C 00 0E 00 0F 00 00 " + // priority, idleTimeout, hardTimeout, flags
- "00 00 00 00 " + //pad_02
- "FF 01 01 01 01 01 01 01 " + //cookie
- "EF 01 01 01 01 01 01 01 " + //packetCount
- "7F 01 01 01 01 01 01 01 " + //byteCount
- "00 01 00 04 00 00 00 00 " + //empty match
- "00 01 00 08 06 00 00 00 " + //
- "00 01 00 08 06 00 00 00");
+ + "00 48 08 00 " // length, tableId, padding
+ + "00 00 00 09 " //durationSec
+ + "00 00 00 07 " //durationNsec
+ + "00 0C 00 0E 00 0F 00 00 " // priority, idleTimeout, hardTimeout, flags
+ + "00 00 00 00 " //pad_02
+ + "FF 01 01 01 01 01 01 01 " //cookie
+ + "EF 01 01 01 01 01 01 01 " //packetCount
+ + "7F 01 01 01 01 01 01 01 " //byteCount
+ + "00 01 00 04 00 00 00 00 " //empty match
+ + "00 01 00 08 06 00 00 00 " //
+ + "00 01 00 08 06 00 00 00");
MultipartReplyMessage builtByFactory = BufferHelper.deserialize(factory, bb);
BufferHelper.checkHeaderV13(builtByFactory);
*/
@Test
public void testMultipartReplyGroupFeatures() {
- ByteBuf bb = BufferHelper.buildBuffer("00 08 00 01 00 00 00 00 " + //
- "00 00 00 0F " + // types
- "00 00 00 0F " + // capabilities
- "00 00 00 01 " + // max groups
- "00 00 00 02 " + // max groups
- "00 00 00 03 " + // max groups
- "00 00 00 04 " + // max groups
- "0F FF 98 01 " + // actions bitmap (all actions included)
- "00 00 00 00 " + // actions bitmap (no actions included)
- "00 00 00 00 " + // actions bitmap (no actions included)
- "00 00 00 00"// actions bitmap (no actions included)
+ ByteBuf bb = BufferHelper.buildBuffer("00 08 00 01 00 00 00 00 " //
+ + "00 00 00 0F " // types
+ + "00 00 00 0F " // capabilities
+ + "00 00 00 01 " // max groups
+ + "00 00 00 02 " // max groups
+ + "00 00 00 03 " // max groups
+ + "00 00 00 04 " // max groups
+ + "0F FF 98 01 " // actions bitmap (all actions included)
+ + "00 00 00 00 " // actions bitmap (no actions included)
+ + "00 00 00 00 " // actions bitmap (no actions included)
+ + "00 00 00 00" // actions bitmap (no actions included)
);
MultipartReplyMessage builtByFactory = BufferHelper.deserialize(factory, bb);
*/
@Test
public void testMultipartReplyGroupFeatures2() {
- ByteBuf bb = BufferHelper.buildBuffer("00 08 00 01 00 00 00 00 " + //
- "00 00 00 00 " + // types
- "00 00 00 00 " + // capabilities
- "00 00 00 01 " + // max groups
- "00 00 00 02 " + // max groups
- "00 00 00 03 " + // max groups
- "00 00 00 04 " + // max groups
- "00 00 00 00 " + // actions bitmap (all actions included)
- "00 00 00 00 " + // actions bitmap (no actions included)
- "00 00 00 00 " + // actions bitmap (no actions included)
- "00 00 00 00"// actions bitmap (no actions included)
+ ByteBuf bb = BufferHelper.buildBuffer("00 08 00 01 00 00 00 00 " //
+ + "00 00 00 00 " // types
+ + "00 00 00 00 " // capabilities
+ + "00 00 00 01 " // max groups
+ + "00 00 00 02 " // max groups
+ + "00 00 00 03 " // max groups
+ + "00 00 00 04 " // max groups
+ + "00 00 00 00 " // actions bitmap (all actions included)
+ + "00 00 00 00 " // actions bitmap (no actions included)
+ + "00 00 00 00 " // actions bitmap (no actions included)
+ + "00 00 00 00" // actions bitmap (no actions included)
);
MultipartReplyMessage builtByFactory = BufferHelper.deserialize(factory, bb);
*/
@Test
public void testMultipartReplyMeterFeatures() {
- ByteBuf bb = BufferHelper.buildBuffer("00 0B 00 01 00 00 00 00 " + //
- "00 00 00 0A " + // maxMeter
- "00 00 00 06 " + // bandTypes
- "00 00 00 0F " + // capabilities
- "07 08 00 00" // maxBands, maxColor, padding
+ ByteBuf bb = BufferHelper.buildBuffer("00 0B 00 01 00 00 00 00 " //
+ + "00 00 00 0A " // maxMeter
+ + "00 00 00 06 " // bandTypes
+ + "00 00 00 0F " // capabilities
+ + "07 08 00 00" // maxBands, maxColor, padding
);
MultipartReplyMessage builtByFactory = BufferHelper.deserialize(factory, bb);
*/
@Test
public void testMultipartReplyMeterFeatures2() {
- ByteBuf bb = BufferHelper.buildBuffer("00 0B 00 01 00 00 00 00 " + //
- "00 00 00 09 " + // maxMeter
- "00 00 00 00 " + // bandTypes
- "00 00 00 00 " + // capabilities
- "03 04 00 00" // maxBands, maxColor, padding
+ ByteBuf bb = BufferHelper.buildBuffer("00 0B 00 01 00 00 00 00 " //
+ + "00 00 00 09 " // maxMeter
+ + "00 00 00 00 " // bandTypes
+ + "00 00 00 00 " // capabilities
+ + "03 04 00 00" // maxBands, maxColor, padding
);
MultipartReplyMessage builtByFactory = BufferHelper.deserialize(factory, bb);
*/
@Test
public void testMultipartReplyPortDesc() {
- ByteBuf bb = BufferHelper.buildBuffer("00 0D 00 00 00 00 00 00 " + //
+ ByteBuf bb = BufferHelper.buildBuffer("00 0D 00 00 00 00 00 00 " //
// first port desc
- "00 01 02 03 00 00 00 00 " + // portNo, padding
- "08 00 27 00 B0 EB 00 00 " + // mac address, padding
- "4F 70 65 6E 64 61 79 6C 69 67 68 74 00 00 00 00 " + // name
- "00 00 00 65 " + //port config
- "00 00 00 07 " + //port state
- "00 00 00 81 " + //current features
- "00 00 FF FF " + //advertised features
- "00 00 C1 89 " + //supported features
- "00 00 C5 8D " + //peer features
- "00 00 00 81 " + //curr speed
- "00 00 00 80 " + //max speed
+ + "00 01 02 03 00 00 00 00 " // portNo, padding
+ + "08 00 27 00 B0 EB 00 00 " // mac address, padding
+ + "4F 70 65 6E 64 61 79 6C 69 67 68 74 00 00 00 00 " // name
+ + "00 00 00 65 " //port config
+ + "00 00 00 07 " //port state
+ + "00 00 00 81 " //current features
+ + "00 00 FF FF " //advertised features
+ + "00 00 C1 89 " //supported features
+ + "00 00 C5 8D " //peer features
+ + "00 00 00 81 " //curr speed
+ + "00 00 00 80 " //max speed
// second port desc
- "00 00 00 01 00 00 00 00 " + // portNo, padding
- "08 00 27 00 B0 EB 00 00 " + // mac address, padding
- "4F 70 65 6E 64 61 79 6C 69 67 68 74 00 00 00 00 " + // name
- "00 00 00 00 " + //port config
- "00 00 00 00 " + //port state
- "00 00 00 00 " + //current features
- "00 00 00 00 " + //advertised features
- "00 00 00 00 " + //supported features
- "00 00 00 00 " + //peer features
- "00 00 00 05 " + //curr speed
- "00 00 00 06" //max speed
+ + "00 00 00 01 00 00 00 00 " // portNo, padding
+ + "08 00 27 00 B0 EB 00 00 " // mac address, padding
+ + "4F 70 65 6E 64 61 79 6C 69 67 68 74 00 00 00 00 " // name
+ + "00 00 00 00 " //port config
+ + "00 00 00 00 " //port state
+ + "00 00 00 00 " //current features
+ + "00 00 00 00 " //advertised features
+ + "00 00 00 00 " //supported features
+ + "00 00 00 00 " //peer features
+ + "00 00 00 05 " //curr speed
+ + "00 00 00 06" //max speed
);
MultipartReplyMessage builtByFactory = BufferHelper.deserialize(factory, bb);
*/
@Test
public void testMultipartReplyTableFeatures() {
- ByteBuf bb = BufferHelper.buildBuffer("00 0C 00 00 00 00 00 00 " + //
+ ByteBuf bb = BufferHelper.buildBuffer("00 0C 00 00 00 00 00 00 " //
// first table feature
- "00 40 01 00 00 00 00 00 " + // length, tableId, padding
- "4F 70 65 6E 64 61 79 6C 69 67 68 74 00 00 00 00 00 00 00 " + //
- "00 00 00 00 00 00 00 00 00 00 00 00 00 " + // name
- "00 00 00 00 00 00 00 01 " + // metadata match
- "00 00 00 00 00 00 00 02 " + // metadata write
- "00 00 00 00 " + // config
- "00 00 00 2A " + // max entries
+ + "00 40 01 00 00 00 00 00 " // length, tableId, padding
+ + "4F 70 65 6E 64 61 79 6C 69 67 68 74 00 00 00 00 00 00 00 " //
+ + "00 00 00 00 00 00 00 00 00 00 00 00 00 " // name
+ + "00 00 00 00 00 00 00 01 " // metadata match
+ + "00 00 00 00 00 00 00 02 " // metadata write
+ + "00 00 00 00 " // config
+ + "00 00 00 2A " // max entries
// second table feature
- "00 40 02 00 00 00 00 00 " + // length, tableId, padding
- "4F 70 65 6E 64 61 79 6C 69 67 68 74 00 00 00 00 00 00 00"
- + " 00 00 00 00 00 00 00 00 00 00 00 00 00 " + // name
- "00 00 00 00 00 00 00 03 " + // metadata match
- "00 00 00 00 00 00 00 04 " + // metadata write
- "00 00 00 03 " + // config
- "00 00 00 2B" // max entries
+ + "00 40 02 00 00 00 00 00 " // length, tableId, padding
+ + "4F 70 65 6E 64 61 79 6C 69 67 68 74 00 00 00 00 00 00 00 "
+ + "00 00 00 00 00 00 00 00 00 00 00 00 00 " // name
+ + "00 00 00 00 00 00 00 03 " // metadata match
+ + "00 00 00 00 00 00 00 04 " // metadata write
+ + "00 00 00 03 " // config
+ + "00 00 00 2B" // max entries
);
MultipartReplyMessage builtByFactory = BufferHelper.deserialize(factory, bb);
*/
@Test
public void testMultipartReplyTableFeatures2() {
- ByteBuf bb = BufferHelper.buildBuffer("00 0C 00 00 00 00 00 00 " + //
- "00 B0 01 00 00 00 00 00 " + // length, tableId, padding
- "4F 70 65 6E 64 61 79 6C 69 67 68 74 00 00 00 00 00 00 00 " + //
- "00 00 00 00 00 00 00 00 00 00 00 00 00 " + // name
- "00 00 00 00 00 00 00 01 " + // metadata match
- "00 00 00 00 00 00 00 02 " + // metadata write
- "00 00 00 00 " + // config
- "00 00 00 2A " + // max entries
- "00 00 00 04 00 00 00 00 " + //
- "00 01 00 04 00 00 00 00 " + //
- "00 02 00 08 01 02 03 04 " + //
- "00 03 00 07 05 06 07 00 " + //
- "00 04 00 04 00 00 00 00 " + //
- "00 05 00 04 00 00 00 00 " + //
- "00 06 00 04 00 00 00 00 " + //
- "00 07 00 04 00 00 00 00 " + //
- "00 08 00 04 00 00 00 00 " + //
- "00 0A 00 04 00 00 00 00 " + //
- "00 0C 00 04 00 00 00 00 " + //
- "00 0D 00 04 00 00 00 00 " + //
- "00 0E 00 04 00 00 00 00 " + //
- "00 0F 00 04 00 00 00 00"
+ ByteBuf bb = BufferHelper.buildBuffer("00 0C 00 00 00 00 00 00 " //
+ + "00 B0 01 00 00 00 00 00 " // length, tableId, padding
+ + "4F 70 65 6E 64 61 79 6C 69 67 68 74 00 00 00 00 00 00 00 " //
+ + "00 00 00 00 00 00 00 00 00 00 00 00 00 " // name
+ + "00 00 00 00 00 00 00 01 " // metadata match
+ + "00 00 00 00 00 00 00 02 " // metadata write
+ + "00 00 00 00 " // config
+ + "00 00 00 2A " // max entries
+ + "00 00 00 04 00 00 00 00 "
+ + "00 01 00 04 00 00 00 00 "
+ + "00 02 00 08 01 02 03 04 "
+ + "00 03 00 07 05 06 07 00 "
+ + "00 04 00 04 00 00 00 00 "
+ + "00 05 00 04 00 00 00 00 "
+ + "00 06 00 04 00 00 00 00 "
+ + "00 07 00 04 00 00 00 00 "
+ + "00 08 00 04 00 00 00 00 "
+ + "00 0A 00 04 00 00 00 00 "
+ + "00 0C 00 04 00 00 00 00 "
+ + "00 0D 00 04 00 00 00 00 "
+ + "00 0E 00 04 00 00 00 00 "
+ + "00 0F 00 04 00 00 00 00"
);
MultipartReplyMessage builtByFactory = BufferHelper.deserialize(factory, bb);