public class DhcpMessageDecoder
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static byte[] |
VENDOR_MAGIC_COOKIE |
| Constructor and Description |
|---|
DhcpMessageDecoder() |
| Modifier and Type | Method and Description |
|---|---|
DhcpMessage |
decode(java.nio.ByteBuffer buffer)
Convert a byte buffer into a DhcpMessage.
|
private static java.net.InetAddress |
decodeAddress(java.nio.ByteBuffer buffer)
Read a 4-byte inet address from the buffer.
|
private static byte[] |
decodeBytes(java.nio.ByteBuffer buffer,
int len) |
OptionsField |
decodeOptions(java.nio.ByteBuffer message) |
private static java.lang.String |
decodeString(java.nio.ByteBuffer buffer,
int len) |
private DhcpOption |
getOptionInstance(int tag,
byte[] value) |
public DhcpMessage decode(java.nio.ByteBuffer buffer) throws DhcpException
buffer - ByteBuffer to convert to a DhcpMessage objectDhcpExceptionprivate static byte[] decodeBytes(java.nio.ByteBuffer buffer,
int len)
buffer - len - private static java.lang.String decodeString(java.nio.ByteBuffer buffer,
int len)
buffer - private static java.net.InetAddress decodeAddress(java.nio.ByteBuffer buffer)
buffer - java.net.UnknownHostExceptionpublic OptionsField decodeOptions(java.nio.ByteBuffer message) throws DhcpException
DhcpExceptionprivate DhcpOption getOptionInstance(int tag, byte[] value) throws DhcpException
DhcpException