fixing 2012: network structure alignment now forced to be correct even on W32 using...
authorChristian Grothoff <christian@grothoff.org>
Wed, 21 Dec 2011 09:40:15 +0000 (09:40 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 21 Dec 2011 09:40:15 +0000 (09:40 +0000)
57 files changed:
src/arm/arm.h
src/ats-test/test_transport_ats_multiple_peers.c
src/ats/ats.h
src/chat/chat.h
src/core/core.h
src/core/gnunet-service-core_kx.c
src/datastore/datastore.h
src/dht/dht.h
src/dht/gnunet-service-dht_neighbours.c
src/dv/dv.h
src/dv/test_transport_api_dv.c
src/fragmentation/fragmentation.h
src/fs/fs.h
src/fs/gnunet-service-fs.h
src/hello/hello.c
src/hostlist/gnunet-daemon-hostlist.c
src/include/block_dns.h
src/include/block_fs.h
src/include/gnunet_ats_service.h
src/include/gnunet_bandwidth_lib.h
src/include/gnunet_common.h
src/include/gnunet_crypto_lib.h
src/include/gnunet_time_lib.h
src/mesh/mesh.h
src/mesh/mesh_protocol.h
src/nat/nat.h
src/nse/gnunet-service-nse.c
src/nse/nse.h
src/peerinfo/peerinfo.h
src/statistics/statistics.h
src/testing/test_testing_large_topology.c
src/testing/test_testing_topology.c
src/testing/test_testing_topology_blacklist.c
src/testing/test_testing_topology_churn.c
src/transport/gnunet-helper-transport-wlan.c
src/transport/gnunet-service-transport_neighbours.c
src/transport/gnunet-service-transport_validation.c
src/transport/gnunet-transport-wlan-sender.c
src/transport/plugin_transport_http.h
src/transport/plugin_transport_smtp.c
src/transport/plugin_transport_tcp.c
src/transport/plugin_transport_udp.c
src/transport/plugin_transport_udp_new.c
src/transport/plugin_transport_unix.c
src/transport/plugin_transport_wlan.c
src/transport/plugin_transport_wlan.h
src/transport/test_quota_compliance.c
src/transport/test_transport_api_reliability.c
src/transport/test_transport_api_unreliability.c
src/transport/test_transport_api_unreliability_constant.c
src/transport/transport.h
src/util/crypto_ksk.c
src/util/crypto_rsa.c
src/util/resolver.h
src/vpn/gnunet-service-dns-p.h
src/vpn/gnunet-service-dns.c
src/vpn/gnunet-vpn-packet.h

index 615079b7c324ba5da9bd2cb817a60c63a9606c79..4b9da6fabab0a5069e15d73dc11d6d6182b76db4 100644 (file)
@@ -33,6 +33,7 @@
  */
 #define DEBUG_ARM GNUNET_EXTRA_LOGGING
 
+GNUNET_NETWORK_STRUCT_BEGIN
 
 /**
  * Reply from ARM to client.
@@ -50,6 +51,6 @@ struct GNUNET_ARM_ResultMessage
    */
   uint32_t status;
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 #endif
index 51b81372528a6175f4d1e327e663cac790f8763e..e9d0baf25a8a66e86e19e1957c43b490464b3055 100644 (file)
@@ -68,11 +68,14 @@ struct TEST_result
   uint64_t state;
 };
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 struct TestMessage
 {
   struct GNUNET_MessageHeader header;
   uint32_t num;
 };
+GNUNET_NETWORK_STRUCT_END
 
 
 static int count;
index 5b9fa869682fd0af504a6b37bf1745c45e43c512..30ca29580463704b0bf1180c1bb66641efaff17b 100644 (file)
@@ -39,6 +39,7 @@ enum StartFlag
   START_FLAG_PERFORMANCE_NO_PIC = 2
 };
 
+GNUNET_NETWORK_STRUCT_BEGIN
 
 struct ClientStartMessage
 {
@@ -214,7 +215,6 @@ struct ReservationResultMessage
   struct GNUNET_TIME_RelativeNBO res_delay;
 };
 
-
 struct PreferenceInformation
 {
 
@@ -236,6 +236,7 @@ struct ChangePreferenceMessage
   /* followed by 'num_preferences'
    * struct PreferenceInformation values */
 };
+GNUNET_NETWORK_STRUCT_END
 
 
 
