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 tcp_packet 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 tcp_packet 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 tcp_packet 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 */