voipplugins/dhcppositionprovider/inc/dhcpdatasender.h
changeset 0 a4daefaec16c
equal deleted inserted replaced
-1:000000000000 0:a4daefaec16c
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DHCPDATASENDER_H
       
    20 #define DHCPDATASENDER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <in_sock.h>
       
    24 #include <es_sock.h>
       
    25 
       
    26 #include "dhcpdatalocationrequest.h"
       
    27 
       
    28 class CIPAppUtilsAddressResolver;
       
    29 
       
    30 /**
       
    31  *  Sends a DHCP inform message to the network
       
    32  *
       
    33  *  @lib dhcppositionprovider.lib
       
    34  *  @since S60 3.2
       
    35  */
       
    36 class CDhcpDataRequestor : public CActive
       
    37     {
       
    38     public:
       
    39 
       
    40         /**
       
    41          * Two-phased constructor.
       
    42          * @since S60 3.2
       
    43          * @param aSocket       Socket port where to send data
       
    44          */
       
    45         static CDhcpDataRequestor* NewL(RSocket& aSocket );
       
    46 
       
    47         /**
       
    48          * C++ destructor
       
    49          * @since S60 3.2
       
    50          */
       
    51         virtual ~CDhcpDataRequestor();
       
    52 
       
    53     public:
       
    54 
       
    55         /**
       
    56          * Make inform message for sendid purpose.
       
    57          * @param aSocket Socket port where to send data
       
    58          *
       
    59          */
       
    60         void MakeDhcpInformMsg (TInetAddr aLocalIpAddress);
       
    61 
       
    62         /**
       
    63          * Return  transaction to follow. Note:
       
    64          * Have to call after make dhcp inform message.
       
    65          * @since S60 3.2
       
    66          * @return      Transaction id to follow.
       
    67          */
       
    68         TUint32     TransActionIdToFollow ();
       
    69 
       
    70         /**
       
    71          * Set this active object to send the DHCP message
       
    72          * @since S60 3.2
       
    73          * @param aInetAddr
       
    74          * @param aStatus       Status to be notify after message
       
    75          *                      has been sent.
       
    76          * @param aIapAddress   Used
       
    77          * @return None
       
    78          */
       
    79         void SendDHCPMessageL ( TInetAddr aInetAddr, TUint32 aIpAddress,
       
    80                 TRequestStatus& aStatus  );
       
    81 
       
    82     private:    // Methods
       
    83 
       
    84         /**
       
    85          * Finalize active object cancelation
       
    86          * @since S60 3.2
       
    87          */
       
    88         void DoCancel();
       
    89 
       
    90         /**
       
    91          * Finalize active object cancelation
       
    92          * @since S60 3.2
       
    93          */
       
    94         void RunL();
       
    95 
       
    96     private:
       
    97 
       
    98         /**
       
    99          * Symbian Os construtor which can leave
       
   100          *
       
   101          * @since S60 3.2
       
   102          */
       
   103         void  ConstructL();
       
   104 
       
   105         /**
       
   106          * C++ constructor
       
   107          * @since S60 3.2
       
   108          * @param aSocket Socket port where to send data
       
   109          *
       
   110          */
       
   111         CDhcpDataRequestor(RSocket& aSocket);
       
   112 
       
   113     private: // data
       
   114         CIPAppUtilsAddressResolver*     iIpAppUtilsResolver;
       
   115 
       
   116         // Used when make a query to the wlan subnet.
       
   117         RSocket& iSocket;
       
   118 
       
   119         /**
       
   120          * Filled in with amount of data sent before
       
   121          * completion.
       
   122          */
       
   123         TSockXfrLength          iLen;
       
   124         TRequestStatus* iClientStatus;
       
   125 
       
   126         //
       
   127         TDhcpLocationRequestPacket  iLocationRequestMsg;
       
   128         TInetAddr   iInetLclIpAddress;
       
   129         TUint32 iIapProfileId;
       
   130     };
       
   131 
       
   132 #endif // DHCPDATASENDER_H