index 9a52a2d75d217ceb634bd8fc15cc55ebd358634c..5df7773a7ccf33957c5e50f7ca6f993b9c07cfde 100644 (file)
@@ -41,6 +41,8 @@
  * Client-service messages
  */
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Notification sent by service to client indicating that we've received a chat
  * message.  After this struct, the remaining bytes are the actual text message.
@@ -476,6 +478,7 @@ struct P2PConfirmationReceiptMessage
   GNUNET_HashCode content;
 
 };
+GNUNET_NETWORK_STRUCT_END
 
 #endif
 
index b76528a8ec275f33d960a4cc6babfedfbcec1647..4942ad0542064a1762bf9f0221463110972a4873 100644 (file)
@@ -50,6 +50,8 @@
 #define GNUNET_CORE_OPTION_SEND_HDR_OUTBOUND  64
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Message transmitted core clients to gnunet-service-core
  * to start the interaction.  This header is followed by
@@ -373,6 +375,6 @@ struct ConnectMessage
   struct GNUNET_PeerIdentity peer;
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 #endif
 /* end of core.h */
index 63dd6b7eeccc6416f3296074bff31ce648271b16..38a5af9a4315550e485bc13e85ad77e1a37dd45b 100644 (file)
@@ -62,6 +62,8 @@
 #define MAX_SET_KEY_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * We're sending an (encrypted) PING to the other peer to check if he
  * can decrypt.  The other peer should respond with a PONG with the
@@ -213,7 +215,7 @@ struct EncryptedMessage
   struct GNUNET_TIME_AbsoluteNBO timestamp;
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 /**
  * Number of bytes (at the beginning) of "struct EncryptedMessage"
  * that are NOT encrypted.
index 563b7486cac3fb1d08fb4f5223d0f2368afc5834..1126027f8ecb1be318aeb6af1f3d66fbc890519d 100644 (file)
@@ -31,6 +31,8 @@
 
 #include "gnunet_util_lib.h"
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Message from datastore service informing client about
  * the current size of the datastore.
@@ -254,7 +256,7 @@ struct DataMessage
   GNUNET_HashCode key GNUNET_PACKED;
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 
 
index 2a67177889ddd9cc5e205ef7ed5c078c868917f8..c9fdd3479c559ae3508304d4ac66170b04975556 100644 (file)
@@ -34,6 +34,8 @@
 #define DHT_BLOOM_SIZE 128
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Message which indicates the DHT should cancel outstanding
  * requests and discard any state.
@@ -191,6 +193,6 @@ struct GNUNET_DHT_ClientPutMessage
   /* DATA copied to end of this message */
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 #endif
index 9ebf1640035d44b179220ac5fffe8d73da86a565..907de9950728b3bede0664ce0ce68fae2d81c6d9 100644 (file)
@@ -90,6 +90,8 @@
 #define GET_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 2)
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * P2P PUT message
  */
@@ -246,7 +248,7 @@ struct PeerGetMessage
   /* result bloomfilter */
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * Linked list of messages to send to a particular other peer.
index 5690cf6ccc34903f2ee7c614894c62b0bc2feafc..0d42505bcbec2b95b99c7acfcec81055e9d21f43 100644 (file)
@@ -44,6 +44,8 @@ typedef void (*GNUNET_DV_MessageReceivedHandler) (void *cls,
                                                   char *sender_address,
                                                   size_t sender_address_len);
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * DV Message, contains a message that was received
  * via DV for this peer! Internal.
@@ -255,7 +257,7 @@ typedef struct
   uint32_t peer_id GNUNET_PACKED;
 
 } p2p_dv_MESSAGE_Disconnect;
-
+GNUNET_NETWORK_STRUCT_END
 
 struct GNUNET_DV_Handle *
 GNUNET_DV_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
index 942ee07c013ff8b95f25820375104064f1dd3063..2e4962964fdf2317425c3f787044b81ab161bb16 100644 (file)
@@ -108,6 +108,8 @@ struct GNUNET_CONTAINER_MultiHashMap *peer_daemon_hash;
 
 #define MTYPE 12345
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 struct GNUNET_TestMessage
 {
   /**
@@ -120,6 +122,7 @@ struct GNUNET_TestMessage
    */
   uint32_t uid;
 };
+GNUNET_NETWORK_STRUCT_END
 
 struct PeerContext
 {
index 3469dd27ed2fc99aa1b13ca51cd0d35e0b897ed2..2f3ea67bb25c2fe8fb36ca2d54ecb5adb4ba7000 100644 (file)
@@ -27,6 +27,8 @@
 #include "platform.h"
 #include "gnunet_fragmentation_lib.h"
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Header for a message fragment.  Followed by the
  * original message.
@@ -82,6 +84,6 @@ struct FragmentAcknowledgement
   uint64_t bits;
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 #endif
index 90d32f4a7ef99475a308c85da9a0c0cad72cdbdc..cd39522bc8998cad23ae8bba66d206ddcf4fac9c 100644 (file)
@@ -64,6 +64,8 @@ struct ContentHashKey
 };
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Message sent from a GNUnet (fs) publishing activity to the
  * gnunet-fs-service to initiate indexing of a file.  The service is
@@ -288,7 +290,7 @@ struct PutMessage
   /* this is followed by the actual encrypted content */
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 
 #endif
index 5a275c5ff870a88fbd7924be3f0c16b6368f977b..c669dcc7ade0f070d48043645d7d35ffc4586447 100644 (file)
@@ -82,6 +82,8 @@
 #define GET_MESSAGE_BIT_TRANSMIT_TO 4
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Message sent between peers asking for FS-content.
  */
@@ -161,7 +163,7 @@ struct MigrationStopMessage
   struct GNUNET_TIME_RelativeNBO duration;
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * A connected peer.
index f7d34233cba2d6b2d103280b3586aab9d0c38e8b..7aa9740089a8280b84ae0a36c8600a7ece50a089 100644 (file)
@@ -28,6 +28,8 @@
 #include "gnunet_protocols.h"
 #include "gnunet_util_lib.h"
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * A HELLO message is used to exchange information about
  * transports with other peers.  This struct is always
@@ -59,7 +61,7 @@ struct GNUNET_HELLO_Message
   struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded publicKey;
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * Copy the given address information into
index b10f124d4a57f4c427125961155bbbb46cc65bf0..0eedb56b16e8f81b54b172d6a6f184e0629e773f 100644 (file)
@@ -99,6 +99,8 @@ static GNUNET_CORE_ConnectEventHandler client_ch;
  */
 static GNUNET_CORE_DisconnectEventHandler client_dh;
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * A HOSTLIST_ADV message is used to exchange information about
  * hostlist advertisements.  This struct is always
@@ -123,7 +125,7 @@ struct GNUNET_HOSTLIST_ADV_Message
    */
   uint32_t reserved GNUNET_PACKED;
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 static struct GNUNET_PeerIdentity me;
 
index 1c01754de8e0bc524841b1584d2c88a0f249d8ec..21dcc7acbf5e141dcbc1f033c41cd64d5b497414 100644 (file)
@@ -13,6 +13,7 @@ enum GNUNET_DNS_ServiceTypes
   GNUNET_DNS_SERVICE_TYPE_TCP = 2
 };
 
+GNUNET_NETWORK_STRUCT_BEGIN
 
 /**
  * This is the structure describing an dns-record such as www.gnunet.
@@ -57,5 +58,6 @@ struct GNUNET_DNS_Record
    */
   uint32_t service_type GNUNET_PACKED;
 };
+GNUNET_NETWORK_STRUCT_END
 
 #endif
index 9dc22e57f872530a2821ad49bc7ee0a2d95e42a7..aae741e60b13ee827147cfa9d0683f846f13cca7 100644 (file)
@@ -139,6 +139,8 @@ struct NBlock
 };
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * @brief index block (indexing a DBlock that
  *        can be obtained directly from reading
@@ -160,6 +162,6 @@ struct OnDemandBlock
   uint64_t offset GNUNET_PACKED;
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 #endif
index 898857af840de31a49e8832b28e0e7db98f327d4..88cab0d9bd427035f798eb513c0d55e413678675 100644 (file)
@@ -403,6 +403,8 @@ enum GNUNET_ATS_Property
 };
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * struct used to communicate the transport's properties like cost and
  * quality of service as well as high-level constraints on resource
@@ -433,7 +435,7 @@ struct GNUNET_ATS_Information
    */
   uint32_t value GNUNET_PACKED;
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 
 /* ******************************** Scheduling API ***************************** */
index 75f71b32c9b7111b7eb32fd2d0cef17549635345..fabe47bea53e27fb4bb19b32a89061753a736452 100644 (file)
@@ -38,6 +38,8 @@ extern "C"
 #include "gnunet_common.h"
 #include "gnunet_time_lib.h"
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * 32-bit bandwidth used for network exchange by GNUnet, in bytes per second.
  */
@@ -48,7 +50,7 @@ struct GNUNET_BANDWIDTH_Value32NBO
    */
   uint32_t value__ GNUNET_PACKED;
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * Struct to track available bandwidth.  Combines a time stamp with a
index 665697a976ed4e382dd7a0485d6be369d4eaa7f5..134543c46486488b271e5a32fb1e21e3013d7268 100644 (file)
  */
 #define GNUNET_UNUSED __attribute__((unused))
 
+#if __GNUC__ > 3
+/**
+ * gcc 4.x-ism to pack structures even on W32 (to be used before structs)
+ */
+#define GNUNET_NETWORK_STRUCT_BEGIN \
+  _Pragma("pack(push)") \
+  _Pragma("pack(1)")
+
+/**
+ * gcc 4.x-ism to pack structures even on W32 (to be used after structs)
+ */
+#define GNUNET_NETWORK_STRUCT_END _Pragma("pack(pop)")
+#else
+#ifdef MINGW
+#error gcc 4.x or higher required on W32 systems
+#endif
+/**
+ * Good luck, GNUNET_PACKED should suffice, but this won't work on W32
+ */
+#define GNUNET_NETWORK_STRUCT_BEGIN 
+
+/**
+ * Good luck, GNUNET_PACKED should suffice, but this won't work on W32
+ */
+#define GNUNET_NETWORK_STRUCT_END
+#endif
 
 /* ************************ super-general types *********************** */
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Header for all communications.
  */
@@ -137,7 +165,7 @@ struct GNUNET_MessageHeader
   uint16_t type GNUNET_PACKED;
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * @brief 512-bit hashcode
@@ -149,6 +177,8 @@ typedef struct
 GNUNET_HashCode;
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * The identity of the host (basically the SHA-512 hashcode of
  * it's public key).
@@ -157,7 +187,7 @@ struct GNUNET_PeerIdentity
 {
   GNUNET_HashCode hashPubKey GNUNET_PACKED;
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * Function called with a filename.
index 53137c1792a63bf6838ca0584ff94ab0890b85e6..76806d43282653a0e8fb7c4b2a14b6ad294c0635 100644 (file)
@@ -121,6 +121,8 @@ struct GNUNET_CRYPTO_RsaSignature
 };
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * @brief header of what an RSA signature signs
  *        this must be followed by "size - 8" bytes of
@@ -197,7 +199,7 @@ struct GNUNET_CRYPTO_AesSessionKey
    */
   uint32_t crc32 GNUNET_PACKED;
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * @brief IV for sym cipher
index f8afdae415874cd9c89125815586516c536321bc..7090c33a1e4102c75ff849f7d3e9167a57c29ed6 100644 (file)
@@ -61,6 +61,7 @@ struct GNUNET_TIME_Relative
   uint64_t rel_value;
 };
 
+GNUNET_NETWORK_STRUCT_BEGIN
 
 /**
  * Time for relative time used by GNUnet, in milliseconds and in network byte order.
@@ -84,7 +85,7 @@ struct GNUNET_TIME_AbsoluteNBO
    */
   uint64_t abs_value__ GNUNET_PACKED;
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * Relative time zero.
index fcddb2eb92e54955cd8c93c4697f950e937dcaf3..d8fc404e19462433a6a6180b523afaddb9810f5b 100644 (file)
@@ -85,6 +85,8 @@
 /**************************        MESSAGES      ******************************/
 /******************************************************************************/
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Message for a client to register to the service
  */
@@ -209,7 +211,7 @@ struct GNUNET_MESH_ConnectPeerByType
    */
   GNUNET_MESH_ApplicationType type GNUNET_PACKED;
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /******************************************************************************/
 /************************        ENUMERATIONS      ****************************/
index b6c7f1b24a9322f0b82698e9cf4c622ab37a2bb3..885f1f3446bf1a07f9aa001abb8a81a7511f0b8b 100644 (file)
@@ -39,6 +39,8 @@ extern "C"
 /********************      MESH NETWORK MESSAGES     **************************/
 /******************************************************************************/
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Message for mesh path management
  */
@@ -276,6 +278,7 @@ struct GNUNET_MESH_SpeedNotify
   uint32_t speed_min;
 
 };
+GNUNET_NETWORK_STRUCT_END
 
 #if 0                           /* keep Emacsens' auto-indent happy */
 {
index a32fe0908a39005eba6fb3db7a8b37f5f0eaa693..efab3a7a7761922afc268b796d77f173d69a7f0a 100644 (file)
@@ -30,6 +30,8 @@
 
 #define DEBUG_NAT GNUNET_EXTRA_LOGGING
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Request to test NAT traversal.
  */
@@ -61,5 +63,6 @@ struct GNUNET_NAT_TestMessage
   int32_t is_tcp;
 
 };
+GNUNET_NETWORK_STRUCT_END
 
 #endif
index 7c3f14273250a3d01ce57346da3eda4ff6a99e95..d37ecd941c6f85e485c70e40db06cb252837975f 100644 (file)
@@ -128,6 +128,8 @@ struct NSEPeerEntry
 };
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Network size estimate reply; sent when "this"
  * peer's timer has run out before receiving a
@@ -178,7 +180,7 @@ struct GNUNET_NSE_FloodMessage
    */
   struct GNUNET_CRYPTO_RsaSignature signature;
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * Handle to our current configuration.
index 91b629657c0829dddfd2300feca5cc233853e3d7..2123e3996f7da5c1d377f58159d5c6007b725293 100644 (file)
@@ -35,6 +35,8 @@
  */
 #define DEBUG_NSE GNUNET_EXTRA_LOGGING
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Network size estimate sent from the service
  * to clients.  Contains the current size estimate
@@ -71,6 +73,6 @@ struct GNUNET_NSE_ClientMessage
    */
   double std_deviation GNUNET_PACKED;
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 #endif
index 992dde782eab44ea4b7bee772ac9eed3a8934dca..bf5677477cc66e9531738e7b5929e38eb6d5d72a 100644 (file)
@@ -29,6 +29,8 @@
 
 #define DEBUG_PEERINFO GNUNET_EXTRA_LOGGING
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Message requesting a listing of all known peers,
  * possibly restricted to the specified peer identity.
@@ -81,6 +83,6 @@ struct InfoMessage
   struct GNUNET_PeerIdentity peer;
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /* end of peerinfo.h */
index a65dff1478dc295d5d130d27a028128a2958b663..3fcac275ad7caa6b71107b42d51b0deb28d4e892 100644 (file)
@@ -29,6 +29,8 @@
 
 #define DEBUG_STATISTICS GNUNET_EXTRA_LOGGING
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Statistics message. Contains how long the system is up
  * and one value.
@@ -128,6 +130,6 @@ struct GNUNET_STATISTICS_WatchValueMessage
   uint64_t value GNUNET_PACKED;
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 #endif
index 08b1df5b999a001fb4cf80648abd30db2d5c33d3..e966ca1370b8e8b45369193270cce4ebe39419fc 100644 (file)
@@ -107,6 +107,8 @@ static char *test_directory;
 
 #define MTYPE 12345
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 struct GNUNET_TestMessage
 {
   /**
@@ -119,6 +121,7 @@ struct GNUNET_TestMessage
    */
   uint32_t uid;
 };
+GNUNET_NETWORK_STRUCT_END
 
 struct TestMessageContext
 {
index f60ac3a1a2f4ce4d4ff786ba8f659745438ffa03..7d0c0da5fe86c4849b3aee0bd8cd7107df889dec 100644 (file)
@@ -115,6 +115,8 @@ static char *test_directory;
 
 #define MTYPE 12345
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 struct GNUNET_TestMessage
 {
   /**
@@ -127,6 +129,7 @@ struct GNUNET_TestMessage
    */
   uint32_t uid;
 };
+GNUNET_NETWORK_STRUCT_END
 
 struct TestMessageContext
 {
index d45d1bbb468240a43ac4c6b36c64469f56f14787..095c5b2a2330fb204a8de37a4103ef6d38ad2bf6 100644 (file)
@@ -85,6 +85,8 @@ static char *test_directory;
 
 #define MTYPE 12345
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 struct GNUNET_TestMessage
 {
   /**
@@ -97,7 +99,7 @@ struct GNUNET_TestMessage
    */
   uint32_t uid;
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * Check whether peers successfully shut down.
index 5a348642cd2ff29ac70e4ffbc02bae2826f267b3..36120893b1342e77040b63b5c40c9808f582b647 100644 (file)
@@ -59,6 +59,8 @@ static char *test_directory;
 
 #define MTYPE 12345
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 struct GNUNET_TestMessage
 {
   /**
@@ -71,6 +73,7 @@ struct GNUNET_TestMessage
    */
   uint32_t uid;
 };
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * Check whether peers successfully shut down.
index fcdd9d5207fca83b078d110e1e3f4bbe04680e54..72314beb231e9523f1abee91c1dbb87f99ec37e9 100644 (file)
@@ -328,6 +328,7 @@ struct SendBuffer
   char buf[MAXLINE * 2];
 };
 
+GNUNET_NETWORK_STRUCT_BEGIN
 
 /**
  * generic definitions for IEEE 802.11 frames
@@ -343,7 +344,7 @@ struct ieee80211_frame
   /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */
   /* see below */
 } GNUNET_PACKED;
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * struct for storing the information of the hardware
index aaeefe8d49a83a260ec5e6404876ba1514c1ea80..5c749d71700d32d058c4e0351828d50bd0b33b62 100644 (file)
@@ -69,6 +69,8 @@
  */
 struct NeighbourMapEntry;
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Message a peer sends to another to indicate its
  * preference for communicating via a particular
@@ -133,7 +135,7 @@ struct SessionDisconnectMessage
   struct GNUNET_CRYPTO_RsaSignature signature;
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * For each neighbour we keep a list of messages
index 559589576b9e514b43814a90f4a4d6432773490a..17fc5edc6a88689a6eb32eb6ad07d9c2bf7754b7 100644 (file)
@@ -92,6 +92,8 @@
 #define PONG_PRIORITY 4
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Message used to ask a peer to validate receipt (to check an address
  * from a HELLO).  Followed by the address we are trying to validate,
@@ -166,7 +168,7 @@ struct TransportPongMessage
   uint32_t addrlen GNUNET_PACKED;
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * Information about an address under validation
index 2096afaeea40ed02231dc2c11afdbf75d72d34f6..9f06b63b46782a3766462caed37a438555be0b4b 100644 (file)
@@ -46,6 +46,7 @@
 #define IEEE80211_FC0_TYPE_CTL                  0x04
 #define IEEE80211_FC0_TYPE_DATA                 0x08
 
+GNUNET_NETWORK_STRUCT_BEGIN
 
 /*
  * generic definitions for IEEE 802.11 frames
@@ -60,7 +61,7 @@ struct ieee80211_frame
   u_int8_t i_seq[2];
   u_int8_t llc[4];
 } GNUNET_PACKED;
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * function to fill the radiotap header
index 84a92c28426489f464777c971ed363032d440d66..9e16e93c827160b6dd062c43f670444cbdbb9546 100644 (file)
@@ -260,6 +260,8 @@ struct Plugin
 
 };
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * IPv4 addresses
  */
@@ -291,7 +293,7 @@ struct IPv6HttpAddress
    */
   uint16_t u6_port GNUNET_PACKED;
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * Session handle for connections.
index fa11a9b6d3d93c9036f470682462bdcf16b87d72..b589e117786b61ae6e49e1b7149f4609c02511ca 100644 (file)
@@ -72,6 +72,8 @@ typedef struct
 
 } EmailAddress;
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Encapsulation of a GNUnet message in the SMTP mail body (before
  * base64 encoding).
@@ -86,6 +88,7 @@ typedef struct
   GNUNET_PeerIdentity sender;
 
 } SMTPMessage;
+GNUNET_NETWORK_STRUCT_END
 
 /* *********** globals ************* */
 
index 1024b800804fc9738310677cb91cd9236fcbf20e..e79440e5e59a368fe41657d4650c6df59a68e08a 100644 (file)
@@ -43,6 +43,8 @@
 
 #define DEBUG_TCP_NAT GNUNET_EXTRA_LOGGING
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Initial handshake message for a session.
  */
@@ -78,7 +80,7 @@ struct TCP_NAT_ProbeMessage
   struct GNUNET_PeerIdentity clientIdentity;
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * Context for sending a NAT probe via TCP.
@@ -118,6 +120,8 @@ struct TCPProbeContext
 };
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Network format for IPv4 addresses.
  */
@@ -152,7 +156,7 @@ struct IPv6TcpAddress
   uint16_t t6_port GNUNET_PACKED;
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * Encapsulation of all of the state of the plugin.
index 04ec108aa2d4052f8b717f4a74680ef9ef2ff66c..1654558567c9b535d0a493b79fffe87b8cb53eb9 100644 (file)
@@ -70,6 +70,8 @@
 #define UDP_MAX_SENDER_ADDRESSES_WITH_DEFRAG 128
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * UDP Message-Packet header (after defragmentation).
  */
@@ -92,7 +94,6 @@ struct UDPMessage
 
 };
 
-
 /**
  * UDP ACK Message-Packet header (after defragmentation).
  */
@@ -162,7 +163,7 @@ struct IPv6UdpAddress
    */
   uint16_t u6_port GNUNET_PACKED;
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /* Forward definition */
 struct Plugin;
