text: //=========================================================================
  // Copyright (C) 2012 The Elastos Open Source Project
  //
  // Licensed under the Apache License, Version 2.0 (the "License");
  // you may not use this file except in compliance with the License.
  // You may obtain a copy of the License at
  //
  //      http://www.apache.org/licenses/LICENSE-2.0
  //
  // Unless required by applicable law or agreed to in writing, software
  // distributed under the License is distributed on an "AS IS" BASIS,
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  // See the License for the specific language governing permissions and
  // limitations under the License.
  //=========================================================================
  
  #ifndef __ELASTOS_DROID_NET_DHCP_DHCPOFFERPACKET_H__
  #define __ELASTOS_DROID_NET_DHCP_DHCPOFFERPACKET_H__
  
  #include "elastos/droid/ext/frameworkext.h"
  #include "elastos/droid/net/dhcp/DhcpPacket.h"
  
  namespace Elastos {
  namespace Droid {
  namespace Net {
  namespace Dhcp {
  
  /**
   * This class implements the DHCP-OFFER packet.
   */
  class DhcpOfferPacket
      : public DhcpPacket
  {
  public:
      DhcpOfferPacket();
  
      /**
       * Generates a OFFER packet with the specified parameters.
       */
      CARAPI constructor(
          /* [in] */ Int32 transId,
          /* [in] */ Boolean broadcast,
          /* [in] */ IInetAddress* serverAddress,
          /* [in] */ IInetAddress* clientIp,
          /* [in] */ ArrayOf<Byte>* clientMac);
  
      CARAPI ToString(
          /* [out] */ String* result);
  
      /**
       * Fills in a packet with the specified OFFER attributes.
       */
      CARAPI BuildPacket(
          /* [in] */ Int32 encap,
          /* [in] */ Int16 destUdp,
          /* [in] */ Int16 srcUdp,
          /* [out] */ IByteBuffer** result);
  
      /**
       * Adds the optional parameters to the server-generated OFFER packet.
       */
      CARAPI FinishPacket(
          /* [in] */ IByteBuffer* buffer);
  
      /**
       * Notifies the state machine of the OFFER packet parameters.
       */
      CARAPI DoNextOp(
          /* [in] */ DhcpStateMachine* machine);
  
  private:
      /**
       * The IP address of the server which sent this packet.
       */
      AutoPtr<IInetAddress> mSrcIp;
  };
  
  } // namespace Dhcp
  } // namespace Net
  } // namespace Droid
  } // namespace Elastos
  
  #endif // __ELASTOS_DROID_NET_DHCP_DHCPOFFERPACKET_H__
  