zeroconf/server/inc/cadvertizehandler.h
changeset 14 da856f45b798
equal deleted inserted replaced
12:78fbd574edf4 14:da856f45b798
       
     1 /*
       
     2 * Copyright (c) 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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 /**
       
    20 @file
       
    21 @internalTechnology
       
    22 */
       
    23 
       
    24 #ifndef __CADVERTIZEHANDLER_H__
       
    25 #define __CADVERTIZEHANDLER_H__
       
    26 
       
    27 //User include
       
    28 #include "cmessagehandler.h"
       
    29 #include <mdns/cdnsmessage.h>
       
    30 #include "cbasehandler.h"
       
    31 #include "cmdnsprobemanager.h"
       
    32 #include "mmessagehandler.h"
       
    33 #include "mdnsdebug.h"
       
    34 
       
    35 class CAdvertizeHandler : public CBaseHandler ,public MMessageHandler
       
    36 	{
       
    37 	public:
       
    38 		static CAdvertizeHandler* NewL(CMessageHandler& aMessageHandler,TBool aAutoResolveEnabled  = ETrue);
       
    39 		~CAdvertizeHandler();
       
    40 		void HandleIncomingPacketL(CDnsMessage& aMessage);
       
    41 		void AdvertizePacketL(const RPointerArray<CDnsResourceData> aData, TInt aSessionId, TBool aIsUpdate);
       
    42 		void SetAutoResolve(TBool aFlag);
       
    43 		//From MMessageHandler
       
    44 		void OnPacketSendL(TInt aError);
       
    45 	private:
       
    46 		CAdvertizeHandler(CMessageHandler& aMessageHandler,TBool aAutoResolveEnabled);
       
    47 		void ConstructL();
       
    48 		void RunL();
       
    49 		TInt RunError(TInt aError);
       
    50 		void Schedule();
       
    51 		TInt GenerateNonConflictingName();
       
    52 	    TBool DefensiveResponseL();
       
    53 	    void SendAnnouncementL();
       
    54 	    void InsertInCache();
       
    55 	    void SendProbeL(TBool aUnicast);
       
    56 	    void ChangeDomainL(TDesC8& aName);
       
    57 	private:
       
    58 	    RBuf8 iName;
       
    59 		TBool iAutoResolveEnabled;
       
    60 		TProbeStates iCurrentProbeState;
       
    61 		TConflictResolveState iConflict;
       
    62 		TInt iProbeCounter;
       
    63 		RPointerArray<CDnsResourceData> iData;
       
    64 		RBuf8 iProbeName;
       
    65 		RBuf8 iProbeType;
       
    66 		TInt  iSessionId;
       
    67 		/**
       
    68 		FLOGGER debug trace member variable.
       
    69 		*/
       
    70 		__FLOG_DECLARATION_MEMBER_MUTABLE;
       
    71 	};
       
    72 
       
    73 
       
    74 
       
    75 #endif //__CADVERTIZEHANDLER_H__