index 7eb4cbe87565fbd572eeb91b2bf3c166ff32db5f..e6b7fe18ffa33efab8b799ecfc62b350806af623 100644 (file)
@@ -70,6 +70,8 @@
 #define UDP_MAX_SENDER_ADDRESSES_WITH_DEFRAG 128
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * UDP Message-Packet header (after defragmentation).
  */
@@ -148,7 +150,7 @@ struct IPv6UdpAddress
    */
   uint16_t u6_port GNUNET_PACKED;
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /* Forward definition */
 struct Plugin;
index 5f6c967f295f1985d54da174ced76edcde26afe2..aebfeb883f2d6f142fd77b9a7a22e495a5a8e2e7 100644 (file)
@@ -64,6 +64,8 @@
  */
 #define UNIX_NAT_DEFAULT_PORT 22086
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * UNIX Message-Packet header.
  */
@@ -131,6 +133,7 @@ struct IPv6UdpAddress
    */
   uint16_t u6_port GNUNET_PACKED;
 };
+GNUNET_NETWORK_STRUCT_END
 
 /* Forward definition */
 struct Plugin;
index 4c4e9f1ab3bf192d79d855a1ac3c1f6fff9f1631..d121ec9be1491e3b574c2c823acb638a42708082 100644 (file)
 #define IEEE80211_FC0_TYPE_CTL                  0x04
 #define IEEE80211_FC0_TYPE_DATA                 0x08
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /*
  * generic definitions for IEEE 802.11 frames
  */
@@ -133,6 +135,7 @@ struct ieee80211_frame
   u_int8_t i_seq[2];
   u_int8_t llc[4];
 } GNUNET_PACKED;
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * Encapsulation of all of the state of the plugin.
@@ -361,6 +364,8 @@ struct Plugin_Session_pair
 };
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Header for messages which need fragmentation
  */
@@ -388,7 +393,7 @@ struct WlanHeader
 // followed by payload
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * Information kept for each message that is yet to
index 35b23fd44feadf1b85c29e5854bcb0faee97102b..b0b8b966a7fd1719c2e54987dbf2272b04fefe3a 100644 (file)
@@ -43,6 +43,8 @@ struct MacAddress
 };
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Format of a WLAN Control Message.
  */
@@ -58,7 +60,7 @@ struct GNUNET_TRANSPORT_WLAN_HelperControlMessage
    */
   struct MacAddress mac;
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * GNUnet bssid
index 1742dd0d39b012bcfa9c1c4f27e1775e1e06d18a..5d9cfff1930f98884add51ccad0e093440784551 100644 (file)
@@ -104,11 +104,14 @@ static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
 
 #define MTYPE 12345
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 struct TestMessage
 {
   struct GNUNET_MessageHeader header;
   uint32_t num;
 };
+GNUNET_NETWORK_STRUCT_END
 
 static int msg_scheduled;
 static int msg_sent;
index 15fc4f6b9e90c1b790a0b210300233cfe83bd93f..ac360a3ea15f5d74a0803ba851da8631094fed22 100644 (file)
@@ -97,11 +97,14 @@ static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
 
 #define MTYPE 12345
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 struct TestMessage
 {
   struct GNUNET_MessageHeader header;
   uint32_t num;
 };
+GNUNET_NETWORK_STRUCT_END
 
 static int msg_scheduled;
 static int msg_sent;
index e52b20f7c3ff80ef664674a0f23eb2b332fce698..2120f704464cece8a73d8d717fa878247dd4f769 100644 (file)
@@ -93,11 +93,14 @@ struct GNUNET_TRANSPORT_TESTING_handle *tth;
 
 #define MTYPE 12345
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 struct TestMessage
 {
   struct GNUNET_MessageHeader header;
   uint32_t num;
 };
+GNUNET_NETWORK_STRUCT_END
 
 static char *test_name;
 
index 414bca7c8308b6fef6f4fbb5fb439561a063bc1e..3770ebfdb8ed69e4db79bcd4af3cf1349919c943 100644 (file)
@@ -97,11 +97,14 @@ static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
 
 #define MSG_SIZE 10000
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 struct TestMessage
 {
   struct GNUNET_MessageHeader header;
   uint32_t num;
 };
+GNUNET_NETWORK_STRUCT_END
 
 static char *test_name;
 
