|
1 /** |
|
2 * Copyright (c) 1997-2009 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 * DNS queries and results classes inline functions implementation |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 /** |
|
23 @file dns_qry.inl |
|
24 */ |
|
25 |
|
26 #ifndef __DNS_QRY_INL__ |
|
27 #define __DNS_QRY_INL__ |
|
28 |
|
29 |
|
30 inline TDnsQuery::TDnsQuery() |
|
31 /** |
|
32 Default constructor |
|
33 */ |
|
34 { |
|
35 iQryType = KDnsRRTypeInvalid; |
|
36 iQryClass = KDnsRRClassIN; // Internet class, default value |
|
37 } |
|
38 |
|
39 inline TDnsQuery::TDnsQuery(const TDesC8& aQryDomainName, TUint16 aType, TUint16 aClass/*=KDnsRRClassIN*/) |
|
40 /** |
|
41 Constructor |
|
42 |
|
43 @param aQryDomainName DNS query data (buffer) |
|
44 @param aType DNS query code |
|
45 @param aClass Internet class |
|
46 */ |
|
47 { |
|
48 iQryType = aType; |
|
49 iQryClass = aClass; // Internet class, default value |
|
50 iQryData.Copy(aQryDomainName); |
|
51 } |
|
52 |
|
53 inline TUint16 TDnsQuery::Type() const |
|
54 /** |
|
55 @return DNS RR type |
|
56 */ |
|
57 { |
|
58 return iQryType; |
|
59 } |
|
60 |
|
61 inline TUint16 TDnsQuery::Class() const |
|
62 /** |
|
63 @return DNS RR class |
|
64 */ |
|
65 { |
|
66 return iQryClass; |
|
67 } |
|
68 |
|
69 inline const TDesC8& TDnsQuery::Data() const |
|
70 /** |
|
71 @return const reference to the DNS query data |
|
72 */ |
|
73 { |
|
74 return iQryData; |
|
75 } |
|
76 |
|
77 inline void TDnsQuery::SetType(TUint16 aType) |
|
78 /** |
|
79 Sets the value of DNS RR type |
|
80 @param aType DNS RR type |
|
81 */ |
|
82 { |
|
83 iQryType = aType; |
|
84 } |
|
85 |
|
86 inline void TDnsQuery::SetClass(TUint16 aClass) |
|
87 /** |
|
88 Sets the value of DNS RR class |
|
89 @param aClass DNS RR class |
|
90 */ |
|
91 { |
|
92 iQryClass = aClass; |
|
93 } |
|
94 |
|
95 inline void TDnsQuery::SetData(const TDesC8& aData) |
|
96 /** |
|
97 Sets the value of the DNS query data |
|
98 @param aData const reference to the DNS query data |
|
99 */ |
|
100 { |
|
101 iQryData.Copy(aData); |
|
102 } |
|
103 |
|
104 |
|
105 //------------------------------------------------------------------------------------- |
|
106 |
|
107 inline TDnsQryRespBase::TDnsQryRespBase(TUint16 aRespType, TUint16 aRespClass) |
|
108 : iRespType(aRespType), iRespClass(aRespClass) |
|
109 /** |
|
110 Constructor |
|
111 |
|
112 @param aRespType RR type |
|
113 @param aRespClass RR Class |
|
114 */ |
|
115 { |
|
116 iRespTtl = 0; |
|
117 } |
|
118 |
|
119 inline TUint16 TDnsQryRespBase::RRType() const |
|
120 /** |
|
121 @return RR type from DNS response message |
|
122 */ |
|
123 { |
|
124 return iRespType; |
|
125 } |
|
126 |
|
127 inline TUint16 TDnsQryRespBase::RRClass() const |
|
128 /** |
|
129 @return RR class from DNS response message |
|
130 */ |
|
131 { |
|
132 return iRespClass; |
|
133 } |
|
134 |
|
135 inline TUint32 TDnsQryRespBase::RRTtl() const |
|
136 /** |
|
137 @return RR TTL from DNS response message |
|
138 */ |
|
139 { |
|
140 return iRespTtl; |
|
141 } |
|
142 |
|
143 inline void TDnsQryRespBase::SetRRTtl(TUint32 aRRTtl) |
|
144 /** |
|
145 Sets the value of RR TTL in the DNS response message |
|
146 @param aRRTtl RR TTL |
|
147 */ |
|
148 { |
|
149 iRespTtl = aRRTtl; |
|
150 } |
|
151 |
|
152 inline TDnsRespSRV::TDnsRespSRV() |
|
153 :TDnsQryRespBase(KDnsRRTypeSRV, KDnsRRClassIN) |
|
154 /** |
|
155 Constructor |
|
156 */ |
|
157 { |
|
158 iPriority = 0; |
|
159 iWeight = 0; |
|
160 iPort = 0; |
|
161 } |
|
162 |
|
163 inline const TDesC8& TDnsRespSRV::Target() const |
|
164 /** |
|
165 @return domain name of the target host. |
|
166 */ |
|
167 { |
|
168 return iTarget; |
|
169 } |
|
170 |
|
171 inline TUint16 TDnsRespSRV::Priority() const |
|
172 /** |
|
173 @return The priority of this target host |
|
174 */ |
|
175 { |
|
176 return iPriority; |
|
177 } |
|
178 |
|
179 inline TUint16 TDnsRespSRV::Weight() const |
|
180 /** |
|
181 @return the value of the weight field |
|
182 */ |
|
183 { |
|
184 return iWeight; |
|
185 } |
|
186 |
|
187 inline TUint16 TDnsRespSRV::Port() const |
|
188 /** |
|
189 @return port number |
|
190 */ |
|
191 { |
|
192 return iPort; |
|
193 } |
|
194 |
|
195 inline void TDnsRespSRV::SetTarget(const TDesC8& aTarget) |
|
196 /** |
|
197 Sets the domain name of the target host. |
|
198 @param aTarget Domain name of the target host. |
|
199 */ |
|
200 { |
|
201 iTarget.Copy(aTarget); |
|
202 } |
|
203 |
|
204 inline void TDnsRespSRV::SetPriority(TUint16 aPriority) |
|
205 /** |
|
206 Sets The priority of this target host |
|
207 @param aPriority The priority of this target host |
|
208 */ |
|
209 { |
|
210 iPriority = aPriority; |
|
211 } |
|
212 |
|
213 inline void TDnsRespSRV::SetWeight(TUint16 aWeight) |
|
214 /** |
|
215 Sets the value of the weight field |
|
216 @param aWeight The value of the weight field |
|
217 */ |
|
218 { |
|
219 iWeight = aWeight; |
|
220 } |
|
221 |
|
222 inline void TDnsRespSRV::SetPort(TUint16 aPort) |
|
223 /** |
|
224 Sets the value of the port number |
|
225 @param aPort port number |
|
226 */ |
|
227 { |
|
228 iPort = aPort; |
|
229 } |
|
230 |
|
231 //------------------------------------------------------------------------------------- |
|
232 |
|
233 inline const TInetAddr& TDnsRespA::HostAddress() const |
|
234 /** |
|
235 @return Resolved Host Address |
|
236 */ |
|
237 { |
|
238 return iInetAddr; |
|
239 } |
|
240 |
|
241 inline void TDnsRespA::SetHostAddress(const TInetAddr& aInetAddr) |
|
242 /** |
|
243 Sets the value of the resolved Host Address |
|
244 @param aInetAddr The resolved Host Address |
|
245 */ |
|
246 { |
|
247 iInetAddr = aInetAddr; |
|
248 } |
|
249 |
|
250 inline const TInetAddr& TDnsRespAAAA::HostAddress() const |
|
251 /** |
|
252 @return Resolved Host Address |
|
253 */ |
|
254 { |
|
255 return iInetAddr; |
|
256 } |
|
257 |
|
258 inline void TDnsRespAAAA::SetHostAddress(const TInetAddr& aInetAddr) |
|
259 /** |
|
260 Sets the value of the resolved Host Address |
|
261 @param aInetAddr The resolved Host Address |
|
262 */ |
|
263 { |
|
264 iInetAddr = aInetAddr; |
|
265 } |
|
266 |
|
267 inline const TDesC8& TDnsRespPTR::HostName() const |
|
268 /** |
|
269 @return The domain name string descriptor |
|
270 */ |
|
271 { |
|
272 return iName; |
|
273 } |
|
274 |
|
275 inline void TDnsRespPTR::SetHostName(const TDesC8& aHostName) |
|
276 /** |
|
277 Sets the value of the domain name |
|
278 @param aHostName The domain name string descriptor |
|
279 */ |
|
280 { |
|
281 iName.Copy(aHostName); |
|
282 } |
|
283 |
|
284 inline TDnsRespNAPTR::TDnsRespNAPTR() |
|
285 : TDnsQryRespBase(KDnsRRTypeNAPTR, KDnsRRClassIN) |
|
286 /** |
|
287 Constructor |
|
288 */ |
|
289 { |
|
290 iOrder = 0; |
|
291 iPref = 0; |
|
292 } |
|
293 |
|
294 inline TUint16 TDnsRespNAPTR::Order() const |
|
295 /** |
|
296 @return Order field value |
|
297 */ |
|
298 { |
|
299 return iOrder; |
|
300 } |
|
301 |
|
302 inline TUint16 TDnsRespNAPTR::Pref() const |
|
303 /** |
|
304 @return Preference field value |
|
305 */ |
|
306 { |
|
307 return iPref; |
|
308 } |
|
309 |
|
310 inline const TDesC8& TDnsRespNAPTR::Flags() const |
|
311 /** |
|
312 @return Flags string descriptor |
|
313 */ |
|
314 { |
|
315 return iFlags; |
|
316 } |
|
317 |
|
318 inline const TDesC8& TDnsRespNAPTR::Service() const |
|
319 /** |
|
320 @return service name(s) available down this rewrite path. |
|
321 */ |
|
322 { |
|
323 return iService; |
|
324 } |
|
325 |
|
326 inline const TDesC8& TDnsRespNAPTR::Regexp() const |
|
327 /** |
|
328 @return Regexp field |
|
329 */ |
|
330 { |
|
331 return iRegexp; |
|
332 } |
|
333 |
|
334 inline const TDesC8& TDnsRespNAPTR::Replacement() const |
|
335 /** |
|
336 @return Replacement field |
|
337 */ |
|
338 { |
|
339 return iReplacement; |
|
340 } |
|
341 |
|
342 inline void TDnsRespNAPTR::SetOrder(TUint16 aOrder) |
|
343 /** |
|
344 Sets the value of Order field |
|
345 @param aOrder Order field value |
|
346 */ |
|
347 { |
|
348 iOrder = aOrder; |
|
349 } |
|
350 |
|
351 inline void TDnsRespNAPTR::SetPref(TUint16 aPref) |
|
352 /** |
|
353 Sets the value of Preference field |
|
354 @param aPref Preference field value |
|
355 */ |
|
356 { |
|
357 iPref = aPref; |
|
358 } |
|
359 |
|
360 inline void TDnsRespNAPTR::SetFlags(const TDesC8& aFlags) |
|
361 /** |
|
362 Sets the value of Flags string |
|
363 @param aFlags Flags string |
|
364 */ |
|
365 { |
|
366 iFlags = aFlags; |
|
367 } |
|
368 |
|
369 inline void TDnsRespNAPTR::SetService(const TDesC8& aService) |
|
370 /** |
|
371 Sets the value of service name(s) available |
|
372 @param aService service name(s) available |
|
373 */ |
|
374 { |
|
375 iService = aService; |
|
376 } |
|
377 |
|
378 inline void TDnsRespNAPTR::SetRegexp(const TDesC8& aRegexp) |
|
379 /** |
|
380 Sets the value of Regexp field |
|
381 @param aRegexp Regexp field value |
|
382 */ |
|
383 { |
|
384 iRegexp = aRegexp; |
|
385 } |
|
386 |
|
387 inline void TDnsRespNAPTR::SetReplacement(const TDesC8& aReplacement) |
|
388 /** |
|
389 Sets the value of Replacement field |
|
390 @param aReplacement Replacement field value |
|
391 */ |
|
392 { |
|
393 iReplacement = aReplacement; |
|
394 } |
|
395 |
|
396 inline TUint16 TDnsRespMX::Pref() const |
|
397 /** |
|
398 @return Preference field value |
|
399 */ |
|
400 { |
|
401 return iPref; |
|
402 } |
|
403 |
|
404 inline const TDesC8& TDnsRespMX::HostName() const |
|
405 /** |
|
406 @return Host name descriptor |
|
407 */ |
|
408 { |
|
409 return iHostName; |
|
410 } |
|
411 |
|
412 inline void TDnsRespMX::SetPref(TUint16 aPref) |
|
413 /** |
|
414 Sets the value of Preference field |
|
415 @param aPref Preference field value |
|
416 */ |
|
417 { |
|
418 iPref = aPref; |
|
419 } |
|
420 |
|
421 inline void TDnsRespMX::SetHostName(const TDesC8& aHostName) |
|
422 /** |
|
423 Sets the value of Host name. |
|
424 @param aHostName Host name. |
|
425 */ |
|
426 { |
|
427 iHostName = aHostName; |
|
428 } |
|
429 |
|
430 #endif //__DNS_QRY_INL__ |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 |
|
437 |