com.h3c.util.pkt

## Class Dhcp

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

- All Implemented Interfaces:
    Protocol

      public class Dhcp
      extends Object
      implements Protocol

  DHCP data store (immutable) add associated `Dhcp.Builder` (mutable).

  There are no OpenFlow match fields that reference this protocol.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Dhcp.Builder` Builder (mutable) used to create new protocol instances.
    `static class` | `Dhcp.Flag` Flags (bitmask enumeration).
    `static class` | `Dhcp.OpCode` Operation codes.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `bootFileName()` Returns the boot file name.
    `IpAddress` | `clientAddr()` Returns the client IP address.
    `MacAddress` | `clientHwAddr()` Returns the client layer-2 hardware address.
    `Dhcp.Flag` | `flag()` Returns the `Dhcp.Flag.BROADCAST` or `Dhcp.Flag.UNICAST` type.
    `IpAddress` | `gatewayAddr()` Returns the gateway IP address.
    `int` | `hopCount()` Returns the hop count.
    `HardwareType` | `hwType()` Returns the hardware type.
    `ProtocolId` | `id()` Returns the protocol ID.
    `DhcpOption.MessageType` | `msgType()` Returns the `DhcpOption.MessageType` specified in the `DhcpOption.Code.MSG_TYPE` option.
    `int` | `numSecs()` Returns the number of seconds elapsed since a client begain an attempt to acquire or renew a lease.
    `Dhcp.OpCode` | `opCode()` Returns the operation code.
    `EnumMap<DhcpOption.Code,DhcpOption>` | `options()` Returns the options in the form of a map to allow access based on `DhcpOption`.
    `IpAddress` | `serverAddr()` Returns the server IP address.
    `String` | `serverHostName()` Returns the server host name (nickname).
    `String` | `toDebugString()` Returns the protocol debug string.
    `String` | `toString()`
    `long` | `transId()` Returns the transaction ID which is 32-bit identification field generated by the client to allow it to match up requests with replies.
    `IpAddress` | `yourAddr()` Returns "Your" IP address which is the IP address that the server is assigning to the client.

    - ### 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

    - #### opCode

          public Dhcp.OpCode opCode()

      Returns the operation code.
      Returns:
        the operation code

    - #### hwType

          public HardwareType hwType()

      Returns the hardware type.
      Returns:
        the hardware type

    - #### hopCount

          public int hopCount()

      Returns the hop count.
      Returns:
        the hop count

    - #### transId

          public long transId()

      Returns the transaction ID which is 32-bit identification field generated by the client to allow it to match up requests with replies.
      Returns:
        the transaction ID

    - #### numSecs

          public int numSecs()

      Returns the number of seconds elapsed since a client begain an attempt to acquire or renew a lease.
      Returns:
        the number of seconds

    - #### flag

          public Dhcp.Flag flag()

      Returns the `Dhcp.Flag.BROADCAST` or `Dhcp.Flag.UNICAST` type.
      Returns:
        the broadcast or unicast type

    - #### clientAddr

          public IpAddress clientAddr()

      Returns the client IP address. The client puts its own current IP address in this field if and only if it has a valid IP address.
      Returns:
        the client IP address

    - #### yourAddr

          public IpAddress yourAddr()

      Returns "Your" IP address which is the IP address that the server is assigning to the client.
      Returns:
        "Your" IP address

    - #### serverAddr

          public IpAddress serverAddr()

      Returns the server IP address. This is the address of the server that the client should use for the next step in the bootstrap process.
      Returns:
        the server IP address

    - #### gatewayAddr

          public IpAddress gatewayAddr()

      Returns the gateway IP address. This address used to route messages when relay agents are involved to facilitate communication between subnets.
      Returns:
        the gateway IP address

    - #### clientHwAddr

          public MacAddress clientHwAddr()

      Returns the client layer-2 hardware address.
      Returns:
        the client hardware address

    - #### serverHostName

          public String serverHostName()

      Returns the server host name (nickname).
      Returns:
        the server host name

    - #### bootFileName

          public String bootFileName()

      Returns the boot file name.
      Returns:
        the boot file name

    - #### msgType

          public DhcpOption.MessageType msgType()

      Returns the `DhcpOption.MessageType` specified in the `DhcpOption.Code.MSG_TYPE` option.
      Returns:
        the message type or null if not found

    - #### options

          public EnumMap<DhcpOption.Code,DhcpOption> options()

      Returns the options in the form of a map to allow access based on `DhcpOption`.
      Returns:
        the options in the form of a map

    - #### 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.