コード例 #1
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;
    if (getClass() != obj.getClass()) return false;
    OFFlowStatsEntryVer10 other = (OFFlowStatsEntryVer10) obj;

    if (tableId == null) {
      if (other.tableId != null) return false;
    } else if (!tableId.equals(other.tableId)) return false;
    if (match == null) {
      if (other.match != null) return false;
    } else if (!match.equals(other.match)) return false;
    if (durationSec != other.durationSec) return false;
    if (durationNsec != other.durationNsec) return false;
    if (priority != other.priority) return false;
    if (idleTimeout != other.idleTimeout) return false;
    if (hardTimeout != other.hardTimeout) return false;
    if (cookie == null) {
      if (other.cookie != null) return false;
    } else if (!cookie.equals(other.cookie)) return false;
    if (packetCount == null) {
      if (other.packetCount != null) return false;
    } else if (!packetCount.equals(other.packetCount)) return false;
    if (byteCount == null) {
      if (other.byteCount != null) return false;
    } else if (!byteCount.equals(other.byteCount)) return false;
    if (actions == null) {
      if (other.actions != null) return false;
    } else if (!actions.equals(other.actions)) return false;
    return true;
  }
コード例 #2
0
    @Override
    public OFFlowStatsEntry readFrom(ByteBuf bb) throws OFParseError {
      int start = bb.readerIndex();
      int length = U16.f(bb.readShort());
      if (length < MINIMUM_LENGTH)
        throw new OFParseError(
            "Wrong length: Expected to be >= " + MINIMUM_LENGTH + ", was: " + length);
      if (bb.readableBytes() + (bb.readerIndex() - start) < length) {
        // Buffer does not have all data yet
        bb.readerIndex(start);
        return null;
      }
      if (logger.isTraceEnabled()) logger.trace("readFrom - length={}", length);
      TableId tableId = TableId.readByte(bb);
      // pad: 1 bytes
      bb.skipBytes(1);
      long durationSec = U32.f(bb.readInt());
      long durationNsec = U32.f(bb.readInt());
      int priority = U16.f(bb.readShort());
      int idleTimeout = U16.f(bb.readShort());
      int hardTimeout = U16.f(bb.readShort());
      Set<OFFlowModFlags> flags = OFFlowModFlagsSerializerVer14.readFrom(bb);
      int importance = U16.f(bb.readShort());
      // pad: 2 bytes
      bb.skipBytes(2);
      U64 cookie = U64.ofRaw(bb.readLong());
      U64 packetCount = U64.ofRaw(bb.readLong());
      U64 byteCount = U64.ofRaw(bb.readLong());
      Match match = ChannelUtilsVer14.readOFMatch(bb);
      List<OFInstruction> instructions =
          ChannelUtils.readList(bb, length - (bb.readerIndex() - start), OFInstructionVer14.READER);

      OFFlowStatsEntryVer14 flowStatsEntryVer14 =
          new OFFlowStatsEntryVer14(
              tableId,
              durationSec,
              durationNsec,
              priority,
              idleTimeout,
              hardTimeout,
              flags,
              importance,
              cookie,
              packetCount,
              byteCount,
              match,
              instructions);
      if (logger.isTraceEnabled()) logger.trace("readFrom - read={}", flowStatsEntryVer14);
      return flowStatsEntryVer14;
    }
コード例 #3
0
  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;

    result = prime * result + ((value == null) ? 0 : value.hashCode());
    return result;
  }
コード例 #4
0
    @Override
    public OFUint64 readFrom(ChannelBuffer bb) throws OFParseError {
      U64 value = U64.ofRaw(bb.readLong());

      OFUint64Ver14 uint64Ver14 = new OFUint64Ver14(value);
      if (logger.isTraceEnabled()) logger.trace("readFrom - read={}", uint64Ver14);
      return uint64Ver14;
    }
コード例 #5
0
  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;

    result = prime * result + ((tableId == null) ? 0 : tableId.hashCode());
    result = prime * result + ((match == null) ? 0 : match.hashCode());
    result = prime * (int) (durationSec ^ (durationSec >>> 32));
    result = prime * (int) (durationNsec ^ (durationNsec >>> 32));
    result = prime * result + priority;
    result = prime * result + idleTimeout;
    result = prime * result + hardTimeout;
    result = prime * result + ((cookie == null) ? 0 : cookie.hashCode());
    result = prime * result + ((packetCount == null) ? 0 : packetCount.hashCode());
    result = prime * result + ((byteCount == null) ? 0 : byteCount.hashCode());
    result = prime * result + ((actions == null) ? 0 : actions.hashCode());
    return result;
  }
