aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/exit/exit.h36
-rw-r--r--src/vpn/vpn.h26
2 files changed, 35 insertions, 27 deletions
diff --git a/src/exit/exit.h b/src/exit/exit.h
index f7366df20..dcc50f1b3 100644
--- a/src/exit/exit.h
+++ b/src/exit/exit.h
@@ -28,6 +28,8 @@
28 28
29#include "gnunet_util_lib.h" 29#include "gnunet_util_lib.h"
30 30
31GNUNET_NETWORK_STRUCT_BEGIN
32
31/** 33/**
32 * Message send via mesh to an exit daemon to initiate forwarding of 34 * Message send via mesh to an exit daemon to initiate forwarding of
33 * TCP data to a local service. 35 * TCP data to a local service.
@@ -42,12 +44,12 @@ struct GNUNET_EXIT_TcpServiceStartMessage
42 /** 44 /**
43 * Always 0. 45 * Always 0.
44 */ 46 */
45 uint32_t reserved; 47 uint32_t reserved GNUNET_PACKED;
46 48
47 /** 49 /**
48 * Identification for the desired service. 50 * Identification for the desired service.
49 */ 51 */
50 GNUNET_HashCode service_descriptor; 52 GNUNET_HashCode service_descriptor GNUNET_PACKED;
51 53
52 /** 54 /**
53 * Skeleton of the TCP header to send. Port numbers are to 55 * Skeleton of the TCP header to send. Port numbers are to
@@ -73,7 +75,7 @@ struct GNUNET_EXIT_TcpInternetStartMessage
73 /** 75 /**
74 * Address family, AF_INET or AF_INET6, in network byte order. 76 * Address family, AF_INET or AF_INET6, in network byte order.
75 */ 77 */
76 int32_t af; 78 int32_t af GNUNET_PACKED;
77 79
78 /** 80 /**
79 * Skeleton of the TCP header to send. Port numbers are to 81 * Skeleton of the TCP header to send. Port numbers are to
@@ -104,7 +106,7 @@ struct GNUNET_EXIT_TcpDataMessage
104 /** 106 /**
105 * Always 0. 107 * Always 0.
106 */ 108 */
107 uint32_t reserved; 109 uint32_t reserved GNUNET_PACKED;
108 110
109 /** 111 /**
110 * Skeleton of the TCP header to send. Port numbers are to 112 * Skeleton of the TCP header to send. Port numbers are to
@@ -130,17 +132,17 @@ struct GNUNET_EXIT_UdpServiceMessage
130 /** 132 /**
131 * Source port to use for the UDP request (0 to use a random port). In NBO. 133 * Source port to use for the UDP request (0 to use a random port). In NBO.
132 */ 134 */
133 uint16_t source_port; 135 uint16_t source_port GNUNET_PACKED;
134 136
135 /** 137 /**
136 * Destination port to use for the UDP request. In NBO. 138 * Destination port to use for the UDP request. In NBO.
137 */ 139 */
138 uint16_t destination_port; 140 uint16_t destination_port GNUNET_PACKED;
139 141
140 /** 142 /**
141 * Identification for the desired service. 143 * Identification for the desired service.
142 */ 144 */
143 GNUNET_HashCode service_descriptor; 145 GNUNET_HashCode service_descriptor GNUNET_PACKED;
144 146
145 /* followed by UDP payload */ 147 /* followed by UDP payload */
146}; 148};
@@ -160,17 +162,17 @@ struct GNUNET_EXIT_UdpInternetMessage
160 /** 162 /**
161 * Address family, AF_INET or AF_INET6, in network byte order. 163 * Address family, AF_INET or AF_INET6, in network byte order.
162 */ 164 */
163 int32_t af; 165 int32_t af GNUNET_PACKED;
164 166
165 /** 167 /**
166 * Source port to use for the UDP request (0 to use a random port). In NBO. 168 * Source port to use for the UDP request (0 to use a random port). In NBO.
167 */ 169 */
168 uint16_t source_port; 170 uint16_t source_port GNUNET_PACKED;
169 171
170 /** 172 /**
171 * Destination port to use for the UDP request. In NBO. 173 * Destination port to use for the UDP request. In NBO.
172 */ 174 */
173 uint16_t destination_port; 175 uint16_t destination_port GNUNET_PACKED;
174 176
175 /* followed by IP address of the destination; either 177 /* followed by IP address of the destination; either
176 'struct in_addr' or 'struct in6_addr', depending on af */ 178 'struct in_addr' or 'struct in6_addr', depending on af */
@@ -194,13 +196,13 @@ struct GNUNET_EXIT_UdpReplyMessage
194 * Source port to use for the UDP reply (0 to use the same 196 * Source port to use for the UDP reply (0 to use the same
195 * port as for the original request). In NBO. 197 * port as for the original request). In NBO.
196 */ 198 */
197 uint16_t source_port; 199 uint16_t source_port GNUNET_PACKED;
198 200
199 /** 201 /**
200 * Destination port to use for the UDP reply (0 to use the same 202 * Destination port to use for the UDP reply (0 to use the same
201 * port as for the original request). In NBO. 203 * port as for the original request). In NBO.
202 */ 204 */
203 uint16_t destination_port; 205 uint16_t destination_port GNUNET_PACKED;
204 206
205 /* followed by UDP payload */ 207 /* followed by UDP payload */
206}; 208};
@@ -223,12 +225,12 @@ struct GNUNET_EXIT_IcmpServiceMessage
223 * The receiver (exit) may still have to translate (PT) to the services' 225 * The receiver (exit) may still have to translate (PT) to the services'
224 * ICMP version (if possible). 226 * ICMP version (if possible).
225 */ 227 */
226 int32_t af; 228 int32_t af GNUNET_PACKED;
227 229
228 /** 230 /**
229 * Identification for the desired service. 231 * Identification for the desired service.
230 */ 232 */
231 GNUNET_HashCode service_descriptor; 233 GNUNET_HashCode service_descriptor GNUNET_PACKED;
232 234
233 /** 235 /**
234 * ICMP header to use. 236 * ICMP header to use.
@@ -259,7 +261,7 @@ struct GNUNET_EXIT_IcmpInternetMessage
259 * the IP address format that is used for the target IP. If 261 * the IP address format that is used for the target IP. If
260 * PT is necessary, the sender has already done it. 262 * PT is necessary, the sender has already done it.
261 */ 263 */
262 int32_t af; 264 int32_t af GNUNET_PACKED;
263 265
264 /** 266 /**
265 * ICMP header to use. Must match the target 'af' given 267 * ICMP header to use. Must match the target 'af' given
@@ -292,7 +294,7 @@ struct GNUNET_EXIT_IcmpToVPNMessage
292 * Address family, AF_INET or AF_INET6, in network byte order. 294 * Address family, AF_INET or AF_INET6, in network byte order.
293 * Useful to determine if this is an ICMPv4 or ICMPv6 header. 295 * Useful to determine if this is an ICMPv4 or ICMPv6 header.
294 */ 296 */
295 int32_t af; 297 int32_t af GNUNET_PACKED;
296 298
297 /** 299 /**
298 * ICMP header to use. ICMPv4 or ICMPv6, depending on 'af'. 300 * ICMP header to use. ICMPv4 or ICMPv6, depending on 'af'.
@@ -306,4 +308,6 @@ struct GNUNET_EXIT_IcmpToVPNMessage
306}; 308};
307 309
308 310
311GNUNET_NETWORK_STRUCT_END
312
309#endif 313#endif
diff --git a/src/vpn/vpn.h b/src/vpn/vpn.h
index 4a80e1812..e937f5ef5 100644
--- a/src/vpn/vpn.h
+++ b/src/vpn/vpn.h
@@ -28,6 +28,8 @@
28 28
29#include "gnunet_util_lib.h" 29#include "gnunet_util_lib.h"
30 30
31GNUNET_NETWORK_STRUCT_BEGIN
32
31/** 33/**
32 * Message send by the VPN client to the VPN service requesting 34 * Message send by the VPN client to the VPN service requesting
33 * the setup of a redirection from some IP via an exit node to 35 * the setup of a redirection from some IP via an exit node to
@@ -44,7 +46,7 @@ struct RedirectToIpRequestMessage
44 * GNUNET_YES to notify only after completion of the mesh-level connection, 46 * GNUNET_YES to notify only after completion of the mesh-level connection,
45 * GNUNET_NO to notify as soon as an address was allocated (in nbo). 47 * GNUNET_NO to notify as soon as an address was allocated (in nbo).
46 */ 48 */
47 int32_t nac; 49 int32_t nac GNUNET_PACKED;
48 50
49 /** 51 /**
50 * How long should the redirection be maintained at most? 52 * How long should the redirection be maintained at most?
@@ -54,18 +56,18 @@ struct RedirectToIpRequestMessage
54 /** 56 /**
55 * Address family desired for the result (AF_INET or AF_INET6 or AF_UNSPEC, in nbo) 57 * Address family desired for the result (AF_INET or AF_INET6 or AF_UNSPEC, in nbo)
56 */ 58 */
57 int32_t result_af; 59 int32_t result_af GNUNET_PACKED;
58 60
59 /** 61 /**
60 * Address family used for the destination address (AF_INET or AF_INET6, in nbo) 62 * Address family used for the destination address (AF_INET or AF_INET6, in nbo)
61 */ 63 */
62 int32_t addr_af; 64 int32_t addr_af GNUNET_PACKED;
63 65
64 /** 66 /**
65 * Unique ID to match a future response to this request. 67 * Unique ID to match a future response to this request.
66 * Picked by the client. 68 * Picked by the client.
67 */ 69 */
68 uint64_t request_id; 70 uint64_t request_id GNUNET_PACKED;
69 71
70 /* followed by destination address ('struct in_addr' or 'struct in6_addr') */ 72 /* followed by destination address ('struct in_addr' or 'struct in6_addr') */
71 73
@@ -88,7 +90,7 @@ struct RedirectToServiceRequestMessage
88 * GNUNET_YES to notify only after completion of the mesh-level connection, 90 * GNUNET_YES to notify only after completion of the mesh-level connection,
89 * GNUNET_NO to notify as soon as an address was allocated (in nbo). 91 * GNUNET_NO to notify as soon as an address was allocated (in nbo).
90 */ 92 */
91 int32_t nac; 93 int32_t nac GNUNET_PACKED;
92 94
93 /** 95 /**
94 * How long should the redirection be maintained at most? 96 * How long should the redirection be maintained at most?
@@ -98,12 +100,12 @@ struct RedirectToServiceRequestMessage
98 /** 100 /**
99 * Desired protocol (IPPROTO_UDP or IPPROTO_TCP) 101 * Desired protocol (IPPROTO_UDP or IPPROTO_TCP)
100 */ 102 */
101 int32_t protocol; 103 int32_t protocol GNUNET_PACKED;
102 104
103 /** 105 /**
104 * Address family desired for the result (AF_INET or AF_INET6 or AF_UNSPEC, in nbo) 106 * Address family desired for the result (AF_INET or AF_INET6 or AF_UNSPEC, in nbo)
105 */ 107 */
106 int32_t result_af; 108 int32_t result_af GNUNET_PACKED;
107 109
108 /** 110 /**
109 * Target peer offering the service. 111 * Target peer offering the service.
@@ -113,13 +115,13 @@ struct RedirectToServiceRequestMessage
113 /** 115 /**
114 * Service descriptor identifying the service. 116 * Service descriptor identifying the service.
115 */ 117 */
116 GNUNET_HashCode service_descriptor; 118 GNUNET_HashCode service_descriptor GNUNET_PACKED;
117 119
118 /** 120 /**
119 * Unique ID to match a future response to this request. 121 * Unique ID to match a future response to this request.
120 * Picked by the client. 122 * Picked by the client.
121 */ 123 */
122 uint64_t request_id; 124 uint64_t request_id GNUNET_PACKED;
123 125
124}; 126};
125 127
@@ -140,16 +142,18 @@ struct RedirectToIpResponseMessage
140 * Address family of the allocated address that follows; will match 142 * Address family of the allocated address that follows; will match
141 * "result_af" from the request, of be "AF_UNSPEC" on errors. 143 * "result_af" from the request, of be "AF_UNSPEC" on errors.
142 */ 144 */
143 int32_t result_af; 145 int32_t result_af GNUNET_PACKED;
144 146
145 /** 147 /**
146 * Unique ID to match the response to a request. 148 * Unique ID to match the response to a request.
147 */ 149 */
148 uint64_t request_id; 150 uint64_t request_id GNUNET_PACKED;
149 151
150 /* followed by destination address ('struct in_addr' or 'struct in6_addr') */ 152 /* followed by destination address ('struct in_addr' or 'struct in6_addr') */
151 153
152}; 154};
153 155
156GNUNET_NETWORK_STRUCT_END
157
154 158
155#endif 159#endif