glitch in the license text detected by hyazinthe, thank you!
[oweals/gnunet.git] / src / nat-auto / nat-auto.h
1 /*
2      This file is part of GNUnet.
3      Copyright (C) 2011, 2016, 2017 GNUnet e.V.
4
5      GNUnet is free software: you can redistribute it and/or modify it
6      under the terms of the GNU Affero General Public License as published
7      by the Free Software Foundation, either version 3 of the License,
8      or (at your 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      Affero General Public License for more details.
14 */
15
16 /**
17  * @file src/nat-auto/nat-auto.h
18  * @brief Messages for interaction with gnunet-nat-auto-service
19  * @author Christian Grothoff
20  *
21  */
22 #ifndef NAT_AUTO_H
23 #define NAT_AUTO_H
24 #include "gnunet_util_lib.h"
25
26
27
28 GNUNET_NETWORK_STRUCT_BEGIN
29
30 /**
31  * Request to test NAT traversal, sent to the gnunet-nat-server
32  * (not the service!).
33  */
34 struct GNUNET_NAT_AUTO_TestMessage
35 {
36   /**
37    * Header with type #GNUNET_MESSAGE_TYPE_NAT_TEST
38    */
39   struct GNUNET_MessageHeader header;
40
41   /**
42    * IPv4 target IP address
43    */
44   uint32_t dst_ipv4;
45
46   /**
47    * Port to use, 0 to send dummy ICMP response.
48    */
49   uint16_t dport;
50
51   /**
52    * Data to send OR advertised-port (in NBO) to use for dummy ICMP.
53    */
54   uint16_t data;
55
56   /**
57    * #GNUNET_YES for TCP, #GNUNET_NO for UDP.
58    */
59   int32_t is_tcp;
60
61 };
62
63
64 /**
65  * Client requesting automatic configuration.
66  */
67 struct GNUNET_NAT_AUTO_AutoconfigRequestMessage
68 {
69   /**
70    * Header with type #GNUNET_MESSAGE_TYPE_NAT_REQUEST_AUTO_CFG
71    */
72   struct GNUNET_MessageHeader header;
73
74   /* Followed by configuration (diff, serialized, compressed) */
75   
76 };
77
78
79 /**
80  * Service responding with proposed configuration.
81  */
82 struct GNUNET_NAT_AUTO_AutoconfigResultMessage
83 {
84   /**
85    * Header with type #GNUNET_MESSAGE_TYPE_NAT_AUTO_CFG_RESULT
86    */
87   struct GNUNET_MessageHeader header;
88   
89   /**
90    * An `enum GNUNET_NAT_StatusCode` in NBO.
91    */
92   int32_t status_code GNUNET_PACKED;
93
94   /**
95    * An `enum GNUNET_NAT_Type` in NBO.
96    */
97   int32_t type GNUNET_PACKED;
98
99   /* Followed by configuration (diff, serialized, compressed) */
100 };
101
102
103 GNUNET_NETWORK_STRUCT_END
104
105 #endif