@Override
    public void write(ChannelBuffer bb, OFBsnPduTxRequestVer10 message) {
      int startIndex = bb.writerIndex();
      // fixed value property version = 1
      bb.writeByte((byte) 0x1);
      // fixed value property type = 4
      bb.writeByte((byte) 0x4);
      // 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 experimenter = 0x5c16c7L
      bb.writeInt(0x5c16c7);
      // fixed value property subtype = 0x1fL
      bb.writeInt(0x1f);
      bb.writeInt(U32.t(message.txIntervalMs));
      message.portNo.write2Bytes(bb);
      bb.writeByte(U8.t(message.slotNum));
      // pad: 3 bytes
      bb.writeZero(3);
      bb.writeBytes(message.data);

      // update length field
      int length = bb.writerIndex() - startIndex;
      bb.setShort(lengthIndex, length);
    }
    @Override
    public void write(ByteBuf bb, OFFlowStatsEntryVer10 message) {
      int startIndex = bb.writerIndex();
      // length is length of variable message, will be updated at the end
      int lengthIndex = bb.writerIndex();
      bb.writeShort(U16.t(0));

      message.tableId.writeByte(bb);
      // pad: 1 bytes
      bb.writeZero(1);
      message.match.writeTo(bb);
      bb.writeInt(U32.t(message.durationSec));
      bb.writeInt(U32.t(message.durationNsec));
      bb.writeShort(U16.t(message.priority));
      bb.writeShort(U16.t(message.idleTimeout));
      bb.writeShort(U16.t(message.hardTimeout));
      // pad: 6 bytes
      bb.writeZero(6);
      bb.writeLong(message.cookie.getValue());
      bb.writeLong(message.packetCount.getValue());
      bb.writeLong(message.byteCount.getValue());
      ChannelUtils.writeList(bb, message.actions);

      // update length field
      int length = bb.writerIndex() - startIndex;
      bb.setShort(lengthIndex, length);
    }
 @Override
 public void write(ByteBuf bb, OFBsnBwEnableSetRequestVer11 message) {
   // fixed value property version = 2
   bb.writeByte((byte) 0x2);
   // fixed value property type = 4
   bb.writeByte((byte) 0x4);
   // fixed value property length = 20
   bb.writeShort((short) 0x14);
   bb.writeInt(U32.t(message.xid));
   // fixed value property experimenter = 0x5c16c7L
   bb.writeInt(0x5c16c7);
   // fixed value property subtype = 0x12L
   bb.writeInt(0x12);
   bb.writeInt(U32.t(message.enable));
 }
    @Override
    public void write(ChannelBuffer bb, OFBsnGentableEntryAddVer13 message) {
      int startIndex = bb.writerIndex();
      // fixed value property version = 4
      bb.writeByte((byte) 0x4);
      // fixed value property type = 4
      bb.writeByte((byte) 0x4);
      // 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 experimenter = 0x5c16c7L
      bb.writeInt(0x5c16c7);
      // fixed value property subtype = 0x2eL
      bb.writeInt(0x2e);
      message.tableId.write2Bytes(bb);
      // keyLength is length indicator for key, will be
      // udpated when key has been written
      int keyLengthIndex = bb.writerIndex();
      bb.writeShort(0);
      message.checksum.write16Bytes(bb);
      int keyStartIndex = bb.writerIndex();
      ChannelUtils.writeList(bb, message.key);
      // update field length member keyLength
      int keyLength = bb.writerIndex() - keyStartIndex;
      bb.setShort(keyLengthIndex, keyLength);
      ChannelUtils.writeList(bb, message.value);

      // update length field
      int length = bb.writerIndex() - startIndex;
      bb.setShort(lengthIndex, length);
    }
 @Override
 public void write(ChannelBuffer bb, OFBsnSetLacpReplyVer14 message) {
   // fixed value property version = 5
   bb.writeByte((byte) 0x5);
   // fixed value property type = 4
   bb.writeByte((byte) 0x4);
   // fixed value property length = 24
   bb.writeShort((short) 0x18);
   bb.writeInt(U32.t(message.xid));
   // fixed value property experimenter = 0x5c16c7L
   bb.writeInt(0x5c16c7);
   // fixed value property subtype = 0x2aL
   bb.writeInt(0x2a);
   bb.writeInt(U32.t(message.status));
   message.portNo.write4Bytes(bb);
 }
    @Override
    public void write(ChannelBuffer bb, OFBsnGentableBucketStatsReplyVer13 message) {
      int startIndex = bb.writerIndex();
      // fixed value property version = 4
      bb.writeByte((byte) 0x4);
      // 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 = 65535
      bb.writeShort((short) 0xffff);
      OFStatsReplyFlagsSerializerVer13.writeTo(bb, message.flags);
      // pad: 4 bytes
      bb.writeZero(4);
      // fixed value property experimenter = 0x5c16c7L
      bb.writeInt(0x5c16c7);
      // fixed value property subtype = 0x5L
      bb.writeInt(0x5);
      ChannelUtils.writeList(bb, message.entries);

      // update length field
      int length = bb.writerIndex() - startIndex;
      bb.setShort(lengthIndex, length);
    }
 @Override
 public void write(ChannelBuffer bb, OFBsnTlvQueueWeightVer13 message) {
   // fixed value property type = 0x15
   bb.writeShort((short) 0x15);
   // fixed value property length = 8
   bb.writeShort((short) 0x8);
   bb.writeInt(U32.t(message.value));
 }
 @Override
 public void write(ByteBuf bb, OFPortDescVer12 message) {
   message.portNo.write4Bytes(bb);
   // pad: 4 bytes
   bb.writeZero(4);
   message.hwAddr.write6Bytes(bb);
   // pad: 2 bytes
   bb.writeZero(2);
   ChannelUtils.writeFixedLengthString(bb, message.name, 16);
   OFPortConfigSerializerVer12.writeTo(bb, message.config);
   OFPortStateSerializerVer12.writeTo(bb, message.state);
   OFPortFeaturesSerializerVer12.writeTo(bb, message.curr);
   OFPortFeaturesSerializerVer12.writeTo(bb, message.advertised);
   OFPortFeaturesSerializerVer12.writeTo(bb, message.supported);
   OFPortFeaturesSerializerVer12.writeTo(bb, message.peer);
   bb.writeInt(U32.t(message.currSpeed));
   bb.writeInt(U32.t(message.maxSpeed));
 }
 @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);
 }
 @Override
 public void write(ByteBuf bb, OFBsnSetMirroringVer14 message) {
   // fixed value property version = 5
   bb.writeByte((byte) 0x5);
   // fixed value property type = 4
   bb.writeByte((byte) 0x4);
   // fixed value property length = 20
   bb.writeShort((short) 0x14);
   bb.writeInt(U32.t(message.xid));
   // fixed value property experimenter = 0x5c16c7L
   bb.writeInt(0x5c16c7);
   // fixed value property subtype = 0x3L
   bb.writeInt(0x3);
   bb.writeByte(U8.t(message.reportMirrorPorts));
   // pad: 3 bytes
   bb.writeZero(3);
 }
 @Override
 public void write(ByteBuf bb, OFPortStatsRequestVer13 message) {
   // fixed value property version = 4
   bb.writeByte((byte) 0x4);
   // fixed value property type = 18
   bb.writeByte((byte) 0x12);
   // fixed value property length = 24
   bb.writeShort((short) 0x18);
   bb.writeInt(U32.t(message.xid));
   // fixed value property statsType = 4
   bb.writeShort((short) 0x4);
   OFStatsRequestFlagsSerializerVer13.writeTo(bb, message.flags);
   // pad: 4 bytes
   bb.writeZero(4);
   message.portNo.write4Bytes(bb);
   // pad: 4 bytes
   bb.writeZero(4);
 }
