コード例 #1
0
 @Override
 public void write(ByteBuf bb, OFMeterFeaturesStatsReplyVer14 message) {
   // fixed value property version = 5
   bb.writeByte((byte) 0x5);
   // fixed value property type = 19
   bb.writeByte((byte) 0x13);
   // fixed value property length = 32
   bb.writeShort((short) 0x20);
   bb.writeInt(U32.t(message.xid));
   // fixed value property statsType = 11
   bb.writeShort((short) 0xb);
   OFStatsReplyFlagsSerializerVer14.writeTo(bb, message.flags);
   // pad: 4 bytes
   bb.writeZero(4);
   message.features.writeTo(bb);
 }
コード例 #2
0
 @Override
 public void write(ChannelBuffer bb, OFBsnImageDescStatsReplyVer14 message) {
   // fixed value property version = 5
   bb.writeByte((byte) 0x5);
   // fixed value property type = 19
   bb.writeByte((byte) 0x13);
   // fixed value property length = 536
   bb.writeShort((short) 0x218);
   bb.writeInt(U32.t(message.xid));
   // fixed value property statsType = 65535
   bb.writeShort((short) 0xffff);
   OFStatsReplyFlagsSerializerVer14.writeTo(bb, message.flags);
   // pad: 4 bytes
   bb.writeZero(4);
   // fixed value property experimenter = 0x5c16c7L
   bb.writeInt(0x5c16c7);
   // fixed value property subtype = 0xeL
   bb.writeInt(0xe);
   ChannelUtils.writeFixedLengthString(bb, message.imageChecksum, 256);
   ChannelUtils.writeFixedLengthString(bb, message.startupConfigChecksum, 256);
 }
コード例 #3
0
    @Override
    public void write(ByteBuf bb, OFMeterStatsReplyVer14 message) {
      int startIndex = bb.writerIndex();
      // fixed value property version = 5
      bb.writeByte((byte) 0x5);
      // fixed value property type = 19
      bb.writeByte((byte) 0x13);
      // length is length of variable message, will be updated at the end
      int lengthIndex = bb.writerIndex();
      bb.writeShort(U16.t(0));

      bb.writeInt(U32.t(message.xid));
      // fixed value property statsType = 9
      bb.writeShort((short) 0x9);
      OFStatsReplyFlagsSerializerVer14.writeTo(bb, message.flags);
      // pad: 4 bytes
      bb.writeZero(4);
      ChannelUtils.writeList(bb, message.entries);

      // update length field
      int length = bb.writerIndex() - startIndex;
      bb.setShort(lengthIndex, length);
    }