All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pcap.codec.icmp.icmp4.Icmp4TimeExceeded Maven / Gradle / Ivy

There is a newer version: 1.5.1
Show newest version
/** This code is licenced under the GPL version 2. */
package pcap.codec.icmp.icmp4;

import pcap.codec.icmp.Icmp;
import pcap.common.annotation.Inclubating;

/** @author Ardika Rommy Sanjaya */
@Inclubating
public class Icmp4TimeExceeded extends Icmp.IcmpTypeAndCode {

  public static final Icmp4TimeExceeded TTL_EXPIRED_IN_TRANSIT =
      new Icmp4TimeExceeded((byte) 0, "TTL expired in transit");

  public static final Icmp4TimeExceeded FRAGMENT_REASSEMBLY_TIME_EXEEDED =
      new Icmp4TimeExceeded((byte) 1, "Fragment reassembly time exceeded");

  public Icmp4TimeExceeded(Byte code, String name) {
    super((byte) 11, code, name);
  }

  /**
   * Add new {@link Icmp4TimeExceeded} to registry.
   *
   * @param code icmp type code.
   * @param name icmp type name.
   * @return returns {@link Icmp4TimeExceeded}.
   */
  public static Icmp4TimeExceeded register(Byte code, String name) {
    return new Icmp4TimeExceeded(code, name);
  }

  @Override
  public String toString() {
    return super.toString();
  }

  static {
    Icmp.IcmpTypeAndCode.ICMP4_REGISTRY.add(TTL_EXPIRED_IN_TRANSIT);
    Icmp.IcmpTypeAndCode.ICMP4_REGISTRY.add(FRAGMENT_REASSEMBLY_TIME_EXEEDED);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy