aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-12-21 09:40:15 +0000
committerChristian Grothoff <christian@grothoff.org>2011-12-21 09:40:15 +0000
commitc4f0fe3ea5a5ca3ce1f7dfecef719da631e4c6ac (patch)
tree02e313a83c4416f07fadf650d33aff09dfe46130 /src/transport
parent40e5092e9a5db88b4c9b62cb341596fbf6ce1cf8 (diff)
downloadgnunet-c4f0fe3ea5a5ca3ce1f7dfecef719da631e4c6ac.tar.gz
gnunet-c4f0fe3ea5a5ca3ce1f7dfecef719da631e4c6ac.zip
fixing 2012: network structure alignment now forced to be correct even on W32 using #pragma pack from gcc 4.x
Diffstat (limited to 'src/transport')
-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
17 files changed, 55 insertions, 13 deletions
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