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"
32 * Message send via mesh to an exit daemon to initiate forwarding of
33 * TCP data to a local service.
35 struct GNUNET_EXIT_TcpServiceStartMessage
38 * Type is GNUNET_MESSAGE_TYPE_VPN_TCP_TO_SERVICE_START
40 struct GNUNET_MessageHeader header;
48 * Identification for the desired service.
50 GNUNET_HashCode service_descriptor;
53 * Skeleton of the TCP header to send. Port numbers are to
54 * be replaced and the checksum may be updated as necessary.
56 struct GNUNET_TUN_TcpHeader tcp_header;
58 /* followed by TCP payload */
63 * Message send via mesh to an exit daemon to initiate forwarding of
64 * TCP data to the Internet.
66 struct GNUNET_EXIT_TcpInternetStartMessage
69 * Type is GNUNET_MESSAGE_TYPE_VPN_TCP_TO_INTERNET_START
71 struct GNUNET_MessageHeader header;
74 * Address family, AF_INET or AF_INET6, in network byte order.
79 * Skeleton of the TCP header to send. Port numbers are to
80 * be replaced and the checksum may be updated as necessary.
82 struct GNUNET_TUN_TcpHeader tcp_header;
84 /* followed by IP address of the destination; either
85 'struct in_addr' or 'struct in6_addr', depending on af */
87 /* followed by TCP payload */
92 * Message send via mesh between VPN and entry and an exit daemon to
93 * transmit TCP data between the VPN entry and an exit session. This
94 * format is used for both Internet-exits and service-exits and
95 * in both directions (VPN to exit and exit to VPN).
97 struct GNUNET_EXIT_TcpDataMessage
100 * Type is GNUNET_MESSAGE_TYPE_VPN_TCP_DATA
102 struct GNUNET_MessageHeader header;
110 * Skeleton of the TCP header to send. Port numbers are to
111 * 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.)
113 struct GNUNET_TUN_TcpHeader tcp_header;
115 /* followed by TCP payload */
120 * Message send via mesh to an exit daemon to send
121 * UDP data to a local service.
123 struct GNUNET_EXIT_UdpServiceMessage
126 * Type is GNUNET_MESSAGE_TYPE_VPN_UDP_TO_SERVICE
128 struct GNUNET_MessageHeader header;
131 * Source port to use for the UDP request (0 to use a random port). In NBO.
133 uint16_t source_port;
136 * Destination port to use for the UDP request. In NBO.
138 uint16_t destination_port;
141 * Identification for the desired service.
143 GNUNET_HashCode service_descriptor;
145 /* followed by UDP payload */
150 * Message send via mesh to an exit daemon to forward
151 * UDP data to the Internet.
153 struct GNUNET_EXIT_UdpInternetMessage
156 * Type is GNUNET_MESSAGE_TYPE_VPN_UDP_TO_INTERNET
158 struct GNUNET_MessageHeader header;
161 * Address family, AF_INET or AF_INET6, in network byte order.
166 * Source port to use for the UDP request (0 to use a random port). In NBO.
168 uint16_t source_port;
171 * Destination port to use for the UDP request. In NBO.
173 uint16_t destination_port;
175 /* followed by IP address of the destination; either
176 'struct in_addr' or 'struct in6_addr', depending on af */
178 /* followed by UDP payload */
183 * Message send from exit daemon back to the UDP entry point
184 * (used for both Internet and Service exit replies).
186 struct GNUNET_EXIT_UdpReplyMessage
189 * Type is GNUNET_MESSAGE_TYPE_VPN_UDP_REPLY
191 struct GNUNET_MessageHeader header;
194 * Source port to use for the UDP reply (0 to use the same
195 * port as for the original request). In NBO.
197 uint16_t source_port;
200 * Destination port to use for the UDP reply (0 to use the same
201 * port as for the original request). In NBO.
203 uint16_t destination_port;
205 /* followed by UDP payload */
210 * Message send via mesh to an exit daemon to send
211 * ICMP data to a local service.
213 struct GNUNET_EXIT_IcmpServiceMessage
216 * Type is GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_SERVICE
218 struct GNUNET_MessageHeader header;
221 * Address family, AF_INET or AF_INET6, in network byte order. This
222 * AF value determines if the 'icmp_header' is ICMPv4 or ICMPv6.
223 * The receiver (exit) may still have to translate (PT) to the services'
224 * ICMP version (if possible).
229 * Identification for the desired service.
231 GNUNET_HashCode service_descriptor;
234 * ICMP header to use.
236 struct GNUNET_TUN_IcmpHeader icmp_header;
238 /* followed by ICMP payload; however, for certain ICMP message
239 types where the payload is the original IP packet, the payload
240 is omitted as it is useless for the receiver (who will need
241 to create some fake payload manually) */
246 * Message send via mesh to an exit daemon to forward
247 * ICMP data to the Internet.
249 struct GNUNET_EXIT_IcmpInternetMessage
252 * Type is GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_INTERNET
254 struct GNUNET_MessageHeader header;
257 * Address family, AF_INET or AF_INET6, in network byte order.
258 * Determines both the ICMP version used in the 'icmp_header' and
259 * the IP address format that is used for the target IP. If
260 * PT is necessary, the sender has already done it.
265 * ICMP header to use. Must match the target 'af' given
268 struct GNUNET_TUN_IcmpHeader icmp_header;
270 /* followed by IP address of the destination; either
271 'struct in_addr' or 'struct in6_addr', depending on af */
273 /* followed by ICMP payload; however, for certain ICMP message
274 types where the payload is the original IP packet, the payload
275 is omitted as it is useless for the receiver (who will need
276 to create some fake payload manually) */
281 * Message send via mesh to the vpn service to send
282 * ICMP data to the VPN's TUN interface.
284 struct GNUNET_EXIT_IcmpToVPNMessage
287 * Type is GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_VPN
289 struct GNUNET_MessageHeader header;
292 * Address family, AF_INET or AF_INET6, in network byte order.
293 * Useful to determine if this is an ICMPv4 or ICMPv6 header.
298 * ICMP header to use. ICMPv4 or ICMPv6, depending on 'af'.
300 struct GNUNET_TUN_IcmpHeader icmp_header;
302 /* followed by ICMP payload; however, for certain ICMP message
303 types where the payload is the original IP packet, the payload
304 is omitted as it is useless for the receiver (who will need
305 to create some fake payload manually) */