aboutsummaryrefslogtreecommitdiff
path: root/src/exit/exit.h
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2023-10-19 11:59:19 +0200
committerMartin Schanzenbach <schanzen@gnunet.org>2023-10-19 11:59:19 +0200
commit858647ab4b2465430800689bda2c2837601c48d1 (patch)
tree048818f625a501cd3c4fc22c814f4e1717353a22 /src/exit/exit.h
parent579d9473bb75072303789599b23be9b0203336fc (diff)
downloadgnunet-858647ab4b2465430800689bda2c2837601c48d1.tar.gz
gnunet-858647ab4b2465430800689bda2c2837601c48d1.zip
BUILD: Move exit/pt to service
Diffstat (limited to 'src/exit/exit.h')
-rw-r--r--src/exit/exit.h298
1 files changed, 0 insertions, 298 deletions
diff --git a/src/exit/exit.h b/src/exit/exit.h
deleted file mode 100644
index 41dad6246..000000000
--- a/src/exit/exit.h
+++ /dev/null
@@ -1,298 +0,0 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2012 Christian Grothoff
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
21/**
22 * @file exit/exit.h
23 * @brief format for cadet messages exchanged between VPN service and exit daemon
24 * @author Christian Grothoff
25 */
26#ifndef EXIT_H
27#define EXIT_H
28
29#include "gnunet_util_lib.h"
30
31GNUNET_NETWORK_STRUCT_BEGIN
32
33/**
34 * Message send via cadet to an exit daemon to initiate forwarding of
35 * TCP data to a local service.
36 */
37struct GNUNET_EXIT_TcpServiceStartMessage
38{
39 /**
40 * Type is #GNUNET_MESSAGE_TYPE_VPN_TCP_TO_SERVICE_START
41 */
42 struct GNUNET_MessageHeader header;
43
44 /**
45 * Always 0.
46 */
47 uint32_t reserved GNUNET_PACKED;
48
49 /**
50 * Skeleton of the TCP header to send. Port numbers are to
51 * be replaced and the checksum may be updated as necessary.
52 */
53 struct GNUNET_TUN_TcpHeader tcp_header;
54
55 /* followed by TCP payload */
56};
57
58
59/**
60 * Message send via cadet to an exit daemon to initiate forwarding of
61 * TCP data to the Internet.
62 */
63struct GNUNET_EXIT_TcpInternetStartMessage
64{
65 /**
66 * Type is #GNUNET_MESSAGE_TYPE_VPN_TCP_TO_INTERNET_START
67 */
68 struct GNUNET_MessageHeader header;
69
70 /**
71 * Address family, AF_INET or AF_INET6, in network byte order.
72 */
73 int32_t af GNUNET_PACKED;
74
75 /**
76 * Skeleton of the TCP header to send. Port numbers are to
77 * be replaced and the checksum may be updated as necessary.
78 */
79 struct GNUNET_TUN_TcpHeader tcp_header;
80
81 /* followed by IP address of the destination; either
82 'struct in_addr' or 'struct in6_addr', depending on af */
83
84 /* followed by TCP payload */
85};
86
87
88/**
89 * Message send via cadet between VPN and entry and an exit daemon to
90 * transmit TCP data between the VPN entry and an exit session. This
91 * format is used for both Internet-exits and service-exits and
92 * in both directions (VPN to exit and exit to VPN).
93 */
94struct GNUNET_EXIT_TcpDataMessage
95{
96 /**
97 * Type is #GNUNET_MESSAGE_TYPE_VPN_TCP_DATA
98 */
99 struct GNUNET_MessageHeader header;
100
101 /**
102 * Always 0.
103 */
104 uint32_t reserved GNUNET_PACKED;
105
106 /**
107 * Skeleton of the TCP header to send. Port numbers are to
108 * 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.)
109 */
110 struct GNUNET_TUN_TcpHeader tcp_header;
111
112 /* followed by TCP payload */
113};
114
115
116/**
117 * Message send via cadet to an exit daemon to send
118 * UDP data to a local service.
119 */
120struct GNUNET_EXIT_UdpServiceMessage
121{
122 /**
123 * Type is #GNUNET_MESSAGE_TYPE_VPN_UDP_TO_SERVICE
124 */
125 struct GNUNET_MessageHeader header;
126
127 /**
128 * Source port to use for the UDP request (0 to use a random port). In NBO.
129 */
130 uint16_t source_port GNUNET_PACKED;
131
132 /**
133 * Destination port to use for the UDP request. In NBO.
134 */
135 uint16_t destination_port GNUNET_PACKED;
136
137 /* followed by UDP payload */
138};
139
140
141/**
142 * Message send via cadet to an exit daemon to forward
143 * UDP data to the Internet.
144 */
145struct GNUNET_EXIT_UdpInternetMessage
146{
147 /**
148 * Type is #GNUNET_MESSAGE_TYPE_VPN_UDP_TO_INTERNET
149 */
150 struct GNUNET_MessageHeader header;
151
152 /**
153 * Address family, AF_INET or AF_INET6, in network byte order.
154 */
155 int32_t af GNUNET_PACKED;
156
157 /**
158 * Source port to use for the UDP request (0 to use a random port). In NBO.
159 */
160 uint16_t source_port GNUNET_PACKED;
161
162 /**
163 * Destination port to use for the UDP request. In NBO.
164 */
165 uint16_t destination_port GNUNET_PACKED;
166
167 /* followed by IP address of the destination; either
168 'struct in_addr' or 'struct in6_addr', depending on af */
169
170 /* followed by UDP payload */
171};
172
173
174/**
175 * Message send from exit daemon back to the UDP entry point
176 * (used for both Internet and Service exit replies).
177 */
178struct GNUNET_EXIT_UdpReplyMessage
179{
180 /**
181 * Type is #GNUNET_MESSAGE_TYPE_VPN_UDP_REPLY
182 */
183 struct GNUNET_MessageHeader header;
184
185 /**
186 * Source port to use for the UDP reply (0 to use the same
187 * port as for the original request). In NBO.
188 */
189 uint16_t source_port GNUNET_PACKED;
190
191 /**
192 * Destination port to use for the UDP reply (0 to use the same
193 * port as for the original request). In NBO.
194 */
195 uint16_t destination_port GNUNET_PACKED;
196
197 /* followed by UDP payload */
198};
199
200
201/**
202 * Message send via cadet to an exit daemon to send
203 * ICMP data to a local service.
204 */
205struct GNUNET_EXIT_IcmpServiceMessage
206{
207 /**
208 * Type is #GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_SERVICE
209 */
210 struct GNUNET_MessageHeader header;
211
212 /**
213 * Address family, AF_INET or AF_INET6, in network byte order. This
214 * AF value determines if the 'icmp_header' is ICMPv4 or ICMPv6.
215 * The receiver (exit) may still have to translate (PT) to the services'
216 * ICMP version (if possible).
217 */
218 int32_t af GNUNET_PACKED;
219
220 /**
221 * ICMP header to use.
222 */
223 struct GNUNET_TUN_IcmpHeader icmp_header;
224
225 /* followed by ICMP payload; however, for certain ICMP message
226 types where the payload is the original IP packet, the payload
227 is omitted as it is useless for the receiver (who will need
228 to create some fake payload manually) */
229};
230
231
232/**
233 * Message send via cadet to an exit daemon to forward
234 * ICMP data to the Internet.
235 */
236struct GNUNET_EXIT_IcmpInternetMessage
237{
238 /**
239 * Type is #GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_INTERNET
240 */
241 struct GNUNET_MessageHeader header;
242
243 /**
244 * Address family, AF_INET or AF_INET6, in network byte order.
245 * Determines both the ICMP version used in the 'icmp_header' and
246 * the IP address format that is used for the target IP. If
247 * PT is necessary, the sender has already done it.
248 */
249 int32_t af GNUNET_PACKED;
250
251 /**
252 * ICMP header to use. Must match the target 'af' given
253 * above.
254 */
255 struct GNUNET_TUN_IcmpHeader icmp_header;
256
257 /* followed by IP address of the destination; either
258 'struct in_addr' or 'struct in6_addr', depending on af */
259
260 /* followed by ICMP payload; however, for certain ICMP message
261 types where the payload is the original IP packet, the payload
262 is omitted as it is useless for the receiver (who will need
263 to create some fake payload manually) */
264};
265
266
267/**
268 * Message send via cadet to the vpn service to send
269 * ICMP data to the VPN's TUN interface.
270 */
271struct GNUNET_EXIT_IcmpToVPNMessage
272{
273 /**
274 * Type is #GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_VPN
275 */
276 struct GNUNET_MessageHeader header;
277
278 /**
279 * Address family, AF_INET or AF_INET6, in network byte order.
280 * Useful to determine if this is an ICMPv4 or ICMPv6 header.
281 */
282 int32_t af GNUNET_PACKED;
283
284 /**
285 * ICMP header to use. ICMPv4 or ICMPv6, depending on 'af'.
286 */
287 struct GNUNET_TUN_IcmpHeader icmp_header;
288
289 /* followed by ICMP payload; however, for certain ICMP message
290 types where the payload is the original IP packet, the payload
291 is omitted as it is useless for the receiver (who will need
292 to create some fake payload manually) */
293};
294
295
296GNUNET_NETWORK_STRUCT_END
297
298#endif