epoc32/include/dns_qry.inl
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/dns_qry.inl	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/dns_qry.inl	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,432 @@
     1.4 -dns_qry.inl
     1.5 +/**
     1.6 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:
    1.19 +* DNS queries and results classes inline functions implementation
    1.20 +* 
    1.21 +*
    1.22 +*/
    1.23 +
    1.24 +
    1.25 +
    1.26 +
    1.27 +
    1.28 +/**
    1.29 + @file dns_qry.inl
    1.30 +*/
    1.31 +
    1.32 +#ifndef __DNS_QRY_INL__
    1.33 +#define __DNS_QRY_INL__
    1.34 +
    1.35 +
    1.36 +inline TDnsQuery::TDnsQuery()
    1.37 +/**
    1.38 +Default constructor
    1.39 +*/
    1.40 +{
    1.41 +    iQryType  = KDnsRRTypeInvalid;
    1.42 +    iQryClass = KDnsRRClassIN;    // Internet class, default value
    1.43 +}
    1.44 +
    1.45 +inline TDnsQuery::TDnsQuery(const TDesC8& aQryDomainName, TUint16 aType, TUint16 aClass/*=KDnsRRClassIN*/)
    1.46 +/**
    1.47 +Constructor
    1.48 +
    1.49 +@param aQryDomainName DNS query data (buffer)
    1.50 +@param aType DNS query code
    1.51 +@param aClass Internet class
    1.52 +*/
    1.53 +{
    1.54 +    iQryType  = aType;
    1.55 +    iQryClass = aClass;    // Internet class, default value
    1.56 +    iQryData.Copy(aQryDomainName);
    1.57 +}
    1.58 +
    1.59 +inline  TUint16 TDnsQuery::Type()  const 
    1.60 +/**
    1.61 +@return DNS RR type
    1.62 +*/
    1.63 +{
    1.64 +    return iQryType;
    1.65 +}  
    1.66 +
    1.67 +inline  TUint16 TDnsQuery::Class() const 
    1.68 +/**
    1.69 +@return DNS RR class
    1.70 +*/
    1.71 +{
    1.72 +    return iQryClass;
    1.73 +}
    1.74 +
    1.75 +inline  const TDesC8& TDnsQuery::Data() const
    1.76 +/**
    1.77 +@return const reference to the DNS query data
    1.78 +*/
    1.79 +{
    1.80 +    return iQryData;
    1.81 +}  
    1.82 +        
    1.83 +inline  void TDnsQuery::SetType(TUint16 aType)
    1.84 +/**
    1.85 +Sets the value of DNS RR type
    1.86 +@param aType DNS RR type
    1.87 +*/
    1.88 +{
    1.89 +    iQryType = aType;
    1.90 +}
    1.91 +
    1.92 +inline  void TDnsQuery::SetClass(TUint16 aClass)
    1.93 +/**
    1.94 +Sets the value of DNS RR class
    1.95 +@param aClass DNS RR class
    1.96 +*/
    1.97 +{
    1.98 +    iQryClass = aClass;
    1.99 +}
   1.100 +
   1.101 +inline  void TDnsQuery::SetData(const TDesC8& aData)
   1.102 +/**
   1.103 +Sets the value of the DNS query data
   1.104 +@param aData const reference to the DNS query data
   1.105 +*/
   1.106 +{
   1.107 +    iQryData.Copy(aData);
   1.108 +}
   1.109 +
   1.110 +
   1.111 +//-------------------------------------------------------------------------------------
   1.112 +
   1.113 +inline  TDnsQryRespBase::TDnsQryRespBase(TUint16 aRespType, TUint16 aRespClass)
   1.114 +: iRespType(aRespType), iRespClass(aRespClass)
   1.115 +/**
   1.116 +Constructor
   1.117 +
   1.118 +@param aRespType RR type
   1.119 +@param aRespClass RR Class
   1.120 +*/
   1.121 +{
   1.122 +    iRespTtl   = 0;
   1.123 +}
   1.124 +
   1.125 +inline TUint16 TDnsQryRespBase::RRType() const 
   1.126 +/**
   1.127 +@return RR type from DNS response message
   1.128 +*/
   1.129 +{
   1.130 +    return iRespType;
   1.131 +}
   1.132 +
   1.133 +inline TUint16 TDnsQryRespBase::RRClass() const 
   1.134 +/**
   1.135 +@return RR class from DNS response message
   1.136 +*/
   1.137 +{
   1.138 +    return iRespClass;
   1.139 +}
   1.140 +
   1.141 +inline TUint32 TDnsQryRespBase::RRTtl() const 
   1.142 +/**
   1.143 +@return RR TTL from DNS response message
   1.144 +*/
   1.145 +{
   1.146 +    return iRespTtl;
   1.147 +}
   1.148 +
   1.149 +inline void TDnsQryRespBase::SetRRTtl(TUint32 aRRTtl)
   1.150 +/**
   1.151 +Sets the value of RR TTL in the DNS response message
   1.152 +@param aRRTtl RR TTL 
   1.153 +*/
   1.154 +{
   1.155 +    iRespTtl = aRRTtl;
   1.156 +}
   1.157 +
   1.158 +inline TDnsRespSRV::TDnsRespSRV()
   1.159 +                   :TDnsQryRespBase(KDnsRRTypeSRV, KDnsRRClassIN)
   1.160 +/**
   1.161 +Constructor
   1.162 +*/
   1.163 +{
   1.164 +    iPriority = 0;
   1.165 +    iWeight   = 0;  
   1.166 +    iPort     = 0;  
   1.167 +}
   1.168 +
   1.169 +inline const TDesC8& TDnsRespSRV::Target() const 
   1.170 +/**
   1.171 +@return domain name of the target host.
   1.172 +*/
   1.173 +{
   1.174 +    return iTarget;
   1.175 +}
   1.176 +
   1.177 +inline TUint16 TDnsRespSRV::Priority() const 
   1.178 +/**
   1.179 +@return The priority of this target host
   1.180 +*/
   1.181 +{
   1.182 +    return iPriority;
   1.183 +}
   1.184 +
   1.185 +inline TUint16 TDnsRespSRV::Weight() const 
   1.186 +/**
   1.187 +@return the value of the weight field
   1.188 +*/
   1.189 +{
   1.190 +    return iWeight;
   1.191 +}
   1.192 +
   1.193 +inline TUint16 TDnsRespSRV::Port() const 
   1.194 +/**
   1.195 +@return port number
   1.196 +*/
   1.197 +{
   1.198 +    return iPort;
   1.199 +}
   1.200 +
   1.201 +inline void TDnsRespSRV::SetTarget(const TDesC8& aTarget) 
   1.202 +/**
   1.203 +Sets the domain name of the target host.
   1.204 +@param aTarget Domain name of the target host.
   1.205 +*/
   1.206 +{
   1.207 +    iTarget.Copy(aTarget);
   1.208 +}   
   1.209 +
   1.210 +inline void TDnsRespSRV::SetPriority(TUint16 aPriority) 
   1.211 +/**
   1.212 +Sets The priority of this target host
   1.213 +@param aPriority The priority of this target host
   1.214 +*/
   1.215 +{
   1.216 +    iPriority = aPriority;
   1.217 +} 
   1.218 +
   1.219 +inline void TDnsRespSRV::SetWeight(TUint16 aWeight) 
   1.220 +/**
   1.221 +Sets the value of the weight field
   1.222 +@param aWeight The value of the weight field
   1.223 +*/
   1.224 +{
   1.225 +    iWeight = aWeight;
   1.226 +}   
   1.227 +
   1.228 +inline void TDnsRespSRV::SetPort(TUint16 aPort) 
   1.229 +/**
   1.230 +Sets the value of the port number
   1.231 +@param aPort port number
   1.232 +*/
   1.233 +{
   1.234 +    iPort = aPort;
   1.235 +}
   1.236 +
   1.237 +//-------------------------------------------------------------------------------------
   1.238 +
   1.239 +inline const TInetAddr&  TDnsRespA::HostAddress() const 
   1.240 +/**
   1.241 +@return Resolved Host Address
   1.242 +*/
   1.243 +{ 
   1.244 +    return iInetAddr; 
   1.245 +}
   1.246 +
   1.247 +inline void TDnsRespA::SetHostAddress(const TInetAddr& aInetAddr) 
   1.248 +/**
   1.249 +Sets the value of the resolved Host Address
   1.250 +@param aInetAddr The resolved Host Address
   1.251 +*/
   1.252 +{
   1.253 +    iInetAddr = aInetAddr;
   1.254 +}
   1.255 +
   1.256 +inline const TInetAddr&  TDnsRespAAAA::HostAddress() const 
   1.257 +/**
   1.258 +@return Resolved Host Address
   1.259 +*/
   1.260 +{ 
   1.261 +    return iInetAddr; 
   1.262 +}
   1.263 +
   1.264 +inline void TDnsRespAAAA::SetHostAddress(const TInetAddr& aInetAddr)
   1.265 +/**
   1.266 +Sets the value of the resolved Host Address
   1.267 +@param aInetAddr The resolved Host Address
   1.268 +*/
   1.269 +{
   1.270 +    iInetAddr = aInetAddr;
   1.271 +}
   1.272 +
   1.273 +inline const TDesC8& TDnsRespPTR::HostName() const 
   1.274 +/**
   1.275 +@return The domain name string descriptor
   1.276 +*/
   1.277 +{ 
   1.278 +    return iName; 
   1.279 +}
   1.280 +
   1.281 +inline void TDnsRespPTR::SetHostName(const TDesC8& aHostName) 
   1.282 +/**
   1.283 +Sets the value of the domain name 
   1.284 +@param aHostName The domain name string descriptor
   1.285 +*/
   1.286 +{
   1.287 +    iName.Copy(aHostName);
   1.288 +}
   1.289 +
   1.290 +inline TDnsRespNAPTR::TDnsRespNAPTR() 
   1.291 +                     : TDnsQryRespBase(KDnsRRTypeNAPTR, KDnsRRClassIN) 
   1.292 +/**
   1.293 +Constructor
   1.294 +*/
   1.295 +{
   1.296 +    iOrder  = 0;
   1.297 +    iPref   = 0;
   1.298 +}
   1.299 +
   1.300 +inline TUint16 TDnsRespNAPTR::Order() const 
   1.301 +/**
   1.302 +@return Order field value
   1.303 +*/
   1.304 +{
   1.305 +    return iOrder;
   1.306 +}
   1.307 +
   1.308 +inline TUint16 TDnsRespNAPTR::Pref() const 
   1.309 +/**
   1.310 +@return Preference field value
   1.311 +*/
   1.312 +{
   1.313 +    return iPref;
   1.314 +}
   1.315 +
   1.316 +inline const TDesC8& TDnsRespNAPTR::Flags() const 
   1.317 +/**
   1.318 +@return Flags string descriptor
   1.319 +*/
   1.320 +{
   1.321 +    return iFlags;
   1.322 +}
   1.323 +
   1.324 +inline const TDesC8& TDnsRespNAPTR::Service() const 
   1.325 +/**
   1.326 +@return service name(s) available down this rewrite path.
   1.327 +*/
   1.328 +{
   1.329 +    return iService;
   1.330 +}
   1.331 +
   1.332 +inline const TDesC8& TDnsRespNAPTR::Regexp() const 
   1.333 +/**
   1.334 +@return Regexp field
   1.335 +*/
   1.336 +{
   1.337 +    return iRegexp;
   1.338 +}
   1.339 +
   1.340 +inline const TDesC8& TDnsRespNAPTR::Replacement() const 
   1.341 +/**
   1.342 +@return Replacement field
   1.343 +*/
   1.344 +{
   1.345 +    return iReplacement;
   1.346 +}
   1.347 +
   1.348 +inline void TDnsRespNAPTR::SetOrder(TUint16 aOrder)                   
   1.349 +/**
   1.350 +Sets the value of Order field 
   1.351 +@param aOrder Order field value
   1.352 +*/
   1.353 +{
   1.354 +    iOrder = aOrder;
   1.355 +}
   1.356 +
   1.357 +inline void TDnsRespNAPTR::SetPref(TUint16 aPref)                     
   1.358 +/**
   1.359 +Sets the value of Preference field
   1.360 +@param aPref Preference field value
   1.361 +*/
   1.362 +{
   1.363 +    iPref = aPref;
   1.364 +}
   1.365 +
   1.366 +inline void TDnsRespNAPTR::SetFlags(const TDesC8& aFlags)             
   1.367 +/**
   1.368 +Sets the value of Flags string 
   1.369 +@param aFlags Flags string 
   1.370 +*/
   1.371 +{
   1.372 +    iFlags = aFlags;
   1.373 +}
   1.374 +
   1.375 +inline void TDnsRespNAPTR::SetService(const TDesC8& aService)         
   1.376 +/**
   1.377 +Sets the value of service name(s) available 
   1.378 +@param aService service name(s) available
   1.379 +*/
   1.380 +{
   1.381 +    iService = aService;
   1.382 +}
   1.383 +
   1.384 +inline void TDnsRespNAPTR::SetRegexp(const TDesC8& aRegexp)           
   1.385 +/**
   1.386 +Sets the value of Regexp field
   1.387 +@param aRegexp Regexp field value
   1.388 +*/
   1.389 +{
   1.390 +    iRegexp = aRegexp;
   1.391 +}
   1.392 +
   1.393 +inline void TDnsRespNAPTR::SetReplacement(const TDesC8& aReplacement) 
   1.394 +/**
   1.395 +Sets the value of Replacement field
   1.396 +@param aReplacement Replacement field value
   1.397 +*/
   1.398 +{
   1.399 +    iReplacement = aReplacement;
   1.400 +}
   1.401 +
   1.402 +inline TUint16 TDnsRespMX::Pref() const 
   1.403 +/**
   1.404 +@return Preference field value
   1.405 +*/
   1.406 +{
   1.407 +    return iPref;
   1.408 +}
   1.409 +
   1.410 +inline const TDesC8& TDnsRespMX::HostName()  const 
   1.411 +/**
   1.412 +@return Host name descriptor
   1.413 +*/
   1.414 +{
   1.415 +    return iHostName;
   1.416 +}
   1.417 +
   1.418 +inline void TDnsRespMX::SetPref(TUint16 aPref) 
   1.419 +/**
   1.420 +Sets the value of Preference field
   1.421 +@param aPref Preference field value
   1.422 +*/
   1.423 +{
   1.424 +    iPref = aPref;
   1.425 +}
   1.426 +
   1.427 +inline void TDnsRespMX::SetHostName(const TDesC8& aHostName) 
   1.428 +/**
   1.429 +Sets the value of Host name.
   1.430 +@param aHostName Host name.
   1.431 +*/
   1.432 +{
   1.433 +    iHostName = aHostName;
   1.434 +}
   1.435 +
   1.436 +#endif //__DNS_QRY_INL__