2 This file is part of GNUnet.
3 (C) 2012 Christian Grothoff
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.
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.
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.
23 * @brief format for mesh messages exchanged between VPN service and exit daemon
24 * @author Christian Grothoff
29 #include "gnunet_util_lib.h"
31 GNUNET_NETWORK_STRUCT_BEGIN
34 * Message send via mesh to an exit daemon to initiate forwarding of
35 * TCP data to a local service.
37 struct GNUNET_EXIT_TcpServiceStartMessage
40 * Type is GNUNET_MESSAGE_TYPE_VPN_TCP_TO_SERVICE_START
42 struct GNUNET_MessageHeader header;
47 uint32_t reserved GNUNET_PACKED;
50 * Identification for the desired service.
52 struct GNUNET_HashCode service_descriptor;
55 * Skeleton of the TCP header to send. Port numbers are to
56 * be replaced and the checksum may be updated as necessary.
58 struct GNUNET_TUN_TcpHeader tcp_header;
60 /* followed by TCP payload */
65 * Message send via mesh to an exit daemon to initiate forwarding of
66 * TCP data to the Internet.
68 struct GNUNET_EXIT_TcpInternetStartMessage
71 * Type is GNUNET_MESSAGE_TYPE_VPN_TCP_TO_INTERNET_START
73 struct GNUNET_MessageHeader header;
76 * Address family, AF_INET or AF_INET6, in network byte order.
78 int32_t af GNUNET_PACKED;
81 * Skeleton of the TCP header to send. Port numbers are to
82 * be replaced and the checksum may be updated as necessary.
84 struct GNUNET_TUN_TcpHeader tcp_header;
86 /* followed by IP address of the destination; either
87 'struct in_addr' or 'struct in6_addr', depending on af */
89 /* followed by TCP payload */
94 * Message send via mesh between VPN and entry and an exit daemon to
95 * transmit TCP data between the VPN entry and an exit session. This
96 * format is used for both Internet-exits and service-exits and
97 * in both directions (VPN to exit and exit to VPN).
99 struct GNUNET_EXIT_TcpDataMessage
102 * Type is GNUNET_MESSAGE_TYPE_VPN_TCP_DATA
104 struct GNUNET_MessageHeader header;
109 uint32_t reserved GNUNET_PACKED;
112 * Skeleton of the TCP header to send. Port numbers are to
113 * be replaced and the checksum may be updated as necessary. (The destination port number should not be changed, as it contains the desired destination port.)
115 struct GNUNET_TUN_TcpHeader tcp_header;
117 /* followed by TCP payload */
122 * Message send via mesh to an exit daemon to send
123 * UDP data to a local service.
125 struct GNUNET_EXIT_UdpServiceMessage
128 * Type is GNUNET_MESSAGE_TYPE_VPN_UDP_TO_SERVICE
130 struct GNUNET_MessageHeader header;
133 * Source port to use for the UDP request (0 to use a random port). In NBO.
135 uint16_t source_port GNUNET_PACKED;
138 * Destination port to use for the UDP request. In NBO.
140 uint16_t destination_port GNUNET_PACKED;
143 * Identification for the desired service.
145 struct GNUNET_HashCode service_descriptor;
147 /* followed by UDP payload */
152 * Message send via mesh to an exit daemon to forward
153 * UDP data to the Internet.
155 struct GNUNET_EXIT_UdpInternetMessage
158 * Type is GNUNET_MESSAGE_TYPE_VPN_UDP_TO_INTERNET
160 struct GNUNET_MessageHeader header;
163 * Address family, AF_INET or AF_INET6, in network byte order.
165 int32_t af GNUNET_PACKED;
168 * Source port to use for the UDP request (0 to use a random port). In NBO.
170 uint16_t source_port GNUNET_PACKED;
173 * Destination port to use for the UDP request. In NBO.
175 uint16_t destination_port GNUNET_PACKED;
177 /* followed by IP address of the destination; either
178 'struct in_addr' or 'struct in6_addr', depending on af */
180 /* followed by UDP payload */
185 * Message send from exit daemon back to the UDP entry point
186 * (used for both Internet and Service exit replies).
188 struct GNUNET_EXIT_UdpReplyMessage
191 * Type is GNUNET_MESSAGE_TYPE_VPN_UDP_REPLY
193 struct GNUNET_MessageHeader header;
196 * Source port to use for the UDP reply (0 to use the same
197 * port as for the original request). In NBO.
199 uint16_t source_port GNUNET_PACKED;
202 * Destination port to use for the UDP reply (0 to use the same
203 * port as for the original request). In NBO.
205 uint16_t destination_port GNUNET_PACKED;
207 /* followed by UDP payload */
212 * Message send via mesh to an exit daemon to send
213 * ICMP data to a local service.
215 struct GNUNET_EXIT_IcmpServiceMessage
218 * Type is GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_SERVICE
220 struct GNUNET_MessageHeader header;
223 * Address family, AF_INET or AF_INET6, in network byte order. This
224 * AF value determines if the 'icmp_header' is ICMPv4 or ICMPv6.
225 * The receiver (exit) may still have to translate (PT) to the services'
226 * ICMP version (if possible).
228 int32_t af GNUNET_PACKED;
231 * Identification for the desired service.
233 struct GNUNET_HashCode service_descriptor;
236 * ICMP header to use.
238 struct GNUNET_TUN_IcmpHeader icmp_header;
240 /* followed by ICMP payload; however, for certain ICMP message
241 types where the payload is the original IP packet, the payload
242 is omitted as it is useless for the receiver (who will need
243 to create some fake payload manually) */
248 * Message send via mesh to an exit daemon to forward
249 * ICMP data to the Internet.
251 struct GNUNET_EXIT_IcmpInternetMessage
254 * Type is GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_INTERNET
256 struct GNUNET_MessageHeader header;
259 * Address family, AF_INET or AF_INET6, in network byte order.
260 * Determines both the ICMP version used in the 'icmp_header' and
261 * the IP address format that is used for the target IP. If
262 * PT is necessary, the sender has already done it.
264 int32_t af GNUNET_PACKED;
267 * ICMP header to use. Must match the target 'af' given
270 struct GNUNET_TUN_IcmpHeader icmp_header;
272 /* followed by IP address of the destination; either
273 'struct in_addr' or 'struct in6_addr', depending on af */
275 /* followed by ICMP payload; however, for certain ICMP message
276 types where the payload is the original IP packet, the payload
277 is omitted as it is useless for the receiver (who will need
278 to create some fake payload manually) */
283 * Message send via mesh to the vpn service to send
284 * ICMP data to the VPN's TUN interface.
286 struct GNUNET_EXIT_IcmpToVPNMessage
289 * Type is GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_VPN
291 struct GNUNET_MessageHeader header;
294 * Address family, AF_INET or AF_INET6, in network byte order.
295 * Useful to determine if this is an ICMPv4 or ICMPv6 header.
297 int32_t af GNUNET_PACKED;
300 * ICMP header to use. ICMPv4 or ICMPv6, depending on 'af'.
302 struct GNUNET_TUN_IcmpHeader icmp_header;
304 /* followed by ICMP payload; however, for certain ICMP message
305 types where the payload is the original IP packet, the payload
306 is omitted as it is useless for the receiver (who will need
307 to create some fake payload manually) */
311 GNUNET_NETWORK_STRUCT_END