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