public class DHCP extends BasePacket
Modifier and Type | Class and Description |
---|---|
static class |
DHCP.DHCPOptionCode |
static class |
DHCP.MsgType |
Modifier and Type | Field and Description |
---|---|
protected String |
bootFileName |
protected byte[] |
clientHardwareAddress |
protected int |
clientIPAddress |
protected short |
flags |
protected int |
gatewayIPAddress |
protected byte |
hardwareAddressLength |
protected byte |
hardwareType |
protected byte |
hops |
static byte |
HWTYPE_ETHERNET |
static int |
MIN_HEADER_LENGTH
Dynamic Host Configuration Protocol packet.
|
protected byte |
opCode |
static byte |
OPCODE_REPLY |
static byte |
OPCODE_REQUEST |
protected List<DhcpOption> |
options |
protected short |
seconds |
protected int |
serverIPAddress |
protected String |
serverName |
protected int |
transactionId |
protected int |
yourIPAddress |
parent, payload
Constructor and Description |
---|
DHCP() |
clone, equals, getParent, getPayload, hashCode, resetChecksum, setParent, setPayload
public static final int MIN_HEADER_LENGTH
public static final byte OPCODE_REQUEST
public static final byte OPCODE_REPLY
public static final byte HWTYPE_ETHERNET
protected byte opCode
protected byte hardwareType
protected byte hardwareAddressLength
protected byte hops
protected int transactionId
protected short seconds
protected short flags
protected int clientIPAddress
protected int yourIPAddress
protected int serverIPAddress
protected int gatewayIPAddress
protected byte[] clientHardwareAddress
protected String serverName
protected String bootFileName
protected List<DhcpOption> options
public byte getOpCode()
public DHCP setOpCode(byte opCode)
opCode
- the opCode to setpublic byte getHardwareType()
public DHCP setHardwareType(byte hardwareType)
hardwareType
- the hardwareType to setpublic byte getHardwareAddressLength()
public DHCP setHardwareAddressLength(byte hardwareAddressLength)
hardwareAddressLength
- the hardwareAddressLength to setpublic byte getHops()
public DHCP setHops(byte hops)
hops
- the hops to setpublic int getTransactionId()
public DHCP setTransactionId(int transactionId)
transactionId
- the transactionId to setpublic short getSeconds()
public DHCP setSeconds(short seconds)
seconds
- the seconds to setpublic short getFlags()
public DHCP setFlags(short flags)
flags
- the flags to setpublic int getClientIPAddress()
public DHCP setClientIPAddress(int clientIPAddress)
clientIPAddress
- the clientIPAddress to setpublic int getYourIPAddress()
public DHCP setYourIPAddress(int yourIPAddress)
yourIPAddress
- the yourIPAddress to setpublic int getServerIPAddress()
public DHCP setServerIPAddress(int serverIPAddress)
serverIPAddress
- the serverIPAddress to setpublic int getGatewayIPAddress()
public DHCP setGatewayIPAddress(int gatewayIPAddress)
gatewayIPAddress
- the gatewayIPAddress to setpublic byte[] getClientHardwareAddress()
public DHCP setClientHardwareAddress(byte[] clientHardwareAddress)
clientHardwareAddress
- the clientHardwareAddress to setpublic DhcpOption getOption(DHCP.DHCPOptionCode optionCode)
optionCode
- The option code to getpublic List<DhcpOption> getOptions()
public DHCP setOptions(List<DhcpOption> options)
options
- the options to setpublic DHCP.MsgType getPacketType()
public String getServerName()
public DHCP setServerName(String server)
server
- the serverName to setpublic String getBootFileName()
public DHCP setBootFileName(String bootFile)
bootFile
- the bootFileName to setpublic byte[] serialize()
IPacket
protected void writeString(String string, ByteBuffer bb, int maxLength)
public static Deserializer<DHCP> deserializer()