コード例 #1
0
  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;

    result = prime * result + ((value == null) ? 0 : value.hashCode());
    result = prime * result + ((mask == null) ? 0 : mask.hashCode());
    return result;
  }
コード例 #2
0
    @Override
    public OFOxmArpTpaMasked readFrom(ChannelBuffer bb) throws OFParseError {
      // fixed value property typeLen == 0x80002f08L
      int typeLen = bb.readInt();
      if (typeLen != (int) 0x80002f08)
        throw new OFParseError("Wrong typeLen: Expected=0x80002f08L(0x80002f08L), got=" + typeLen);
      IPv4Address value = IPv4Address.read4Bytes(bb);
      IPv4Address mask = IPv4Address.read4Bytes(bb);

      OFOxmArpTpaMaskedVer12 oxmArpTpaMaskedVer12 = new OFOxmArpTpaMaskedVer12(value, mask);
      if (logger.isTraceEnabled()) logger.trace("readFrom - read={}", oxmArpTpaMaskedVer12);
      return oxmArpTpaMaskedVer12;
    }
コード例 #3
0
    @Override
    public OFOxmTunnelIpv4SrcMasked readFrom(ByteBuf bb) throws OFParseError {
      // fixed value property typeLen == 0x13f08L
      int typeLen = bb.readInt();
      if (typeLen != 0x13f08)
        throw new OFParseError("Wrong typeLen: Expected=0x13f08L(0x13f08L), got=" + typeLen);
      IPv4Address value = IPv4Address.read4Bytes(bb);
      IPv4Address mask = IPv4Address.read4Bytes(bb);

      OFOxmTunnelIpv4SrcMaskedVer13 oxmTunnelIpv4SrcMaskedVer13 =
          new OFOxmTunnelIpv4SrcMaskedVer13(value, mask);
      if (logger.isTraceEnabled()) logger.trace("readFrom - read={}", oxmTunnelIpv4SrcMaskedVer13);
      return oxmTunnelIpv4SrcMaskedVer13;
    }
コード例 #4
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;
    if (getClass() != obj.getClass()) return false;
    OFOxmArpTpaMaskedVer12 other = (OFOxmArpTpaMaskedVer12) obj;

    if (value == null) {
      if (other.value != null) return false;
    } else if (!value.equals(other.value)) return false;
    if (mask == null) {
      if (other.mask != null) return false;
    } else if (!mask.equals(other.mask)) return false;
    return true;
  }
コード例 #5
0
  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;

    result = prime * result + ((nwAddr == null) ? 0 : nwAddr.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;
    OFActionSetNwDstVer11 other = (OFActionSetNwDstVer11) obj;

    if (nwAddr == null) {
      if (other.nwAddr != null) return false;
    } else if (!nwAddr.equals(other.nwAddr)) return false;
    return true;
  }
コード例 #7
0
    @Override
    public OFActionSetNwDst readFrom(ChannelBuffer bb) throws OFParseError {
      int start = bb.readerIndex();
      // fixed value property type == 6
      short type = bb.readShort();
      if (type != (short) 0x6)
        throw new OFParseError("Wrong type: Expected=OFActionType.SET_NW_DST(6), got=" + type);
      int length = U16.f(bb.readShort());
      if (length != 8) throw new OFParseError("Wrong length: Expected=8(8), 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);
      IPv4Address nwAddr = IPv4Address.read4Bytes(bb);

      OFActionSetNwDstVer11 actionSetNwDstVer11 = new OFActionSetNwDstVer11(nwAddr);
      if (logger.isTraceEnabled()) logger.trace("readFrom - read={}", actionSetNwDstVer11);
      return actionSetNwDstVer11;
    }