コード例 #6
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;
    if (getClass() != obj.getClass()) return false;
    OFBsnTlvMissPacketsVer13 other = (OFBsnTlvMissPacketsVer13) obj;

    if (value == null) {
      if (other.value != null) return false;
    } else if (!value.equals(other.value)) return false;
    return true;
  }
コード例 #7
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;
    if (getClass() != obj.getClass()) return false;
    OFUint64Ver14 other = (OFUint64Ver14) obj;

    if (value == null) {
      if (other.value != null) return false;
    } else if (!value.equals(other.value)) return false;
    return true;
  }
  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;

    result = prime * (int) (xid ^ (xid >>> 32));
    result = prime * result + (enabled ? 1231 : 1237);
    result = prime * result + idleTimeout;
    result = prime * result + hardTimeout;
    result = prime * result + priority;
    result = prime * result + ((cookie == null) ? 0 : cookie.hashCode());
    return result;
  }
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;
    if (getClass() != obj.getClass()) return false;
    OFBsnSetPktinSuppressionRequestVer12 other = (OFBsnSetPktinSuppressionRequestVer12) obj;

    if (xid != other.xid) return false;
    if (enabled != other.enabled) return false;
    if (idleTimeout != other.idleTimeout) return false;
    if (hardTimeout != other.hardTimeout) return false;
    if (priority != other.priority) return false;
    if (cookie == null) {
      if (other.cookie != null) return false;
    } else if (!cookie.equals(other.cookie)) return false;
    return true;
  }
    @Override
    public OFBsnSetPktinSuppressionRequest readFrom(ByteBuf bb) throws OFParseError {
      int start = bb.readerIndex();
      // fixed value property version == 3
      byte version = bb.readByte();
      if (version != (byte) 0x3)
        throw new OFParseError("Wrong version: Expected=OFVersion.OF_12(3), got=" + version);
      // fixed value property type == 4
      byte type = bb.readByte();
      if (type != (byte) 0x4)
        throw new OFParseError("Wrong type: Expected=OFType.EXPERIMENTER(4), got=" + type);
      int length = U16.f(bb.readShort());
      if (length != 32) throw new OFParseError("Wrong length: Expected=32(32), got=" + length);
      if (bb.readableBytes() + (bb.readerIndex() - start) < length) {
        // Buffer does not have all data yet
        bb.readerIndex(start);
        return null;
      }
      if (logger.isTraceEnabled()) logger.trace("readFrom - length={}", length);
      long xid = U32.f(bb.readInt());
      // fixed value property experimenter == 0x5c16c7L
      int experimenter = bb.readInt();
      if (experimenter != 0x5c16c7)
        throw new OFParseError(
            "Wrong experimenter: Expected=0x5c16c7L(0x5c16c7L), got=" + experimenter);
      // fixed value property subtype == 0xbL
      int subtype = bb.readInt();
      if (subtype != 0xb)
        throw new OFParseError("Wrong subtype: Expected=0xbL(0xbL), got=" + subtype);
      boolean enabled = (bb.readByte() != 0);
      // pad: 1 bytes
      bb.skipBytes(1);
      int idleTimeout = U16.f(bb.readShort());
      int hardTimeout = U16.f(bb.readShort());
      int priority = U16.f(bb.readShort());
      U64 cookie = U64.ofRaw(bb.readLong());

      OFBsnSetPktinSuppressionRequestVer12 bsnSetPktinSuppressionRequestVer12 =
          new OFBsnSetPktinSuppressionRequestVer12(
              xid, enabled, idleTimeout, hardTimeout, priority, cookie);
      if (logger.isTraceEnabled())
        logger.trace("readFrom - read={}", bsnSetPktinSuppressionRequestVer12);
      return bsnSetPktinSuppressionRequestVer12;
    }
コード例 #11
0
    @Override
    public OFBsnTlvMissPackets readFrom(ByteBuf bb) throws OFParseError {
      int start = bb.readerIndex();
      // fixed value property type == 0xd
      short type = bb.readShort();
      if (type != (short) 0xd) throw new OFParseError("Wrong type: Expected=0xd(0xd), got=" + type);
      int length = U16.f(bb.readShort());
      if (length != 12) throw new OFParseError("Wrong length: Expected=12(12), got=" + length);
      if (bb.readableBytes() + (bb.readerIndex() - start) < length) {
        // Buffer does not have all data yet
        bb.readerIndex(start);
        return null;
      }
      if (logger.isTraceEnabled()) logger.trace("readFrom - length={}", length);
      U64 value = U64.ofRaw(bb.readLong());

      OFBsnTlvMissPacketsVer13 bsnTlvMissPacketsVer13 = new OFBsnTlvMissPacketsVer13(value);
      if (logger.isTraceEnabled()) logger.trace("readFrom - read={}", bsnTlvMissPacketsVer13);
      return bsnTlvMissPacketsVer13;
    }