diff options
Diffstat (limited to 'src/include/gnunet_dnsparser_lib.h')
-rw-r--r-- | src/include/gnunet_dnsparser_lib.h | 53 |
1 files changed, 39 insertions, 14 deletions
diff --git a/src/include/gnunet_dnsparser_lib.h b/src/include/gnunet_dnsparser_lib.h index a9ed5b3b2..37e31d24f 100644 --- a/src/include/gnunet_dnsparser_lib.h +++ b/src/include/gnunet_dnsparser_lib.h | |||
@@ -1,5 +1,30 @@ | |||
1 | #ifndef _GNVPN_DNSP_H_ | 1 | /* |
2 | #define _GNVPN_DNSP_H_ | 2 | This file is part of GNUnet |
3 | (C) 2010, 2011, 2012 Christian Grothoff (and other contributing authors) | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 2, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file include/gnunet_dnsparse_lib.h | ||
23 | * @brief API for helper library to parse DNS packets. | ||
24 | * @author Philipp Toelke | ||
25 | */ | ||
26 | #ifndef GNUNET_DNSPARSER_LIB_H | ||
27 | #define GNUNET_DNSPARSER_LIB_H | ||
3 | 28 | ||
4 | #include "platform.h" | 29 | #include "platform.h" |
5 | #include "gnunet_common.h" | 30 | #include "gnunet_common.h" |
@@ -50,24 +75,24 @@ struct dns_pkt_parsed | |||
50 | 75 | ||
51 | struct dns_query_line | 76 | struct dns_query_line |
52 | { | 77 | { |
53 | unsigned short type; | 78 | uint16_t type; |
54 | unsigned short class; | 79 | uint16_t class; |
55 | }; | 80 | }; |
56 | 81 | ||
57 | struct dns_query | 82 | struct dns_query |
58 | { | 83 | { |
59 | char *name; | 84 | char *name; |
60 | unsigned char namelen; | 85 | unsigned char namelen; |
61 | unsigned short qtype; | 86 | uint16_t qtype; |
62 | unsigned short qclass; | 87 | uint16_t qclass; |
63 | }; | 88 | }; |
64 | 89 | ||
65 | struct dns_record_line | 90 | struct dns_record_line |
66 | { | 91 | { |
67 | unsigned short type; | 92 | uint16_t type; |
68 | unsigned short class; | 93 | uint16_t class; |
69 | unsigned int ttl; | 94 | uint32_t ttl; |
70 | unsigned short data_len; | 95 | uint16_t data_len; |
71 | unsigned char data; | 96 | unsigned char data; |
72 | }; | 97 | }; |
73 | 98 | ||
@@ -75,10 +100,10 @@ struct dns_record | |||
75 | { | 100 | { |
76 | char *name; | 101 | char *name; |
77 | unsigned char namelen; | 102 | unsigned char namelen; |
78 | unsigned short type; | 103 | uint16_t type; |
79 | unsigned short class; | 104 | uint16_t class; |
80 | unsigned int ttl; | 105 | uint32_t ttl; |
81 | unsigned short data_len; | 106 | uint16_t data_len; |
82 | unsigned char *data; | 107 | unsigned char *data; |
83 | }; | 108 | }; |
84 | 109 | ||