*/
#define DEBUG_ARM GNUNET_EXTRA_LOGGING
+GNUNET_NETWORK_STRUCT_BEGIN
/**
* Reply from ARM to client.
*/
uint32_t status;
};
-
+GNUNET_NETWORK_STRUCT_END
#endif
uint64_t state;
};
+GNUNET_NETWORK_STRUCT_BEGIN
+
struct TestMessage
{
struct GNUNET_MessageHeader header;
uint32_t num;
};
+GNUNET_NETWORK_STRUCT_END
static int count;
START_FLAG_PERFORMANCE_NO_PIC = 2
};
+GNUNET_NETWORK_STRUCT_BEGIN
struct ClientStartMessage
{
struct GNUNET_TIME_RelativeNBO res_delay;
};
-
struct PreferenceInformation
{
/* followed by 'num_preferences'
* struct PreferenceInformation values */
};
+GNUNET_NETWORK_STRUCT_END
* 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.
GNUNET_HashCode content;
};
+GNUNET_NETWORK_STRUCT_END
#endif
#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
struct GNUNET_PeerIdentity peer;
};
-
+GNUNET_NETWORK_STRUCT_END
#endif
/* end of core.h */
#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
struct GNUNET_TIME_AbsoluteNBO timestamp;
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* Number of bytes (at the beginning) of "struct EncryptedMessage"
* that are NOT encrypted.
#include "gnunet_util_lib.h"
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* Message from datastore service informing client about
* the current size of the datastore.
GNUNET_HashCode key GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
#define DHT_BLOOM_SIZE 128
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* Message which indicates the DHT should cancel outstanding
* requests and discard any state.
/* DATA copied to end of this message */
};
-
+GNUNET_NETWORK_STRUCT_END
#endif
#define GET_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 2)
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* P2P PUT message
*/
/* result bloomfilter */
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* Linked list of messages to send to a particular other peer.
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.
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,
#define MTYPE 12345
+GNUNET_NETWORK_STRUCT_BEGIN
+
struct GNUNET_TestMessage
{
/**
*/
uint32_t uid;
};
+GNUNET_NETWORK_STRUCT_END
struct PeerContext
{
#include "platform.h"
#include "gnunet_fragmentation_lib.h"
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* Header for a message fragment. Followed by the
* original message.
uint64_t bits;
};
-
+GNUNET_NETWORK_STRUCT_END
#endif
};
+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
/* this is followed by the actual encrypted content */
};
-
+GNUNET_NETWORK_STRUCT_END
#endif
#define GET_MESSAGE_BIT_TRANSMIT_TO 4
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* Message sent between peers asking for FS-content.
*/
struct GNUNET_TIME_RelativeNBO duration;
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* A connected peer.
#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
struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded publicKey;
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* Copy the given address information into
*/
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
*/
uint32_t reserved GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
static struct GNUNET_PeerIdentity me;
GNUNET_DNS_SERVICE_TYPE_TCP = 2
};
+GNUNET_NETWORK_STRUCT_BEGIN
/**
* This is the structure describing an dns-record such as www.gnunet.
*/
uint32_t service_type GNUNET_PACKED;
};
+GNUNET_NETWORK_STRUCT_END
#endif
};
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* @brief index block (indexing a DBlock that
* can be obtained directly from reading
uint64_t offset GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
#endif
};
+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
*/
uint32_t value GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
/* ******************************** Scheduling API ***************************** */
#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.
*/
*/
uint32_t value__ GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* Struct to track available bandwidth. Combines a time stamp with a
*/
#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.
*/
uint16_t type GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* @brief 512-bit hashcode
GNUNET_HashCode;
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* The identity of the host (basically the SHA-512 hashcode of
* it's public key).
{
GNUNET_HashCode hashPubKey GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* Function called with a filename.
};
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* @brief header of what an RSA signature signs
* this must be followed by "size - 8" bytes of
*/
uint32_t crc32 GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* @brief IV for sym cipher
uint64_t rel_value;
};
+GNUNET_NETWORK_STRUCT_BEGIN
/**
* Time for relative time used by GNUnet, in milliseconds and in network byte order.
*/
uint64_t abs_value__ GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* Relative time zero.
/************************** MESSAGES ******************************/
/******************************************************************************/
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* Message for a client to register to the service
*/
*/
GNUNET_MESH_ApplicationType type GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
/******************************************************************************/
/************************ ENUMERATIONS ****************************/
/******************** MESH NETWORK MESSAGES **************************/
/******************************************************************************/
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* Message for mesh path management
*/
uint32_t speed_min;
};
+GNUNET_NETWORK_STRUCT_END
#if 0 /* keep Emacsens' auto-indent happy */
{
#define DEBUG_NAT GNUNET_EXTRA_LOGGING
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* Request to test NAT traversal.
*/
int32_t is_tcp;
};
+GNUNET_NETWORK_STRUCT_END
#endif
};
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* Network size estimate reply; sent when "this"
* peer's timer has run out before receiving a
*/
struct GNUNET_CRYPTO_RsaSignature signature;
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* Handle to our current configuration.
*/
#define DEBUG_NSE GNUNET_EXTRA_LOGGING
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* Network size estimate sent from the service
* to clients. Contains the current size estimate
*/
double std_deviation GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
#endif
#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.
struct GNUNET_PeerIdentity peer;
};
-
+GNUNET_NETWORK_STRUCT_END
/* end of peerinfo.h */
#define DEBUG_STATISTICS GNUNET_EXTRA_LOGGING
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* Statistics message. Contains how long the system is up
* and one value.
uint64_t value GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
#endif
#define MTYPE 12345
+GNUNET_NETWORK_STRUCT_BEGIN
+
struct GNUNET_TestMessage
{
/**
*/
uint32_t uid;
};
+GNUNET_NETWORK_STRUCT_END
struct TestMessageContext
{
#define MTYPE 12345
+GNUNET_NETWORK_STRUCT_BEGIN
+
struct GNUNET_TestMessage
{
/**
*/
uint32_t uid;
};
+GNUNET_NETWORK_STRUCT_END
struct TestMessageContext
{
#define MTYPE 12345
+GNUNET_NETWORK_STRUCT_BEGIN
+
struct GNUNET_TestMessage
{
/**
*/
uint32_t uid;
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* Check whether peers successfully shut down.
#define MTYPE 12345
+GNUNET_NETWORK_STRUCT_BEGIN
+
struct GNUNET_TestMessage
{
/**
*/
uint32_t uid;
};
+GNUNET_NETWORK_STRUCT_END
/**
* Check whether peers successfully shut down.
char buf[MAXLINE * 2];
};
+GNUNET_NETWORK_STRUCT_BEGIN
/**
* generic definitions for IEEE 802.11 frames
/* possibly followed by addr4[IEEE80211_ADDR_LEN]; */
/* see below */
} GNUNET_PACKED;
-
+GNUNET_NETWORK_STRUCT_END
/**
* struct for storing the information of the hardware
*/
struct NeighbourMapEntry;
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* Message a peer sends to another to indicate its
* preference for communicating via a particular
struct GNUNET_CRYPTO_RsaSignature signature;
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* For each neighbour we keep a list of messages
#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,
uint32_t addrlen GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* Information about an address under validation
#define IEEE80211_FC0_TYPE_CTL 0x04
#define IEEE80211_FC0_TYPE_DATA 0x08
+GNUNET_NETWORK_STRUCT_BEGIN
/*
* generic definitions for IEEE 802.11 frames
u_int8_t i_seq[2];
u_int8_t llc[4];
} GNUNET_PACKED;
-
+GNUNET_NETWORK_STRUCT_END
/**
* function to fill the radiotap header
};
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* IPv4 addresses
*/
*/
uint16_t u6_port GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* Session handle for connections.
} EmailAddress;
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* Encapsulation of a GNUnet message in the SMTP mail body (before
* base64 encoding).
GNUNET_PeerIdentity sender;
} SMTPMessage;
+GNUNET_NETWORK_STRUCT_END
/* *********** globals ************* */
#define DEBUG_TCP_NAT GNUNET_EXTRA_LOGGING
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* Initial handshake message for a session.
*/
struct GNUNET_PeerIdentity clientIdentity;
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* Context for sending a NAT probe via TCP.
};
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* Network format for IPv4 addresses.
*/
uint16_t t6_port GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* Encapsulation of all of the state of the plugin.
#define UDP_MAX_SENDER_ADDRESSES_WITH_DEFRAG 128
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* UDP Message-Packet header (after defragmentation).
*/
};
-
/**
* UDP ACK Message-Packet header (after defragmentation).
*/
*/
uint16_t u6_port GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
/* Forward definition */
struct Plugin;
#define UDP_MAX_SENDER_ADDRESSES_WITH_DEFRAG 128
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* UDP Message-Packet header (after defragmentation).
*/
*/
uint16_t u6_port GNUNET_PACKED;
};
-
+GNUNET_NETWORK_STRUCT_END
/* Forward definition */
struct Plugin;
*/
#define UNIX_NAT_DEFAULT_PORT 22086
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* UNIX Message-Packet header.
*/
*/
uint16_t u6_port GNUNET_PACKED;
};
+GNUNET_NETWORK_STRUCT_END
/* Forward definition */
struct Plugin;
#define IEEE80211_FC0_TYPE_CTL 0x04
#define IEEE80211_FC0_TYPE_DATA 0x08
+GNUNET_NETWORK_STRUCT_BEGIN
+
/*
* generic definitions for IEEE 802.11 frames
*/
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.
};
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* Header for messages which need fragmentation
*/
// followed by payload
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* Information kept for each message that is yet to
};
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* Format of a WLAN Control Message.
*/
*/
struct MacAddress mac;
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* GNUnet bssid
#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;
#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;
#define MTYPE 12345
+GNUNET_NETWORK_STRUCT_BEGIN
+
struct TestMessage
{
struct GNUNET_MessageHeader header;
uint32_t num;
};
+GNUNET_NETWORK_STRUCT_END
static char *test_name;
#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;
*/
#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
struct GNUNET_PeerIdentity peer;
};
-
+GNUNET_NETWORK_STRUCT_END
/* end of transport.h */
#endif
gcry_mpi_release (g);
}
+GNUNET_NETWORK_STRUCT_BEGIN
/**
* Internal representation of the private key.
uint16_t sizedmq1 GNUNET_PACKED; /* in big-endian! */
/* followed by the actual values */
};
-
+GNUNET_NETWORK_STRUCT_END
/**
* Deterministically (!) create a hostkey using only the
};
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* GNUnet mandates a certain format for the encoding
* of private RSA key information that is provided
uint16_t sizedmq1 GNUNET_PACKED; /* in big-endian! */
/* followed by the actual values */
};
-
+GNUNET_NETWORK_STRUCT_END
#define HOSTKEY_LEN 2048
#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.
int32_t domain GNUNET_PACKED;
};
+GNUNET_NETWORK_STRUCT_END
#endif
#include "gnunet_common.h"
+GNUNET_NETWORK_STRUCT_BEGIN
+
struct query_packet
{
struct GNUNET_MessageHeader hdr;
struct GNUNET_SERVER_Client *client;
struct answer_packet pkt;
};
+GNUNET_NETWORK_STRUCT_END
#endif
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];
#include "platform.h"
#include "gnunet_common.h"
+GNUNET_NETWORK_STRUCT_BEGIN
+
// Headers
struct pkt_tun
{
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
{
struct dns_pkt data;
};
+GNUNET_NETWORK_STRUCT_BEGIN
+
// Complete Packets
struct tun_pkt
{
struct ip_hdr ip_hdr;
struct icmp_hdr icmp_hdr;
};
+GNUNET_NETWORK_STRUCT_END
#endif