FileDocCategorySizeDatePackage
DhcpInformPacket.javaAPI DocAndroid 5.1 API2406Thu Mar 12 22:22:10 GMT 2015android.net.dhcp

DhcpInformPacket

public class DhcpInformPacket extends DhcpPacket
This class implements the (unused) DHCP-INFORM packet.

Fields Summary
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.ByteBufferbuildPacket(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 voiddoNextOp(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);
    
voidfinishPacket(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.StringtoString()

        String s = super.toString();
        return s + " INFORM";