aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/arm/arm.h3
-rw-r--r--src/ats-test/test_transport_ats_multiple_peers.c3
-rw-r--r--src/ats/ats.h3
-rw-r--r--src/chat/chat.h3
-rw-r--r--src/core/core.h4
-rw-r--r--src/core/gnunet-service-core_kx.c4
-rw-r--r--src/datastore/datastore.h4
-rw-r--r--src/dht/dht.h4
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c4
-rw-r--r--src/dv/dv.h4
-rw-r--r--src/dv/test_transport_api_dv.c3
-rw-r--r--src/fragmentation/fragmentation.h4
-rw-r--r--src/fs/fs.h4
-rw-r--r--src/fs/gnunet-service-fs.h4
-rw-r--r--src/hello/hello.c4
-rw-r--r--src/hostlist/gnunet-daemon-hostlist.c4
-rw-r--r--src/include/block_dns.h2
-rw-r--r--src/include/block_fs.h4
-rw-r--r--src/include/gnunet_ats_service.h4
-rw-r--r--src/include/gnunet_bandwidth_lib.h4
-rw-r--r--src/include/gnunet_common.h34
-rw-r--r--src/include/gnunet_crypto_lib.h4
-rw-r--r--src/include/gnunet_time_lib.h3
-rw-r--r--src/mesh/mesh.h4
-rw-r--r--src/mesh/mesh_protocol.h3
-rw-r--r--src/nat/nat.h3
-rw-r--r--src/nse/gnunet-service-nse.c4
-rw-r--r--src/nse/nse.h4
-rw-r--r--src/peerinfo/peerinfo.h4
-rw-r--r--src/statistics/statistics.h4
-rw-r--r--src/testing/test_testing_large_topology.c3
-rw-r--r--src/testing/test_testing_topology.c3
-rw-r--r--src/testing/test_testing_topology_blacklist.c4
-rw-r--r--src/testing/test_testing_topology_churn.c3
-rw-r--r--src/transport/gnunet-helper-transport-wlan.c3
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c4
-rw-r--r--src/transport/gnunet-service-transport_validation.c4
-rw-r--r--src/transport/gnunet-transport-wlan-sender.c3
-rw-r--r--src/transport/plugin_transport_http.h4
-rw-r--r--src/transport/plugin_transport_smtp.c3
-rw-r--r--src/transport/plugin_transport_tcp.c8
-rw-r--r--src/transport/plugin_transport_udp.c5
-rw-r--r--src/transport/plugin_transport_udp_new.c4
-rw-r--r--src/transport/plugin_transport_unix.c3
-rw-r--r--src/transport/plugin_transport_wlan.c7
-rw-r--r--src/transport/plugin_transport_wlan.h4
-rw-r--r--src/transport/test_quota_compliance.c3
-rw-r--r--src/transport/test_transport_api_reliability.c3
-rw-r--r--src/transport/test_transport_api_unreliability.c3
-rw-r--r--src/transport/test_transport_api_unreliability_constant.c3
-rw-r--r--src/transport/transport.h4
-rw-r--r--src/util/crypto_ksk.c3
-rw-r--r--src/util/crypto_rsa.c4
-rw-r--r--src/util/resolver.h3
-rw-r--r--src/vpn/gnunet-service-dns-p.h3
-rw-r--r--src/vpn/gnunet-service-dns.c3
-rw-r--r--src/vpn/gnunet-vpn-packet.h6
57 files changed, 202 insertions, 41 deletions
diff --git a/src/arm/arm.h b/src/arm/arm.h
index 615079b7c..4b9da6fab 100644
--- a/src/arm/arm.h
+++ b/src/arm/arm.h
@@ -33,6 +33,7 @@
33 */ 33 */
34#define DEBUG_ARM GNUNET_EXTRA_LOGGING 34#define DEBUG_ARM GNUNET_EXTRA_LOGGING
35 35
36GNUNET_NETWORK_STRUCT_BEGIN
36 37
37/** 38/**
38 * Reply from ARM to client. 39 * Reply from ARM to client.
@@ -50,6 +51,6 @@ struct GNUNET_ARM_ResultMessage
50 */ 51 */
51 uint32_t status; 52 uint32_t status;
52}; 53};
53 54GNUNET_NETWORK_STRUCT_END
54 55
55#endif 56#endif
diff --git a/src/ats-test/test_transport_ats_multiple_peers.c b/src/ats-test/test_transport_ats_multiple_peers.c
index 51b813725..e9d0baf25 100644
--- a/src/ats-test/test_transport_ats_multiple_peers.c
+++ b/src/ats-test/test_transport_ats_multiple_peers.c
@@ -68,11 +68,14 @@ struct TEST_result
68 uint64_t state; 68 uint64_t state;
69}; 69};
70 70
71GNUNET_NETWORK_STRUCT_BEGIN
72
71struct TestMessage 73struct TestMessage
72{ 74{
73 struct GNUNET_MessageHeader header; 75 struct GNUNET_MessageHeader header;
74 uint32_t num; 76 uint32_t num;
75}; 77};
78GNUNET_NETWORK_STRUCT_END
76 79
77 80
78static int count; 81static int count;
diff --git a/src/ats/ats.h b/src/ats/ats.h
index 5b9fa8696..30ca29580 100644
--- a/src/ats/ats.h
+++ b/src/ats/ats.h
@@ -39,6 +39,7 @@ enum StartFlag
39 START_FLAG_PERFORMANCE_NO_PIC = 2 39 START_FLAG_PERFORMANCE_NO_PIC = 2
40}; 40};
41 41
42GNUNET_NETWORK_STRUCT_BEGIN
42 43
43struct ClientStartMessage 44struct ClientStartMessage
44{ 45{
@@ -214,7 +215,6 @@ struct ReservationResultMessage
214 struct GNUNET_TIME_RelativeNBO res_delay; 215 struct GNUNET_TIME_RelativeNBO res_delay;
215}; 216};
216 217
217
218struct PreferenceInformation 218struct PreferenceInformation
219{ 219{
220 220
@@ -236,6 +236,7 @@ struct ChangePreferenceMessage
236 /* followed by 'num_preferences' 236 /* followed by 'num_preferences'
237 * struct PreferenceInformation values */ 237 * struct PreferenceInformation values */
238}; 238};
239GNUNET_NETWORK_STRUCT_END
239 240
240 241
241 242
diff --git a/src/chat/chat.h b/src/chat/chat.h
index 9a52a2d75..5df7773a7 100644
--- a/src/chat/chat.h
+++ b/src/chat/chat.h
@@ -41,6 +41,8 @@
41 * Client-service messages 41 * Client-service messages
42 */ 42 */
43 43
44GNUNET_NETWORK_STRUCT_BEGIN
45
44/** 46/**
45 * Notification sent by service to client indicating that we've received a chat 47 * Notification sent by service to client indicating that we've received a chat
46 * message. After this struct, the remaining bytes are the actual text message. 48 * message. After this struct, the remaining bytes are the actual text message.
@@ -476,6 +478,7 @@ struct P2PConfirmationReceiptMessage
476 GNUNET_HashCode content; 478 GNUNET_HashCode content;
477 479
478}; 480};
481GNUNET_NETWORK_STRUCT_END
479 482
480#endif 483#endif
481 484
diff --git a/src/core/core.h b/src/core/core.h
index b76528a8e..4942ad054 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -50,6 +50,8 @@
50#define GNUNET_CORE_OPTION_SEND_HDR_OUTBOUND 64 50#define GNUNET_CORE_OPTION_SEND_HDR_OUTBOUND 64
51 51
52 52
53GNUNET_NETWORK_STRUCT_BEGIN
54
53/** 55/**
54 * Message transmitted core clients to gnunet-service-core 56 * Message transmitted core clients to gnunet-service-core
55 * to start the interaction. This header is followed by 57 * to start the interaction. This header is followed by
@@ -373,6 +375,6 @@ struct ConnectMessage
373 struct GNUNET_PeerIdentity peer; 375 struct GNUNET_PeerIdentity peer;
374 376
375}; 377};
376 378GNUNET_NETWORK_STRUCT_END
377#endif 379#endif
378/* end of core.h */ 380/* end of core.h */
diff --git a/src/core/gnunet-service-core_kx.c b/src/core/gnunet-service-core_kx.c
index 63dd6b7ee..38a5af9a4 100644
--- a/src/core/gnunet-service-core_kx.c
+++ b/src/core/gnunet-service-core_kx.c
@@ -62,6 +62,8 @@
62#define MAX_SET_KEY_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) 62#define MAX_SET_KEY_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
63 63
64 64
65GNUNET_NETWORK_STRUCT_BEGIN
66
65/** 67/**
66 * We're sending an (encrypted) PING to the other peer to check if he 68 * We're sending an (encrypted) PING to the other peer to check if he
67 * can decrypt. The other peer should respond with a PONG with the 69 * can decrypt. The other peer should respond with a PONG with the
@@ -213,7 +215,7 @@ struct EncryptedMessage
213 struct GNUNET_TIME_AbsoluteNBO timestamp; 215 struct GNUNET_TIME_AbsoluteNBO timestamp;
214 216
215}; 217};
216 218GNUNET_NETWORK_STRUCT_END
217/** 219/**
218 * Number of bytes (at the beginning) of "struct EncryptedMessage" 220 * Number of bytes (at the beginning) of "struct EncryptedMessage"
219 * that are NOT encrypted. 221 * that are NOT encrypted.
diff --git a/src/datastore/datastore.h b/src/datastore/datastore.h
index 563b7486c..1126027f8 100644
--- a/src/datastore/datastore.h
+++ b/src/datastore/datastore.h
@@ -31,6 +31,8 @@
31 31
32#include "gnunet_util_lib.h" 32#include "gnunet_util_lib.h"
33 33
34GNUNET_NETWORK_STRUCT_BEGIN
35
34/** 36/**
35 * Message from datastore service informing client about 37 * Message from datastore service informing client about
36 * the current size of the datastore. 38 * the current size of the datastore.
@@ -254,7 +256,7 @@ struct DataMessage
254 GNUNET_HashCode key GNUNET_PACKED; 256 GNUNET_HashCode key GNUNET_PACKED;
255 257
256}; 258};
257 259GNUNET_NETWORK_STRUCT_END
258 260
259 261
260 262
diff --git a/src/dht/dht.h b/src/dht/dht.h
index 2a6717788..c9fdd3479 100644
--- a/src/dht/dht.h
+++ b/src/dht/dht.h
@@ -34,6 +34,8 @@
34#define DHT_BLOOM_SIZE 128 34#define DHT_BLOOM_SIZE 128
35 35
36 36
37GNUNET_NETWORK_STRUCT_BEGIN
38
37/** 39/**
38 * Message which indicates the DHT should cancel outstanding 40 * Message which indicates the DHT should cancel outstanding
39 * requests and discard any state. 41 * requests and discard any state.
@@ -191,6 +193,6 @@ struct GNUNET_DHT_ClientPutMessage
191 /* DATA copied to end of this message */ 193 /* DATA copied to end of this message */
192 194
193}; 195};
194 196GNUNET_NETWORK_STRUCT_END
195 197
196#endif 198#endif
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index 9ebf16400..907de9950 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -90,6 +90,8 @@
90#define GET_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 2) 90#define GET_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 2)
91 91
92 92
93GNUNET_NETWORK_STRUCT_BEGIN
94
93/** 95/**
94 * P2P PUT message 96 * P2P PUT message
95 */ 97 */
@@ -246,7 +248,7 @@ struct PeerGetMessage
246 /* result bloomfilter */ 248 /* result bloomfilter */
247 249
248}; 250};
249 251GNUNET_NETWORK_STRUCT_END
250 252
251/** 253/**
252 * Linked list of messages to send to a particular other peer. 254 * Linked list of messages to send to a particular other peer.
diff --git a/src/dv/dv.h b/src/dv/dv.h
index 5690cf6cc..0d42505bc 100644
--- a/src/dv/dv.h
+++ b/src/dv/dv.h
@@ -44,6 +44,8 @@ typedef void (*GNUNET_DV_MessageReceivedHandler) (void *cls,
44 char *sender_address, 44 char *sender_address,
45 size_t sender_address_len); 45 size_t sender_address_len);
46 46
47GNUNET_NETWORK_STRUCT_BEGIN
48
47/** 49/**
48 * DV Message, contains a message that was received 50 * DV Message, contains a message that was received
49 * via DV for this peer! Internal. 51 * via DV for this peer! Internal.
@@ -255,7 +257,7 @@ typedef struct
255 uint32_t peer_id GNUNET_PACKED; 257 uint32_t peer_id GNUNET_PACKED;
256 258
257} p2p_dv_MESSAGE_Disconnect; 259} p2p_dv_MESSAGE_Disconnect;
258 260GNUNET_NETWORK_STRUCT_END
259 261
260struct GNUNET_DV_Handle * 262struct GNUNET_DV_Handle *
261GNUNET_DV_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, 263GNUNET_DV_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
diff --git a/src/dv/test_transport_api_dv.c b/src/dv/test_transport_api_dv.c
index 942ee07c0..2e4962964 100644
--- a/src/dv/test_transport_api_dv.c
+++ b/src/dv/test_transport_api_dv.c
@@ -108,6 +108,8 @@ struct GNUNET_CONTAINER_MultiHashMap *peer_daemon_hash;
108 108
109#define MTYPE 12345 109#define MTYPE 12345
110 110
111GNUNET_NETWORK_STRUCT_BEGIN
112
111struct GNUNET_TestMessage 113struct GNUNET_TestMessage
112{ 114{
113 /** 115 /**
@@ -120,6 +122,7 @@ struct GNUNET_TestMessage
120 */ 122 */
121 uint32_t uid; 123 uint32_t uid;
122}; 124};
125GNUNET_NETWORK_STRUCT_END
123 126
124struct PeerContext 127struct PeerContext
125{ 128{
diff --git a/src/fragmentation/fragmentation.h b/src/fragmentation/fragmentation.h
index 3469dd27e..2f3ea67bb 100644
--- a/src/fragmentation/fragmentation.h
+++ b/src/fragmentation/fragmentation.h
@@ -27,6 +27,8 @@
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_fragmentation_lib.h" 28#include "gnunet_fragmentation_lib.h"
29 29
30GNUNET_NETWORK_STRUCT_BEGIN
31
30/** 32/**
31 * Header for a message fragment. Followed by the 33 * Header for a message fragment. Followed by the
32 * original message. 34 * original message.
@@ -82,6 +84,6 @@ struct FragmentAcknowledgement
82 uint64_t bits; 84 uint64_t bits;
83 85
84}; 86};
85 87GNUNET_NETWORK_STRUCT_END
86 88
87#endif 89#endif
diff --git a/src/fs/fs.h b/src/fs/fs.h
index 90d32f4a7..cd39522bc 100644
--- a/src/fs/fs.h
+++ b/src/fs/fs.h
@@ -64,6 +64,8 @@ struct ContentHashKey
64}; 64};
65 65
66 66
67GNUNET_NETWORK_STRUCT_BEGIN
68
67/** 69/**
68 * Message sent from a GNUnet (fs) publishing activity to the 70 * Message sent from a GNUnet (fs) publishing activity to the
69 * gnunet-fs-service to initiate indexing of a file. The service is 71 * gnunet-fs-service to initiate indexing of a file. The service is
@@ -288,7 +290,7 @@ struct PutMessage
288 /* this is followed by the actual encrypted content */ 290 /* this is followed by the actual encrypted content */
289 291
290}; 292};
291 293GNUNET_NETWORK_STRUCT_END
292 294
293 295
294#endif 296#endif
diff --git a/src/fs/gnunet-service-fs.h b/src/fs/gnunet-service-fs.h
index 5a275c5ff..c669dcc7a 100644
--- a/src/fs/gnunet-service-fs.h
+++ b/src/fs/gnunet-service-fs.h
@@ -82,6 +82,8 @@
82#define GET_MESSAGE_BIT_TRANSMIT_TO 4 82#define GET_MESSAGE_BIT_TRANSMIT_TO 4
83 83
84 84
85GNUNET_NETWORK_STRUCT_BEGIN
86
85/** 87/**
86 * Message sent between peers asking for FS-content. 88 * Message sent between peers asking for FS-content.
87 */ 89 */
@@ -161,7 +163,7 @@ struct MigrationStopMessage
161 struct GNUNET_TIME_RelativeNBO duration; 163 struct GNUNET_TIME_RelativeNBO duration;
162 164
163}; 165};
164 166GNUNET_NETWORK_STRUCT_END
165 167
166/** 168/**
167 * A connected peer. 169 * A connected peer.
diff --git a/src/hello/hello.c b/src/hello/hello.c
index f7d34233c..7aa974008 100644
--- a/src/hello/hello.c
+++ b/src/hello/hello.c
@@ -28,6 +28,8 @@
28#include "gnunet_protocols.h" 28#include "gnunet_protocols.h"
29#include "gnunet_util_lib.h" 29#include "gnunet_util_lib.h"
30 30
31GNUNET_NETWORK_STRUCT_BEGIN
32
31/** 33/**
32 * A HELLO message is used to exchange information about 34 * A HELLO message is used to exchange information about
33 * transports with other peers. This struct is always 35 * transports with other peers. This struct is always
@@ -59,7 +61,7 @@ struct GNUNET_HELLO_Message
59 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded publicKey; 61 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded publicKey;
60 62
61}; 63};
62 64GNUNET_NETWORK_STRUCT_END
63 65
64/** 66/**
65 * Copy the given address information into 67 * Copy the given address information into
diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c
index b10f124d4..0eedb56b1 100644
--- a/src/hostlist/gnunet-daemon-hostlist.c
+++ b/src/hostlist/gnunet-daemon-hostlist.c
@@ -99,6 +99,8 @@ static GNUNET_CORE_ConnectEventHandler client_ch;
99 */ 99 */
100static GNUNET_CORE_DisconnectEventHandler client_dh; 100static GNUNET_CORE_DisconnectEventHandler client_dh;
101 101
102GNUNET_NETWORK_STRUCT_BEGIN
103
102/** 104/**
103 * A HOSTLIST_ADV message is used to exchange information about 105 * A HOSTLIST_ADV message is used to exchange information about
104 * hostlist advertisements. This struct is always 106 * hostlist advertisements. This struct is always
@@ -123,7 +125,7 @@ struct GNUNET_HOSTLIST_ADV_Message
123 */ 125 */
124 uint32_t reserved GNUNET_PACKED; 126 uint32_t reserved GNUNET_PACKED;
125}; 127};
126 128GNUNET_NETWORK_STRUCT_END
127 129
128static struct GNUNET_PeerIdentity me; 130static struct GNUNET_PeerIdentity me;
129 131
diff --git a/src/include/block_dns.h b/src/include/block_dns.h
index 1c01754de..21dcc7acb 100644
--- a/src/include/block_dns.h
+++ b/src/include/block_dns.h
@@ -13,6 +13,7 @@ enum GNUNET_DNS_ServiceTypes
13 GNUNET_DNS_SERVICE_TYPE_TCP = 2 13 GNUNET_DNS_SERVICE_TYPE_TCP = 2
14}; 14};
15 15
16GNUNET_NETWORK_STRUCT_BEGIN
16 17
17/** 18/**
18 * This is the structure describing an dns-record such as www.gnunet. 19 * This is the structure describing an dns-record such as www.gnunet.
@@ -57,5 +58,6 @@ struct GNUNET_DNS_Record
57 */ 58 */
58 uint32_t service_type GNUNET_PACKED; 59 uint32_t service_type GNUNET_PACKED;
59}; 60};
61GNUNET_NETWORK_STRUCT_END
60 62
61#endif 63#endif
diff --git a/src/include/block_fs.h b/src/include/block_fs.h
index 9dc22e57f..aae741e60 100644
--- a/src/include/block_fs.h
+++ b/src/include/block_fs.h
@@ -139,6 +139,8 @@ struct NBlock
139}; 139};
140 140
141 141
142GNUNET_NETWORK_STRUCT_BEGIN
143
142/** 144/**
143 * @brief index block (indexing a DBlock that 145 * @brief index block (indexing a DBlock that
144 * can be obtained directly from reading 146 * can be obtained directly from reading
@@ -160,6 +162,6 @@ struct OnDemandBlock
160 uint64_t offset GNUNET_PACKED; 162 uint64_t offset GNUNET_PACKED;
161 163
162}; 164};
163 165GNUNET_NETWORK_STRUCT_END
164 166
165#endif 167#endif
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h
index 898857af8..88cab0d9b 100644
--- a/src/include/gnunet_ats_service.h
+++ b/src/include/gnunet_ats_service.h
@@ -403,6 +403,8 @@ enum GNUNET_ATS_Property
403}; 403};
404 404
405 405
406GNUNET_NETWORK_STRUCT_BEGIN
407
406/** 408/**
407 * struct used to communicate the transport's properties like cost and 409 * struct used to communicate the transport's properties like cost and
408 * quality of service as well as high-level constraints on resource 410 * quality of service as well as high-level constraints on resource
@@ -433,7 +435,7 @@ struct GNUNET_ATS_Information
433 */ 435 */
434 uint32_t value GNUNET_PACKED; 436 uint32_t value GNUNET_PACKED;
435}; 437};
436 438GNUNET_NETWORK_STRUCT_END
437 439
438 440
439/* ******************************** Scheduling API ***************************** */ 441/* ******************************** Scheduling API ***************************** */
diff --git a/src/include/gnunet_bandwidth_lib.h b/src/include/gnunet_bandwidth_lib.h
index 75f71b32c..fabe47bea 100644
--- a/src/include/gnunet_bandwidth_lib.h
+++ b/src/include/gnunet_bandwidth_lib.h
@@ -38,6 +38,8 @@ extern "C"
38#include "gnunet_common.h" 38#include "gnunet_common.h"
39#include "gnunet_time_lib.h" 39#include "gnunet_time_lib.h"
40 40
41GNUNET_NETWORK_STRUCT_BEGIN
42
41/** 43/**
42 * 32-bit bandwidth used for network exchange by GNUnet, in bytes per second. 44 * 32-bit bandwidth used for network exchange by GNUnet, in bytes per second.
43 */ 45 */
@@ -48,7 +50,7 @@ struct GNUNET_BANDWIDTH_Value32NBO
48 */ 50 */
49 uint32_t value__ GNUNET_PACKED; 51 uint32_t value__ GNUNET_PACKED;
50}; 52};
51 53GNUNET_NETWORK_STRUCT_END
52 54
53/** 55/**
54 * Struct to track available bandwidth. Combines a time stamp with a 56 * Struct to track available bandwidth. Combines a time stamp with a
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index 665697a97..134543c46 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -116,9 +116,37 @@
116 */ 116 */
117#define GNUNET_UNUSED __attribute__((unused)) 117#define GNUNET_UNUSED __attribute__((unused))
118 118
119#if __GNUC__ > 3
120/**
121 * gcc 4.x-ism to pack structures even on W32 (to be used before structs)
122 */
123#define GNUNET_NETWORK_STRUCT_BEGIN \
124 _Pragma("pack(push)") \
125 _Pragma("pack(1)")
126
127/**
128 * gcc 4.x-ism to pack structures even on W32 (to be used after structs)
129 */
130#define GNUNET_NETWORK_STRUCT_END _Pragma("pack(pop)")
131#else
132#ifdef MINGW
133#error gcc 4.x or higher required on W32 systems
134#endif
135/**
136 * Good luck, GNUNET_PACKED should suffice, but this won't work on W32
137 */
138#define GNUNET_NETWORK_STRUCT_BEGIN
139
140/**
141 * Good luck, GNUNET_PACKED should suffice, but this won't work on W32
142 */
143#define GNUNET_NETWORK_STRUCT_END
144#endif
119 145
120/* ************************ super-general types *********************** */ 146/* ************************ super-general types *********************** */
121 147
148GNUNET_NETWORK_STRUCT_BEGIN
149
122/** 150/**
123 * Header for all communications. 151 * Header for all communications.
124 */ 152 */
@@ -137,7 +165,7 @@ struct GNUNET_MessageHeader
137 uint16_t type GNUNET_PACKED; 165 uint16_t type GNUNET_PACKED;
138 166
139}; 167};
140 168GNUNET_NETWORK_STRUCT_END
141 169
142/** 170/**
143 * @brief 512-bit hashcode 171 * @brief 512-bit hashcode
@@ -149,6 +177,8 @@ typedef struct
149GNUNET_HashCode; 177GNUNET_HashCode;
150 178
151 179
180GNUNET_NETWORK_STRUCT_BEGIN
181
152/** 182/**
153 * The identity of the host (basically the SHA-512 hashcode of 183 * The identity of the host (basically the SHA-512 hashcode of
154 * it's public key). 184 * it's public key).
@@ -157,7 +187,7 @@ struct GNUNET_PeerIdentity
157{ 187{
158 GNUNET_HashCode hashPubKey GNUNET_PACKED; 188 GNUNET_HashCode hashPubKey GNUNET_PACKED;
159}; 189};
160 190GNUNET_NETWORK_STRUCT_END
161 191
162/** 192/**
163 * Function called with a filename. 193 * Function called with a filename.
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index 53137c179..76806d432 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -121,6 +121,8 @@ struct GNUNET_CRYPTO_RsaSignature
121}; 121};
122 122
123 123
124GNUNET_NETWORK_STRUCT_BEGIN
125
124/** 126/**
125 * @brief header of what an RSA signature signs 127 * @brief header of what an RSA signature signs
126 * this must be followed by "size - 8" bytes of 128 * this must be followed by "size - 8" bytes of
@@ -197,7 +199,7 @@ struct GNUNET_CRYPTO_AesSessionKey
197 */ 199 */
198 uint32_t crc32 GNUNET_PACKED; 200 uint32_t crc32 GNUNET_PACKED;
199}; 201};
200 202GNUNET_NETWORK_STRUCT_END
201 203
202/** 204/**
203 * @brief IV for sym cipher 205 * @brief IV for sym cipher
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h
index f8afdae41..7090c33a1 100644
--- a/src/include/gnunet_time_lib.h
+++ b/src/include/gnunet_time_lib.h
@@ -61,6 +61,7 @@ struct GNUNET_TIME_Relative
61 uint64_t rel_value; 61 uint64_t rel_value;
62}; 62};
63 63
64GNUNET_NETWORK_STRUCT_BEGIN
64 65
65/** 66/**
66 * Time for relative time used by GNUnet, in milliseconds and in network byte order. 67 * Time for relative time used by GNUnet, in milliseconds and in network byte order.
@@ -84,7 +85,7 @@ struct GNUNET_TIME_AbsoluteNBO
84 */ 85 */
85 uint64_t abs_value__ GNUNET_PACKED; 86 uint64_t abs_value__ GNUNET_PACKED;
86}; 87};
87 88GNUNET_NETWORK_STRUCT_END
88 89
89/** 90/**
90 * Relative time zero. 91 * Relative time zero.
diff --git a/src/mesh/mesh.h b/src/mesh/mesh.h
index fcddb2eb9..d8fc404e1 100644
--- a/src/mesh/mesh.h
+++ b/src/mesh/mesh.h
@@ -85,6 +85,8 @@
85/************************** MESSAGES ******************************/ 85/************************** MESSAGES ******************************/
86/******************************************************************************/ 86/******************************************************************************/
87 87
88GNUNET_NETWORK_STRUCT_BEGIN
89
88/** 90/**
89 * Message for a client to register to the service 91 * Message for a client to register to the service
90 */ 92 */
@@ -209,7 +211,7 @@ struct GNUNET_MESH_ConnectPeerByType
209 */ 211 */
210 GNUNET_MESH_ApplicationType type GNUNET_PACKED; 212 GNUNET_MESH_ApplicationType type GNUNET_PACKED;
211}; 213};
212 214GNUNET_NETWORK_STRUCT_END
213 215
214/******************************************************************************/ 216/******************************************************************************/
215/************************ ENUMERATIONS ****************************/ 217/************************ ENUMERATIONS ****************************/
diff --git a/src/mesh/mesh_protocol.h b/src/mesh/mesh_protocol.h
index b6c7f1b24..885f1f344 100644
--- a/src/mesh/mesh_protocol.h
+++ b/src/mesh/mesh_protocol.h
@@ -39,6 +39,8 @@ extern "C"
39/******************** MESH NETWORK MESSAGES **************************/ 39/******************** MESH NETWORK MESSAGES **************************/
40/******************************************************************************/ 40/******************************************************************************/
41 41
42GNUNET_NETWORK_STRUCT_BEGIN
43
42/** 44/**
43 * Message for mesh path management 45 * Message for mesh path management
44 */ 46 */
@@ -276,6 +278,7 @@ struct GNUNET_MESH_SpeedNotify
276 uint32_t speed_min; 278 uint32_t speed_min;
277 279
278}; 280};
281GNUNET_NETWORK_STRUCT_END
279 282
280#if 0 /* keep Emacsens' auto-indent happy */ 283#if 0 /* keep Emacsens' auto-indent happy */
281{ 284{
diff --git a/src/nat/nat.h b/src/nat/nat.h
index a32fe0908..efab3a7a7 100644
--- a/src/nat/nat.h
+++ b/src/nat/nat.h
@@ -30,6 +30,8 @@
30 30
31#define DEBUG_NAT GNUNET_EXTRA_LOGGING 31#define DEBUG_NAT GNUNET_EXTRA_LOGGING
32 32
33GNUNET_NETWORK_STRUCT_BEGIN
34
33/** 35/**
34 * Request to test NAT traversal. 36 * Request to test NAT traversal.
35 */ 37 */
@@ -61,5 +63,6 @@ struct GNUNET_NAT_TestMessage
61 int32_t is_tcp; 63 int32_t is_tcp;
62 64
63}; 65};
66GNUNET_NETWORK_STRUCT_END
64 67
65#endif 68#endif
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c
index 7c3f14273..d37ecd941 100644
--- a/src/nse/gnunet-service-nse.c
+++ b/src/nse/gnunet-service-nse.c
@@ -128,6 +128,8 @@ struct NSEPeerEntry
128}; 128};
129 129
130 130
131GNUNET_NETWORK_STRUCT_BEGIN
132
131/** 133/**
132 * Network size estimate reply; sent when "this" 134 * Network size estimate reply; sent when "this"
133 * peer's timer has run out before receiving a 135 * peer's timer has run out before receiving a
@@ -178,7 +180,7 @@ struct GNUNET_NSE_FloodMessage
178 */ 180 */
179 struct GNUNET_CRYPTO_RsaSignature signature; 181 struct GNUNET_CRYPTO_RsaSignature signature;
180}; 182};
181 183GNUNET_NETWORK_STRUCT_END
182 184
183/** 185/**
184 * Handle to our current configuration. 186 * Handle to our current configuration.
diff --git a/src/nse/nse.h b/src/nse/nse.h
index 91b629657..2123e3996 100644
--- a/src/nse/nse.h
+++ b/src/nse/nse.h
@@ -35,6 +35,8 @@
35 */ 35 */
36#define DEBUG_NSE GNUNET_EXTRA_LOGGING 36#define DEBUG_NSE GNUNET_EXTRA_LOGGING
37 37
38GNUNET_NETWORK_STRUCT_BEGIN
39
38/** 40/**
39 * Network size estimate sent from the service 41 * Network size estimate sent from the service
40 * to clients. Contains the current size estimate 42 * to clients. Contains the current size estimate
@@ -71,6 +73,6 @@ struct GNUNET_NSE_ClientMessage
71 */ 73 */
72 double std_deviation GNUNET_PACKED; 74 double std_deviation GNUNET_PACKED;
73}; 75};
74 76GNUNET_NETWORK_STRUCT_END
75 77
76#endif 78#endif
diff --git a/src/peerinfo/peerinfo.h b/src/peerinfo/peerinfo.h
index 992dde782..bf5677477 100644
--- a/src/peerinfo/peerinfo.h
+++ b/src/peerinfo/peerinfo.h
@@ -29,6 +29,8 @@
29 29
30#define DEBUG_PEERINFO GNUNET_EXTRA_LOGGING 30#define DEBUG_PEERINFO GNUNET_EXTRA_LOGGING
31 31
32GNUNET_NETWORK_STRUCT_BEGIN
33
32/** 34/**
33 * Message requesting a listing of all known peers, 35 * Message requesting a listing of all known peers,
34 * possibly restricted to the specified peer identity. 36 * possibly restricted to the specified peer identity.
@@ -81,6 +83,6 @@ struct InfoMessage
81 struct GNUNET_PeerIdentity peer; 83 struct GNUNET_PeerIdentity peer;
82 84
83}; 85};
84 86GNUNET_NETWORK_STRUCT_END
85 87
86/* end of peerinfo.h */ 88/* end of peerinfo.h */
diff --git a/src/statistics/statistics.h b/src/statistics/statistics.h
index a65dff147..3fcac275a 100644
--- a/src/statistics/statistics.h
+++ b/src/statistics/statistics.h
@@ -29,6 +29,8 @@
29 29
30#define DEBUG_STATISTICS GNUNET_EXTRA_LOGGING 30#define DEBUG_STATISTICS GNUNET_EXTRA_LOGGING
31 31
32GNUNET_NETWORK_STRUCT_BEGIN
33
32/** 34/**
33 * Statistics message. Contains how long the system is up 35 * Statistics message. Contains how long the system is up
34 * and one value. 36 * and one value.
@@ -128,6 +130,6 @@ struct GNUNET_STATISTICS_WatchValueMessage
128 uint64_t value GNUNET_PACKED; 130 uint64_t value GNUNET_PACKED;
129 131
130}; 132};
131 133GNUNET_NETWORK_STRUCT_END
132 134
133#endif 135#endif
diff --git a/src/testing/test_testing_large_topology.c b/src/testing/test_testing_large_topology.c
index 08b1df5b9..e966ca137 100644
--- a/src/testing/test_testing_large_topology.c
+++ b/src/testing/test_testing_large_topology.c
@@ -107,6 +107,8 @@ static char *test_directory;
107 107
108#define MTYPE 12345 108#define MTYPE 12345
109 109
110GNUNET_NETWORK_STRUCT_BEGIN
111
110struct GNUNET_TestMessage 112struct GNUNET_TestMessage
111{ 113{
112 /** 114 /**
@@ -119,6 +121,7 @@ struct GNUNET_TestMessage
119 */ 121 */
120 uint32_t uid; 122 uint32_t uid;
121}; 123};
124GNUNET_NETWORK_STRUCT_END
122 125
123struct TestMessageContext 126struct TestMessageContext
124{ 127{
diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c
index f60ac3a1a..7d0c0da5f 100644
--- a/src/testing/test_testing_topology.c
+++ b/src/testing/test_testing_topology.c
@@ -115,6 +115,8 @@ static char *test_directory;
115 115
116#define MTYPE 12345 116#define MTYPE 12345
117 117
118GNUNET_NETWORK_STRUCT_BEGIN
119
118struct GNUNET_TestMessage 120struct GNUNET_TestMessage
119{ 121{
120 /** 122 /**
@@ -127,6 +129,7 @@ struct GNUNET_TestMessage
127 */ 129 */
128 uint32_t uid; 130 uint32_t uid;
129}; 131};
132GNUNET_NETWORK_STRUCT_END
130 133
131struct TestMessageContext 134struct TestMessageContext
132{ 135{
diff --git a/src/testing/test_testing_topology_blacklist.c b/src/testing/test_testing_topology_blacklist.c
index d45d1bbb4..095c5b2a2 100644
--- a/src/testing/test_testing_topology_blacklist.c
+++ b/src/testing/test_testing_topology_blacklist.c
@@ -85,6 +85,8 @@ static char *test_directory;
85 85
86#define MTYPE 12345 86#define MTYPE 12345
87 87
88GNUNET_NETWORK_STRUCT_BEGIN
89
88struct GNUNET_TestMessage 90struct GNUNET_TestMessage
89{ 91{
90 /** 92 /**
@@ -97,7 +99,7 @@ struct GNUNET_TestMessage
97 */ 99 */
98 uint32_t uid; 100 uint32_t uid;
99}; 101};
100 102GNUNET_NETWORK_STRUCT_END
101 103
102/** 104/**
103 * Check whether peers successfully shut down. 105 * Check whether peers successfully shut down.
diff --git a/src/testing/test_testing_topology_churn.c b/src/testing/test_testing_topology_churn.c
index 5a348642c..36120893b 100644
--- a/src/testing/test_testing_topology_churn.c
+++ b/src/testing/test_testing_topology_churn.c
@@ -59,6 +59,8 @@ static char *test_directory;
59 59
60#define MTYPE 12345 60#define MTYPE 12345
61 61
62GNUNET_NETWORK_STRUCT_BEGIN
63
62struct GNUNET_TestMessage 64struct GNUNET_TestMessage
63{ 65{
64 /** 66 /**
@@ -71,6 +73,7 @@ struct GNUNET_TestMessage
71 */ 73 */
72 uint32_t uid; 74 uint32_t uid;
73}; 75};
76GNUNET_NETWORK_STRUCT_END
74 77
75/** 78/**
76 * Check whether peers successfully shut down. 79 * Check whether peers successfully shut down.
diff --git a/src/transport/gnunet-helper-transport-wlan.c b/src/transport/gnunet-helper-transport-wlan.c
index fcdd9d520..72314beb2 100644
--- a/src/transport/gnunet-helper-transport-wlan.c
+++ b/src/transport/gnunet-helper-transport-wlan.c
@@ -328,6 +328,7 @@ struct SendBuffer
328 char buf[MAXLINE * 2]; 328 char buf[MAXLINE * 2];
329}; 329};
330 330
331GNUNET_NETWORK_STRUCT_BEGIN
331 332
332/** 333/**
333 * generic definitions for IEEE 802.11 frames 334 * generic definitions for IEEE 802.11 frames
@@ -343,7 +344,7 @@ struct ieee80211_frame
343 /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */ 344 /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */
344 /* see below */ 345 /* see below */
345} GNUNET_PACKED; 346} GNUNET_PACKED;
346 347GNUNET_NETWORK_STRUCT_END
347 348
348/** 349/**
349 * struct for storing the information of the hardware 350 * struct for storing the information of the hardware
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index aaeefe8d4..5c749d717 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -69,6 +69,8 @@
69 */ 69 */
70struct NeighbourMapEntry; 70struct NeighbourMapEntry;
71 71
72GNUNET_NETWORK_STRUCT_BEGIN
73
72/** 74/**
73 * Message a peer sends to another to indicate its 75 * Message a peer sends to another to indicate its
74 * preference for communicating via a particular 76 * preference for communicating via a particular
@@ -133,7 +135,7 @@ struct SessionDisconnectMessage
133 struct GNUNET_CRYPTO_RsaSignature signature; 135 struct GNUNET_CRYPTO_RsaSignature signature;
134 136
135}; 137};
136 138GNUNET_NETWORK_STRUCT_END
137 139
138/** 140/**
139 * For each neighbour we keep a list of messages 141 * For each neighbour we keep a list of messages
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c
index 559589576..17fc5edc6 100644
--- a/src/transport/gnunet-service-transport_validation.c
+++ b/src/transport/gnunet-service-transport_validation.c
@@ -92,6 +92,8 @@
92#define PONG_PRIORITY 4 92#define PONG_PRIORITY 4
93 93
94 94
95GNUNET_NETWORK_STRUCT_BEGIN
96
95/** 97/**
96 * Message used to ask a peer to validate receipt (to check an address 98 * Message used to ask a peer to validate receipt (to check an address
97 * from a HELLO). Followed by the address we are trying to validate, 99 * from a HELLO). Followed by the address we are trying to validate,
@@ -166,7 +168,7 @@ struct TransportPongMessage
166 uint32_t addrlen GNUNET_PACKED; 168 uint32_t addrlen GNUNET_PACKED;
167 169
168}; 170};
169 171GNUNET_NETWORK_STRUCT_END
170 172
171/** 173/**
172 * Information about an address under validation 174 * Information about an address under validation
diff --git a/src/transport/gnunet-transport-wlan-sender.c b/src/transport/gnunet-transport-wlan-sender.c
index 2096afaee..9f06b63b4 100644
--- a/src/transport/gnunet-transport-wlan-sender.c
+++ b/src/transport/gnunet-transport-wlan-sender.c
@@ -46,6 +46,7 @@
46#define IEEE80211_FC0_TYPE_CTL 0x04 46#define IEEE80211_FC0_TYPE_CTL 0x04
47#define IEEE80211_FC0_TYPE_DATA 0x08 47#define IEEE80211_FC0_TYPE_DATA 0x08
48 48
49GNUNET_NETWORK_STRUCT_BEGIN
49 50
50/* 51/*
51 * generic definitions for IEEE 802.11 frames 52 * generic definitions for IEEE 802.11 frames
@@ -60,7 +61,7 @@ struct ieee80211_frame
60 u_int8_t i_seq[2]; 61 u_int8_t i_seq[2];
61 u_int8_t llc[4]; 62 u_int8_t llc[4];
62} GNUNET_PACKED; 63} GNUNET_PACKED;
63 64GNUNET_NETWORK_STRUCT_END
64 65
65/** 66/**
66 * function to fill the radiotap header 67 * function to fill the radiotap header
diff --git a/src/transport/plugin_transport_http.h b/src/transport/plugin_transport_http.h
index 84a92c284..9e16e93c8 100644
--- a/src/transport/plugin_transport_http.h
+++ b/src/transport/plugin_transport_http.h
@@ -260,6 +260,8 @@ struct Plugin
260 260
261}; 261};
262 262
263GNUNET_NETWORK_STRUCT_BEGIN
264
263/** 265/**
264 * IPv4 addresses 266 * IPv4 addresses
265 */ 267 */
@@ -291,7 +293,7 @@ struct IPv6HttpAddress
291 */ 293 */
292 uint16_t u6_port GNUNET_PACKED; 294 uint16_t u6_port GNUNET_PACKED;
293}; 295};
294 296GNUNET_NETWORK_STRUCT_END
295 297
296/** 298/**
297 * Session handle for connections. 299 * Session handle for connections.
diff --git a/src/transport/plugin_transport_smtp.c b/src/transport/plugin_transport_smtp.c
index fa11a9b6d..b589e1177 100644
--- a/src/transport/plugin_transport_smtp.c
+++ b/src/transport/plugin_transport_smtp.c
@@ -72,6 +72,8 @@ typedef struct
72 72
73} EmailAddress; 73} EmailAddress;
74 74
75GNUNET_NETWORK_STRUCT_BEGIN
76
75/** 77/**
76 * Encapsulation of a GNUnet message in the SMTP mail body (before 78 * Encapsulation of a GNUnet message in the SMTP mail body (before
77 * base64 encoding). 79 * base64 encoding).
@@ -86,6 +88,7 @@ typedef struct
86 GNUNET_PeerIdentity sender; 88 GNUNET_PeerIdentity sender;
87 89
88} SMTPMessage; 90} SMTPMessage;
91GNUNET_NETWORK_STRUCT_END
89 92
90/* *********** globals ************* */ 93/* *********** globals ************* */
91 94
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index 1024b8008..e79440e5e 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -43,6 +43,8 @@
43 43
44#define DEBUG_TCP_NAT GNUNET_EXTRA_LOGGING 44#define DEBUG_TCP_NAT GNUNET_EXTRA_LOGGING
45 45
46GNUNET_NETWORK_STRUCT_BEGIN
47
46/** 48/**
47 * Initial handshake message for a session. 49 * Initial handshake message for a session.
48 */ 50 */
@@ -78,7 +80,7 @@ struct TCP_NAT_ProbeMessage
78 struct GNUNET_PeerIdentity clientIdentity; 80 struct GNUNET_PeerIdentity clientIdentity;
79 81
80}; 82};
81 83GNUNET_NETWORK_STRUCT_END
82 84
83/** 85/**
84 * Context for sending a NAT probe via TCP. 86 * Context for sending a NAT probe via TCP.
@@ -118,6 +120,8 @@ struct TCPProbeContext
118}; 120};
119 121
120 122
123GNUNET_NETWORK_STRUCT_BEGIN
124
121/** 125/**
122 * Network format for IPv4 addresses. 126 * Network format for IPv4 addresses.
123 */ 127 */
@@ -152,7 +156,7 @@ struct IPv6TcpAddress
152 uint16_t t6_port GNUNET_PACKED; 156 uint16_t t6_port GNUNET_PACKED;
153 157
154}; 158};
155 159GNUNET_NETWORK_STRUCT_END
156 160
157/** 161/**
158 * Encapsulation of all of the state of the plugin. 162 * Encapsulation of all of the state of the plugin.
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index 04ec108aa..165455856 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -70,6 +70,8 @@
70#define UDP_MAX_SENDER_ADDRESSES_WITH_DEFRAG 128 70#define UDP_MAX_SENDER_ADDRESSES_WITH_DEFRAG 128
71 71
72 72
73GNUNET_NETWORK_STRUCT_BEGIN
74
73/** 75/**
74 * UDP Message-Packet header (after defragmentation). 76 * UDP Message-Packet header (after defragmentation).
75 */ 77 */
@@ -92,7 +94,6 @@ struct UDPMessage
92 94
93}; 95};
94 96
95
96/** 97/**
97 * UDP ACK Message-Packet header (after defragmentation). 98 * UDP ACK Message-Packet header (after defragmentation).
98 */ 99 */
@@ -162,7 +163,7 @@ struct IPv6UdpAddress
162 */ 163 */
163 uint16_t u6_port GNUNET_PACKED; 164 uint16_t u6_port GNUNET_PACKED;
164}; 165};
165 166GNUNET_NETWORK_STRUCT_END
166 167
167/* Forward definition */ 168/* Forward definition */
168struct Plugin; 169struct Plugin;
diff --git a/src/transport/plugin_transport_udp_new.c b/src/transport/plugin_transport_udp_new.c
index 7eb4cbe87..e6b7fe18f 100644
--- a/src/transport/plugin_transport_udp_new.c
+++ b/src/transport/plugin_transport_udp_new.c
@@ -70,6 +70,8 @@
70#define UDP_MAX_SENDER_ADDRESSES_WITH_DEFRAG 128 70#define UDP_MAX_SENDER_ADDRESSES_WITH_DEFRAG 128
71 71
72 72
73GNUNET_NETWORK_STRUCT_BEGIN
74
73/** 75/**
74 * UDP Message-Packet header (after defragmentation). 76 * UDP Message-Packet header (after defragmentation).
75 */ 77 */
@@ -148,7 +150,7 @@ struct IPv6UdpAddress
148 */ 150 */
149 uint16_t u6_port GNUNET_PACKED; 151 uint16_t u6_port GNUNET_PACKED;
150}; 152};
151 153GNUNET_NETWORK_STRUCT_END
152 154
153/* Forward definition */ 155/* Forward definition */
154struct Plugin; 156struct Plugin;
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index 5f6c967f2..aebfeb883 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -64,6 +64,8 @@
64 */ 64 */
65#define UNIX_NAT_DEFAULT_PORT 22086 65#define UNIX_NAT_DEFAULT_PORT 22086
66 66
67GNUNET_NETWORK_STRUCT_BEGIN
68
67/** 69/**
68 * UNIX Message-Packet header. 70 * UNIX Message-Packet header.
69 */ 71 */
@@ -131,6 +133,7 @@ struct IPv6UdpAddress
131 */ 133 */
132 uint16_t u6_port GNUNET_PACKED; 134 uint16_t u6_port GNUNET_PACKED;
133}; 135};
136GNUNET_NETWORK_STRUCT_END
134 137
135/* Forward definition */ 138/* Forward definition */
136struct Plugin; 139struct Plugin;
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c
index 4c4e9f1ab..d121ec9be 100644
--- a/src/transport/plugin_transport_wlan.c
+++ b/src/transport/plugin_transport_wlan.c
@@ -120,6 +120,8 @@
120#define IEEE80211_FC0_TYPE_CTL 0x04 120#define IEEE80211_FC0_TYPE_CTL 0x04
121#define IEEE80211_FC0_TYPE_DATA 0x08 121#define IEEE80211_FC0_TYPE_DATA 0x08
122 122
123GNUNET_NETWORK_STRUCT_BEGIN
124
123/* 125/*
124 * generic definitions for IEEE 802.11 frames 126 * generic definitions for IEEE 802.11 frames
125 */ 127 */
@@ -133,6 +135,7 @@ struct ieee80211_frame
133 u_int8_t i_seq[2]; 135 u_int8_t i_seq[2];
134 u_int8_t llc[4]; 136 u_int8_t llc[4];
135} GNUNET_PACKED; 137} GNUNET_PACKED;
138GNUNET_NETWORK_STRUCT_END
136 139
137/** 140/**
138 * Encapsulation of all of the state of the plugin. 141 * Encapsulation of all of the state of the plugin.
@@ -361,6 +364,8 @@ struct Plugin_Session_pair
361}; 364};
362 365
363 366
367GNUNET_NETWORK_STRUCT_BEGIN
368
364/** 369/**
365 * Header for messages which need fragmentation 370 * Header for messages which need fragmentation
366 */ 371 */
@@ -388,7 +393,7 @@ struct WlanHeader
388// followed by payload 393// followed by payload
389 394
390}; 395};
391 396GNUNET_NETWORK_STRUCT_END
392 397
393/** 398/**
394 * Information kept for each message that is yet to 399 * Information kept for each message that is yet to
diff --git a/src/transport/plugin_transport_wlan.h b/src/transport/plugin_transport_wlan.h
index 35b23fd44..b0b8b966a 100644
--- a/src/transport/plugin_transport_wlan.h
+++ b/src/transport/plugin_transport_wlan.h
@@ -43,6 +43,8 @@ struct MacAddress
43}; 43};
44 44
45 45
46GNUNET_NETWORK_STRUCT_BEGIN
47
46/** 48/**
47 * Format of a WLAN Control Message. 49 * Format of a WLAN Control Message.
48 */ 50 */
@@ -58,7 +60,7 @@ struct GNUNET_TRANSPORT_WLAN_HelperControlMessage
58 */ 60 */
59 struct MacAddress mac; 61 struct MacAddress mac;
60}; 62};
61 63GNUNET_NETWORK_STRUCT_END
62 64
63/** 65/**
64 * GNUnet bssid 66 * GNUnet bssid
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c
index 1742dd0d3..5d9cfff19 100644
--- a/src/transport/test_quota_compliance.c
+++ b/src/transport/test_quota_compliance.c
@@ -104,11 +104,14 @@ static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
104 104
105#define MTYPE 12345 105#define MTYPE 12345
106 106
107GNUNET_NETWORK_STRUCT_BEGIN
108
107struct TestMessage 109struct TestMessage
108{ 110{
109 struct GNUNET_MessageHeader header; 111 struct GNUNET_MessageHeader header;
110 uint32_t num; 112 uint32_t num;
111}; 113};
114GNUNET_NETWORK_STRUCT_END
112 115
113static int msg_scheduled; 116static int msg_scheduled;
114static int msg_sent; 117static int msg_sent;
diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c
index 15fc4f6b9..ac360a3ea 100644
--- a/src/transport/test_transport_api_reliability.c
+++ b/src/transport/test_transport_api_reliability.c
@@ -97,11 +97,14 @@ static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
97 97
98#define MTYPE 12345 98#define MTYPE 12345
99 99
100GNUNET_NETWORK_STRUCT_BEGIN
101
100struct TestMessage 102struct TestMessage
101{ 103{
102 struct GNUNET_MessageHeader header; 104 struct GNUNET_MessageHeader header;
103 uint32_t num; 105 uint32_t num;
104}; 106};
107GNUNET_NETWORK_STRUCT_END
105 108
106static int msg_scheduled; 109static int msg_scheduled;
107static int msg_sent; 110static int msg_sent;
diff --git a/src/transport/test_transport_api_unreliability.c b/src/transport/test_transport_api_unreliability.c
index e52b20f7c..2120f7044 100644
--- a/src/transport/test_transport_api_unreliability.c
+++ b/src/transport/test_transport_api_unreliability.c
@@ -93,11 +93,14 @@ struct GNUNET_TRANSPORT_TESTING_handle *tth;
93 93
94#define MTYPE 12345 94#define MTYPE 12345
95 95
96GNUNET_NETWORK_STRUCT_BEGIN
97
96struct TestMessage 98struct TestMessage
97{ 99{
98 struct GNUNET_MessageHeader header; 100 struct GNUNET_MessageHeader header;
99 uint32_t num; 101 uint32_t num;
100}; 102};
103GNUNET_NETWORK_STRUCT_END
101 104
102static char *test_name; 105static char *test_name;
103 106
diff --git a/src/transport/test_transport_api_unreliability_constant.c b/src/transport/test_transport_api_unreliability_constant.c
index 414bca7c8..3770ebfdb 100644
--- a/src/transport/test_transport_api_unreliability_constant.c
+++ b/src/transport/test_transport_api_unreliability_constant.c
@@ -97,11 +97,14 @@ static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
97 97
98#define MSG_SIZE 10000 98#define MSG_SIZE 10000
99 99
100GNUNET_NETWORK_STRUCT_BEGIN
101
100struct TestMessage 102struct TestMessage
101{ 103{
102 struct GNUNET_MessageHeader header; 104 struct GNUNET_MessageHeader header;
103 uint32_t num; 105 uint32_t num;
104}; 106};
107GNUNET_NETWORK_STRUCT_END
105 108
106static char *test_name; 109static char *test_name;
107 110
diff --git a/src/transport/transport.h b/src/transport/transport.h
index d2792b92d..ff6818813 100644
--- a/src/transport/transport.h
+++ b/src/transport/transport.h
@@ -61,6 +61,8 @@
61 */ 61 */
62#define CONNECTED_LATENCY_EVALUATION_MAX_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1) 62#define CONNECTED_LATENCY_EVALUATION_MAX_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1)
63 63
64GNUNET_NETWORK_STRUCT_BEGIN
65
64/** 66/**
65 * Message from the transport service to the library 67 * Message from the transport service to the library
66 * asking to check if both processes agree about this 68 * asking to check if both processes agree about this
@@ -430,7 +432,7 @@ struct BlacklistMessage
430 struct GNUNET_PeerIdentity peer; 432 struct GNUNET_PeerIdentity peer;
431 433
432}; 434};
433 435GNUNET_NETWORK_STRUCT_END
434 436
435/* end of transport.h */ 437/* end of transport.h */
436#endif 438#endif
diff --git a/src/util/crypto_ksk.c b/src/util/crypto_ksk.c
index 60639a709..0f5a29507 100644
--- a/src/util/crypto_ksk.c
+++ b/src/util/crypto_ksk.c
@@ -463,6 +463,7 @@ generate_kblock_key (KBlock_secret_key *sk, unsigned int nbits,
463 gcry_mpi_release (g); 463 gcry_mpi_release (g);
464} 464}
465 465
466GNUNET_NETWORK_STRUCT_BEGIN
466 467
467/** 468/**
468 * Internal representation of the private key. 469 * Internal representation of the private key.
@@ -482,7 +483,7 @@ struct KskRsaPrivateKeyBinaryEncoded
482 uint16_t sizedmq1 GNUNET_PACKED; /* in big-endian! */ 483 uint16_t sizedmq1 GNUNET_PACKED; /* in big-endian! */
483 /* followed by the actual values */ 484 /* followed by the actual values */
484}; 485};
485 486GNUNET_NETWORK_STRUCT_END
486 487
487/** 488/**
488 * Deterministically (!) create a hostkey using only the 489 * Deterministically (!) create a hostkey using only the
diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c
index d29566ac8..418fe833b 100644
--- a/src/util/crypto_rsa.c
+++ b/src/util/crypto_rsa.c
@@ -53,6 +53,8 @@ struct GNUNET_CRYPTO_RsaPrivateKey
53}; 53};
54 54
55 55
56GNUNET_NETWORK_STRUCT_BEGIN
57
56/** 58/**
57 * GNUnet mandates a certain format for the encoding 59 * GNUnet mandates a certain format for the encoding
58 * of private RSA key information that is provided 60 * of private RSA key information that is provided
@@ -75,7 +77,7 @@ struct RsaPrivateKeyBinaryEncoded
75 uint16_t sizedmq1 GNUNET_PACKED; /* in big-endian! */ 77 uint16_t sizedmq1 GNUNET_PACKED; /* in big-endian! */
76 /* followed by the actual values */ 78 /* followed by the actual values */
77}; 79};
78 80GNUNET_NETWORK_STRUCT_END
79 81
80#define HOSTKEY_LEN 2048 82#define HOSTKEY_LEN 2048
81 83
diff --git a/src/util/resolver.h b/src/util/resolver.h
index 57cb68650..eca753a55 100644
--- a/src/util/resolver.h
+++ b/src/util/resolver.h
@@ -29,6 +29,8 @@
29 29
30#define DEBUG_RESOLVER GNUNET_EXTRA_LOGGING 30#define DEBUG_RESOLVER GNUNET_EXTRA_LOGGING
31 31
32GNUNET_NETWORK_STRUCT_BEGIN
33
32/** 34/**
33 * Request for the resolver. Followed by either 35 * Request for the resolver. Followed by either
34 * the "struct sockaddr" or the 0-terminated hostname. 36 * the "struct sockaddr" or the 0-terminated hostname.
@@ -59,5 +61,6 @@ struct GNUNET_RESOLVER_GetMessage
59 int32_t domain GNUNET_PACKED; 61 int32_t domain GNUNET_PACKED;
60 62
61}; 63};
64GNUNET_NETWORK_STRUCT_END
62 65
63#endif 66#endif
diff --git a/src/vpn/gnunet-service-dns-p.h b/src/vpn/gnunet-service-dns-p.h
index 0519b1f84..632145ae2 100644
--- a/src/vpn/gnunet-service-dns-p.h
+++ b/src/vpn/gnunet-service-dns-p.h
@@ -3,6 +3,8 @@
3 3
4#include "gnunet_common.h" 4#include "gnunet_common.h"
5 5
6GNUNET_NETWORK_STRUCT_BEGIN
7
6struct query_packet 8struct query_packet
7{ 9{
8 struct GNUNET_MessageHeader hdr; 10 struct GNUNET_MessageHeader hdr;
@@ -109,5 +111,6 @@ struct answer_packet_list
109 struct GNUNET_SERVER_Client *client; 111 struct GNUNET_SERVER_Client *client;
110 struct answer_packet pkt; 112 struct answer_packet pkt;
111}; 113};
114GNUNET_NETWORK_STRUCT_END
112 115
113#endif 116#endif
diff --git a/src/vpn/gnunet-service-dns.c b/src/vpn/gnunet-service-dns.c
index 6ef621c26..12d0a93cf 100644
--- a/src/vpn/gnunet-service-dns.c
+++ b/src/vpn/gnunet-service-dns.c
@@ -287,12 +287,15 @@ send_answer (void *cls, size_t size, void *buf)
287 return len; 287 return len;
288} 288}
289 289
290GNUNET_NETWORK_STRUCT_BEGIN
291
290struct tunnel_cls 292struct tunnel_cls
291{ 293{
292 struct GNUNET_MESH_Tunnel *tunnel GNUNET_PACKED; 294 struct GNUNET_MESH_Tunnel *tunnel GNUNET_PACKED;
293 struct GNUNET_MessageHeader hdr; 295 struct GNUNET_MessageHeader hdr;
294 struct dns_pkt dns; 296 struct dns_pkt dns;
295}; 297};
298GNUNET_NETWORK_STRUCT_END
296 299
297struct tunnel_cls *remote_pending[UINT16_MAX]; 300struct tunnel_cls *remote_pending[UINT16_MAX];
298 301
diff --git a/src/vpn/gnunet-vpn-packet.h b/src/vpn/gnunet-vpn-packet.h
index e2082f9a1..9cbbf1bb2 100644
--- a/src/vpn/gnunet-vpn-packet.h
+++ b/src/vpn/gnunet-vpn-packet.h
@@ -4,6 +4,8 @@
4#include "platform.h" 4#include "platform.h"
5#include "gnunet_common.h" 5#include "gnunet_common.h"
6 6
7GNUNET_NETWORK_STRUCT_BEGIN
8
7// Headers 9// Headers
8struct pkt_tun 10struct pkt_tun
9{ 11{
@@ -100,6 +102,7 @@ struct dns_static
100 uint16_t nscount GNUNET_PACKED; // number of authority-records 102 uint16_t nscount GNUNET_PACKED; // number of authority-records
101 uint16_t arcount GNUNET_PACKED; // number of additional records 103 uint16_t arcount GNUNET_PACKED; // number of additional records
102}; 104};
105GNUNET_NETWORK_STRUCT_END
103 106
104struct dns_pkt 107struct dns_pkt
105{ 108{
@@ -156,6 +159,8 @@ struct udp_dns
156 struct dns_pkt data; 159 struct dns_pkt data;
157}; 160};
158 161
162GNUNET_NETWORK_STRUCT_BEGIN
163
159// Complete Packets 164// Complete Packets
160struct tun_pkt 165struct tun_pkt
161{ 166{
@@ -246,5 +251,6 @@ struct ip_icmp
246 struct ip_hdr ip_hdr; 251 struct ip_hdr ip_hdr;
247 struct icmp_hdr icmp_hdr; 252 struct icmp_hdr icmp_hdr;
248}; 253};
254GNUNET_NETWORK_STRUCT_END
249 255
250#endif 256#endif