tcpiputils/dnd/inc/llmnrnotifyhandler.h
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // llmnrnotifyhandler.h - Link-local multicast name resolution 
       
    15 // notify handler module header
       
    16 //
       
    17 
       
    18 #ifndef _LLMNRNOTIFYHANDLER_H_
       
    19 #define _LLMNRNOTIFYHANDLER_H_
       
    20 
       
    21 /**
       
    22 @file llmnrnotifyhandler.h
       
    23 LLMNR interface monitoring
       
    24 @internalComponent	Domain Name Resolver
       
    25 */
       
    26 #include "timeout.h"
       
    27 
       
    28 class CDndLlmnrResponder;
       
    29 class CDndLlmnrNotifyHandler : public CBase
       
    30 	/**
       
    31 	* Handles notifications of interface changes for the LLMNR
       
    32 	*/
       
    33     {
       
    34 public:
       
    35     CDndLlmnrNotifyHandler(CDndLlmnrResponder &aMaster);
       
    36     ~CDndLlmnrNotifyHandler();
       
    37     void ConstructL();
       
    38     void ConfigurationChanged();
       
    39     void Timeout(const TTime &aNow);
       
    40 	RTimeout iTimeout;			//< Hook to the timer service (MTimeoutManager)
       
    41 private:
       
    42     void ScanInterfaces();
       
    43 	TInt IsLlmnrDisabledL(TUint32 aIap);
       
    44     CDndLlmnrResponder &iMaster;
       
    45     };
       
    46 
       
    47 // This ungainly manoevure is forced on us because the offset is not evaluated early enough by GCC3.4 to be
       
    48 // passed as a template parameter
       
    49 #if defined(__X86GCC__) || defined(__GCCE__)
       
    50 #define KDndLlmnrNotifyHandlerTimeoutOffset 4
       
    51 __ASSERT_COMPILE(KDndLlmnrNotifyHandlerTimeoutOffset == _FOFF(CDndLlmnrNotifyHandler, iTimeout));
       
    52 #else
       
    53 #define KDndLlmnrNotifyHandlerTimeoutOffset _FOFF(CDndLlmnrNotifyHandler, iTimeout)
       
    54 #endif
       
    55 
       
    56 //
       
    57 //	CLlmnrNotifyHandlerTimeoutLinkage
       
    58 //	**************************
       
    59 //	Glue to bind timeout callback from the timeout manager into Timeout() call
       
    60 //	on the CDndLlmnrNotifyHandler
       
    61 //  Copied from CDndResolverTimeoutLinkage
       
    62 class CLlmnrNotifyHandlerTimeoutLinkage : public TimeoutLinkage<CDndLlmnrNotifyHandler, KDndLlmnrNotifyHandlerTimeoutOffset>
       
    63 	{
       
    64 public:
       
    65 	static void Timeout(RTimeout &aLink, const TTime &aNow, TAny * /*aPtr*/)
       
    66 		{
       
    67 		Object(aLink)->Timeout(aNow);
       
    68 		}
       
    69 	};
       
    70 #endif