GNUnet  0.10.x
nat.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2011, 2016 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  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19 */
20 
27 #ifndef NAT_H
28 #define NAT_H
29 #include "gnunet_util_lib.h"
30 
31 
32 
34 
40 {
45 
49  uint32_t dst_ipv4;
50 
54  uint16_t dport;
55 
59  uint16_t data;
60 
64  int32_t is_tcp;
65 
66 };
67 
68 
74 {
79 
85 
90 };
91 
92 
97 {
102 
106  uint8_t flags;
107 
111  uint8_t proto;
112 
117  uint16_t str_len GNUNET_PACKED;
118 
124  uint16_t num_addrs GNUNET_PACKED;
125 
126  /* Followed by @e num_addrs addresses of type 'struct
127  sockaddr' */
128 
129  /* Followed by @e str_len section name to use for options */
130 
131 };
132 
133 
138 {
143 
148 
152  uint16_t payload_size;
153 
154  /* followed by a `struct sockaddr` of @e sender_addr_size bytes */
155 
156  /* followed by payload with @e payload_size bytes */
157 };
158 
159 
164 {
169 
173  uint16_t local_addr_size;
174 
179 
180  /* followed by a `struct sockaddr` of @e local_addr_size bytes */
181 
182  /* followed by a `struct sockaddr` of @e remote_addr_size bytes */
183 
184 };
185 
186 
191 {
196 
197  /* followed by a `struct sockaddr_in` */
198 
199 };
200 
201 
207 {
211  struct GNUNET_MessageHeader header;
212 
216  int32_t add_remove GNUNET_PACKED;
217 
221  uint32_t addr_class GNUNET_PACKED;
222  /* followed by a `struct sockaddr` */
223 
224 };
225 
226 
228 
229 #endif
Client telling the service to (possibly) handle a STUN message.
Definition: nat.h:137
struct GNUNET_MessageHeader header
Header with type GNUNET_MESSAGE_TYPE_NAT_TEST.
Definition: nat.h:44
Service notifying the client about changes in the set of addresses it has.
Definition: nat.h:206
uint32_t dst_ipv4
IPv4 target IP address.
Definition: nat.h:49
uint16_t remote_addr_size
Size of the remote address included, in NBO.
Definition: nat.h:178
Message sent by a client to register with its addresses.
Definition: nat.h:96
int32_t is_tcp
GNUNET_YES for TCP, GNUNET_NO for UDP.
Definition: nat.h:64
Client asking the service to initiate connection reversal.
Definition: nat.h:163
uint8_t proto
Client&#39;s IPPROTO, e.g.
Definition: nat.h:111
uint16_t payload_size
Number of bytes of payload included, in NBO.
Definition: nat.h:152
uint16_t local_addr_size
Size of the local address included, in NBO.
Definition: nat.h:173
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32.
uint16_t dport
Port to use, 0 to send dummy ICMP response.
Definition: nat.h:54
uint16_t sender_addr_size
Size of the sender address included, in NBO.
Definition: nat.h:147
uint8_t flags
An enum GNUNET_NAT_RegisterFlags.
Definition: nat.h:106
Service telling a client that connection reversal was requested.
Definition: nat.h:190
Request to test NAT traversal, sent to the gnunet-nat-server (not the service!).
Definition: nat.h:39
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32;.
#define GNUNET_PACKED
gcc-ism to get packed structs.
This client supports address reversal.
Definition: nat.h:89
Header for all communications.
This client wants to be informed about changes to our applicable addresses.
Definition: nat.h:84
uint16_t data
Data to send OR advertised-port (in NBO) to use for dummy ICMP.
Definition: nat.h:59
This client does not want any notifications.
Definition: nat.h:78
GNUNET_NAT_RegisterFlags
Flags specifying the events this client would be interested in being told about.
Definition: nat.h:73