14
|
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 |
#ifndef __MDNSPARAMSET_H__
|
|
20 |
#define __MDNSPARAMSET_H__
|
|
21 |
|
|
22 |
#include <es_sock.h>
|
|
23 |
#include <pnp/pnpparameterbundle.h>
|
|
24 |
#include <in_sock.h>
|
|
25 |
|
|
26 |
|
|
27 |
const TInt KMDnsParamsFactoryUid = 0x2000D067;//0x2000D05E;
|
|
28 |
|
|
29 |
/**
|
|
30 |
MDns ParameterSet Family Identifiers.
|
|
31 |
@publishedPartner
|
|
32 |
@prototype
|
|
33 |
*/
|
|
34 |
enum TMDnsParamSetFamily
|
|
35 |
{
|
|
36 |
EMDnsDiscoverRequestParamSet = 1,
|
|
37 |
EMdnsPtrParamset = 2,
|
|
38 |
EMdnsSrvParamset = 3,
|
|
39 |
EMdnsAddrParamset = 4,
|
|
40 |
EMdnsTxtParamset = 5,
|
|
41 |
EMdnsPublishResponseParamset = 6,
|
|
42 |
EMdnsRegisterNotifyParamset = 7,
|
|
43 |
EMdnsPublishParamset = 8,
|
|
44 |
//@internalTechnology
|
|
45 |
//@prototype
|
|
46 |
};
|
|
47 |
|
|
48 |
/**
|
|
49 |
class TMDnsEvent
|
|
50 |
MDnsEvent class defines the reason code for an event callback.
|
|
51 |
@publishedPartner
|
|
52 |
@prototype
|
|
53 |
*/
|
|
54 |
NONSHARABLE_CLASS(TMDnsEvent)
|
|
55 |
{
|
|
56 |
public:
|
|
57 |
/** Type of MDns Event. */
|
|
58 |
enum TEventType
|
|
59 |
{
|
|
60 |
/** This signifies that the operation completed successfully. */
|
|
61 |
ESuccess,
|
|
62 |
/** This is a 'catch-all' for communicating failures. The actual error reason is
|
|
63 |
shown in error code. */
|
|
64 |
EFail,
|
|
65 |
/** This signifies a discovery search timeout */
|
|
66 |
EDiscoveryTimeout,
|
|
67 |
/** This signifies a subscription request timeout */
|
|
68 |
ESubscriptionTimeout
|
|
69 |
};
|
|
70 |
|
|
71 |
public:
|
|
72 |
/** The event status. */
|
|
73 |
TInt iStatus;
|
|
74 |
/** The error code value. */
|
|
75 |
TInt iErrorCode;
|
|
76 |
};
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
/**
|
|
82 |
The base class for all MDns ParamSet classes.
|
|
83 |
|
|
84 |
@internalTechnology
|
|
85 |
@prototype
|
|
86 |
*/
|
|
87 |
NONSHARABLE_CLASS (CMDnsParamSetBase) : public CSubConExtensionParameterSet
|
|
88 |
{
|
|
89 |
public:
|
|
90 |
inline static CMDnsParamSetBase* NewL ( RParameterFamily& aFamily, TMDnsParamSetFamily aFamilyType );
|
|
91 |
protected:
|
|
92 |
inline CMDnsParamSetBase ();
|
|
93 |
};
|
|
94 |
|
|
95 |
|
|
96 |
// -------------------------------------------------------------------
|
|
97 |
|
|
98 |
/**
|
|
99 |
Parameter set class containing a Uri. All UPnP Request ParamSet classes derive from this class.
|
|
100 |
|
|
101 |
@internalTechnology
|
|
102 |
@prototype
|
|
103 |
*/
|
|
104 |
NONSHARABLE_CLASS ( CMDnsQueryRequestParamSet ) : public CMDnsParamSetBase
|
|
105 |
{
|
|
106 |
protected:
|
|
107 |
RBuf8 iInstanceName;
|
|
108 |
TInt iQueryType;
|
|
109 |
TInt iProtocol;
|
|
110 |
RBuf8 iServiceType;
|
|
111 |
public:
|
|
112 |
inline static CMDnsQueryRequestParamSet* NewL( RParameterFamily& aFamily );
|
|
113 |
inline void SetInstanceNameL ( const TDesC8& aName );
|
|
114 |
inline const TDesC8& InstanceName () const;
|
|
115 |
inline void SetQueryTypeL(TInt aQueryType );
|
|
116 |
inline TInt QueryType()const;
|
|
117 |
inline void SetProtocol(TInt aProtocol);
|
|
118 |
inline TInt Protocol()const;
|
|
119 |
inline void SetServiceTypeL(const TDesC8& aServiceType);
|
|
120 |
inline const TDesC8& ServiceType() const;
|
|
121 |
protected:
|
|
122 |
inline ~CMDnsQueryRequestParamSet ();
|
|
123 |
protected:
|
|
124 |
DATA_VTABLE
|
|
125 |
};
|
|
126 |
|
|
127 |
// ----------------------------------------------------------------------
|
|
128 |
NONSHARABLE_CLASS (CMDnsPtrParamSet): public CMDnsParamSetBase
|
|
129 |
{
|
|
130 |
protected:
|
|
131 |
RBuf8 iInstanceName;
|
|
132 |
RBuf8 iDomainName;
|
|
133 |
TInt iTtl;
|
|
134 |
public:
|
|
135 |
inline static CMDnsPtrParamSet* NewL(RParameterFamily& aFamily) ;
|
|
136 |
inline void SetInstanceNameL(const TDesC8& aName);
|
|
137 |
inline const TDesC8& InstanceName()const;
|
|
138 |
inline void SetDomainNameL(const TDesC8& aDomainName);
|
|
139 |
inline const TDesC8& DomainName() const;
|
|
140 |
inline void SetTtlL(TInt aTtl);
|
|
141 |
inline TInt Ttl() const;
|
|
142 |
protected:
|
|
143 |
inline ~CMDnsPtrParamSet();
|
|
144 |
protected:
|
|
145 |
DATA_VTABLE
|
|
146 |
|
|
147 |
};
|
|
148 |
|
|
149 |
//---------------------------------------------------------------------------
|
|
150 |
NONSHARABLE_CLASS (CMDnsSrvParamSet): public CMDnsParamSetBase
|
|
151 |
{
|
|
152 |
protected:
|
|
153 |
RBuf8 iDomainName;
|
|
154 |
RBuf8 iTarget;
|
|
155 |
TUint16 iPrio;
|
|
156 |
TUint16 iWeight;
|
|
157 |
TUint16 iPort;
|
|
158 |
|
|
159 |
public:
|
|
160 |
inline static CMDnsSrvParamSet* NewL(RParameterFamily& aFamily) ;
|
|
161 |
inline void SetDomainNameL(const TDesC8& aDomainName);
|
|
162 |
inline const TDesC8& DomainName() const;
|
|
163 |
inline void SetTargetL(const TDesC8& aName);
|
|
164 |
inline const TDesC8& Target()const;
|
|
165 |
inline void SetPriority(TUint16 aPriority);
|
|
166 |
inline TUint16 Priority()const;
|
|
167 |
inline void SetWeight(TUint16 aWeight);
|
|
168 |
inline TUint16 Weight()const;
|
|
169 |
inline void SetPort(TUint16 aPort);
|
|
170 |
inline TUint16 Port()const;
|
|
171 |
protected:
|
|
172 |
inline ~CMDnsSrvParamSet();
|
|
173 |
protected:
|
|
174 |
DATA_VTABLE
|
|
175 |
|
|
176 |
};
|
|
177 |
//------------------------------------------------------------------------------
|
|
178 |
NONSHARABLE_CLASS (CMDnsAddrParamSet): public CMDnsParamSetBase
|
|
179 |
{
|
|
180 |
protected:
|
|
181 |
RBuf8 iDomainName;
|
|
182 |
TInetAddr iAddr;
|
|
183 |
|
|
184 |
public:
|
|
185 |
inline static CMDnsAddrParamSet* NewL(RParameterFamily& aFamily) ;
|
|
186 |
inline void SetDomainNameL(const TDesC8& aDomainName);
|
|
187 |
inline const TDesC8& DomainName() const;
|
|
188 |
inline void SetAddress(TInetAddr aAddr);
|
|
189 |
inline TInetAddr Address()const;
|
|
190 |
protected:
|
|
191 |
inline ~CMDnsAddrParamSet();
|
|
192 |
protected:
|
|
193 |
DATA_VTABLE
|
|
194 |
|
|
195 |
};
|
|
196 |
|
|
197 |
//-------------------------------------------------------------------------------
|
|
198 |
NONSHARABLE_CLASS (CMDnsTxtParamSet): public CMDnsParamSetBase
|
|
199 |
{
|
|
200 |
protected:
|
|
201 |
RBuf8 iDomainName;
|
|
202 |
RBuf8 iTxtData;
|
|
203 |
private:
|
|
204 |
TInt iCount;
|
|
205 |
public:
|
|
206 |
inline static CMDnsTxtParamSet* NewL(RParameterFamily& aFamily) ;
|
|
207 |
inline void SetDomainNameL(const TDesC8& aDomainName);
|
|
208 |
inline const TDesC8& DomainName() const;
|
|
209 |
inline void AppendTxtData(TDesC8& aData);
|
|
210 |
inline void TxtDataL(RArray<RBuf8>& aTxtData);
|
|
211 |
private:
|
|
212 |
inline void TokenizeStringL(RBuf8& aString, RArray<RBuf8>& aList, TChar aSeparator);
|
|
213 |
protected:
|
|
214 |
inline ~CMDnsTxtParamSet();
|
|
215 |
protected:
|
|
216 |
DATA_VTABLE
|
|
217 |
|
|
218 |
};
|
|
219 |
//--------------------------------------------------------------------------------
|
|
220 |
NONSHARABLE_CLASS (CMDnsPublishResponseParamSet): public CMDnsParamSetBase
|
|
221 |
{
|
|
222 |
protected:
|
|
223 |
RBuf8 iDomainName;
|
|
224 |
TInt iError;
|
|
225 |
public:
|
|
226 |
inline static CMDnsPublishResponseParamSet* NewL(RParameterFamily& aFamily) ;
|
|
227 |
inline void SetDomainNameL(const TDesC8& aDomainName);
|
|
228 |
inline const TDesC8& DomainName() const;
|
|
229 |
inline void SetError(TInt aError);
|
|
230 |
inline TInt Error()const;
|
|
231 |
protected:
|
|
232 |
inline ~CMDnsPublishResponseParamSet();
|
|
233 |
protected:
|
|
234 |
DATA_VTABLE
|
|
235 |
|
|
236 |
};
|
|
237 |
|
|
238 |
//--------------------------------------------------------------------------------
|
|
239 |
NONSHARABLE_CLASS (CMDnsRegisterNotifyParamSet): public CMDnsParamSetBase
|
|
240 |
{
|
|
241 |
protected:
|
|
242 |
RBuf8 iInstanceName;
|
|
243 |
|
|
244 |
public :
|
|
245 |
inline static CMDnsRegisterNotifyParamSet* NewL(RParameterFamily& aFamily);
|
|
246 |
inline void SetInstanceNameL(const TDesC8& aInstanceName);
|
|
247 |
inline const TDesC8& InstanceName()const;
|
|
248 |
protected:
|
|
249 |
inline ~CMDnsRegisterNotifyParamSet();
|
|
250 |
protected:
|
|
251 |
DATA_VTABLE
|
|
252 |
|
|
253 |
};
|
|
254 |
|
|
255 |
//--------------------------------------------------------------------------------
|
|
256 |
NONSHARABLE_CLASS (CMDnsPublishParamSet): public CMDnsParamSetBase
|
|
257 |
{
|
|
258 |
protected:
|
|
259 |
TBool isPublish;
|
|
260 |
public:
|
|
261 |
inline static CMDnsPublishParamSet* NewL(RParameterFamily& aFamily) ;
|
|
262 |
inline void SetPublishUpdate(TBool aFlag);
|
|
263 |
inline TBool PublishUpdate()const;
|
|
264 |
protected:
|
|
265 |
inline ~CMDnsPublishParamSet();
|
|
266 |
protected:
|
|
267 |
DATA_VTABLE
|
|
268 |
|
|
269 |
};
|
|
270 |
#include <mdns/mdnsparamset.inl>
|
|
271 |
|
|
272 |
#endif // __MDNSPARAMSET_H__
|