index d2792b92df51ca42f00b1bdc19bbcbdf1e105a70..ff6818813f318213a06f766693e5a8bb51582b27 100644 (file)
@@ -61,6 +61,8 @@
  */
 #define CONNECTED_LATENCY_EVALUATION_MAX_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1)
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Message from the transport service to the library
  * asking to check if both processes agree about this
@@ -430,7 +432,7 @@ struct BlacklistMessage
   struct GNUNET_PeerIdentity peer;
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /* end of transport.h */
 #endif
index 60639a709e7b5344297b48c918932aede6733bf1..0f5a2950709a0a464761edd94a2904665245d44b 100644 (file)
@@ -463,6 +463,7 @@ generate_kblock_key (KBlock_secret_key *sk, unsigned int nbits,
   gcry_mpi_release (g);
 }
 
+GNUNET_NETWORK_STRUCT_BEGIN
 
 /**
  * Internal representation of the private key.
@@ -482,7 +483,7 @@ struct KskRsaPrivateKeyBinaryEncoded
   uint16_t sizedmq1 GNUNET_PACKED;      /*  in big-endian! */
   /* followed by the actual values */
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * Deterministically (!) create a hostkey using only the
index d29566ac8e909b8f9f1b8690c54cb28f10d6d8c8..418fe833ba238b1f6d6e84dd74241d4c14cb77d5 100644 (file)
@@ -53,6 +53,8 @@ struct GNUNET_CRYPTO_RsaPrivateKey
 };
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * GNUnet mandates a certain format for the encoding
  * of private RSA key information that is provided
@@ -75,7 +77,7 @@ struct RsaPrivateKeyBinaryEncoded
   uint16_t sizedmq1 GNUNET_PACKED;      /*  in big-endian! */
   /* followed by the actual values */
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 #define HOSTKEY_LEN 2048
 
index 57cb68650786f5cb656d7733c1802624cecd98ad..eca753a5524593670b070731f9ca79ff53e9ab54 100644 (file)
@@ -29,6 +29,8 @@
 
 #define DEBUG_RESOLVER GNUNET_EXTRA_LOGGING
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Request for the resolver.  Followed by either
  * the "struct sockaddr" or the 0-terminated hostname.
@@ -59,5 +61,6 @@ struct GNUNET_RESOLVER_GetMessage
   int32_t domain GNUNET_PACKED;
 
 };
+GNUNET_NETWORK_STRUCT_END
 
 #endif
index 0519b1f8472aecdeb3f385b186e4043f811f09a9..632145ae2fc98dc3bf7c073216c5d41f56ce2868 100644 (file)
@@ -3,6 +3,8 @@
 
 #include "gnunet_common.h"
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 struct query_packet
 {
   struct GNUNET_MessageHeader hdr;
@@ -109,5 +111,6 @@ struct answer_packet_list
   struct GNUNET_SERVER_Client *client;
   struct answer_packet pkt;
 };
+GNUNET_NETWORK_STRUCT_END
 
 #endif
index 6ef621c26da7856c2383ff3b4a66800184a8038b..12d0a93cf8f730525145e395db285ce3c36cbc25 100644 (file)
@@ -287,12 +287,15 @@ send_answer (void *cls, size_t size, void *buf)
   return len;
 }
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 struct tunnel_cls
 {
   struct GNUNET_MESH_Tunnel *tunnel GNUNET_PACKED;
   struct GNUNET_MessageHeader hdr;
   struct dns_pkt dns;
 };
+GNUNET_NETWORK_STRUCT_END
 
 struct tunnel_cls *remote_pending[UINT16_MAX];
 
index e2082f9a1f88e026a482bfefc6960749edc20bc5..9cbbf1bb2c8a61f3495d52edc697651b1995677d 100644 (file)
@@ -4,6 +4,8 @@
 #include "platform.h"
 #include "gnunet_common.h"
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 // Headers
 struct pkt_tun
 {
@@ -100,6 +102,7 @@ struct dns_static
   uint16_t nscount GNUNET_PACKED;       // number of authority-records
   uint16_t arcount GNUNET_PACKED;       // number of additional records
 };
+GNUNET_NETWORK_STRUCT_END
 
 struct dns_pkt
 {
@@ -156,6 +159,8 @@ struct udp_dns
   struct dns_pkt data;
 };
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 // Complete Packets
 struct tun_pkt
 {
@@ -246,5 +251,6 @@ struct ip_icmp
   struct ip_hdr ip_hdr;
   struct icmp_hdr icmp_hdr;
 };
+GNUNET_NETWORK_STRUCT_END
 
 #endif