| 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_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_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_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_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 | |
|