com.h3c.util.pkt

## Class Ip

- java.lang.Object
- - com.h3c.util.pkt.Ip

- All Implemented Interfaces:
    Protocol

      public class Ip
      extends Object
      implements Protocol

  IPv4 data store (immutable) and associated `Ip.Builder` (mutable).

  Includes support for the following OpenFlow match fields:

  - IPv4 TOS Differentiated Services Field Codepoints (DSFC)
  - IPv4 TOS Explicit Congestion Notification (ECN)
  - IPv4 protocol
  - IPv4 source address
  - IPv4 destination address

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Ip.Builder` Builder (mutable) used to create new protocol instances.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `checkSum()` Returns the decoded check sum.
    `boolean` | `doNotFrag()` Returns the flag indicating not to fragment this packet.
    `IpAddress` | `dstAddr()` Returns the destination address.
    `int` | `fragOffset()` Returns the fragment offset.
    `int` | `hdrLen()` Returns the decoded header length (in octets).
    `ProtocolId` | `id()` Returns the protocol ID.
    `int` | `ident()` Returns the identifier value assigned by the sender.
    `boolean` | `moreFragToCome()` Returns the flag indicating that more fragments are coming.
    `byte[]` | `options()` Returns a copy of the option bytes.
    `IpAddress` | `srcAddr()` Returns the source address.
    `String` | `toDebugString()` Returns the protocol debug string.
    `IpTosDsfc` | `tosDsfc()` Returns the TOS Differentiated Services Field Codepoints (DSFC) type.
    `IpTosEcn` | `tosEcn()` Returns the TOS Explicit Congestion Notification (ECN) type.
    `String` | `toString()`
    `int` | `totalLen()` Returns the decoded length (in octets) of the datagram including the internet header and data.
    `int` | `ttl()` Returns the Time to Live seconds.
    `IpType` | `type()` Returns the next (payload) protocol type.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### id

          public ProtocolId id()

      Description copied from interface: `Protocol`
      Returns the protocol ID.
      Specified by:
        `id` in interface `Protocol`
      Returns:
        protocol ID

    - #### ident

          public int ident()

      Returns the identifier value assigned by the sender.
      Returns:
        the identifier value

    - #### tosDsfc

          public IpTosDsfc tosDsfc()

      Returns the TOS Differentiated Services Field Codepoints (DSFC) type.
      Returns:
        the TOS DSFC type

    - #### tosEcn

          public IpTosEcn tosEcn()

      Returns the TOS Explicit Congestion Notification (ECN) type.
      Returns:
        the TOS ECN type

    - #### fragOffset

          public int fragOffset()

      Returns the fragment offset.
      Returns:
        the fragment offset

    - #### doNotFrag

          public boolean doNotFrag()

      Returns the flag indicating not to fragment this packet.
      Returns:
        the do not fragment flag

    - #### moreFragToCome

          public boolean moreFragToCome()

      Returns the flag indicating that more fragments are coming.
      Returns:
        the more fragments to come flag

    - #### ttl

          public int ttl()

      Returns the Time to Live seconds.
      Returns:
        the TTL seconds

    - #### type

          public IpType type()

      Returns the next (payload) protocol type.
      Returns:
        the payload protocol type

    - #### checkSum

          public int checkSum()

      Returns the decoded check sum. This value is only available in decoded packets.
      Returns:
        the check sum

    - #### dstAddr

          public IpAddress dstAddr()

      Returns the destination address.
      Returns:
        the destination address.

    - #### srcAddr

          public IpAddress srcAddr()

      Returns the source address.
      Returns:
        the source address

    - #### options

          public byte[] options()

      Returns a copy of the option bytes.
      Returns:
        the option bytes

    - #### hdrLen

          public int hdrLen()

      Returns the decoded header length (in octets). This value is only available in decoded packets.
      Returns:
        the header length

    - #### totalLen

          public int totalLen()

      Returns the decoded length (in octets) of the datagram including the internet header and data. This value is only available in decoded packets.
      Returns:
        the total length

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### toDebugString

          public String toDebugString()

      Description copied from interface: `Protocol`
      Returns the protocol debug string.
      Specified by:
        `toDebugString` in interface `Protocol`
      Returns:
        the protocol debug string

Copyright © 2014. All Rights Reserved.