natfw/natfwconnectionmultiplexer/inc/cncmlocaladdressresolver.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2006-2008 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:    Connection multiplexer session abstraction.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef C_CNCMLOCALADDRESSRESOLVER_H
       
    22 #define C_CNCMLOCALADDRESSRESOLVER_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <in_sock.h>
       
    26 
       
    27 class RSocketServ;
       
    28 class TSoInetInterfaceInfo;
       
    29 class TSoInetIfQuery;
       
    30 
       
    31 /**
       
    32  *  Connection multiplexer local IP resolver.
       
    33  *
       
    34  *  @lib connectionmux.lib
       
    35  *  @since S60 v3.2
       
    36  */
       
    37 NONSHARABLE_CLASS( CNcmLocalAddressResolver ) : public CBase
       
    38     {
       
    39 
       
    40     friend class UT_CNcmLocalAddressResolver;
       
    41     
       
    42 public:
       
    43 
       
    44     /**
       
    45      * Two-phased constructor
       
    46      *
       
    47      * @param    aSocketServ        Socket server
       
    48      */
       
    49     static CNcmLocalAddressResolver* NewL( RSocketServ& aSocketServ );
       
    50 
       
    51     /**
       
    52      * Two-phased constructor
       
    53      *
       
    54      * @param    aSocketServ        Socket server
       
    55      */
       
    56     static CNcmLocalAddressResolver* NewLC( RSocketServ& aSocketServ );
       
    57     
       
    58     /**
       
    59      * Destructor
       
    60      */
       
    61     virtual ~CNcmLocalAddressResolver();
       
    62 
       
    63     /**
       
    64      * Resolve local IP address
       
    65      *
       
    66      * @since    S60 v3.2
       
    67      * @param    aIPv4Addr          Resolved local IPv4 address
       
    68      * @param    aIPv6Addr          Resolved local IPv6 address
       
    69      * @param    aIap               IAP
       
    70      * @return   void
       
    71      */
       
    72     void GetLocalAddrL( TInetAddr& aIPv4Addr, TInetAddr& aIPv6Addr,
       
    73         TUint32 aIap );
       
    74 
       
    75 private: 
       
    76         
       
    77     CNcmLocalAddressResolver( RSocketServ& aSocketServ );
       
    78 
       
    79     void CheckAndSetAddr( const TSoInetInterfaceInfo& aInfo,
       
    80         const TSoInetIfQuery& aQuery, TUint32 aSpecifiedIap );
       
    81                          
       
    82     TBool Match( const TSoInetInterfaceInfo& aInfo,
       
    83         const TSoInetIfQuery& aQuery, TUint32 aSpecifiedIap ) const;
       
    84 
       
    85 
       
    86 private: // data
       
    87 
       
    88     /**
       
    89      * Socket server
       
    90      * Not own.
       
    91      */
       
    92     RSocketServ& iSocketServ;
       
    93     
       
    94     /**
       
    95      * IPv4 address
       
    96      */
       
    97     TInetAddr iIPv4Addr;
       
    98     
       
    99     /**
       
   100      * IPv6 address
       
   101      */
       
   102     TInetAddr iIPv6Addr; 
       
   103     };
       
   104 
       
   105 
       
   106 #endif // C_CNCMLOCALADDRESSRESOLVER_H
       
   107