14
|
1 |
/*
|
|
2 |
* Copyright (c) 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 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef __TDNSHEADER_H__
|
|
21 |
#define __TDNSHEADER_H__
|
|
22 |
|
|
23 |
#include <mdns/dnsconstants.h>
|
|
24 |
|
|
25 |
class TDnsHeader
|
|
26 |
{
|
|
27 |
public:
|
|
28 |
inline TUint16 Id()const;
|
|
29 |
inline TUint16 IsQuery()const;
|
|
30 |
inline TUint16 Opcode()const;
|
|
31 |
inline TUint16 IsAuthoritative()const;
|
|
32 |
inline TUint16 IsTruncated()const;
|
|
33 |
inline TUint16 RecursionDesired()const;
|
|
34 |
inline TUint16 RecursionAvailable()const;
|
|
35 |
inline TUint16 Reserved()const;
|
|
36 |
inline TUint16 ResponseCode()const;
|
|
37 |
inline TUint16 QueryCount()const;
|
|
38 |
inline TUint16 AnswerCount()const;
|
|
39 |
inline TUint16 AuthorityNSCount()const;
|
|
40 |
inline TUint16 AdditionalRCount()const;
|
|
41 |
inline TUint16 Flags()const;
|
|
42 |
|
|
43 |
inline void SetId(TUint16 aId);
|
|
44 |
inline void SetQuery(TBool aQuery);
|
|
45 |
inline void SetOpcode(TUint16 aOpcode);
|
|
46 |
inline void SetAuthoritative(TBool aAuthBit);
|
|
47 |
inline void SetTruncated(TBool aTruncBit);
|
|
48 |
inline void SetRecursionDesired(TBool aRecDesired);
|
|
49 |
inline void SetRecursionAvailable(TBool aRecAvailable);
|
|
50 |
inline void SetReserved(TUint16 aResv);
|
|
51 |
inline void SetResponseCode(TUint16 aRespCode);
|
|
52 |
inline void SetFlags(TUint16 aFlags);
|
|
53 |
inline void SetQueryCount(TUint16 aCount);
|
|
54 |
inline void SetAnswerCount(TUint16 aCount);
|
|
55 |
inline void SetAuthorityNSCount(TUint16 aCount);
|
|
56 |
inline void SetAdditionalRCount(TUint16 aCount);
|
|
57 |
|
|
58 |
inline TDnsHeader();
|
|
59 |
inline TDnsHeader(const TDnsHeader& aHeader);
|
|
60 |
|
|
61 |
private:
|
|
62 |
/* 1 1 1 1 1 1
|
|
63 |
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
|
|
64 |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
|
65 |
| ID |
|
|
66 |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
|
67 |
|QR| Opcode |AA|TC|RD|RA| Z | RCODE |
|
|
68 |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
|
69 |
| QDCOUNT |
|
|
70 |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
|
71 |
| ANCOUNT |
|
|
72 |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
|
73 |
| NSCOUNT |
|
|
74 |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
|
75 |
| ARCOUNT |
|
|
76 |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
|
77 |
|
|
78 |
*/
|
|
79 |
TUint16 iID;
|
|
80 |
TUint16 iFlags;
|
|
81 |
TUint16 iQCount;
|
|
82 |
TUint16 iACount;
|
|
83 |
TUint16 iNSCount;
|
|
84 |
TUint16 iARCount;
|
|
85 |
};
|
|
86 |
|
|
87 |
#include <mdns/tdnsheader.inl>
|
|
88 |
|
|
89 |
#endif //__TDNSHEADER_H__
|
|
90 |
|