block_dns.h | block_dns.h | |||
---|---|---|---|---|
skipping to change at line 16 | skipping to change at line 16 | |||
/** | /** | |||
* Bitmask describing what IP-protocols are supported by the service | * Bitmask describing what IP-protocols are supported by the service | |||
*/ | */ | |||
enum GNUNET_DNS_ServiceTypes | enum GNUNET_DNS_ServiceTypes | |||
{ | { | |||
GNUNET_DNS_SERVICE_TYPE_UDP = 1, | GNUNET_DNS_SERVICE_TYPE_UDP = 1, | |||
GNUNET_DNS_SERVICE_TYPE_TCP = 2 | GNUNET_DNS_SERVICE_TYPE_TCP = 2 | |||
}; | }; | |||
GNUNET_NETWORK_STRUCT_BEGIN | ||||
/** | /** | |||
* This is the structure describing an dns-record such as www.gnunet. | * This is the structure describing an dns-record such as www.gnunet. | |||
*/ | */ | |||
struct GNUNET_DNS_Record | struct GNUNET_DNS_Record | |||
{ | { | |||
/** | /** | |||
* Signature of the peer affirming that he is offering the service. | * Signature of the peer affirming that he is offering the service. | |||
*/ | */ | |||
struct GNUNET_CRYPTO_RsaSignature signature; | struct GNUNET_CRYPTO_RsaSignature signature; | |||
skipping to change at line 59 | skipping to change at line 61 | |||
* Four TCP and UDP-Ports that are used by this service, big endian forma t | * Four TCP and UDP-Ports that are used by this service, big endian forma t | |||
*/ | */ | |||
uint64_t ports GNUNET_PACKED; | uint64_t ports GNUNET_PACKED; | |||
/** | /** | |||
* What connection-types (UDP, TCP, ...) are supported by the service. | * What connection-types (UDP, TCP, ...) are supported by the service. | |||
* Contains an 'enum GNUNET_DNS_ServiceTypes' in big endian format. | * Contains an 'enum GNUNET_DNS_ServiceTypes' in big endian format. | |||
*/ | */ | |||
uint32_t service_type GNUNET_PACKED; | uint32_t service_type GNUNET_PACKED; | |||
}; | }; | |||
GNUNET_NETWORK_STRUCT_END | ||||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added | |||
block_fs.h | block_fs.h | |||
---|---|---|---|---|
skipping to change at line 139 | skipping to change at line 139 | |||
struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded subspace; | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded subspace; | |||
/* from here on, data is encrypted with H(keyword) */ | /* from here on, data is encrypted with H(keyword) */ | |||
/* 0-terminated root identifier here */ | /* 0-terminated root identifier here */ | |||
/* variable-size Meta-Data follows here */ | /* variable-size Meta-Data follows here */ | |||
}; | }; | |||
GNUNET_NETWORK_STRUCT_BEGIN | ||||
/** | /** | |||
* @brief index block (indexing a DBlock that | * @brief index block (indexing a DBlock that | |||
* can be obtained directly from reading | * can be obtained directly from reading | |||
* the plaintext file) | * the plaintext file) | |||
*/ | */ | |||
struct OnDemandBlock | struct OnDemandBlock | |||
{ | { | |||
/** | /** | |||
* Hash code of the entire content of the | * Hash code of the entire content of the | |||
* file that was indexed (used to uniquely | * file that was indexed (used to uniquely | |||
skipping to change at line 160 | skipping to change at line 162 | |||
*/ | */ | |||
GNUNET_HashCode file_id; | GNUNET_HashCode file_id; | |||
/** | /** | |||
* At which offset should we be able to find | * At which offset should we be able to find | |||
* this on-demand encoded block? (in NBO) | * this on-demand encoded block? (in NBO) | |||
*/ | */ | |||
uint64_t offset GNUNET_PACKED; | uint64_t offset GNUNET_PACKED; | |||
}; | }; | |||
GNUNET_NETWORK_STRUCT_END | ||||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added | |||
gnunet_arm_service.h | gnunet_arm_service.h | |||
---|---|---|---|---|
skipping to change at line 45 | skipping to change at line 45 | |||
#endif | #endif | |||
#endif | #endif | |||
#include "gnunet_configuration_lib.h" | #include "gnunet_configuration_lib.h" | |||
#include "gnunet_scheduler_lib.h" | #include "gnunet_scheduler_lib.h" | |||
#include "gnunet_time_lib.h" | #include "gnunet_time_lib.h" | |||
/** | /** | |||
* Version of the arm API. | * Version of the arm API. | |||
*/ | */ | |||
#define GNUNET_ARM_VERSION 0x00000000 | #define GNUNET_ARM_VERSION 0x00000001 | |||
/** | ||||
* Values characterizing GNUnet process states. | ||||
*/ | ||||
enum GNUNET_ARM_ProcessStatus | ||||
{ | ||||
/** | ||||
* Service name is unknown to ARM. | ||||
*/ | ||||
GNUNET_ARM_PROCESS_UNKNOWN = -1, | ||||
/** | ||||
* Service is now down (due to client request). | ||||
*/ | ||||
GNUNET_ARM_PROCESS_DOWN = 0, | ||||
/** | ||||
* Service is already running. | ||||
*/ | ||||
GNUNET_ARM_PROCESS_ALREADY_RUNNING = 1, | ||||
/** | ||||
* Service is currently being started (due to client request). | ||||
*/ | ||||
GNUNET_ARM_PROCESS_STARTING = 2, | ||||
/** | ||||
* Service is already being stopped by some other client. | ||||
*/ | ||||
GNUNET_ARM_PROCESS_ALREADY_STOPPING = 3, | ||||
/** | ||||
* Service is already down (no action taken) | ||||
*/ | ||||
GNUNET_ARM_PROCESS_ALREADY_DOWN = 4, | ||||
/** | ||||
* ARM is currently being shut down (no more process starts) | ||||
*/ | ||||
GNUNET_ARM_PROCESS_SHUTDOWN = 5, | ||||
/** | ||||
* Error in communication with ARM | ||||
*/ | ||||
GNUNET_ARM_PROCESS_COMMUNICATION_ERROR = 6, | ||||
/** | ||||
* Timeout in communication with ARM | ||||
*/ | ||||
GNUNET_ARM_PROCESS_COMMUNICATION_TIMEOUT = 7, | ||||
/** | ||||
* Failure to perform operation | ||||
*/ | ||||
GNUNET_ARM_PROCESS_FAILURE = 8 | ||||
}; | ||||
/** | /** | |||
* Callback function invoked when operation is complete. | * Callback function invoked when operation is complete. | |||
* | * | |||
* @param cls closure | * @param cls closure | |||
* @param success GNUNET_YES if we think the service is running | * @param result outcome of the operation | |||
* GNUNET_NO if we think the service is stopped | ||||
* GNUNET_SYSERR if we think ARM was not running or | ||||
* if the service status is unknown | ||||
*/ | */ | |||
typedef void (*GNUNET_ARM_Callback) (void *cls, int success); | typedef void (*GNUNET_ARM_Callback) (void *cls, | |||
enum GNUNET_ARM_ProcessStatus result); | ||||
/** | /** | |||
* Handle for interacting with ARM. | * Handle for interacting with ARM. | |||
*/ | */ | |||
struct GNUNET_ARM_Handle; | struct GNUNET_ARM_Handle; | |||
/** | /** | |||
* Setup a context for communicating with ARM. Note that this | * Setup a context for communicating with ARM. Note that this | |||
* can be done even if the ARM service is not yet running. | * can be done even if the ARM service is not yet running. | |||
* | * | |||
End of changes. 3 change blocks. | ||||
6 lines changed or deleted | 60 lines changed or added | |||
gnunet_ats_service.h | gnunet_ats_service.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* @author Christian Grothoff | * @author Christian Grothoff | |||
* @author Matthias Wachs | * @author Matthias Wachs | |||
*/ | */ | |||
#ifndef GNUNET_ATS_SERVICE_H | #ifndef GNUNET_ATS_SERVICE_H | |||
#define GNUNET_ATS_SERVICE_H | #define GNUNET_ATS_SERVICE_H | |||
#include "gnunet_constants.h" | #include "gnunet_constants.h" | |||
#include "gnunet_util_lib.h" | #include "gnunet_util_lib.h" | |||
#include "gnunet_hello_lib.h" | #include "gnunet_hello_lib.h" | |||
enum GNUNET_ATS_Network_Type | ||||
{ | ||||
GNUNET_ATS_NET_UNSPECIFIED = 0, | ||||
GNUNET_ATS_NET_LOOPBACK = 1, | ||||
GNUNET_ATS_NET_LAN = 2, | ||||
GNUNET_ATS_NET_WAN = 3, | ||||
GNUNET_ATS_NET_WLAN = 4, | ||||
}; | ||||
/** | /** | |||
* Enum defining all known property types for ATS Enum values are used | * Enum defining all known property types for ATS Enum values are used | |||
* in the GNUNET_ATS_Information struct as | * in the GNUNET_ATS_Information struct as | |||
* (key,value)-pairs. | * (key,value)-pairs. | |||
* | * | |||
* Cost are always stored in uint32_t, so all units used to define costs | * Cost are always stored in uint32_t, so all units used to define costs | |||
* have to be normalized to fit in uint32_t [0 .. 4.294.967.295] | * have to be normalized to fit in uint32_t [0 .. 4.294.967.295] | |||
*/ | */ | |||
enum GNUNET_ATS_Property | enum GNUNET_ATS_Property | |||
{ | { | |||
skipping to change at line 65 | skipping to change at line 74 | |||
GNUNET_ATS_UTILIZATION_UP, | GNUNET_ATS_UTILIZATION_UP, | |||
/** | /** | |||
* Actual traffic on this connection from this peer to the other peer. | * Actual traffic on this connection from this peer to the other peer. | |||
* | * | |||
* Unit: [bytes/second] | * Unit: [bytes/second] | |||
*/ | */ | |||
GNUNET_ATS_UTILIZATION_DOWN, | GNUNET_ATS_UTILIZATION_DOWN, | |||
/** | /** | |||
* Is this address located in WAN, LAN or a loopback address | ||||
* Value is element of GNUNET_ATS_Network_Type | ||||
*/ | ||||
GNUNET_ATS_NETWORK_TYPE, | ||||
/** | ||||
* Delay | * Delay | |||
* Time between when the time packet is sent and the packet arrives | * Time between when the time packet is sent and the packet arrives | |||
* | * | |||
* Unit: [ms] | * Unit: [ms] | |||
* | * | |||
* Examples: | * Examples: | |||
* | * | |||
* LAN : 1 | * LAN : 1 | |||
* WLAN : 2 | * WLAN : 2 | |||
* Dialup: 500 | * Dialup: 500 | |||
skipping to change at line 389 | skipping to change at line 404 | |||
/** | /** | |||
* Is a peer reachable? | * Is a peer reachable? | |||
*/ | */ | |||
// GNUNET_ATS_AVAILABILITY_REACHABLE = 2048, | // GNUNET_ATS_AVAILABILITY_REACHABLE = 2048, | |||
/** | /** | |||
* Is there a connection established to a peer using this transport | * Is there a connection established to a peer using this transport | |||
*/ | */ | |||
// GNUNET_ATS_AVAILABILITY_CONNECTED = 2049 | // GNUNET_ATS_AVAILABILITY_CONNECTED = 2049 | |||
}; | }; | |||
GNUNET_NETWORK_STRUCT_BEGIN | ||||
/** | /** | |||
* struct used to communicate the transport's properties like cost and | * struct used to communicate the transport's properties like cost and | |||
* quality of service as well as high-level constraints on resource | * quality of service as well as high-level constraints on resource | |||
* consumption. | * consumption. | |||
* | * | |||
* +---+ | * +---+ | |||
* +-----------+ Constraints | | Plugin properties +---------+ | * +-----------+ Constraints | | Plugin properties +---------+ | |||
* | Highlevel |------------> |ATS| <------------------|Transport| | * | Highlevel |------------> |ATS| <------------------|Transport| | |||
* | Component | ATS struct | | ATS struct | Plugin | | * | Component | ATS struct | | ATS struct | Plugin | | |||
* +-----------+ | | +---------+ | * +-----------+ | | +---------+ | |||
skipping to change at line 419 | skipping to change at line 436 | |||
/** | /** | |||
* ATS property type, in network byte order. | * ATS property type, in network byte order. | |||
*/ | */ | |||
uint32_t type GNUNET_PACKED; | uint32_t type GNUNET_PACKED; | |||
/** | /** | |||
* ATS property value, in network byte order. | * ATS property value, in network byte order. | |||
*/ | */ | |||
uint32_t value GNUNET_PACKED; | uint32_t value GNUNET_PACKED; | |||
}; | }; | |||
GNUNET_NETWORK_STRUCT_END | ||||
/* ******************************** Scheduling API ************************ ***** */ | /* ******************************** Scheduling API ************************ ***** */ | |||
/** | /** | |||
* Handle to the ATS subsystem for bandwidth/transport scheduling informati on. | * Handle to the ATS subsystem for bandwidth/transport scheduling informati on. | |||
*/ | */ | |||
struct GNUNET_ATS_SchedulingHandle; | struct GNUNET_ATS_SchedulingHandle; | |||
/** | /** | |||
* Opaque session handle, defined by plugins. Contents not known to ATS. | * Opaque session handle, defined by plugins. Contents not known to ATS. | |||
skipping to change at line 502 | skipping to change at line 520 | |||
* We want to cancel ATS suggesting addresses for a peer. | * We want to cancel ATS suggesting addresses for a peer. | |||
* | * | |||
* @param sh handle | * @param sh handle | |||
* @param peer identity of the peer | * @param peer identity of the peer | |||
*/ | */ | |||
void | void | |||
GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SchedulingHandle *sh, | GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SchedulingHandle *sh, | |||
const struct GNUNET_PeerIdentity *peer); | const struct GNUNET_PeerIdentity *peer); | |||
/** | /** | |||
* Returns where the address is located: LAN or WAN or ... | ||||
* @param addr address | ||||
* @param addrlen address length | ||||
* @return location as GNUNET_ATS_Information | ||||
*/ | ||||
struct GNUNET_ATS_Information | ||||
GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle *sh, | ||||
const struct sockaddr * addr, | ||||
socklen_t addrlen); | ||||
/** | ||||
* We have updated performance statistics for a given address. Note | * We have updated performance statistics for a given address. Note | |||
* that this function can be called for addresses that are currently | * that this function can be called for addresses that are currently | |||
* in use as well as addresses that are valid but not actively in use. | * in use as well as addresses that are valid but not actively in use. | |||
* Furthermore, the peer may not even be connected to us right now (in | * Furthermore, the peer may not even be connected to us right now (in | |||
* which case the call may be ignored or the information may be stored | * which case the call may be ignored or the information may be stored | |||
* for later use). Update bandwidth assignments. | * for later use). Update bandwidth assignments. | |||
* | * | |||
* @param sh handle | * @param sh handle | |||
* @param address updated address | * @param address updated address | |||
* @param session session handle (if available) | * @param session session handle (if available) | |||
End of changes. 5 change blocks. | ||||
0 lines changed or deleted | 29 lines changed or added | |||
gnunet_bandwidth_lib.h | gnunet_bandwidth_lib.h | |||
---|---|---|---|---|
skipping to change at line 41 | skipping to change at line 41 | |||
extern "C" | extern "C" | |||
{ | { | |||
#if 0 /* keep Emacsens' auto-indent happy */ | #if 0 /* keep Emacsens' auto-indent happy */ | |||
} | } | |||
#endif | #endif | |||
#endif | #endif | |||
#include "gnunet_common.h" | #include "gnunet_common.h" | |||
#include "gnunet_time_lib.h" | #include "gnunet_time_lib.h" | |||
GNUNET_NETWORK_STRUCT_BEGIN | ||||
/** | /** | |||
* 32-bit bandwidth used for network exchange by GNUnet, in bytes per secon d. | * 32-bit bandwidth used for network exchange by GNUnet, in bytes per secon d. | |||
*/ | */ | |||
struct GNUNET_BANDWIDTH_Value32NBO | struct GNUNET_BANDWIDTH_Value32NBO | |||
{ | { | |||
/** | /** | |||
* The actual value (bytes per second). | * The actual value (bytes per second). | |||
*/ | */ | |||
uint32_t value__ GNUNET_PACKED; | uint32_t value__ GNUNET_PACKED; | |||
}; | }; | |||
GNUNET_NETWORK_STRUCT_END | ||||
/** | /** | |||
* Struct to track available bandwidth. Combines a time stamp with a | * Struct to track available bandwidth. Combines a time stamp with a | |||
* number of bytes transmitted, a quota and a maximum amount that | * number of bytes transmitted, a quota and a maximum amount that | |||
* carries over. Not opaque so that it can be inlined into data | * carries over. Not opaque so that it can be inlined into data | |||
* structures (reducing malloc-ing); however, values should not be | * structures (reducing malloc-ing); however, values should not be | |||
* accessed directly by clients (hence the '__'). | * accessed directly by clients (hence the '__'). | |||
*/ | */ | |||
struct GNUNET_BANDWIDTH_Tracker | struct GNUNET_BANDWIDTH_Tracker | |||
{ | { | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added | |||
gnunet_bio_lib.h | gnunet_bio_lib.h | |||
---|---|---|---|---|
skipping to change at line 252 | skipping to change at line 252 | |||
* | * | |||
* @param h hande to open file | * @param h hande to open file | |||
* @param f double to write (must be a variable) | * @param f double to write (must be a variable) | |||
*/ | */ | |||
#define GNUNET_BIO_write_double(h, f) GNUNET_BIO_write (h, &f, sizeof(doubl e)) | #define GNUNET_BIO_write_double(h, f) GNUNET_BIO_write (h, &f, sizeof(doubl e)) | |||
/** | /** | |||
* Write an (u)int32_t. | * Write an (u)int32_t. | |||
* | * | |||
* @param h hande to open file | * @param h hande to open file | |||
* @param i address of 32-bit integer to write | * @param i 32-bit integer to write | |||
* @return GNUNET_OK on success, GNUNET_SYSERR on error | * @return GNUNET_OK on success, GNUNET_SYSERR on error | |||
*/ | */ | |||
int | int | |||
GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i); | GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i); | |||
/** | /** | |||
* Write an (u)int64_t. | * Write an (u)int64_t. | |||
* | * | |||
* @param h hande to open file | * @param h hande to open file | |||
* @param i address of 64-bit integer to write | * @param i 64-bit integer to write | |||
* @return GNUNET_OK on success, GNUNET_SYSERR on error | * @return GNUNET_OK on success, GNUNET_SYSERR on error | |||
*/ | */ | |||
int | int | |||
GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, int64_t i); | GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, int64_t i); | |||
#if 0 /* keep Emacsens' auto-indent happy */ | #if 0 /* keep Emacsens' auto-indent happy */ | |||
{ | { | |||
#endif | #endif | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
gnunet_common.h | gnunet_common.h | |||
---|---|---|---|---|
skipping to change at line 52 | skipping to change at line 52 | |||
#ifdef HAVE_STDINT_H | #ifdef HAVE_STDINT_H | |||
#include <stdint.h> | #include <stdint.h> | |||
#endif | #endif | |||
#ifdef HAVE_STDARG_H | #ifdef HAVE_STDARG_H | |||
#include <stdarg.h> | #include <stdarg.h> | |||
#endif | #endif | |||
/** | /** | |||
* Version of the API (for entire gnunetutil.so library). | * Version of the API (for entire gnunetutil.so library). | |||
*/ | */ | |||
#define GNUNET_UTIL_VERSION 0x00090000 | #define GNUNET_UTIL_VERSION 0x00090100 | |||
/** | ||||
* Name used for "services" that are actually command-line | ||||
* programs invoked by the end user. | ||||
*/ | ||||
#define GNUNET_CLIENT_SERVICE_NAME "client" | ||||
/** | /** | |||
* Named constants for return values. The following | * Named constants for return values. The following | |||
* invariants hold: "GNUNET_NO == 0" (to allow "if (GNUNET_NO)") | * invariants hold: "GNUNET_NO == 0" (to allow "if (GNUNET_NO)") | |||
* "GNUNET_OK != GNUNET_SYSERR", "GNUNET_OK != GNUNET_NO", "GNUNET_NO != GN UNET_SYSERR" | * "GNUNET_OK != GNUNET_SYSERR", "GNUNET_OK != GNUNET_NO", "GNUNET_NO != GN UNET_SYSERR" | |||
* and finally "GNUNET_YES != GNUNET_NO". | * and finally "GNUNET_YES != GNUNET_NO". | |||
*/ | */ | |||
#define GNUNET_OK 1 | #define GNUNET_OK 1 | |||
#define GNUNET_SYSERR -1 | #define GNUNET_SYSERR -1 | |||
#define GNUNET_YES 1 | #define GNUNET_YES 1 | |||
#define GNUNET_NO 0 | #define GNUNET_NO 0 | |||
#define GNUNET_MIN(a,b) (((a) < (b)) ? (a) : (b)) | #define GNUNET_MIN(a,b) (((a) < (b)) ? (a) : (b)) | |||
#define GNUNET_MAX(a,b) (((a) > (b)) ? (a) : (b)) | #define GNUNET_MAX(a,b) (((a) > (b)) ? (a) : (b)) | |||
/** | /** | |||
* Endian operations | ||||
*/ | ||||
# if __BYTE_ORDER == __LITTLE_ENDIAN | ||||
# define GNUNET_htobe16(x) __bswap_16 (x) | ||||
# define GNUNET_htole16(x) (x) | ||||
# define GNUNET_be16toh(x) __bswap_16 (x) | ||||
# define GNUNET_le16toh(x) (x) | ||||
# define GNUNET_htobe32(x) __bswap_32 (x) | ||||
# define GNUNET_htole32(x) (x) | ||||
# define GNUNET_be32toh(x) __bswap_32 (x) | ||||
# define GNUNET_le32toh(x) (x) | ||||
# define GNUNET_htobe64(x) __bswap_64 (x) | ||||
# define GNUNET_htole64(x) (x) | ||||
# define GNUNET_be64toh(x) __bswap_64 (x) | ||||
# define GNUNET_le64toh(x) (x) | ||||
#endif | ||||
# if __BYTE_ORDER == __BIG_ENDIAN | ||||
# define GNUNET_htobe16(x) (x) | ||||
# define GNUNET_htole16(x) __bswap_16 (x) | ||||
# define GNUNET_be16toh(x) (x) | ||||
# define GNUNET_le16toh(x) __bswap_16 (x) | ||||
# define GNUNET_htobe32(x) (x) | ||||
# define GNUNET_htole32(x) __bswap_32 (x) | ||||
# define GNUNET_be32toh(x) (x) | ||||
# define GNUNET_le32toh(x) __bswap_32 (x) | ||||
# define GNUNET_htobe64(x) (x) | ||||
# define GNUNET_htole64(x) __bswap_64 (x) | ||||
# define GNUNET_be64toh(x) (x) | ||||
# define GNUNET_le64toh(x) __bswap_64 (x) | ||||
#endif | ||||
/** | ||||
* gcc-ism to get packed structs. | * gcc-ism to get packed structs. | |||
*/ | */ | |||
#define GNUNET_PACKED __attribute__((packed)) | #define GNUNET_PACKED __attribute__((packed)) | |||
/** | /** | |||
* gcc-ism to document unused arguments | * gcc-ism to document unused arguments | |||
*/ | */ | |||
#define GNUNET_UNUSED __attribute__((unused)) | #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 *********************** */ | /* ************************ super-general types *********************** */ | |||
GNUNET_NETWORK_STRUCT_BEGIN | ||||
/** | /** | |||
* Header for all communications. | * Header for all communications. | |||
*/ | */ | |||
struct GNUNET_MessageHeader | struct GNUNET_MessageHeader | |||
{ | { | |||
/** | /** | |||
* The length of the struct (in bytes, including the length field itself) , | * The length of the struct (in bytes, including the length field itself) , | |||
* in big-endian format. | * in big-endian format. | |||
*/ | */ | |||
uint16_t size GNUNET_PACKED; | uint16_t size GNUNET_PACKED; | |||
/** | /** | |||
* The type of the message (GNUNET_MESSAGE_TYPE_XXXX), in big-endian form at. | * The type of the message (GNUNET_MESSAGE_TYPE_XXXX), in big-endian form at. | |||
*/ | */ | |||
uint16_t type GNUNET_PACKED; | uint16_t type GNUNET_PACKED; | |||
}; | }; | |||
GNUNET_NETWORK_STRUCT_END | ||||
/** | /** | |||
* @brief 512-bit hashcode | * @brief 512-bit hashcode | |||
*/ | */ | |||
typedef struct | typedef struct | |||
{ | { | |||
uint32_t bits[512 / 8 / sizeof (uint32_t)]; /* = 16 */ | uint32_t bits[512 / 8 / sizeof (uint32_t)]; /* = 16 */ | |||
} | } | |||
GNUNET_HashCode; | GNUNET_HashCode; | |||
GNUNET_NETWORK_STRUCT_BEGIN | ||||
/** | /** | |||
* The identity of the host (basically the SHA-512 hashcode of | * The identity of the host (basically the SHA-512 hashcode of | |||
* it's public key). | * it's public key). | |||
*/ | */ | |||
struct GNUNET_PeerIdentity | struct GNUNET_PeerIdentity | |||
{ | { | |||
GNUNET_HashCode hashPubKey GNUNET_PACKED; | GNUNET_HashCode hashPubKey GNUNET_PACKED; | |||
}; | }; | |||
GNUNET_NETWORK_STRUCT_END | ||||
/** | /** | |||
* Function called with a filename. | * Function called with a filename. | |||
* | * | |||
* @param cls closure | * @param cls closure | |||
* @param filename complete filename (absolute path) | * @param filename complete filename (absolute path) | |||
* @return GNUNET_OK to continue to iterate, | * @return GNUNET_OK to continue to iterate, | |||
* GNUNET_SYSERR to abort iteration with error! | * GNUNET_SYSERR to abort iteration with error! | |||
*/ | */ | |||
typedef int (*GNUNET_FileNameCallback) (void *cls, const char *filename); | typedef int (*GNUNET_FileNameCallback) (void *cls, const char *filename); | |||
skipping to change at line 404 | skipping to change at line 468 | |||
/** | /** | |||
* Log an error message at log-level 'level' that indicates | * Log an error message at log-level 'level' that indicates | |||
* a failure of the command 'cmd' with the message given | * a failure of the command 'cmd' with the message given | |||
* by strerror(errno). | * by strerror(errno). | |||
*/ | */ | |||
#define GNUNET_log_from_strerror_file(level, component, cmd, filename) do { GNUNET_log_from (level, component, _("`%s' failed on file `%s' at %s:%d wi th error: %s\n"), cmd, filename,__FILE__, __LINE__, STRERROR(errno)); } whi le(0) | #define GNUNET_log_from_strerror_file(level, component, cmd, filename) do { GNUNET_log_from (level, component, _("`%s' failed on file `%s' at %s:%d wi th error: %s\n"), cmd, filename,__FILE__, __LINE__, STRERROR(errno)); } whi le(0) | |||
/* ************************* endianess conversion ****************** */ | /* ************************* endianess conversion ****************** */ | |||
/** | /** | |||
* Convert a long-long to host-byte-order. | * Convert unsigned 64-bit integer to host-byte-order. | |||
* @param n the value in network byte order | * @param n the value in network byte order | |||
* @return the same value in host byte order | * @return the same value in host byte order | |||
*/ | */ | |||
unsigned long long | uint64_t | |||
GNUNET_ntohll (unsigned long long n); | GNUNET_ntohll (uint64_t n); | |||
/** | /** | |||
* Convert a long long to network-byte-order. | * Convert unsigned 64-bit integer to network-byte-order. | |||
* @param n the value in host byte order | * @param n the value in host byte order | |||
* @return the same value in network byte order | * @return the same value in network byte order | |||
*/ | */ | |||
unsigned long long | uint64_t | |||
GNUNET_htonll (unsigned long long n); | GNUNET_htonll (uint64_t n); | |||
/* ************************* allocation functions ****************** */ | /* ************************* allocation functions ****************** */ | |||
/** | /** | |||
* Maximum allocation with GNUNET_malloc macro. | * Maximum allocation with GNUNET_malloc macro. | |||
*/ | */ | |||
#define GNUNET_MAX_MALLOC_CHECKED (1024 * 1024 * 40) | #define GNUNET_MAX_MALLOC_CHECKED (1024 * 1024 * 40) | |||
/** | /** | |||
* Wrapper around malloc. Allocates size bytes of memory. | * Wrapper around malloc. Allocates size bytes of memory. | |||
End of changes. 11 change blocks. | ||||
13 lines changed or deleted | 77 lines changed or added | |||
gnunet_config.h | gnunet_config.h | |||
---|---|---|---|---|
skipping to change at line 384 | skipping to change at line 384 | |||
/* Define to 1 if you have the `sbrk' function. */ | /* Define to 1 if you have the `sbrk' function. */ | |||
#define HAVE_SBRK 1 | #define HAVE_SBRK 1 | |||
/* Define to 1 if you have the `select' function. */ | /* Define to 1 if you have the `select' function. */ | |||
#define HAVE_SELECT 1 | #define HAVE_SELECT 1 | |||
/* Define to 1 if you have the `setlocale' function. */ | /* Define to 1 if you have the `setlocale' function. */ | |||
#define HAVE_SETLOCALE 1 | #define HAVE_SETLOCALE 1 | |||
/* Define to 1 if you have the `setresuid' function. */ | ||||
#define HAVE_SETRESUID 1 | ||||
/* Define to 1 if you have the `setrlimit' function. */ | /* Define to 1 if you have the `setrlimit' function. */ | |||
#define HAVE_SETRLIMIT 1 | #define HAVE_SETRLIMIT 1 | |||
/* Define if you have the shl_load function. */ | /* Define if you have the shl_load function. */ | |||
/* #undef HAVE_SHL_LOAD */ | /* #undef HAVE_SHL_LOAD */ | |||
/* Define to 1 if you have the <signal.h> header file. */ | /* Define to 1 if you have the <signal.h> header file. */ | |||
#define HAVE_SIGNAL_H 1 | #define HAVE_SIGNAL_H 1 | |||
/* Define to 1 if the system has the type `sigset_t'. */ | /* Define to 1 if the system has the type `sigset_t'. */ | |||
skipping to change at line 664 | skipping to change at line 667 | |||
/* Define if the OS needs help to load dependent libraries for dlopen(). */ | /* Define if the OS needs help to load dependent libraries for dlopen(). */ | |||
/* #undef LTDL_DLOPEN_DEPLIBS */ | /* #undef LTDL_DLOPEN_DEPLIBS */ | |||
/* Define to the system default library search path. */ | /* Define to the system default library search path. */ | |||
#define LT_DLSEARCH_PATH "/lib:/usr/lib:/usr/lib/atlas-sse:/usr/lib/atlas-s se3:/usr/lib/atlas:/usr/lib/paraview-mpi" | #define LT_DLSEARCH_PATH "/lib:/usr/lib:/usr/lib/atlas-sse:/usr/lib/atlas-s se3:/usr/lib/atlas:/usr/lib/paraview-mpi" | |||
/* The archive extension */ | /* The archive extension */ | |||
#define LT_LIBEXT "a" | #define LT_LIBEXT "a" | |||
/* The archive prefix */ | ||||
#define LT_LIBPREFIX "lib" | ||||
/* Define to the extension used for runtime loadable modules, say, ".so". * / | /* Define to the extension used for runtime loadable modules, say, ".so". * / | |||
#define LT_MODULE_EXT ".so" | #define LT_MODULE_EXT ".so" | |||
/* Define to the name of the environment variable that determines the run-t ime | /* Define to the name of the environment variable that determines the run-t ime | |||
module search path. */ | module search path. */ | |||
#define LT_MODULE_PATH_VAR "LD_LIBRARY_PATH" | #define LT_MODULE_PATH_VAR "LD_LIBRARY_PATH" | |||
/* Define to the sub-directory in which libtool stores uninstalled librarie s. | /* Define to the sub-directory in which libtool stores uninstalled librarie s. | |||
*/ | */ | |||
#define LT_OBJDIR ".libs/" | #define LT_OBJDIR ".libs/" | |||
/* Define to the shared library suffix, say, ".dylib". */ | ||||
/* #undef LT_SHARED_EXT */ | ||||
/* This is a MinGW system */ | /* This is a MinGW system */ | |||
/* #undef MINGW */ | /* #undef MINGW */ | |||
/* Define if dlsym() requires a leading underscore in symbol names. */ | /* Define if dlsym() requires a leading underscore in symbol names. */ | |||
/* #undef NEED_USCORE */ | /* #undef NEED_USCORE */ | |||
/* This is a NetBSD system */ | /* This is a NetBSD system */ | |||
/* #undef NETBSD */ | /* #undef NETBSD */ | |||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */ | /* Define to 1 if your C compiler doesn't accept -c and -o together. */ | |||
skipping to change at line 709 | skipping to change at line 706 | |||
/* Name of package */ | /* Name of package */ | |||
#define PACKAGE "gnunet" | #define PACKAGE "gnunet" | |||
/* Define to the address where bug reports for this package should be sent. */ | /* Define to the address where bug reports for this package should be sent. */ | |||
#define PACKAGE_BUGREPORT "bug-gnunet@gnu.org" | #define PACKAGE_BUGREPORT "bug-gnunet@gnu.org" | |||
/* Define to the full name of this package. */ | /* Define to the full name of this package. */ | |||
#define PACKAGE_NAME "gnunet" | #define PACKAGE_NAME "gnunet" | |||
/* Define to the full name and version of this package. */ | /* Define to the full name and version of this package. */ | |||
#define PACKAGE_STRING "gnunet 0.9.0" | #define PACKAGE_STRING "gnunet 0.9.1" | |||
/* Define to the one symbol short name of this package. */ | /* Define to the one symbol short name of this package. */ | |||
#define PACKAGE_TARNAME "gnunet" | #define PACKAGE_TARNAME "gnunet" | |||
/* Define to the home page for this package. */ | /* Define to the home page for this package. */ | |||
#define PACKAGE_URL "" | #define PACKAGE_URL "" | |||
/* Define to the version of this package. */ | /* Define to the version of this package. */ | |||
#define PACKAGE_VERSION "0.9.0" | #define PACKAGE_VERSION "0.9.1" | |||
/* Define as the return type of signal handlers (`int' or `void'). */ | /* Define as the return type of signal handlers (`int' or `void'). */ | |||
#define RETSIGTYPE void | #define RETSIGTYPE void | |||
/* Define to the type of arg 1 for `select'. */ | /* Define to the type of arg 1 for `select'. */ | |||
#define SELECT_TYPE_ARG1 int | #define SELECT_TYPE_ARG1 int | |||
/* Define to the type of args 2, 3 and 4 for `select'. */ | /* Define to the type of args 2, 3 and 4 for `select'. */ | |||
#define SELECT_TYPE_ARG234 (fd_set *) | #define SELECT_TYPE_ARG234 (fd_set *) | |||
skipping to change at line 751 | skipping to change at line 748 | |||
/* Define to 1 if you have the ANSI C header files. */ | /* Define to 1 if you have the ANSI C header files. */ | |||
#define STDC_HEADERS 1 | #define STDC_HEADERS 1 | |||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ | /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ | |||
#define TIME_WITH_SYS_TIME 1 | #define TIME_WITH_SYS_TIME 1 | |||
/* Define to 1 if your <sys/time.h> declares `struct tm'. */ | /* Define to 1 if your <sys/time.h> declares `struct tm'. */ | |||
/* #undef TM_IN_SYS_TIME */ | /* #undef TM_IN_SYS_TIME */ | |||
/* Version number of package */ | /* Version number of package */ | |||
#define VERSION "0.9.0" | #define VERSION "0.9.1" | |||
/* This is a Windows system */ | /* This is a Windows system */ | |||
/* #undef WINDOWS */ | /* #undef WINDOWS */ | |||
/* Define to 1 if the X Window System is missing or not being used. */ | /* Define to 1 if the X Window System is missing or not being used. */ | |||
/* #undef X_DISPLAY_MISSING */ | /* #undef X_DISPLAY_MISSING */ | |||
/* Number of bits in a file offset, on hosts where this is settable. */ | /* Number of bits in a file offset, on hosts where this is settable. */ | |||
#define _FILE_OFFSET_BITS 64 | #define _FILE_OFFSET_BITS 64 | |||
End of changes. 6 change blocks. | ||||
9 lines changed or deleted | 6 lines changed or added | |||
gnunet_crypto_lib.h | gnunet_crypto_lib.h | |||
---|---|---|---|---|
skipping to change at line 116 | skipping to change at line 116 | |||
}; | }; | |||
/** | /** | |||
* @brief an RSA signature | * @brief an RSA signature | |||
*/ | */ | |||
struct GNUNET_CRYPTO_RsaSignature | struct GNUNET_CRYPTO_RsaSignature | |||
{ | { | |||
unsigned char sig[GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH]; | unsigned char sig[GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH]; | |||
}; | }; | |||
GNUNET_NETWORK_STRUCT_BEGIN | ||||
/** | /** | |||
* @brief header of what an RSA signature signs | * @brief header of what an RSA signature signs | |||
* this must be followed by "size - 8" bytes of | * this must be followed by "size - 8" bytes of | |||
* the actual signed data | * the actual signed data | |||
*/ | */ | |||
struct GNUNET_CRYPTO_RsaSignaturePurpose | struct GNUNET_CRYPTO_RsaSignaturePurpose | |||
{ | { | |||
/** | /** | |||
* How many bytes does this signature sign? | * How many bytes does this signature sign? | |||
* (including this purpose header); in network | * (including this purpose header); in network | |||
skipping to change at line 189 | skipping to change at line 191 | |||
/** | /** | |||
* Actual key. | * Actual key. | |||
*/ | */ | |||
unsigned char key[GNUNET_CRYPTO_AES_KEY_LENGTH]; | unsigned char key[GNUNET_CRYPTO_AES_KEY_LENGTH]; | |||
/** | /** | |||
* checksum! | * checksum! | |||
*/ | */ | |||
uint32_t crc32 GNUNET_PACKED; | uint32_t crc32 GNUNET_PACKED; | |||
}; | }; | |||
GNUNET_NETWORK_STRUCT_END | ||||
/** | /** | |||
* @brief IV for sym cipher | * @brief IV for sym cipher | |||
* | * | |||
* NOTE: must be smaller (!) in size than the | * NOTE: must be smaller (!) in size than the | |||
* GNUNET_HashCode. | * GNUNET_HashCode. | |||
*/ | */ | |||
struct GNUNET_CRYPTO_AesInitializationVector | struct GNUNET_CRYPTO_AesInitializationVector | |||
{ | { | |||
unsigned char iv[GNUNET_CRYPTO_AES_KEY_LENGTH / 2]; | unsigned char iv[GNUNET_CRYPTO_AES_KEY_LENGTH / 2]; | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added | |||
gnunet_datastore_plugin.h | gnunet_datastore_plugin.h | |||
---|---|---|---|---|
skipping to change at line 132 | skipping to change at line 132 | |||
* @return GNUNET_OK on success, | * @return GNUNET_OK on success, | |||
* GNUNET_SYSERR on failure | * GNUNET_SYSERR on failure | |||
*/ | */ | |||
typedef int (*PluginPut) (void *cls, const GNUNET_HashCode * key, uint32_t size, | typedef int (*PluginPut) (void *cls, const GNUNET_HashCode * key, uint32_t size, | |||
const void *data, enum GNUNET_BLOCK_Type type, | const void *data, enum GNUNET_BLOCK_Type type, | |||
uint32_t priority, uint32_t anonymity, | uint32_t priority, uint32_t anonymity, | |||
uint32_t replication, | uint32_t replication, | |||
struct GNUNET_TIME_Absolute expiration, char **ms g); | struct GNUNET_TIME_Absolute expiration, char **ms g); | |||
/** | /** | |||
* An processor over a set of keys stored in the datastore. | ||||
* | ||||
* @param cls closure | ||||
* @param key key in the data store | ||||
* @param count how many values are stored under this key in the datastore | ||||
*/ | ||||
typedef void (*PluginKeyProcessor) (void *cls, | ||||
const GNUNET_HashCode *key, | ||||
unsigned int count); | ||||
/** | ||||
* Get all of the keys in the datastore. | ||||
* | ||||
* @param cls closure | ||||
* @param proc function to call on each key | ||||
* @param proc_cls closure for proc | ||||
*/ | ||||
typedef void (*PluginGetKeys) (void *cls, | ||||
PluginKeyProcessor proc, void *proc_cls); | ||||
/** | ||||
* Get one of the results for a particular key in the datastore. | * Get one of the results for a particular key in the datastore. | |||
* | * | |||
* @param cls closure | * @param cls closure | |||
* @param offset offset of the result (modulo num-results); | * @param offset offset of the result (modulo num-results); | |||
* specific ordering does not matter for the offset | * specific ordering does not matter for the offset | |||
* @param key key to match, never NULL | * @param key key to match, never NULL | |||
* @param vhash hash of the value, maybe NULL (to | * @param vhash hash of the value, maybe NULL (to | |||
* match all values that have the right key). | * match all values that have the right key). | |||
* Note that for DBlocks there is no difference | * Note that for DBlocks there is no difference | |||
* betwen key and vhash, but for other blocks | * betwen key and vhash, but for other blocks | |||
* there may be! | * there may be! | |||
* @param type entries of which type are relevant? | * @param type entries of which type are relevant? | |||
* Use 0 for any type. | * Use 0 for any type. | |||
* @param min find the smallest key that is larger than the given min, | ||||
* NULL for no minimum (return smallest key) | ||||
* @param proc function to call on the matching value; | * @param proc function to call on the matching value; | |||
* proc should be called with NULL if there is no result | * proc should be called with NULL if there is no result | |||
* @param proc_cls closure for proc | * @param proc_cls closure for proc | |||
*/ | */ | |||
typedef void (*PluginGetKey) (void *cls, uint64_t offset, | typedef void (*PluginGetKey) (void *cls, uint64_t offset, | |||
const GNUNET_HashCode * key, | const GNUNET_HashCode * key, | |||
const GNUNET_HashCode * vhash, | const GNUNET_HashCode * vhash, | |||
enum GNUNET_BLOCK_Type type, | enum GNUNET_BLOCK_Type type, | |||
PluginDatumProcessor proc, void *proc_cls); | PluginDatumProcessor proc, void *proc_cls); | |||
skipping to change at line 286 | skipping to change at line 309 | |||
* on what was efficiently implementable). | * on what was efficiently implementable). | |||
*/ | */ | |||
PluginGetRandom get_expiration; | PluginGetRandom get_expiration; | |||
/** | /** | |||
* Delete the database. The next operation is | * Delete the database. The next operation is | |||
* guaranteed to be unloading of the module. | * guaranteed to be unloading of the module. | |||
*/ | */ | |||
PluginDrop drop; | PluginDrop drop; | |||
/** | ||||
* Iterate over all keys in the database. | ||||
*/ | ||||
PluginGetKeys get_keys; | ||||
}; | }; | |||
#endif | #endif | |||
End of changes. 3 change blocks. | ||||
0 lines changed or deleted | 28 lines changed or added | |||
gnunet_datastore_service.h | gnunet_datastore_service.h | |||
---|---|---|---|---|
skipping to change at line 87 | skipping to change at line 87 | |||
GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop); | GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop); | |||
/** | /** | |||
* Continuation called to notify client about result of the | * Continuation called to notify client about result of the | |||
* operation. | * operation. | |||
* | * | |||
* @param cls closure | * @param cls closure | |||
* @param success GNUNET_SYSERR on failure (including timeout/queue drop) | * @param success GNUNET_SYSERR on failure (including timeout/queue drop) | |||
* GNUNET_NO if content was already there | * GNUNET_NO if content was already there | |||
* GNUNET_YES (or other positive value) on success | * GNUNET_YES (or other positive value) on success | |||
* @param min_expiration minimum expiration time required for 0-priority co | ||||
ntent to be stored | ||||
* by the datacache at this time, zero for unknown, forever | ||||
if we have no | ||||
* space for 0-priority content | ||||
* @param msg NULL on success, otherwise an error message | * @param msg NULL on success, otherwise an error message | |||
*/ | */ | |||
typedef void (*GNUNET_DATASTORE_ContinuationWithStatus) (void *cls, | typedef void (*GNUNET_DATASTORE_ContinuationWithStatus) (void *cls, | |||
int32_t success, | int32_t success, | |||
struct GNUNET_TIME_ Absolute min_expiration, | ||||
const char *msg); | const char *msg); | |||
/** | /** | |||
* Reserve space in the datastore. This function should be used | * Reserve space in the datastore. This function should be used | |||
* to avoid "out of space" failures during a longer sequence of "put" | * to avoid "out of space" failures during a longer sequence of "put" | |||
* operations (for example, when a file is being inserted). | * operations (for example, when a file is being inserted). | |||
* | * | |||
* @param h handle to the datastore | * @param h handle to the datastore | |||
* @param amount how much space (in bytes) should be reserved (for content only) | * @param amount how much space (in bytes) should be reserved (for content only) | |||
* @param entries how many entries will be created (to calculate per-entry overhead) | * @param entries how many entries will be created (to calculate per-entry overhead) | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 6 lines changed or added | |||
gnunet_disk_lib.h | gnunet_disk_lib.h | |||
---|---|---|---|---|
skipping to change at line 358 | skipping to change at line 358 | |||
* @param perm permissions for the newly created file, use | * @param perm permissions for the newly created file, use | |||
* GNUNET_DISK_PERM_NONE if a file could not be created by this | * GNUNET_DISK_PERM_NONE if a file could not be created by this | |||
* call (because of flags) | * call (because of flags) | |||
* @return IO handle on success, NULL on error | * @return IO handle on success, NULL on error | |||
*/ | */ | |||
struct GNUNET_DISK_FileHandle * | struct GNUNET_DISK_FileHandle * | |||
GNUNET_DISK_file_open (const char *fn, enum GNUNET_DISK_OpenFlags flags, | GNUNET_DISK_file_open (const char *fn, enum GNUNET_DISK_OpenFlags flags, | |||
enum GNUNET_DISK_AccessPermissions perm); | enum GNUNET_DISK_AccessPermissions perm); | |||
/** | /** | |||
* Get the size of an open file. | ||||
* | ||||
* @param fh open file handle | ||||
* @param size where to write size of the file | ||||
* @return GNUNET_OK on success, GNUNET_SYSERR on error | ||||
*/ | ||||
int | ||||
GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh, | ||||
off_t *size); | ||||
/** | ||||
* Creates an interprocess channel | * Creates an interprocess channel | |||
* @param blocking creates an asynchronous pipe if set to GNUNET_NO | * @param blocking creates an asynchronous pipe if set to GNUNET_NO | |||
* @param inherit_read 1 to make read handle inheritable, 0 otherwise (NT o nly) | * @param inherit_read 1 to make read handle inheritable, 0 otherwise (NT o nly) | |||
* @param inherit_write 1 to make write handle inheritable, 0 otherwise (NT only) | * @param inherit_write 1 to make write handle inheritable, 0 otherwise (NT only) | |||
* @return handle to the new pipe, NULL on error | * @return handle to the new pipe, NULL on error | |||
*/ | */ | |||
struct GNUNET_DISK_PipeHandle * | struct GNUNET_DISK_PipeHandle * | |||
GNUNET_DISK_pipe (int blocking, int inherit_read, int inherit_write); | GNUNET_DISK_pipe (int blocking, int inherit_read, int inherit_write); | |||
/** | /** | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 11 lines changed or added | |||
gnunet_fs_service.h | gnunet_fs_service.h | |||
---|---|---|---|---|
skipping to change at line 56 | skipping to change at line 56 | |||
* 3.0.x: with namespaces | * 3.0.x: with namespaces | |||
* 3.1.x: with namespace meta-data | * 3.1.x: with namespace meta-data | |||
* 3.2.x: with collections | * 3.2.x: with collections | |||
* 4.0.x: with expiration, variable meta-data, kblocks | * 4.0.x: with expiration, variable meta-data, kblocks | |||
* 4.1.x: with new error and configuration handling | * 4.1.x: with new error and configuration handling | |||
* 5.0.x: with location URIs | * 5.0.x: with location URIs | |||
* 6.0.0: with support for OR in KSKs | * 6.0.0: with support for OR in KSKs | |||
* 6.1.x: with simplified namespace support | * 6.1.x: with simplified namespace support | |||
* 9.0.0: CPS-style integrated API | * 9.0.0: CPS-style integrated API | |||
*/ | */ | |||
#define GNUNET_FS_VERSION 0x00090000 | #define GNUNET_FS_VERSION 0x00090001 | |||
/* ******************** URI API *********************** */ | /* ******************** URI API *********************** */ | |||
#define GNUNET_FS_URI_PREFIX "gnunet://fs/" | #define GNUNET_FS_URI_PREFIX "gnunet://fs/" | |||
#define GNUNET_FS_URI_KSK_INFIX "ksk/" | #define GNUNET_FS_URI_KSK_INFIX "ksk/" | |||
#define GNUNET_FS_URI_SKS_INFIX "sks/" | #define GNUNET_FS_URI_SKS_INFIX "sks/" | |||
#define GNUNET_FS_URI_CHK_INFIX "chk/" | #define GNUNET_FS_URI_CHK_INFIX "chk/" | |||
#define GNUNET_FS_URI_LOC_INFIX "loc/" | #define GNUNET_FS_URI_LOC_INFIX "loc/" | |||
/** | /** | |||
skipping to change at line 218 | skipping to change at line 218 | |||
* @param cfg configuration information (used to find our hostkey) | * @param cfg configuration information (used to find our hostkey) | |||
* @param expiration_time how long will the content be offered? | * @param expiration_time how long will the content be offered? | |||
* @return the location URI, NULL on error | * @return the location URI, NULL on error | |||
*/ | */ | |||
struct GNUNET_FS_Uri * | struct GNUNET_FS_Uri * | |||
GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, | GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, | |||
const struct GNUNET_CONFIGURATION_Handle *cfg, | const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
struct GNUNET_TIME_Absolute expiration_time); | struct GNUNET_TIME_Absolute expiration_time); | |||
/** | /** | |||
* Canonicalize keyword URI. Performs operations such | ||||
* as decapitalization and removal of certain characters. | ||||
* (useful for search). | ||||
* | ||||
* @param uri the URI to canonicalize | ||||
* @return canonicalized version of the URI, NULL on error | ||||
*/ | ||||
struct GNUNET_FS_Uri * | ||||
GNUNET_FS_uri_ksk_canonicalize (const struct GNUNET_FS_Uri *uri); | ||||
/** | ||||
* Merge the sets of keywords from two KSK URIs. | * Merge the sets of keywords from two KSK URIs. | |||
* (useful for merging the canonicalized keywords with | ||||
* the original keywords for sharing). | ||||
* | * | |||
* @param u1 first uri | * @param u1 first uri | |||
* @param u2 second uri | * @param u2 second uri | |||
* @return merged URI, NULL on error | * @return merged URI, NULL on error | |||
*/ | */ | |||
struct GNUNET_FS_Uri * | struct GNUNET_FS_Uri * | |||
GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1, | GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1, | |||
const struct GNUNET_FS_Uri *u2); | const struct GNUNET_FS_Uri *u2); | |||
/** | /** | |||
skipping to change at line 473 | skipping to change at line 460 | |||
* will be STARTED before child-operations and STOPPED after | * will be STARTED before child-operations and STOPPED after | |||
* their respective child-operations. START and STOP signals | * their respective child-operations. START and STOP signals | |||
* are typically generated either due to explicit client requests | * are typically generated either due to explicit client requests | |||
* or because of suspend/resume operations. | * or because of suspend/resume operations. | |||
*/ | */ | |||
enum GNUNET_FS_Status | enum GNUNET_FS_Status | |||
{ | { | |||
/** | /** | |||
* Notification that we have started to publish a file structure. | * Notification that we have started to publish a file structure. | |||
*/ | */ | |||
GNUNET_FS_STATUS_PUBLISH_START, | GNUNET_FS_STATUS_PUBLISH_START = 0, | |||
/** | /** | |||
* Notification that we have resumed sharing a file structure. | * Notification that we have resumed sharing a file structure. | |||
*/ | */ | |||
GNUNET_FS_STATUS_PUBLISH_RESUME, | GNUNET_FS_STATUS_PUBLISH_RESUME = 1, | |||
/** | /** | |||
* Notification that we have suspended sharing a file structure. | * Notification that we have suspended sharing a file structure. | |||
*/ | */ | |||
GNUNET_FS_STATUS_PUBLISH_SUSPEND, | GNUNET_FS_STATUS_PUBLISH_SUSPEND = 2, | |||
/** | /** | |||
* Notification that we are making progress sharing a file structure. | * Notification that we are making progress sharing a file structure. | |||
*/ | */ | |||
GNUNET_FS_STATUS_PUBLISH_PROGRESS, | GNUNET_FS_STATUS_PUBLISH_PROGRESS = 3, | |||
/** | /** | |||
* Notification that an error was encountered sharing a file structure. | * Notification that an error was encountered sharing a file structure. | |||
* The application will continue to receive resume/suspend events for | * The application will continue to receive resume/suspend events for | |||
* this structure until "GNUNET_FS_publish_stop" is called. | * this structure until "GNUNET_FS_publish_stop" is called. | |||
*/ | */ | |||
GNUNET_FS_STATUS_PUBLISH_ERROR, | GNUNET_FS_STATUS_PUBLISH_ERROR = 4, | |||
/** | /** | |||
* Notification that we completed sharing a file structure. | * Notification that we completed sharing a file structure. | |||
* The application will continue to receive resume/suspend events for | * The application will continue to receive resume/suspend events for | |||
* this structure until "GNUNET_FS_publish_stop" is called. | * this structure until "GNUNET_FS_publish_stop" is called. | |||
*/ | */ | |||
GNUNET_FS_STATUS_PUBLISH_COMPLETED, | GNUNET_FS_STATUS_PUBLISH_COMPLETED = 5, | |||
/** | /** | |||
* Notification that we have stopped | * Notification that we have stopped | |||
* the process of uploading a file structure; no | * the process of uploading a file structure; no | |||
* futher events will be generated for this action. | * futher events will be generated for this action. | |||
*/ | */ | |||
GNUNET_FS_STATUS_PUBLISH_STOPPED, | GNUNET_FS_STATUS_PUBLISH_STOPPED = 6, | |||
/** | /** | |||
* Notification that we have started this download. | * Notification that we have started this download. | |||
*/ | */ | |||
GNUNET_FS_STATUS_DOWNLOAD_START, | GNUNET_FS_STATUS_DOWNLOAD_START = 7, | |||
/** | /** | |||
* Notification that this download is being resumed. | * Notification that this download is being resumed. | |||
*/ | */ | |||
GNUNET_FS_STATUS_DOWNLOAD_RESUME, | GNUNET_FS_STATUS_DOWNLOAD_RESUME = 8, | |||
/** | /** | |||
* Notification that this download was suspended. | * Notification that this download was suspended. | |||
*/ | */ | |||
GNUNET_FS_STATUS_DOWNLOAD_SUSPEND, | GNUNET_FS_STATUS_DOWNLOAD_SUSPEND = 9, | |||
/** | /** | |||
* Notification about progress with this download. | * Notification about progress with this download. | |||
*/ | */ | |||
GNUNET_FS_STATUS_DOWNLOAD_PROGRESS, | GNUNET_FS_STATUS_DOWNLOAD_PROGRESS = 10, | |||
/** | /** | |||
* Notification that this download encountered an error. | * Notification that this download encountered an error. | |||
*/ | */ | |||
GNUNET_FS_STATUS_DOWNLOAD_ERROR, | GNUNET_FS_STATUS_DOWNLOAD_ERROR = 11, | |||
/** | /** | |||
* Notification that this download completed. Note that for | * Notification that this download completed. Note that for | |||
* directories, completion does not imply completion of all files in | * directories, completion does not imply completion of all files in | |||
* the directory. | * the directory. | |||
*/ | */ | |||
GNUNET_FS_STATUS_DOWNLOAD_COMPLETED, | GNUNET_FS_STATUS_DOWNLOAD_COMPLETED = 12, | |||
/** | /** | |||
* Notification that this download was stopped | * Notification that this download was stopped | |||
* (final event with respect to this action). | * (final event with respect to this action). | |||
*/ | */ | |||
GNUNET_FS_STATUS_DOWNLOAD_STOPPED, | GNUNET_FS_STATUS_DOWNLOAD_STOPPED = 13, | |||
/** | /** | |||
* Notification that this download is now actively being | * Notification that this download is now actively being | |||
* pursued (as opposed to waiting in the queue). | * pursued (as opposed to waiting in the queue). | |||
*/ | */ | |||
GNUNET_FS_STATUS_DOWNLOAD_ACTIVE, | GNUNET_FS_STATUS_DOWNLOAD_ACTIVE = 14, | |||
/** | /** | |||
* Notification that this download is no longer actively | * Notification that this download is no longer actively | |||
* being pursued (back in the queue). | * being pursued (back in the queue). | |||
*/ | */ | |||
GNUNET_FS_STATUS_DOWNLOAD_INACTIVE, | GNUNET_FS_STATUS_DOWNLOAD_INACTIVE = 15, | |||
/** | /** | |||
* Notification that this download is no longer part of a | * Notification that this download is no longer part of a | |||
* recursive download or search but now a 'stand-alone' | * recursive download or search but now a 'stand-alone' | |||
* download (and may thus need to be moved in the GUI | * download (and may thus need to be moved in the GUI | |||
* into a different category). | * into a different category). | |||
*/ | */ | |||
GNUNET_FS_STATUS_DOWNLOAD_LOST_PARENT, | GNUNET_FS_STATUS_DOWNLOAD_LOST_PARENT = 16, | |||
/** | /** | |||
* First event generated when a client requests | * First event generated when a client requests | |||
* a search to begin or when a namespace result | * a search to begin or when a namespace result | |||
* automatically triggers the search for updates. | * automatically triggers the search for updates. | |||
*/ | */ | |||
GNUNET_FS_STATUS_SEARCH_START, | GNUNET_FS_STATUS_SEARCH_START = 17, | |||
/** | /** | |||
* Last event when a search is being resumed; | * Last event when a search is being resumed; | |||
* note that "GNUNET_FS_SEARCH_START" will not | * note that "GNUNET_FS_SEARCH_START" will not | |||
* be generated in this case. | * be generated in this case. | |||
*/ | */ | |||
GNUNET_FS_STATUS_SEARCH_RESUME, | GNUNET_FS_STATUS_SEARCH_RESUME = 18, | |||
/** | /** | |||
* Event generated for each search result | * Event generated for each search result | |||
* when the respective search is resumed. | * when the respective search is resumed. | |||
*/ | */ | |||
GNUNET_FS_STATUS_SEARCH_RESUME_RESULT, | GNUNET_FS_STATUS_SEARCH_RESUME_RESULT = 19, | |||
/** | /** | |||
* Last event when a search is being suspended; | * Last event when a search is being suspended; | |||
* note that "GNUNET_FS_SEARCH_STOPPED" will not | * note that "GNUNET_FS_SEARCH_STOPPED" will not | |||
* be generated in this case. | * be generated in this case. | |||
*/ | */ | |||
GNUNET_FS_STATUS_SEARCH_SUSPEND, | GNUNET_FS_STATUS_SEARCH_SUSPEND = 20, | |||
/** | /** | |||
* This search has yielded a result. | * This search has yielded a result. | |||
*/ | */ | |||
GNUNET_FS_STATUS_SEARCH_RESULT, | GNUNET_FS_STATUS_SEARCH_RESULT = 21, | |||
/** | /** | |||
* We have discovered a new namespace. | * We have discovered a new namespace. | |||
*/ | */ | |||
GNUNET_FS_STATUS_SEARCH_RESULT_NAMESPACE, | GNUNET_FS_STATUS_SEARCH_RESULT_NAMESPACE = 22, | |||
/** | /** | |||
* We have additional data about the quality | * We have additional data about the quality | |||
* or availability of a search result. | * or availability of a search result. | |||
*/ | */ | |||
GNUNET_FS_STATUS_SEARCH_UPDATE, | GNUNET_FS_STATUS_SEARCH_UPDATE = 23, | |||
/** | /** | |||
* Signals a problem with this search. | * Signals a problem with this search. | |||
*/ | */ | |||
GNUNET_FS_STATUS_SEARCH_ERROR, | GNUNET_FS_STATUS_SEARCH_ERROR = 24, | |||
/** | /** | |||
* Signals that this search was paused. | * Signals that this search was paused. | |||
*/ | */ | |||
GNUNET_FS_STATUS_SEARCH_PAUSED, | GNUNET_FS_STATUS_SEARCH_PAUSED = 25, | |||
/** | /** | |||
* Signals that this search was continued (unpaused). | * Signals that this search was continued (unpaused). | |||
*/ | */ | |||
GNUNET_FS_STATUS_SEARCH_CONTINUED, | GNUNET_FS_STATUS_SEARCH_CONTINUED = 26, | |||
/** | /** | |||
* Event generated for each search result | * Event generated for each search result | |||
* when the respective search is stopped. | * when the respective search is stopped. | |||
*/ | */ | |||
GNUNET_FS_STATUS_SEARCH_RESULT_STOPPED, | GNUNET_FS_STATUS_SEARCH_RESULT_STOPPED = 27, | |||
/** | /** | |||
* Event generated for each search result | * Event generated for each search result | |||
* when the respective search is suspended. | * when the respective search is suspended. | |||
*/ | */ | |||
GNUNET_FS_STATUS_SEARCH_RESULT_SUSPEND, | GNUNET_FS_STATUS_SEARCH_RESULT_SUSPEND = 28, | |||
/** | /** | |||
* Last message from a search; this signals | * Last message from a search; this signals | |||
* that there will be no further events associated | * that there will be no further events associated | |||
* with this search. | * with this search. | |||
*/ | */ | |||
GNUNET_FS_STATUS_SEARCH_STOPPED, | GNUNET_FS_STATUS_SEARCH_STOPPED = 29, | |||
/** | /** | |||
* Notification that we started to unindex a file. | * Notification that we started to unindex a file. | |||
*/ | */ | |||
GNUNET_FS_STATUS_UNINDEX_START, | GNUNET_FS_STATUS_UNINDEX_START = 30, | |||
/** | /** | |||
* Notification that we resumed unindexing of a file. | * Notification that we resumed unindexing of a file. | |||
*/ | */ | |||
GNUNET_FS_STATUS_UNINDEX_RESUME, | GNUNET_FS_STATUS_UNINDEX_RESUME = 31, | |||
/** | /** | |||
* Notification that we suspended unindexing a file. | * Notification that we suspended unindexing a file. | |||
*/ | */ | |||
GNUNET_FS_STATUS_UNINDEX_SUSPEND, | GNUNET_FS_STATUS_UNINDEX_SUSPEND = 32, | |||
/** | /** | |||
* Notification that we made progress unindexing a file. | * Notification that we made progress unindexing a file. | |||
*/ | */ | |||
GNUNET_FS_STATUS_UNINDEX_PROGRESS, | GNUNET_FS_STATUS_UNINDEX_PROGRESS = 33, | |||
/** | /** | |||
* Notification that we encountered an error unindexing | * Notification that we encountered an error unindexing | |||
* a file. | * a file. | |||
*/ | */ | |||
GNUNET_FS_STATUS_UNINDEX_ERROR, | GNUNET_FS_STATUS_UNINDEX_ERROR = 34, | |||
/** | /** | |||
* Notification that the unindexing of this file | * Notification that the unindexing of this file | |||
* was completed. | * was completed. | |||
*/ | */ | |||
GNUNET_FS_STATUS_UNINDEX_COMPLETED, | GNUNET_FS_STATUS_UNINDEX_COMPLETED = 35, | |||
/** | /** | |||
* Notification that the unindexing of this file | * Notification that the unindexing of this file | |||
* was stopped (final event for this action). | * was stopped (final event for this action). | |||
*/ | */ | |||
GNUNET_FS_STATUS_UNINDEX_STOPPED | GNUNET_FS_STATUS_UNINDEX_STOPPED = 36 | |||
}; | }; | |||
/** | /** | |||
* Handle for controlling an upload. | * Handle for controlling an upload. | |||
*/ | */ | |||
struct GNUNET_FS_PublishContext; | struct GNUNET_FS_PublishContext; | |||
/** | /** | |||
* Handle for controlling an unindexing operation. | * Handle for controlling an unindexing operation. | |||
*/ | */ | |||
skipping to change at line 1611 | skipping to change at line 1598 | |||
/** | /** | |||
* Convert a year to an expiration time of January 1st of that year. | * Convert a year to an expiration time of January 1st of that year. | |||
* | * | |||
* @param year a year (after 1970, please ;-)). | * @param year a year (after 1970, please ;-)). | |||
* @return absolute time for January 1st of that year. | * @return absolute time for January 1st of that year. | |||
*/ | */ | |||
struct GNUNET_TIME_Absolute | struct GNUNET_TIME_Absolute | |||
GNUNET_FS_year_to_time (unsigned int year); | GNUNET_FS_year_to_time (unsigned int year); | |||
/** | /** | |||
* Convert an expiration time to the respective year (rounds) | ||||
* | ||||
* @param at absolute time | ||||
* @return year a year (after 1970), 0 on error | ||||
*/ | ||||
unsigned int | ||||
GNUNET_FS_time_to_year (struct GNUNET_TIME_Absolute at); | ||||
/** | ||||
* Handle to the file-sharing service. | * Handle to the file-sharing service. | |||
*/ | */ | |||
struct GNUNET_FS_Handle; | struct GNUNET_FS_Handle; | |||
/** | /** | |||
* Setup a connection to the file-sharing service. | * Setup a connection to the file-sharing service. | |||
* | * | |||
* @param cfg configuration to use | * @param cfg configuration to use | |||
* @param client_name unique identifier for this client | * @param client_name unique identifier for this client | |||
* @param upcb function to call to notify about FS actions | * @param upcb function to call to notify about FS actions | |||
skipping to change at line 1838 | skipping to change at line 1834 | |||
bo, GNUNET_FS_FileProcessor proc , | bo, GNUNET_FS_FileProcessor proc , | |||
void *proc_cls, char **emsg); | void *proc_cls, char **emsg); | |||
/** | /** | |||
* Simple, useful default implementation of a directory scanner | * Simple, useful default implementation of a directory scanner | |||
* (GNUNET_FS_DirectoryScanner). This implementation expects to get a | * (GNUNET_FS_DirectoryScanner). This implementation expects to get a | |||
* UNIX filename, will publish all files in the directory except hidden | * UNIX filename, will publish all files in the directory except hidden | |||
* files (those starting with a "."). Metadata will be extracted | * files (those starting with a "."). Metadata will be extracted | |||
* using GNU libextractor; the specific list of plugins should be | * using GNU libextractor; the specific list of plugins should be | |||
* specified in "cls", passing NULL will disable (!) metadata | * specified in "cls", passing NULL will disable (!) metadata | |||
* extraction. Keywords will be derived from the metadata and be | * extraction. Keywords will be derived from the metadata and | |||
* subject to default canonicalization. This is strictly a | * associated with directories as appropriate. This is strictly a | |||
* convenience function. | * convenience function (however, if all tools use it, there will | |||
* be less of a chance of distinguishing users by the specific | ||||
* user-interface they were using). | ||||
* | * | |||
* @param cls must be of type "struct EXTRACTOR_Extractor*" | * @param cls must be of type "struct EXTRACTOR_Extractor*" | |||
* @param h handle to the file sharing subsystem | * @param h handle to the file sharing subsystem | |||
* @param dirname name of the directory to scan | * @param dirname name of the directory to scan | |||
* @param do_index should files be indexed or inserted | * @param do_index should files be indexed or inserted | |||
* @param bo block options | * @param bo block options | |||
* @param proc function called on each entry | * @param proc function called on each entry | |||
* @param proc_cls closure for proc | * @param proc_cls closure for proc | |||
* @param emsg where to store an error message (on errors) | * @param emsg where to store an error message (on errors) | |||
* @return GNUNET_OK on success | * @return GNUNET_OK on success | |||
End of changes. 42 change blocks. | ||||
54 lines changed or deleted | 52 lines changed or added | |||
gnunet_getopt_lib.h | gnunet_getopt_lib.h | |||
---|---|---|---|---|
skipping to change at line 226 | skipping to change at line 226 | |||
* @param scls additional closure (will point to the 'unsigned long long') | * @param scls additional closure (will point to the 'unsigned long long') | |||
* @param option name of the option | * @param option name of the option | |||
* @param value actual value of the option as a string. | * @param value actual value of the option as a string. | |||
* @return GNUNET_OK if parsing the value worked | * @return GNUNET_OK if parsing the value worked | |||
*/ | */ | |||
int | int | |||
GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext * ctx, | GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext * ctx, | |||
void *scls, const char *option, const char *value) ; | void *scls, const char *option, const char *value) ; | |||
/** | /** | |||
* Set an option of type 'unsigned long long' from the command line. | * Set an option of type 'unsigned int' from the command line. | |||
* A pointer to this function should be passed as part of the | * A pointer to this function should be passed as part of the | |||
* 'struct GNUNET_GETOPT_CommandLineOption' array to initialize options | * 'struct GNUNET_GETOPT_CommandLineOption' array to initialize options | |||
* of this type. It should be followed by a pointer to a value of | * of this type. It should be followed by a pointer to a value of | |||
* type 'unsigned int'. | * type 'unsigned int'. | |||
* | * | |||
* @param ctx command line processing context | * @param ctx command line processing context | |||
* @param scls additional closure (will point to the 'unsigned int') | * @param scls additional closure (will point to the 'unsigned int') | |||
* @param option name of the option | * @param option name of the option | |||
* @param value actual value of the option as a string. | * @param value actual value of the option as a string. | |||
* @return GNUNET_OK if parsing the value worked | * @return GNUNET_OK if parsing the value worked | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
gnunet_network_lib.h | gnunet_network_lib.h | |||
---|---|---|---|---|
skipping to change at line 93 | skipping to change at line 93 | |||
struct sockaddr *address, | struct sockaddr *address, | |||
socklen_t * address_len); | socklen_t * address_len); | |||
/** | /** | |||
* Box a native socket (and check that it is a socket). | * Box a native socket (and check that it is a socket). | |||
* | * | |||
* @param fd socket to box | * @param fd socket to box | |||
* @return NULL on error (including not supported on target platform) | * @return NULL on error (including not supported on target platform) | |||
*/ | */ | |||
struct GNUNET_NETWORK_Handle * | struct GNUNET_NETWORK_Handle * | |||
GNUNET_NETWORK_socket_box_native (int fd); | GNUNET_NETWORK_socket_box_native (SOCKTYPE fd); | |||
/** | /** | |||
* Bind to a connected socket | * Bind to a connected socket | |||
* | * | |||
* @param desc socket to bind | * @param desc socket to bind | |||
* @param address address to be bound | * @param address address to be bound | |||
* @param address_len length of address | * @param address_len length of address | |||
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | |||
*/ | */ | |||
int | int | |||
skipping to change at line 300 | skipping to change at line 300 | |||
/** | /** | |||
* Add a socket to the FD set | * Add a socket to the FD set | |||
* @param fds fd set | * @param fds fd set | |||
* @param desc socket to add | * @param desc socket to add | |||
*/ | */ | |||
void | void | |||
GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, | GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, | |||
const struct GNUNET_NETWORK_Handle *desc); | const struct GNUNET_NETWORK_Handle *desc); | |||
#ifdef __MINGW32__ | #if WINDOWS | |||
/* TODO: maybe #ifdef WINDOWS? -ndurner */ | ||||
/** | /** | |||
* Add a W32 file handle to the fd set | * Add a W32 file handle to the fd set | |||
* @param fds fd set | * @param fds fd set | |||
* @param h the file handle to add | * @param h the file handle to add | |||
*/ | */ | |||
void | void | |||
GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FD Set | GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FD Set | |||
*fds, HANDLE h); | *fds, HANDLE h); | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 2 lines changed or added | |||
gnunet_os_lib.h | gnunet_os_lib.h | |||
---|---|---|---|---|
skipping to change at line 68 | skipping to change at line 68 | |||
* Return the "PREFIX" directory given to configure. | * Return the "PREFIX" directory given to configure. | |||
*/ | */ | |||
GNUNET_OS_IPK_PREFIX, | GNUNET_OS_IPK_PREFIX, | |||
/** | /** | |||
* Return the directory where the program binaries are installed. (bin/) | * Return the directory where the program binaries are installed. (bin/) | |||
*/ | */ | |||
GNUNET_OS_IPK_BINDIR, | GNUNET_OS_IPK_BINDIR, | |||
/** | /** | |||
* Return the directory where libraries are installed. (lib/) | * Return the directory where libraries are installed. (lib/gnunet/) | |||
*/ | */ | |||
GNUNET_OS_IPK_LIBDIR, | GNUNET_OS_IPK_LIBDIR, | |||
/** | /** | |||
* Return the directory where data is installed (share/) | * Return the directory where data is installed (share/gnunet/) | |||
*/ | */ | |||
GNUNET_OS_IPK_DATADIR, | GNUNET_OS_IPK_DATADIR, | |||
/** | /** | |||
* Return the directory where translations are installed (share/locale/) | * Return the directory where translations are installed (share/locale/) | |||
*/ | */ | |||
GNUNET_OS_IPK_LOCALEDIR, | GNUNET_OS_IPK_LOCALEDIR, | |||
/** | /** | |||
* Return the installation directory of this application, not | * Return the installation directory of this application, not | |||
* the one of the overall GNUnet installation (in case they | * the one of the overall GNUnet installation (in case they | |||
* are different). | * are different). | |||
*/ | */ | |||
GNUNET_OS_IPK_SELF_PREFIX, | GNUNET_OS_IPK_SELF_PREFIX, | |||
/** | /** | |||
* Return the prefix of the path with application icons. | * Return the prefix of the path with application icons (share/icons/). | |||
*/ | */ | |||
GNUNET_OS_IPK_ICONDIR | GNUNET_OS_IPK_ICONDIR, | |||
/** | ||||
* Return the prefix of the path with documentation files, including the | ||||
* license (share/doc/gnunet/). | ||||
*/ | ||||
GNUNET_OS_IPK_DOCDIR | ||||
}; | }; | |||
/** | /** | |||
* Process status types | * Process status types | |||
*/ | */ | |||
enum GNUNET_OS_ProcessStatusType | enum GNUNET_OS_ProcessStatusType | |||
{ | { | |||
/** | /** | |||
* The process is not known to the OS (or at | * The process is not known to the OS (or at | |||
* least not one of our children). | * least not one of our children). | |||
skipping to change at line 268 | skipping to change at line 274 | |||
* Start a process. | * Start a process. | |||
* | * | |||
* @param lsocks array of listen sockets to dup systemd-style (or NULL); | * @param lsocks array of listen sockets to dup systemd-style (or NULL); | |||
* must be NULL on platforms where dup is not supported | * must be NULL on platforms where dup is not supported | |||
* @param filename name of the binary | * @param filename name of the binary | |||
* @param argv NULL-terminated list of arguments to the process, | * @param argv NULL-terminated list of arguments to the process, | |||
* including the process name as the first argument | * including the process name as the first argument | |||
* @return pointer to process structure of the new process, NULL on error | * @return pointer to process structure of the new process, NULL on error | |||
*/ | */ | |||
struct GNUNET_OS_Process * | struct GNUNET_OS_Process * | |||
GNUNET_OS_start_process_v (const int *lsocks, const char *filename, | GNUNET_OS_start_process_v (const SOCKTYPE *lsocks, const char *filename, | |||
char *const argv[]); | char *const argv[]); | |||
/** | /** | |||
* Handle to a command action. | * Handle to a command action. | |||
*/ | */ | |||
struct GNUNET_OS_CommandHandle; | struct GNUNET_OS_CommandHandle; | |||
/** | /** | |||
* Type of a function to process a line of output. | * Type of a function to process a line of output. | |||
* | * | |||
End of changes. 5 change blocks. | ||||
5 lines changed or deleted | 11 lines changed or added | |||
gnunet_protocols.h | gnunet_protocols.h | |||
---|---|---|---|---|
skipping to change at line 81 | skipping to change at line 81 | |||
* Request to ARM to start a service. | * Request to ARM to start a service. | |||
*/ | */ | |||
#define GNUNET_MESSAGE_TYPE_ARM_START 8 | #define GNUNET_MESSAGE_TYPE_ARM_START 8 | |||
/** | /** | |||
* Request to ARM to stop a service. | * Request to ARM to stop a service. | |||
*/ | */ | |||
#define GNUNET_MESSAGE_TYPE_ARM_STOP 9 | #define GNUNET_MESSAGE_TYPE_ARM_STOP 9 | |||
/** | /** | |||
* Response from ARM: service is now up. | * Request ARM service itself to shutdown. | |||
*/ | */ | |||
#define GNUNET_MESSAGE_TYPE_ARM_IS_UP 10 | #define GNUNET_MESSAGE_TYPE_ARM_SHUTDOWN 10 | |||
/** | /** | |||
* Response from ARM: service is now down. | * Response from ARM. | |||
* (failed to start it or shut it down). | ||||
*/ | */ | |||
#define GNUNET_MESSAGE_TYPE_ARM_IS_DOWN 11 | #define GNUNET_MESSAGE_TYPE_ARM_RESULT 11 | |||
/** | ||||
* Response from ARM: service status is unknown. | ||||
*/ | ||||
#define GNUNET_MESSAGE_TYPE_ARM_IS_UNKNOWN 12 | ||||
/** | ||||
* Request ARM service shutdown. | ||||
*/ | ||||
#define GNUNET_MESSAGE_TYPE_ARM_SHUTDOWN 13 | ||||
/** | ||||
* Acknowledge service shutting down, disconnect | ||||
* indicates service stopped. | ||||
*/ | ||||
#define GNUNET_MESSAGE_TYPE_ARM_SHUTDOWN_ACK 14 | ||||
/************************************************************************** ***** | /************************************************************************** ***** | |||
* HELLO message types | * HELLO message types | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
/** | /** | |||
* HELLO message used for communicating peer addresses. | * HELLO message used for communicating peer addresses. | |||
* Managed by libgnunethello. | * Managed by libgnunethello. | |||
*/ | */ | |||
#define GNUNET_MESSAGE_TYPE_HELLO 16 | #define GNUNET_MESSAGE_TYPE_HELLO 16 | |||
End of changes. 4 change blocks. | ||||
21 lines changed or deleted | 4 lines changed or added | |||
gnunet_server_lib.h | gnunet_server_lib.h | |||
---|---|---|---|---|
skipping to change at line 48 | skipping to change at line 48 | |||
#include "gnunet_common.h" | #include "gnunet_common.h" | |||
#include "gnunet_connection_lib.h" | #include "gnunet_connection_lib.h" | |||
/** | /** | |||
* Largest supported message. | * Largest supported message. | |||
*/ | */ | |||
#define GNUNET_SERVER_MAX_MESSAGE_SIZE 65536 | #define GNUNET_SERVER_MAX_MESSAGE_SIZE 65536 | |||
/** | /** | |||
* Largest supported message. | * Smallest supported message. | |||
*/ | */ | |||
#define GNUNET_SERVER_MIN_BUFFER_SIZE sizeof (struct GNUNET_MessageHeader) | #define GNUNET_SERVER_MIN_BUFFER_SIZE sizeof (struct GNUNET_MessageHeader) | |||
/** | /** | |||
* @brief handle for a server | * @brief handle for a server | |||
*/ | */ | |||
struct GNUNET_SERVER_Handle; | struct GNUNET_SERVER_Handle; | |||
/** | /** | |||
* @brief opaque handle for a client of the server | * @brief opaque handle for a client of the server | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
gnunet_statistics_service.h | gnunet_statistics_service.h | |||
---|---|---|---|---|
skipping to change at line 92 | skipping to change at line 92 | |||
* | * | |||
* @param h statistics handle to destroy | * @param h statistics handle to destroy | |||
* @param sync_first set to GNUNET_YES if pending SET requests should | * @param sync_first set to GNUNET_YES if pending SET requests should | |||
* be completed | * be completed | |||
*/ | */ | |||
void | void | |||
GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, int sync_fir st); | GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, int sync_fir st); | |||
/** | /** | |||
* Watch statistics from the peer (be notified whenever they change). | * Watch statistics from the peer (be notified whenever they change). | |||
* Note that the only way to cancel a "watch" request is to destroy | ||||
* the statistics handle given as the first argument to this call. | ||||
* | * | |||
* @param handle identification of the statistics service | * @param handle identification of the statistics service | |||
* @param subsystem limit to the specified subsystem, never NULL | * @param subsystem limit to the specified subsystem, never NULL | |||
* @param name name of the statistic value, never NULL | * @param name name of the statistic value, never NULL | |||
* @param proc function to call on each value | * @param proc function to call on each value | |||
* @param proc_cls closure for proc | * @param proc_cls closure for proc | |||
* @return GNUNET_OK on success, GNUNET_SYSERR on error | * @return GNUNET_OK on success, GNUNET_SYSERR on error | |||
*/ | */ | |||
int | int | |||
GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle, | GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle, | |||
const char *subsystem, const char *name, | const char *subsystem, const char *name, | |||
GNUNET_STATISTICS_Iterator proc, void *proc_cls); | GNUNET_STATISTICS_Iterator proc, void *proc_cls); | |||
/** | /** | |||
* Stop watching statistics from the peer. | ||||
* | ||||
* @param handle identification of the statistics service | ||||
* @param subsystem limit to the specified subsystem, never NULL | ||||
* @param name name of the statistic value, never NULL | ||||
* @param proc function to call on each value | ||||
* @param proc_cls closure for proc | ||||
* @return GNUNET_OK on success, GNUNET_SYSERR on error (no such watch) | ||||
*/ | ||||
int | ||||
GNUNET_STATISTICS_watch_cancel (struct GNUNET_STATISTICS_Handle *handle, | ||||
const char *subsystem, const char *name, | ||||
GNUNET_STATISTICS_Iterator proc, void *proc_ | ||||
cls); | ||||
/** | ||||
* Continuation called by the "get_all" and "get" functions. | * Continuation called by the "get_all" and "get" functions. | |||
* | * | |||
* @param cls closure | * @param cls closure | |||
* @param success GNUNET_OK if statistics were | * @param success GNUNET_OK if statistics were | |||
* successfully obtained, GNUNET_SYSERR if not. | * successfully obtained, GNUNET_SYSERR if not. | |||
*/ | */ | |||
typedef void (*GNUNET_STATISTICS_Callback) (void *cls, int success); | typedef void (*GNUNET_STATISTICS_Callback) (void *cls, int success); | |||
/** | /** | |||
* Handle that can be used to cancel a statistics 'get' operation. | * Handle that can be used to cancel a statistics 'get' operation. | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 16 lines changed or added | |||
gnunet_strings_lib.h | gnunet_strings_lib.h | |||
---|---|---|---|---|
skipping to change at line 86 | skipping to change at line 86 | |||
* Convert a given filesize into a fancy human-readable format. | * Convert a given filesize into a fancy human-readable format. | |||
* | * | |||
* @param size number of bytes | * @param size number of bytes | |||
* @return fancy representation of the size (possibly rounded) for humans | * @return fancy representation of the size (possibly rounded) for humans | |||
*/ | */ | |||
char * | char * | |||
GNUNET_STRINGS_byte_size_fancy (unsigned long long size); | GNUNET_STRINGS_byte_size_fancy (unsigned long long size); | |||
/** | /** | |||
* Convert the len characters long character sequence | * Convert the len characters long character sequence | |||
* given in input that is in the given input charset | ||||
* to a string in given output charset. | ||||
* @return the converted string (0-terminated), | ||||
* if conversion fails, a copy of the orignal | ||||
* string is returned. | ||||
*/ | ||||
char * | ||||
GNUNET_STRINGS_conv (const char *input, size_t len, | ||||
const char *input_charset, const char *output_charset); | ||||
/** | ||||
* Convert the len characters long character sequence | ||||
* given in input that is in the given charset | * given in input that is in the given charset | |||
* to UTF-8. | * to UTF-8. | |||
* | * | |||
* @param input the input string (not necessarily 0-terminated) | * @param input the input string (not necessarily 0-terminated) | |||
* @param len the number of bytes in the input | * @param len the number of bytes in the input | |||
* @param charset character set to convert from | * @param charset character set to convert from | |||
* @return the converted string (0-terminated) | * @return the converted string (0-terminated) | |||
*/ | */ | |||
char * | char * | |||
GNUNET_STRINGS_to_utf8 (const char *input, size_t len, const char *charset) ; | GNUNET_STRINGS_to_utf8 (const char *input, size_t len, const char *charset) ; | |||
/** | /** | |||
* Convert the len bytes-long UTF-8 string | ||||
* given in input to the given charset. | ||||
* @return the converted string (0-terminated), | ||||
* if conversion fails, a copy of the orignal | ||||
* string is returned. | ||||
*/ | ||||
char * | ||||
GNUNET_STRINGS_from_utf8 (const char *input, size_t len, const char *charse | ||||
t); | ||||
/** | ||||
* Complete filename (a la shell) from abbrevition. | * Complete filename (a la shell) from abbrevition. | |||
* | * | |||
* @param fil the name of the file, may contain ~/ or | * @param fil the name of the file, may contain ~/ or | |||
* be relative to the current directory | * be relative to the current directory | |||
* @return the full file name, | * @return the full file name, | |||
* NULL is returned on error | * NULL is returned on error | |||
*/ | */ | |||
char * | char * | |||
GNUNET_STRINGS_filename_expand (const char *fil); | GNUNET_STRINGS_filename_expand (const char *fil); | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 24 lines changed or added | |||
gnunet_testing_lib.h | gnunet_testing_lib.h | |||
---|---|---|---|---|
skipping to change at line 605 | skipping to change at line 605 | |||
* @param allow_restart GNUNET_YES to restart peer later (using this API) | * @param allow_restart GNUNET_YES to restart peer later (using this API) | |||
* GNUNET_NO to kill off and clean up for good | * GNUNET_NO to kill off and clean up for good | |||
*/ | */ | |||
void | void | |||
GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, | GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, | |||
struct GNUNET_TIME_Relative timeout, | struct GNUNET_TIME_Relative timeout, | |||
GNUNET_TESTING_NotifyCompletion cb, void *cb_cl s, | GNUNET_TESTING_NotifyCompletion cb, void *cb_cl s, | |||
int delete_files, int allow_restart); | int delete_files, int allow_restart); | |||
/** | /** | |||
* Create a new configuration using the given configuration | ||||
* as a template; however, each PORT in the existing cfg | ||||
* must be renumbered by incrementing "*port". If we run | ||||
* out of "*port" numbers, return NULL. | ||||
* | ||||
* @param cfg template configuration | ||||
* @param off the current peer offset | ||||
* @param port port numbers to use, update to reflect | ||||
* port numbers that were used | ||||
* @param upnum number to make unix domain socket names unique | ||||
* @param hostname hostname of the controlling host, to allow control conne | ||||
ctions from | ||||
* @param fdnum number used to offset the unix domain socket for grouped pr | ||||
ocesses | ||||
* (such as statistics or peerinfo, which can be shared among | ||||
others) | ||||
* | ||||
* @return new configuration, NULL on error | ||||
*/ | ||||
struct GNUNET_CONFIGURATION_Handle * | ||||
GNUNET_TESTING_create_cfg (const struct GNUNET_CONFIGURATION_Handle *cfg, u | ||||
int32_t off, | ||||
uint16_t * port, uint32_t * upnum, const char *hostname, | ||||
uint32_t * fdnum); | ||||
/** | ||||
* Changes the configuration of a GNUnet daemon. | * Changes the configuration of a GNUnet daemon. | |||
* | * | |||
* @param d the daemon that should be modified | * @param d the daemon that should be modified | |||
* @param cfg the new configuration for the daemon | * @param cfg the new configuration for the daemon | |||
* @param cb function called once the configuration was changed | * @param cb function called once the configuration was changed | |||
* @param cb_cls closure for cb | * @param cb_cls closure for cb | |||
*/ | */ | |||
void | void | |||
GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, | GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, | |||
struct GNUNET_CONFIGURATION_Handle *cfg, | struct GNUNET_CONFIGURATION_Handle *cfg, | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 26 lines changed or added | |||
gnunet_time_lib.h | gnunet_time_lib.h | |||
---|---|---|---|---|
skipping to change at line 64 | skipping to change at line 64 | |||
* Always positive, so we can only refer to future time. | * Always positive, so we can only refer to future time. | |||
*/ | */ | |||
struct GNUNET_TIME_Relative | struct GNUNET_TIME_Relative | |||
{ | { | |||
/** | /** | |||
* The actual value. | * The actual value. | |||
*/ | */ | |||
uint64_t rel_value; | uint64_t rel_value; | |||
}; | }; | |||
GNUNET_NETWORK_STRUCT_BEGIN | ||||
/** | /** | |||
* Time for relative time used by GNUnet, in milliseconds and in network by te order. | * Time for relative time used by GNUnet, in milliseconds and in network by te order. | |||
*/ | */ | |||
struct GNUNET_TIME_RelativeNBO | struct GNUNET_TIME_RelativeNBO | |||
{ | { | |||
/** | /** | |||
* The actual value (in network byte order). | * The actual value (in network byte order). | |||
*/ | */ | |||
uint64_t rel_value__ GNUNET_PACKED; | uint64_t rel_value__ GNUNET_PACKED; | |||
}; | }; | |||
skipping to change at line 85 | skipping to change at line 87 | |||
/** | /** | |||
* Time for absolute time used by GNUnet, in milliseconds and in network by te order. | * Time for absolute time used by GNUnet, in milliseconds and in network by te order. | |||
*/ | */ | |||
struct GNUNET_TIME_AbsoluteNBO | struct GNUNET_TIME_AbsoluteNBO | |||
{ | { | |||
/** | /** | |||
* The actual value (in network byte order). | * The actual value (in network byte order). | |||
*/ | */ | |||
uint64_t abs_value__ GNUNET_PACKED; | uint64_t abs_value__ GNUNET_PACKED; | |||
}; | }; | |||
GNUNET_NETWORK_STRUCT_END | ||||
/** | /** | |||
* Relative time zero. | * Relative time zero. | |||
*/ | */ | |||
#define GNUNET_TIME_UNIT_ZERO GNUNET_TIME_relative_get_zero() | #define GNUNET_TIME_UNIT_ZERO GNUNET_TIME_relative_get_zero() | |||
/** | /** | |||
* Absolute time zero. | * Absolute time zero. | |||
*/ | */ | |||
#define GNUNET_TIME_UNIT_ZERO_ABS GNUNET_TIME_absolute_get_zero() | #define GNUNET_TIME_UNIT_ZERO_ABS GNUNET_TIME_absolute_get_zero() | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added | |||
gnunet_transport_plugin.h | gnunet_transport_plugin.h | |||
---|---|---|---|---|
skipping to change at line 129 | skipping to change at line 129 | |||
ats_cou nt, | ats_cou nt, | |||
struct | struct | |||
Session * | Session * | |||
session , | session , | |||
const c har | const c har | |||
*sender _address, | *sender _address, | |||
uint16_ t | uint16_ t | |||
sender_ address_len); | sender_ address_len); | |||
/** | /** | |||
* Function that will be called to figure if an address is an loopback, | ||||
* LAN, WAN etc. address | ||||
* | ||||
* @param cls closure | ||||
* @param addr binary address | ||||
* @param addrlen length of the address | ||||
* @return ATS Information containing the network type | ||||
*/ | ||||
typedef const struct GNUNET_ATS_Information | ||||
(*GNUNET_TRANSPORT_AddressToType) (void *cls, | ||||
const struct sockaddr *addr, | ||||
size_t addrlen); | ||||
/** | ||||
* Function that will be called for each address the transport | * Function that will be called for each address the transport | |||
* is aware that it might be reachable under. | * is aware that it might be reachable under. | |||
* | * | |||
* @param cls closure | * @param cls closure | |||
* @param add_remove should the address added (YES) or removed (NO) from th e | * @param add_remove should the address added (YES) or removed (NO) from th e | |||
* set of valid addresses? | * set of valid addresses? | |||
* @param addr one of the addresses of the host | * @param addr one of the addresses of the host | |||
* the specific address format depends on the transport | * the specific address format depends on the transport | |||
* @param addrlen length of the address | * @param addrlen length of the address | |||
*/ | */ | |||
skipping to change at line 225 | skipping to change at line 239 | |||
*/ | */ | |||
GNUNET_TRANSPORT_AddressNotification notify_address; | GNUNET_TRANSPORT_AddressNotification notify_address; | |||
/** | /** | |||
* Function that must be called by the plugin when a non-NULL | * Function that must be called by the plugin when a non-NULL | |||
* session handle stops being valid (is destroyed). | * session handle stops being valid (is destroyed). | |||
*/ | */ | |||
GNUNET_TRANSPORT_SessionEnd session_end; | GNUNET_TRANSPORT_SessionEnd session_end; | |||
/** | /** | |||
* Function that will be called to figure if an address is an loopback, | ||||
* LAN, WAN etc. address | ||||
*/ | ||||
GNUNET_TRANSPORT_AddressToType get_address_type; | ||||
/** | ||||
* What is the maximum number of connections that this transport | * What is the maximum number of connections that this transport | |||
* should allow? Transports that do not have sessions (such as | * should allow? Transports that do not have sessions (such as | |||
* UDP) can ignore this value. | * UDP) can ignore this value. | |||
*/ | */ | |||
uint32_t max_connections; | uint32_t max_connections; | |||
}; | }; | |||
/** | /** | |||
* Function called by the GNUNET_TRANSPORT_TransmitFunction | * Function called by the GNUNET_TRANSPORT_TransmitFunction | |||
skipping to change at line 308 | skipping to change at line 328 | |||
GNUNET_TIME_Relative | GNUNET_TIME_Relative | |||
timeout, | timeout, | |||
struct Session * sess ion, | struct Session * sess ion, | |||
const void *addr, | const void *addr, | |||
size_t addrlen, | size_t addrlen, | |||
int force_address, | int force_address, | |||
GNUNET_TRANSPORT_Tran smitContinuation | GNUNET_TRANSPORT_Tran smitContinuation | |||
cont, void *cont_cls) ; | cont, void *cont_cls) ; | |||
/** | /** | |||
* The new send function with just the session and no address | ||||
* | ||||
* Function that can be used by the transport service to transmit | ||||
* a message using the plugin. Note that in the case of a | ||||
* peer disconnecting, the continuation MUST be called | ||||
* prior to the disconnect notification itself. This function | ||||
* will be called with this peer's HELLO message to initiate | ||||
* a fresh connection to another peer. | ||||
* | ||||
* @param cls closure | ||||
* @param target who should receive this message | ||||
* @param msgbuf the message to transmit | ||||
* @param msgbuf_size number of bytes in 'msgbuf' | ||||
* @param priority how important is the message (most plugins will | ||||
* ignore message priority and just FIFO) | ||||
* @param timeout how long to wait at most for the transmission (does not | ||||
* require plugins to discard the message after the timeout, | ||||
* just advisory for the desired delay; most plugins will ig | ||||
nore | ||||
* this as well) | ||||
* @param session which session must be used (or NULL for "any") | ||||
* @param addr the address to use (can be NULL if the plugin | ||||
* is "on its own" (i.e. re-use existing TCP connection)) | ||||
* @param addrlen length of the address in bytes | ||||
* @param force_address GNUNET_YES if the plugin MUST use the given address | ||||
, | ||||
* GNUNET_NO means the plugin may use any other address and | ||||
* GNUNET_SYSERR means that only reliable existing | ||||
* bi-directional connections should be used (regardless | ||||
* of address) | ||||
* @param cont continuation to call once the message has | ||||
* been transmitted (or if the transport is ready | ||||
* for the next transmission call; or if the | ||||
* peer disconnected...); can be NULL | ||||
* @param cont_cls closure for cont | ||||
* @return number of bytes used (on the physical network, with overheads); | ||||
* -1 on hard errors (i.e. address invalid); 0 is a legal value | ||||
* and does NOT mean that the message was not transmitted (DV) | ||||
*/ | ||||
typedef ssize_t (*GNUNET_TRANSPORT_TransmitFunctionWithSession) (void *cls, | ||||
const struct | ||||
GNUNET_PeerIdentity * | ||||
target, | ||||
const char *msgbuf, | ||||
size_t msgbuf_size, | ||||
uint32_t priority, | ||||
struct GNUNET_TIME_Re | ||||
lative timeout, | ||||
struct Session * sess | ||||
ion, | ||||
GNUNET_TRANSPORT_Tran | ||||
smitContinuation | ||||
cont, void *cont_cls) | ||||
; | ||||
/** | ||||
* Function that can be called to force a disconnect from the | * Function that can be called to force a disconnect from the | |||
* specified neighbour. This should also cancel all previously | * specified neighbour. This should also cancel all previously | |||
* scheduled transmissions. Obviously the transmission may have been | * scheduled transmissions. Obviously the transmission may have been | |||
* partially completed already, which is OK. The plugin is supposed | * partially completed already, which is OK. The plugin is supposed | |||
* to close the connection (if applicable) and no longer call the | * to close the connection (if applicable) and no longer call the | |||
* transmit continuation(s). | * transmit continuation(s). | |||
* | * | |||
* Finally, plugin MUST NOT call the services's receive function to | * Finally, plugin MUST NOT call the services's receive function to | |||
* notify the service that the connection to the specified target was | * notify the service that the connection to the specified target was | |||
* closed after a getting this call. | * closed after a getting this call. | |||
skipping to change at line 382 | skipping to change at line 452 | |||
* | * | |||
* @param addr pointer to the address | * @param addr pointer to the address | |||
* @param addrlen length of addr | * @param addrlen length of addr | |||
* @return GNUNET_OK if this is a plausible address for this peer | * @return GNUNET_OK if this is a plausible address for this peer | |||
* and transport, GNUNET_SYSERR if not | * and transport, GNUNET_SYSERR if not | |||
*/ | */ | |||
typedef int (*GNUNET_TRANSPORT_CheckAddress) (void *cls, const void *addr, | typedef int (*GNUNET_TRANSPORT_CheckAddress) (void *cls, const void *addr, | |||
size_t addrlen); | size_t addrlen); | |||
/** | /** | |||
* Create a new session to transmit data to the target | ||||
* This session will used to send data to this peer and the plugin will | ||||
* notify us by calling the env->session_end function | ||||
* | ||||
* @param cls closure | ||||
* @param target the neighbour id | ||||
* @param addr pointer to the address | ||||
* @param addrlen length of addr | ||||
* @return the session if the address is valid, NULL otherwise | ||||
*/ | ||||
typedef const void * (*GNUNET_TRANSPORT_CreateSession) (void *cls, | ||||
const struct GNUNET_PeerI | ||||
dentity *target, | ||||
const void *addr, | ||||
size_t addrlen); | ||||
/** | ||||
* Function called for a quick conversion of the binary address to | * Function called for a quick conversion of the binary address to | |||
* a numeric address. Note that the caller must not free the | * a numeric address. Note that the caller must not free the | |||
* address and that the next call to this function is allowed | * address and that the next call to this function is allowed | |||
* to override the address again. | * to override the address again. | |||
* | * | |||
* @param cls closure | * @param cls closure | |||
* @param addr binary address | * @param addr binary address | |||
* @param addr_len length of the address | * @param addr_len length of the address | |||
* @return string representing the same address | * @return string representing the same address | |||
*/ | */ | |||
skipping to change at line 418 | skipping to change at line 504 | |||
/** | /** | |||
* Function that the transport service will use to transmit data to | * Function that the transport service will use to transmit data to | |||
* another peer. May be NULL for plugins that only support | * another peer. May be NULL for plugins that only support | |||
* receiving data. After this call, the plugin call the specified | * receiving data. After this call, the plugin call the specified | |||
* continuation with success or error before notifying us about the | * continuation with success or error before notifying us about the | |||
* target having disconnected. | * target having disconnected. | |||
*/ | */ | |||
GNUNET_TRANSPORT_TransmitFunction send; | GNUNET_TRANSPORT_TransmitFunction send; | |||
/** | /** | |||
* New send function | ||||
* Will be renamed to "send" when implementation is done | ||||
*/ | ||||
GNUNET_TRANSPORT_TransmitFunctionWithSession send_with_session; | ||||
/** | ||||
* Function that can be used to force the plugin to disconnect from | * Function that can be used to force the plugin to disconnect from | |||
* the given peer and cancel all previous transmissions (and their | * the given peer and cancel all previous transmissions (and their | |||
* continuations). | * continuations). | |||
*/ | */ | |||
GNUNET_TRANSPORT_DisconnectFunction disconnect; | GNUNET_TRANSPORT_DisconnectFunction disconnect; | |||
/** | /** | |||
* Function to pretty-print addresses. NOTE: this function is not | * Function to pretty-print addresses. NOTE: this function is not | |||
* yet used by transport-service, but will be used in the future | * yet used by transport-service, but will be used in the future | |||
* once the transport-API has been completed. | * once the transport-API has been completed. | |||
skipping to change at line 448 | skipping to change at line 541 | |||
* try to man-in-the-middle our traffic. | * try to man-in-the-middle our traffic. | |||
*/ | */ | |||
GNUNET_TRANSPORT_CheckAddress check_address; | GNUNET_TRANSPORT_CheckAddress check_address; | |||
/** | /** | |||
* Function that will be called to convert a binary address | * Function that will be called to convert a binary address | |||
* to a string (numeric conversion only). | * to a string (numeric conversion only). | |||
*/ | */ | |||
GNUNET_TRANSPORT_AddressToString address_to_string; | GNUNET_TRANSPORT_AddressToString address_to_string; | |||
/** | ||||
* Function that will be called tell the plugin to create a session | ||||
* object | ||||
*/ | ||||
GNUNET_TRANSPORT_CreateSession create_session; | ||||
}; | }; | |||
#endif | #endif | |||
End of changes. 6 change blocks. | ||||
0 lines changed or deleted | 105 lines changed or added | |||
platform.h | platform.h | |||
---|---|---|---|---|
skipping to change at line 72 | skipping to change at line 72 | |||
#ifndef _REENTRANT | #ifndef _REENTRANT | |||
#define _REENTRANT | #define _REENTRANT | |||
#endif | #endif | |||
/* configuration options */ | /* configuration options */ | |||
#define VERBOSE_STATS 0 | #define VERBOSE_STATS 0 | |||
#ifdef CYGWIN | #ifdef CYGWIN | |||
#include <sys/reent.h> | #include <sys/reent.h> | |||
#define _REENT_ONLY | ||||
#endif | ||||
#ifdef CYGWIN | ||||
#undef _REENT_ONLY | ||||
#endif | #endif | |||
#ifdef _MSC_VER | #ifdef _MSC_VER | |||
#ifndef FD_SETSIZE | ||||
#define FD_SETSIZE 1024 | ||||
#endif | ||||
#include <Winsock2.h> | #include <Winsock2.h> | |||
#include <ws2tcpip.h> | #include <ws2tcpip.h> | |||
#else | #else | |||
#ifndef MINGW | #ifndef MINGW | |||
#include <netdb.h> | #include <netdb.h> | |||
#include <sys/socket.h> | #include <sys/socket.h> | |||
#include <sys/un.h> | #include <sys/un.h> | |||
#if HAVE_NETINET_IN_H | #if HAVE_NETINET_IN_H | |||
#include <netinet/in.h> | #include <netinet/in.h> | |||
#endif | #endif | |||
skipping to change at line 250 | skipping to change at line 248 | |||
#ifndef O_LARGEFILE | #ifndef O_LARGEFILE | |||
#define O_LARGEFILE 0 | #define O_LARGEFILE 0 | |||
#endif | #endif | |||
#if defined(__sparc__) | #if defined(__sparc__) | |||
#define MAKE_UNALIGNED(val) ({ __typeof__((val)) __tmp; memmove(&__tmp, &(v al), sizeof((val))); __tmp; }) | #define MAKE_UNALIGNED(val) ({ __typeof__((val)) __tmp; memmove(&__tmp, &(v al), sizeof((val))); __tmp; }) | |||
#else | #else | |||
#define MAKE_UNALIGNED(val) val | #define MAKE_UNALIGNED(val) val | |||
#endif | #endif | |||
#if WINDOWS | ||||
#define FDTYPE HANDLE | ||||
#define SOCKTYPE SOCKET | ||||
#else | ||||
#define FDTYPE int | ||||
#define SOCKTYPE int | ||||
#endif | ||||
#endif | #endif | |||
End of changes. 3 change blocks. | ||||
5 lines changed or deleted | 11 lines changed or added | |||