DhcpInformPacketpublic class DhcpInformPacket extends DhcpPacket This class implements the (unused) DHCP-INFORM packet. |
Constructors Summary |
---|
DhcpInformPacket(int transId, InetAddress clientIp, InetAddress yourIp, InetAddress nextIp, InetAddress relayIp, byte[] clientMac)Generates an INFORM packet with the specified parameters.
super(transId, clientIp, yourIp, nextIp, relayIp, clientMac, false);
|
Methods Summary |
---|
public java.nio.ByteBuffer | buildPacket(int encap, short destUdp, short srcUdp)Builds an INFORM packet.
ByteBuffer result = ByteBuffer.allocate(MAX_LENGTH);
fillInPacket(encap, mClientIp, mYourIp, destUdp, srcUdp, result,
DHCP_BOOTREQUEST, false);
result.flip();
return result;
| public void | doNextOp(DhcpStateMachine machine)Informs the state machine of the arrival of an INFORM packet. Not
used currently.
InetAddress clientRequest =
mRequestedIp == null ? mClientIp : mRequestedIp;
machine.onInformReceived(mTransId, mClientMac, clientRequest,
mRequestedParams);
| void | finishPacket(java.nio.ByteBuffer buffer)Adds additional parameters to the INFORM packet.
byte[] clientId = new byte[7];
clientId[0] = CLIENT_ID_ETHER;
System.arraycopy(mClientMac, 0, clientId, 1, 6);
addTlv(buffer, DHCP_MESSAGE_TYPE, DHCP_MESSAGE_TYPE_REQUEST);
addTlv(buffer, DHCP_PARAMETER_LIST, mRequestedParams);
addTlvEnd(buffer);
| public java.lang.String | toString()
String s = super.toString();
return s + " INFORM";
|
|