controller link as operation
[oweals/gnunet.git] / src / include / block_dns.h
1 /*
2      This file is part of GNUnet.
3      (C) 2009 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 3, 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/block_dns.h
23  * @author Philipp Toelke
24  */
25 #ifndef _GNVPN_BLOCKDNS_H_
26 #define _GNVPN_BLOCKDNS_H_
27
28 #include "gnunet_common.h"
29 #include "gnunet_crypto_lib.h"
30
31 /**
32  * Bitmask describing what IP-protocols are supported by the service
33  */
34 enum GNUNET_DNS_ServiceTypes
35 {
36   GNUNET_DNS_SERVICE_TYPE_UDP = 1,
37   GNUNET_DNS_SERVICE_TYPE_TCP = 2
38 };
39
40 GNUNET_NETWORK_STRUCT_BEGIN
41
42 /**
43  * This is the structure describing an dns-record such as www.gnunet.
44  */
45 struct GNUNET_DNS_Record
46 {
47   /**
48    * Signature of the peer affirming that he is offering the service.
49    */
50   struct GNUNET_CRYPTO_RsaSignature signature;
51
52   /**
53    * Beginning of signed portion of the record, signs everything until
54    * the end of the struct.
55    */
56   struct GNUNET_CRYPTO_RsaSignaturePurpose purpose;
57
58   /**
59    * The peer providing this service
60    */
61   struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded peer;
62
63   /**
64    * The descriptor for the service
65    * (a peer may provide more than one service)
66    */
67   struct GNUNET_HashCode service_descriptor;
68
69   /**
70    * When does this record expire?
71    */
72   struct GNUNET_TIME_AbsoluteNBO expiration_time;
73
74   /**
75    * Four TCP and UDP-Ports that are used by this service, big endian format
76    */
77   uint64_t ports GNUNET_PACKED;
78
79   /**
80    * What connection-types (UDP, TCP, ...) are supported by the service.
81    * Contains an 'enum GNUNET_DNS_ServiceTypes' in big endian format.
82    */
83   uint32_t service_type GNUNET_PACKED;
84 };
85 GNUNET_NETWORK_STRUCT_END
86
87 #endif