zeroconf/server/inc/mdnsserversession.h
author guru.kini@nokia.com
Thu, 24 Jun 2010 19:09:47 +0530
changeset 14 da856f45b798
permissions -rw-r--r--
Committing ZeroConf for 10.1 to the FCL.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
     1
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
     2
// All rights reserved.
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
     3
// This component and the accompanying materials are made available
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
     5
// which accompanies this distribution, and is available
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
     7
//
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
     8
// Initial Contributors:
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    10
//
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    11
// Contributors:
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    12
//
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    13
// Description:
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    14
// mdnsserversession.h
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    15
// 
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    16
//
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    17
/**
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    18
@file
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    19
@internalTechnology
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    20
*/
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    21
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    22
#ifndef __MDNSSERVERSESSION_H__
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    23
#define __MDNSSERVERSESSION_H__
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    24
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    25
#include <e32base.h>
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    26
#include <pnp/pnpparameterbundle.h>
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    27
#include <mdns/mdnsparamset.h>
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    28
#include <mdns/ccacheentry.h>
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    29
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    30
//User Include
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    31
#include "cmessagehandler.h"
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    32
#include "mdnsdebug.h"
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    33
class CMdnsServer;
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    34
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    35
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    36
class CMdnsServerSession : public CSession2
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    37
	{
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    38
public:
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    39
	static CMdnsServerSession* NewL(const CMdnsServer& aServer);
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    40
	static CMdnsServerSession* NewLC(const CMdnsServer& aServer);
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    41
	
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    42
	void ServiceL(const RMessage2& aMessage);
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    43
	void ServiceError(const RMessage2& aMessage, TInt aError);
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    44
	TInt OutStandQueryClientHandle()const;
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    45
	void SendResponseL();
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    46
	//void HandleNameChangeL();
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    47
	void HandleServiceNameConflictL(const RBuf8& aName,TInt aError);
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    48
	void ServiceQueryL(const RMessage2& aMessage);
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    49
	void PublishL(const RMessage2& aMessage);
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    50
	void NewServiceL(const RArray<RBuf8>& aName);
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    51
	TInt SessionId();
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    52
	~CMdnsServerSession();
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    53
	
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    54
private:
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    55
	CMdnsServerSession(const CMdnsServer& aServer);
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    56
	void ConstructL();
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    57
	TInt CountResources();
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    58
	void RegisterNotifyL(const RMessage2& aMessage);
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    59
	void ServerVersionL(const RMessage2& aMessage);
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    60
	void StopNotifyL (const RMessage2& aMessage);
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    61
	void CleanUp();
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    62
	void CreateAnyQueryResponseL(CCacheEntry& aEntry);
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    63
private:
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    64
	CMdnsServer& iServer;
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    65
	RMessage2 iClientQuery;
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    66
	RMessage2 iPublishRequest;
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    67
	RMessage2 iNotifyMessageRequest;
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    68
	RPnPParameterBundle iQueryBundle;
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    69
	RPnPParameterBundle iResponseBundle;
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    70
	RPnPParameterBundle iPublishBundle;
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    71
	RArray<RBuf8>       iRegisterNotifyArray;
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    72
	
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    73
	//TInt iNextSubsessionId;
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    74
	TInt iSessionId;
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    75
	TBool iIsNotifyRequested;
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    76
	
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    77
	TInt iLastTypeSent;
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    78
	
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    79
	TInt iLastServiceSent;
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    80
	/**
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    81
	*FLOGGER debug trace member variable.
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    82
	*/
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    83
	__FLOG_DECLARATION_MEMBER_MUTABLE;
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    84
	};
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    85
da856f45b798 Committing ZeroConf for 10.1 to the FCL.
guru.kini@nokia.com
parents:
diff changeset
    86
#endif /* __MDNSSERVERSESSION_H__ */