Exemplo n.º 12
0
    @Override
    public void write(ChannelBuffer bb, OFEchoRequestVer10 message) {
      int startIndex = bb.writerIndex();
      // fixed value property version = 1
      bb.writeByte((byte) 0x1);
      // fixed value property type = 2
      bb.writeByte((byte) 0x2);
      // 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));
      bb.writeBytes(message.data);

      // update length field
      int length = bb.writerIndex() - startIndex;
      bb.setShort(lengthIndex, length);
    }
 @Override
 public void write(ChannelBuffer bb, OFBsnGentableDescStatsRequestVer13 message) {
   // fixed value property version = 4
   bb.writeByte((byte) 0x4);
   // fixed value property type = 18
   bb.writeByte((byte) 0x12);
   // fixed value property length = 24
   bb.writeShort((short) 0x18);
   bb.writeInt(U32.t(message.xid));
   // fixed value property statsType = 65535
   bb.writeShort((short) 0xffff);
   OFStatsRequestFlagsSerializerVer13.writeTo(bb, message.flags);
   // pad: 4 bytes
   bb.writeZero(4);
   // fixed value property experimenter = 0x5c16c7L
   bb.writeInt(0x5c16c7);
   // fixed value property subtype = 0x4L
   bb.writeInt(0x4);
 }
    @Override
    public void write(ByteBuf bb, OFFlowModFailedErrorMsgVer10 message) {
      int startIndex = bb.writerIndex();
      // fixed value property version = 1
      bb.writeByte((byte) 0x1);
      // fixed value property type = 1
      bb.writeByte((byte) 0x1);
      // 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 errType = 3
      bb.writeShort((short) 0x3);
      OFFlowModFailedCodeSerializerVer10.writeTo(bb, message.code);
      message.data.writeTo(bb);

      // update length field
      int length = bb.writerIndex() - startIndex;
      bb.setShort(lengthIndex, length);
    }
 @Override
 public void write(ByteBuf bb, OFBsnSetPktinSuppressionRequestVer12 message) {
   // fixed value property version = 3
   bb.writeByte((byte) 0x3);
   // fixed value property type = 4
   bb.writeByte((byte) 0x4);
   // fixed value property length = 32
   bb.writeShort((short) 0x20);
   bb.writeInt(U32.t(message.xid));
   // fixed value property experimenter = 0x5c16c7L
   bb.writeInt(0x5c16c7);
   // fixed value property subtype = 0xbL
   bb.writeInt(0xb);
   bb.writeByte(message.enabled ? 1 : 0);
   // pad: 1 bytes
   bb.writeZero(1);
   bb.writeShort(U16.t(message.idleTimeout));
   bb.writeShort(U16.t(message.hardTimeout));
   bb.writeShort(U16.t(message.priority));
   bb.writeLong(message.cookie.getValue());
 }
    @Override
    public void write(ChannelBuffer bb, OFBadPropertyErrorMsgVer14 message) {
      int startIndex = bb.writerIndex();
      // fixed value property version = 5
      bb.writeByte((byte) 0x5);
      // fixed value property type = 1
      bb.writeByte((byte) 0x1);
      // 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 errType = 14
      bb.writeShort((short) 0xe);
      OFBadPropertyCodeSerializerVer14.writeTo(bb, message.code);
      message.data.writeTo(bb);

      // update length field
      int length = bb.writerIndex() - startIndex;
      bb.setShort(lengthIndex, length);
    }
 @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);
 }
    @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);
    }
 @Override
 public void write(ChannelBuffer bb, OFGroupFeaturesStatsReplyVer12 message) {
   // fixed value property version = 3
   bb.writeByte((byte) 0x3);
   // fixed value property type = 19
   bb.writeByte((byte) 0x13);
   // fixed value property length = 56
   bb.writeShort((short) 0x38);
   bb.writeInt(U32.t(message.xid));
   // fixed value property statsType = 8
   bb.writeShort((short) 0x8);
   OFStatsReplyFlagsSerializerVer12.writeTo(bb, message.flags);
   // pad: 4 bytes
   bb.writeZero(4);
   bb.writeInt(U32.t(message.types));
   bb.writeInt(U32.t(message.capabilities));
   bb.writeInt(U32.t(message.maxGroupsAll));
   bb.writeInt(U32.t(message.maxGroupsSelect));
   bb.writeInt(U32.t(message.maxGroupsIndirect));
   bb.writeInt(U32.t(message.maxGroupsFf));
   bb.writeInt(U32.t(message.actionsAll));
   bb.writeInt(U32.t(message.actionsSelect));
   bb.writeInt(U32.t(message.actionsIndirect));
   bb.writeInt(U32.t(message.actionsFf));
 }