gnunet_applications.h   gnunet_applications.h 
skipping to change at line 54 skipping to change at line 54
* Test. * Test.
*/ */
#define GNUNET_APPLICATION_TYPE_TEST 1 #define GNUNET_APPLICATION_TYPE_TEST 1
/** /**
* Internet DNS resolution (external DNS gateway). * Internet DNS resolution (external DNS gateway).
*/ */
#define GNUNET_APPLICATION_TYPE_INTERNET_RESOLVER 2 #define GNUNET_APPLICATION_TYPE_INTERNET_RESOLVER 2
/** /**
* Transfer of blocks for non-anonymmous file-sharing.
*/
#define GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER 3
/**
* Internet IPv4 gateway (any TCP/UDP/ICMP). * Internet IPv4 gateway (any TCP/UDP/ICMP).
*/ */
#define GNUNET_APPLICATION_TYPE_IPV4_GATEWAY 16 #define GNUNET_APPLICATION_TYPE_IPV4_GATEWAY 16
/** /**
* Internet IPv6 gateway (any TCP/UDP/ICMP). * Internet IPv6 gateway (any TCP/UDP/ICMP).
*/ */
#define GNUNET_APPLICATION_TYPE_IPV6_GATEWAY 17 #define GNUNET_APPLICATION_TYPE_IPV6_GATEWAY 17
/** /**
* Internet exit regex prefix. Consisting of application ID, followed by ve rsion * Internet exit regex prefix. Consisting of application ID, followed by ve rsion
* and padding. * and padding.
*/ */
#define GNUNET_APPLICATION_TYPE_EXIT_REGEX_PREFIX "GNEX0001PADPADPA" #define GNUNET_APPLICATION_TYPE_EXIT_REGEX_PREFIX "GNUNET-VPN-VER-0001-"
#if 0 /* keep Emacsens' auto-indent happy */ #if 0 /* keep Emacsens' auto-indent happy */
{ {
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/* ifndef GNUNET_APPLICATIONS_H */ /* ifndef GNUNET_APPLICATIONS_H */
#endif #endif
 End of changes. 2 change blocks. 
1 lines changed or deleted 6 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"
/**
* Number of network types supported by ATS
*/
#define GNUNET_ATS_NetworkTypeCount 5
/**
* ATS network types as array initializer
*/
#define GNUNET_ATS_NetworkType {GNUNET_ATS_NET_UNSPECIFIED, GNUNET_ATS_NET_
LOOPBACK, GNUNET_ATS_NET_LAN, GNUNET_ATS_NET_WAN, GNUNET_ATS_NET_WLAN}
/**
* ATS network types as string array initializer
*/
#define GNUNET_ATS_NetworkTypeString {"UNSPECIFIED", "LOOPBACK", "LAN", "WA
N", "WLAN"}
enum GNUNET_ATS_Network_Type enum GNUNET_ATS_Network_Type
{ {
GNUNET_ATS_NET_UNSPECIFIED = 0, GNUNET_ATS_NET_UNSPECIFIED = 0,
GNUNET_ATS_NET_LOOPBACK = 1, GNUNET_ATS_NET_LOOPBACK = 1,
GNUNET_ATS_NET_LAN = 2, GNUNET_ATS_NET_LAN = 2,
GNUNET_ATS_NET_WAN = 3, GNUNET_ATS_NET_WAN = 3,
GNUNET_ATS_NET_WLAN = 4, GNUNET_ATS_NET_WLAN = 4,
}; };
/** /**
* Default bandwidth assigned to a network : 64 KB/s
*/
#define GNUNET_ATS_DefaultBandwidth 65536
/**
* Maximum bandwidth assigned to a network : 4095 MB/s
*/
#define GNUNET_ATS_MaxBandwidth UINT32_MAX
/**
* Number of property types supported by ATS
*/
#define GNUNET_ATS_PropertyCount 9
/**
* ATS properties types as string array initializer
*/
#define GNUNET_ATS_PropertyStrings {"Terminator", "Utilization up", "Utiliz
ation down", "Network type", "Delay", "Distance", "Cost WAN", "Cost LAN", "
Cost WLAN"}
/**
* 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 415 skipping to change at line 450
* Number of ATS quality properties * Number of ATS quality properties
*/ */
#define GNUNET_ATS_QualityPropertiesCount 2 #define GNUNET_ATS_QualityPropertiesCount 2
/** /**
* ATS quality properties as array initializer * ATS quality properties as array initializer
*/ */
#define GNUNET_ATS_QualityProperties {GNUNET_ATS_QUALITY_NET_DELAY, GNUNET_ ATS_QUALITY_NET_DISTANCE} #define GNUNET_ATS_QualityProperties {GNUNET_ATS_QUALITY_NET_DELAY, GNUNET_ ATS_QUALITY_NET_DISTANCE}
/** /**
* Number of ATS quality properties * ATS quality properties as string array initializer
*/ */
#define GNUNET_ATS_NetworkTypeCount 5 #define GNUNET_ATS_QualityPropertiesString {"Delay", "Distance"}
/**
* ATS quality properties as array initializer
*/
#define GNUNET_ATS_NetworkType {GNUNET_ATS_NET_UNSPECIFIED, GNUNET_ATS_NET_
LOOPBACK, GNUNET_ATS_NET_LAN, GNUNET_ATS_NET_WAN, GNUNET_ATS_NET_WLAN}
GNUNET_NETWORK_STRUCT_BEGIN 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 +---------+
skipping to change at line 551 skipping to change at line 581
* 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);
/** /**
* Convert a GNUNET_ATS_NetworkType to a string
*
* @param net the network type
* @return a string or NULL if invalid
*/
const char *
GNUNET_ATS_print_network_type (uint32_t net);
/**
* Returns where the address is located: LAN or WAN or ... * Returns where the address is located: LAN or WAN or ...
* @param sh the GNUNET_ATS_SchedulingHandle handle * @param sh the GNUNET_ATS_SchedulingHandle handle
* @param addr address * @param addr address
* @param addrlen address length * @param addrlen address length
* @return location as GNUNET_ATS_Information * @return location as GNUNET_ATS_Information
*/ */
struct GNUNET_ATS_Information struct GNUNET_ATS_Information
GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle *sh, GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle *sh,
const struct sockaddr * addr, const struct sockaddr * addr,
socklen_t addrlen); socklen_t addrlen);
skipping to change at line 658 skipping to change at line 697
GNUNET_BANDWIDTH_Value3 2NBO GNUNET_BANDWIDTH_Value3 2NBO
bandwidth_out, bandwidth_out,
struct struct
GNUNET_BANDWIDTH_Value3 2NBO GNUNET_BANDWIDTH_Value3 2NBO
bandwidth_in, bandwidth_in,
const struct const struct
GNUNET_ATS_Information * GNUNET_ATS_Information *
ats, uint32_t ats_count ); ats, uint32_t ats_count );
/** /**
* Handle for an address listing operation
*/
struct GNUNET_ATS_AddressListHandle;
/**
* Get handle to access performance API of the ATS subsystem. * Get handle to access performance API of the ATS subsystem.
* *
* @param cfg configuration to use * @param cfg configuration to use
* @param infocb function to call on performance changes, can be NULL * @param infocb function to call on performance changes, can be NULL
* @param infocb_cls closure for infocb * @param infocb_cls closure for infocb
* @return ats performance context * @return ats performance context
*/ */
struct GNUNET_ATS_PerformanceHandle * struct GNUNET_ATS_PerformanceHandle *
GNUNET_ATS_performance_init (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_ATS_performance_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
GNUNET_ATS_PeerInformationCallback infocb, GNUNET_ATS_PeerInformationCallback infocb,
void *infocb_cls); void *infocb_cls);
/** /**
* Get information about addresses known to the ATS subsystem.
*
* @param handle the performance handle to use
* @param peer peer idm can be NULL for all peers
* @param all GNUNET_YES to get information about all addresses or GNUNET_N
O to
* get only address currently used
* @param infocb callback to call with the addresses,
* will callback with address == NULL when done
* @param infocb_cls closure for infocb
* @return ats performance context
*/
struct GNUNET_ATS_AddressListHandle *
GNUNET_ATS_performance_list_addresses (struct GNUNET_ATS_PerformanceHandle
*handle,
const struct GNUNET_PeerIdentity *pe
er,
int all,
GNUNET_ATS_PeerInformationCallback i
nfocb,
void *infocb_cls);
/**
* Cancel a pending address listing operation
*
* @param handle the GNUNET_ATS_AddressListHandle handle to cancel
*/
void
GNUNET_ATS_performance_list_addresses_cancel (struct GNUNET_ATS_AddressList
Handle *handle);
/**
* Client is done using the ATS performance subsystem, release resources. * Client is done using the ATS performance subsystem, release resources.
* *
* @param ph handle * @param ph handle
*/ */
void void
GNUNET_ATS_performance_done (struct GNUNET_ATS_PerformanceHandle *ph); GNUNET_ATS_performance_done (struct GNUNET_ATS_PerformanceHandle *ph);
/** /**
* Function called with reservation result. * Function called with reservation result.
* *
skipping to change at line 729 skipping to change at line 800
/** /**
* Cancel request for reserving bandwidth. * Cancel request for reserving bandwidth.
* *
* @param rc context returned by the original GNUNET_ATS_reserve_bandwidth call * @param rc context returned by the original GNUNET_ATS_reserve_bandwidth call
*/ */
void void
GNUNET_ATS_reserve_bandwidth_cancel (struct GNUNET_ATS_ReservationContext * rc); GNUNET_ATS_reserve_bandwidth_cancel (struct GNUNET_ATS_ReservationContext * rc);
/** /**
* Number of preference types supported by ATS
*/
#define GNUNET_ATS_PreferenceCount 3
/**
* ATS preference types as array initializer
*/
#define GNUNET_ATS_PreferenceType {GNUNET_ATS_PREFERENCE_END, GNUNET_ATS_PR
EFERENCE_BANDWIDTH, GNUNET_ATS_PREFERENCE_LATENCY}
/**
* ATS preference types as string array initializer
*/
#define GNUNET_ATS_PreferenceTypeString {"END", "BANDWIDTH", "LATENCY"}
/**
* Enum defining all known preference categories. * Enum defining all known preference categories.
*/ */
enum GNUNET_ATS_PreferenceKind enum GNUNET_ATS_PreferenceKind
{ {
/** /**
* End of preference list. * End of preference list.
*/ */
GNUNET_ATS_PREFERENCE_END = 0, GNUNET_ATS_PREFERENCE_END = 0,
skipping to change at line 758 skipping to change at line 844
* Change the peer's latency value to the given amount. The * Change the peer's latency value to the given amount. The
* argument is followed by a double value giving the desired value * argument is followed by a double value giving the desired value
* (can be negative). The absolute score in the goal function is * (can be negative). The absolute score in the goal function is
* the inverse of the latency in ms (minimum: 1 ms) multiplied by * the inverse of the latency in ms (minimum: 1 ms) multiplied by
* the latency preferences. * the latency preferences.
*/ */
GNUNET_ATS_PREFERENCE_LATENCY GNUNET_ATS_PREFERENCE_LATENCY
}; };
/** /**
* Convert a GNUNET_ATS_PreferenceType to a string
*
* @param type the preference type
* @return a string or NULL if invalid
*/
const char *
GNUNET_ATS_print_preference_type (uint32_t type);
/**
* Change preferences for the given peer. Preference changes are forgotten if peers * Change preferences for the given peer. Preference changes are forgotten if peers
* disconnect. * disconnect.
* *
* @param ph performance handle * @param ph performance handle
* @param peer identifies the peer * @param peer identifies the peer
* @param ... 0-terminated specification of the desired changes * @param ... 0-terminated specification of the desired changes
*/ */
void void
GNUNET_ATS_change_preference (struct GNUNET_ATS_PerformanceHandle *ph, GNUNET_ATS_change_preference (struct GNUNET_ATS_PerformanceHandle *ph,
const struct GNUNET_PeerIdentity *peer, ...); const struct GNUNET_PeerIdentity *peer, ...);
 End of changes. 9 change blocks. 
8 lines changed or deleted 112 lines changed or added


 gnunet_block_lib.h   gnunet_block_lib.h 
skipping to change at line 149 skipping to change at line 149
* Valid result, but suppressed because it is a duplicate. * Valid result, but suppressed because it is a duplicate.
*/ */
GNUNET_BLOCK_EVALUATION_OK_DUPLICATE = 2, GNUNET_BLOCK_EVALUATION_OK_DUPLICATE = 2,
/** /**
* Block does not match query (invalid result) * Block does not match query (invalid result)
*/ */
GNUNET_BLOCK_EVALUATION_RESULT_INVALID = 3, GNUNET_BLOCK_EVALUATION_RESULT_INVALID = 3,
/** /**
* Block does not match xquery (valid result, not relevant for the requ
est)
*/
GNUNET_BLOCK_EVALUATION_RESULT_IRRELEVANT = 4,
/**
* Query is valid, no reply given. * Query is valid, no reply given.
*/ */
GNUNET_BLOCK_EVALUATION_REQUEST_VALID = 4, GNUNET_BLOCK_EVALUATION_REQUEST_VALID = 10,
/** /**
* Query format does not match block type (invalid query). For * Query format does not match block type (invalid query). For
* example, xquery not given or xquery_size not appropriate for * example, xquery not given or xquery_size not appropriate for
* type. * type.
*/ */
GNUNET_BLOCK_EVALUATION_REQUEST_INVALID = 5, GNUNET_BLOCK_EVALUATION_REQUEST_INVALID = 11,
/** /**
* Specified block type not supported by this plugin. * Specified block type not supported by this plugin.
*/ */
GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED = 6 GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED = 20
}; };
/** /**
* Handle to an initialized block library. * Handle to an initialized block library.
*/ */
struct GNUNET_BLOCK_Context; struct GNUNET_BLOCK_Context;
/** /**
* Mingle hash with the mingle_number to produce different bits. * Mingle hash with the mingle_number to produce different bits.
* *
 End of changes. 4 change blocks. 
3 lines changed or deleted 9 lines changed or added


 gnunet_common.h   gnunet_common.h 
skipping to change at line 60 skipping to change at line 60
extern "C" extern "C"
{ {
#if 0 /* keep Emacsens' auto-indent happy */ #if 0 /* keep Emacsens' auto-indent happy */
} }
#endif #endif
#endif #endif
/** /**
* Version of the API (for entire gnunetutil.so library). * Version of the API (for entire gnunetutil.so library).
*/ */
#define GNUNET_UTIL_VERSION 0x00090400 #define GNUNET_UTIL_VERSION 0x00090500
/** /**
* 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
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 gnunet_config.h   gnunet_config.h 
skipping to change at line 198 skipping to change at line 198
/* Define to 1 if you have the `getresgid' function. */ /* Define to 1 if you have the `getresgid' function. */
#define HAVE_GETRESGID 1 #define HAVE_GETRESGID 1
/* Define to 1 if you have the `getrusage' function. */ /* Define to 1 if you have the `getrusage' function. */
#define HAVE_GETRUSAGE 1 #define HAVE_GETRUSAGE 1
/* Define if the GNU gettext() function is already present or preinstalled. */ /* Define if the GNU gettext() function is already present or preinstalled. */
#define HAVE_GETTEXT 1 #define HAVE_GETTEXT 1
/* Have glib2 */
#define HAVE_GLIB2 1
/* Define to 1 if you have the <glpk.h> header file. */ /* Define to 1 if you have the <glpk.h> header file. */
#define HAVE_GLPK_H 1 #define HAVE_GLPK_H 1
/* Define to 1 if `presolve' is a member of `glp_iocp'. */ /* Define to 1 if `presolve' is a member of `glp_iocp'. */
#define HAVE_GLP_IOCP_PRESOLVE 1 #define HAVE_GLP_IOCP_PRESOLVE 1
/* We have gnutls */ /* We have gnutls */
#define HAVE_GNUTLS true #define HAVE_GNUTLS true
/* Define to 1 if you have the <gnutls/abstract.h> header file. */ /* Define to 1 if you have the <gnutls/abstract.h> header file. */
skipping to change at line 246 skipping to change at line 249
/* Define if you have the libdl library or equivalent. */ /* Define if you have the libdl library or equivalent. */
#define HAVE_LIBDL 1 #define HAVE_LIBDL 1
/* Define if libdlloader will be built on this platform */ /* Define if libdlloader will be built on this platform */
#define HAVE_LIBDLLOADER 1 #define HAVE_LIBDLLOADER 1
/* Have GLPK */ /* Have GLPK */
#define HAVE_LIBGLPK 1 #define HAVE_LIBGLPK 1
/* Have libgtop */
#define HAVE_LIBGTOP 1
/* Define to 1 if you have the `intl' library (-lintl). */ /* Define to 1 if you have the `intl' library (-lintl). */
/* #undef HAVE_LIBINTL */ /* #undef HAVE_LIBINTL */
/* Define to 1 if you have the <libintl.h> header file. */ /* Define to 1 if you have the <libintl.h> header file. */
#define HAVE_LIBINTL_H 1 #define HAVE_LIBINTL_H 1
/* Define to 1 if you have the `kstat' library (-lkstat). */ /* Define to 1 if you have the `kstat' library (-lkstat). */
/* #undef HAVE_LIBKSTAT */ /* #undef HAVE_LIBKSTAT */
/* Define to 1 if you have the `kvm' library (-lkvm). */ /* Define to 1 if you have the `kvm' library (-lkvm). */
skipping to change at line 279 skipping to change at line 285
/* Define if you have the unistring library. */ /* Define if you have the unistring library. */
#define HAVE_LIBUNISTRING 1 #define HAVE_LIBUNISTRING 1
/* Define to 1 if you have the `z' library (-lz). */ /* Define to 1 if you have the `z' library (-lz). */
#define HAVE_LIBZ 1 #define HAVE_LIBZ 1
/* Define to 1 if you have the <limits.h> header file. */ /* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1 #define HAVE_LIMITS_H 1
/* Define to 1 if you have the <llapi.h> header file. */
/* #undef HAVE_LLAPI_H */
/* Define to 1 if you have the <locale.h> header file. */ /* Define to 1 if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1 #define HAVE_LOCALE_H 1
/* Define this if a modern libltdl is already installed */ /* Define this if a modern libltdl is already installed */
#define HAVE_LTDL 1 #define HAVE_LTDL 1
/* Define to 1 if you have the <mach/mach.h> header file. */ /* Define to 1 if you have the <mach/mach.h> header file. */
/* #undef HAVE_MACH_MACH_H */ /* #undef HAVE_MACH_MACH_H */
/* Define to 1 if you have the <mach-o/dyld.h> header file. */ /* Define to 1 if you have the <mach-o/dyld.h> header file. */
skipping to change at line 667 skipping to change at line 676
/* 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.4" #define PACKAGE_STRING "gnunet 0.9.5"
/* 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.4" #define PACKAGE_VERSION "0.9.5"
/* 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 708 skipping to change at line 717
/* 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 */
/* repository svn version */
#define VCS_VERSION "svn-"
/* Version number of package */ /* Version number of package */
#define VERSION "0.9.4" #define VERSION "0.9.5"
/* This is a Windows system */ /* This is a Windows system */
/* #undef WINDOWS */ /* #undef WINDOWS */
/* Do we have to use IBM LoadLeveler */
#define WITH_LL 0
/* 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 */
/* Enable large inode numbers on Mac OS X 10.5. */ /* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE #ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1 # define _DARWIN_USE_64_BIT_INODE 1
#endif #endif
/* 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. 8 change blocks. 
3 lines changed or deleted 18 lines changed or added


 gnunet_configuration_lib.h   gnunet_configuration_lib.h 
skipping to change at line 162 skipping to change at line 162
* @param filename where to write the configuration diff between default an d new * @param filename where to write the configuration diff between default an d new
* @return GNUNET_OK on success, GNUNET_SYSERR on error * @return GNUNET_OK on success, GNUNET_SYSERR on error
*/ */
int int
GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle
*cfgDefault, *cfgDefault,
const struct GNUNET_CONFIGURATION_Handle const struct GNUNET_CONFIGURATION_Handle
*cfgNew, const char *filename); *cfgNew, const char *filename);
/** /**
* Compute configuration with only entries that have been changed
*
* @param cfgDefault original configuration
* @param cfgNew new configuration
* @return configuration with only the differences, never NULL
*/
struct GNUNET_CONFIGURATION_Handle *
GNUNET_CONFIGURATION_get_diff (const struct GNUNET_CONFIGURATION_Handle
*cfgDefault,
const struct GNUNET_CONFIGURATION_Handle
*cfgNew);
/**
* Test if there are configuration options that were * Test if there are configuration options that were
* changed since the last save. * changed since the last save.
* *
* @param cfg configuration to inspect * @param cfg configuration to inspect
* @return GNUNET_NO if clean, GNUNET_YES if dirty, GNUNET_SYSERR on error (i.e. last save failed) * @return GNUNET_NO if clean, GNUNET_YES if dirty, GNUNET_SYSERR on error (i.e. last save failed)
*/ */
int int
GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cf g); GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cf g);
/** /**
 End of changes. 1 change blocks. 
0 lines changed or deleted 13 lines changed or added


 gnunet_container_lib.h   gnunet_container_lib.h 
skipping to change at line 1028 skipping to change at line 1028
* @param heap the heap * @param heap the heap
* @param iterator function to call on each entry * @param iterator function to call on each entry
* @param iterator_cls closure for iterator * @param iterator_cls closure for iterator
*/ */
void void
GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap, GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap,
GNUNET_CONTAINER_HeapIterator iterator, GNUNET_CONTAINER_HeapIterator iterator,
void *iterator_cls); void *iterator_cls);
/** /**
* Return a *uniform* random element from the heap. Choose a random
* number between 0 and heap size and then walk directly to it.
* This cost can be between 0 and n, amortized cost of logN.
*
* @param heap heap to choose random element from
* @param max how many nodes from the heap to choose from
*
* @return data stored at the chosen random node,
* NULL if the heap is empty.
*
*/
void *
GNUNET_CONTAINER_heap_get_random (struct GNUNET_CONTAINER_Heap *heap,
uint32_t max);
/**
* Perform a random walk of the tree. The walk is biased * Perform a random walk of the tree. The walk is biased
* towards elements closer to the root of the tree (since * towards elements closer to the root of the tree (since
* each walk starts at the root and ends at a random leaf). * each walk starts at the root and ends at a random leaf).
* The heap internally tracks the current position of the * The heap internally tracks the current position of the
* walk. * walk.
* *
* @param heap heap to walk * @param heap heap to walk
* @return data stored at the next random node in the walk; * @return data stored at the next random node in the walk;
* NULL if the tree is empty. * NULL if the tree is empty.
*/ */
 End of changes. 1 change blocks. 
16 lines changed or deleted 0 lines changed or added


 gnunet_core_service.h   gnunet_core_service.h 
skipping to change at line 128 skipping to change at line 128
*/ */
uint16_t expected_size; uint16_t expected_size;
}; };
/** /**
* Function called after GNUNET_CORE_connect has succeeded (or failed * Function called after GNUNET_CORE_connect has succeeded (or failed
* for good). Note that the private key of the peer is intentionally * for good). Note that the private key of the peer is intentionally
* not exposed here; if you need it, your process should try to read * not exposed here; if you need it, your process should try to read
* the private key file directly (which should work if you are * the private key file directly (which should work if you are
* authorized...). * authorized...). Implementations of this function must not call
* GNUNET_CORE_disconnect (other than by scheduling a new task to
* do this later).
* *
* @param cls closure * @param cls closure
* @param server handle to the server, NULL if we failed * @param server handle to the server, NULL if we failed
* @param my_identity ID of this peer, NULL if we failed * @param my_identity ID of this peer, NULL if we failed
*/ */
typedef void (*GNUNET_CORE_StartupCallback) (void *cls, typedef void (*GNUNET_CORE_StartupCallback) (void *cls,
struct GNUNET_CORE_Handle * se rver, struct GNUNET_CORE_Handle * se rver,
const struct GNUNET_PeerIdenti ty * const struct GNUNET_PeerIdenti ty *
my_identity); my_identity);
 End of changes. 1 change blocks. 
1 lines changed or deleted 3 lines changed or added


 gnunet_crypto_lib.h   gnunet_crypto_lib.h 
skipping to change at line 893 skipping to change at line 893
GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts, GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts,
size_t xts_len, const void *skm, size_t skm_len, ...); size_t xts_len, const void *skm, size_t skm_len, ...);
/** /**
* Convert a public key to a string. * Convert a public key to a string.
* *
* @param pub key to convert * @param pub key to convert
* @return string representing 'pub' * @return string representing 'pub'
*/ */
char * char *
GNUNET_CRYPTO_rsa_public_key_to_string (struct GNUNET_CRYPTO_RsaPublicKeyBi naryEncoded *pub); GNUNET_CRYPTO_rsa_public_key_to_string (const struct GNUNET_CRYPTO_RsaPubli cKeyBinaryEncoded *pub);
/** /**
* Convert a string representing a public key to a public key. * Convert a string representing a public key to a public key.
* *
* @param enc encoded public key * @param enc encoded public key
* @param enclen number of bytes in enc (without 0-terminator) * @param enclen number of bytes in enc (without 0-terminator)
* @param pub where to store the public key * @param pub where to store the public key
* @return GNUNET_OK on success * @return GNUNET_OK on success
*/ */
int int
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 gnunet_datacache_lib.h   gnunet_datacache_lib.h 
skipping to change at line 73 skipping to change at line 73
* *
* @param h handle to the datastore * @param h handle to the datastore
*/ */
void void
GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h); GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h);
/** /**
* An iterator over a set of items stored in the datacache. * An iterator over a set of items stored in the datacache.
* *
* @param cls closure * @param cls closure
* @param exp when will the content expire?
* @param key key for the content * @param key key for the content
* @param size number of bytes in data * @param size number of bytes in data
* @param data content stored * @param data content stored
* @param type type of the content * @param type type of the content
* @param exp when will the content expire?
* @param path_info_len number of entries in 'path_info'
* @param path_info a path through the network
* @return GNUNET_OK to continue iterating, GNUNET_SYSERR to abort * @return GNUNET_OK to continue iterating, GNUNET_SYSERR to abort
*/ */
typedef int (*GNUNET_DATACACHE_Iterator) (void *cls, typedef int (*GNUNET_DATACACHE_Iterator) (void *cls,
struct GNUNET_TIME_Absolute exp, const struct GNUNET_HashCode *key
const struct GNUNET_HashCode * ke ,
y,
size_t size, const char *data, size_t size, const char *data,
enum GNUNET_BLOCK_Type type); enum GNUNET_BLOCK_Type type,
struct GNUNET_TIME_Absolute exp,
unsigned int path_info_len,
const struct GNUNET_PeerIdentity *
path_info);
/** /**
* Store an item in the datacache. * Store an item in the datacache.
* *
* @param h handle to the datacache * @param h handle to the datacache
* @param key key to store data under * @param key key to store data under
* @param size number of bytes in data * @param size number of bytes in data
* @param data data to store * @param data data to store
* @param type type of the value * @param type type of the value
* @param discard_time when to discard the value in any case * @param discard_time when to discard the value in any case
* @return GNUNET_OK on success, GNUNET_SYSERR on error (full, etc.) * @param path_info_len number of entries in 'path_info'
* @param path_info a path through the network
* @return GNUNET_OK on success, GNUNET_SYSERR on error, GNUNET_NO if dupli
cate
*/ */
int int
GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h,
const struct GNUNET_HashCode * key, size_t size, const struct GNUNET_HashCode * key, size_t size,
const char *data, enum GNUNET_BLOCK_Type type, const char *data, enum GNUNET_BLOCK_Type type,
struct GNUNET_TIME_Absolute discard_time); struct GNUNET_TIME_Absolute discard_time,
unsigned int path_info_len,
const struct GNUNET_PeerIdentity *path_info);
/** /**
* Iterate over the results for a particular key * Iterate over the results for a particular key
* in the datacache. * in the datacache.
* *
* @param h handle to the datacache * @param h handle to the datacache
* @param key what to look up * @param key what to look up
* @param type entries of which type are relevant? * @param type entries of which type are relevant?
* @param iter maybe NULL (to just count) * @param iter maybe NULL (to just count)
* @param iter_cls closure for iter * @param iter_cls closure for iter
 End of changes. 6 change blocks. 
7 lines changed or deleted 17 lines changed or added


 gnunet_datacache_plugin.h   gnunet_datacache_plugin.h 
skipping to change at line 106 skipping to change at line 106
void *cls; void *cls;
/** /**
* Store an item in the datastore. * Store an item in the datastore.
* *
* @param cls closure (internal context for the plugin) * @param cls closure (internal context for the plugin)
* @param size number of bytes in data * @param size number of bytes in data
* @param data data to store * @param data data to store
* @param type type of the value * @param type type of the value
* @param discard_time when to discard the value in any case * @param discard_time when to discard the value in any case
* @return 0 on error, number of bytes used otherwise * @param path_info_len number of entries in 'path_info'
* @param path_info a path through the network
* @return 0 if duplicate, -1 on error, number of bytes used otherwise
*/ */
size_t (*put) (void *cls, const struct GNUNET_HashCode * key, size_t ssize_t (*put) (void *cls, const struct GNUNET_HashCode * key, size_t siz
size, e,
const char *data, enum GNUNET_BLOCK_Type type, const char *data, enum GNUNET_BLOCK_Type type,
struct GNUNET_TIME_Absolute discard_time); struct GNUNET_TIME_Absolute discard_time,
unsigned int path_info_len,
const struct GNUNET_PeerIdentity *path_info);
/** /**
* Iterate over the results for a particular key * Iterate over the results for a particular key
* in the datastore. * in the datastore.
* *
* @param cls closure (internal context for the plugin) * @param cls closure (internal context for the plugin)
* @param key * @param key
* @param type entries of which type are relevant? * @param type entries of which type are relevant?
* @param iter maybe NULL (to just count) * @param iter maybe NULL (to just count)
* @param iter_cls closure for iter * @param iter_cls closure for iter
 End of changes. 2 change blocks. 
5 lines changed or deleted 9 lines changed or added


 gnunet_datastore_plugin.h   gnunet_datastore_plugin.h 
skipping to change at line 199 skipping to change at line 199
void *proc_cls); void *proc_cls);
/** /**
* Update the priority for a particular key in the datastore. If * Update the priority for a particular key in the datastore. If
* the expiration time in value is different than the time found in * the expiration time in value is different than the time found in
* the datastore, the higher value should be kept. For the * the datastore, the higher value should be kept. For the
* anonymity level, the lower value is to be used. The specified * anonymity level, the lower value is to be used. The specified
* priority should be added to the existing priority, ignoring the * priority should be added to the existing priority, ignoring the
* priority in value. * priority in value.
* *
* Note that it is possible for multiple values to match this put.
* In that case, all of the respective values are updated.
*
* @param cls closure * @param cls closure
* @param uid unique identifier of the datum * @param uid unique identifier of the datum
* @param delta by how much should the priority * @param delta by how much should the priority
* change? If priority + delta < 0 the * change? If priority + delta < 0 the
* priority should be set to 0 (never go * priority should be set to 0 (never go
* negative). * negative).
* @param expire new expiration time should be the * @param expire new expiration time should be the
* MAX of any existing expiration time and * MAX of any existing expiration time and
* this value * this value
* @param msg set to an error message (on error) * @param msg set to an error message (on error)
 End of changes. 1 change blocks. 
3 lines changed or deleted 0 lines changed or added


 gnunet_dht_service.h   gnunet_dht_service.h 
skipping to change at line 225 skipping to change at line 225
* @param options routing options for this message * @param options routing options for this message
* @param xquery extended query data (can be NULL, depending on type) * @param xquery extended query data (can be NULL, depending on type)
* @param xquery_size number of bytes in xquery * @param xquery_size number of bytes in xquery
* @param iter function to call on each result * @param iter function to call on each result
* @param iter_cls closure for iter * @param iter_cls closure for iter
* *
* @return handle to stop the async get * @return handle to stop the async get
*/ */
struct GNUNET_DHT_GetHandle * struct GNUNET_DHT_GetHandle *
GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle, GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle,
enum GNUNET_BLOCK_Type type, const struct GNUNET_Hash enum GNUNET_BLOCK_Type type,
Code * key, const struct GNUNET_HashCode *key,
uint32_t desired_replication_level, uint32_t desired_replication_level,
enum GNUNET_DHT_RouteOption options, const void *xque enum GNUNET_DHT_RouteOption options,
ry, const void *xquery, size_t xquery_size,
size_t xquery_size, GNUNET_DHT_GetIterator iter, GNUNET_DHT_GetIterator iter, void *iter_cls);
void *iter_cls);
/**
* Tell the DHT not to return any of the following known results
* to this client.
*
* @param get_handle get operation for which results should be filtered
* @param num_results number of results to be blocked that are
* provided in this call (size of the 'results' array)
* @param results array of hash codes over the 'data' of the results
* to be blocked
*/
void
GNUNET_DHT_get_filter_known_results (struct GNUNET_DHT_GetHandle *get_handl
e,
unsigned int num_results,
const struct GNUNET_HashCode *results);
/** /**
* Stop async DHT-get. Frees associated resources. * Stop async DHT-get. Frees associated resources.
* *
* @param get_handle GET operation to stop. * @param get_handle GET operation to stop.
* *
* On return get_handle will no longer be valid, caller * On return get_handle will no longer be valid, caller
* must not use again!!! * must not use again!!!
*/ */
void void
 End of changes. 2 change blocks. 
6 lines changed or deleted 21 lines changed or added


 gnunet_disk_lib.h   gnunet_disk_lib.h 
/* /*
This file is part of GNUnet. This file is part of GNUnet.
(C) 2001, 2002, 2003, 2004, 2005, 2006, 2009 Christian Grothoff (and o ther contributing authors) (C) 2001-2012 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2, or (at your by the Free Software Foundation; either version 2, or (at your
option) any later version. option) any later version.
GNUnet is distributed in the hope that it will be useful, but GNUnet is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the along with GNUnet; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
/** /**
* @file include/gnunet_disk_lib.h * @file include/gnunet_disk_lib.h
* @brief disk IO apis * @brief disk IO apis
* @author Christian Grothoff
*/ */
#ifndef GNUNET_DISK_LIB_H #ifndef GNUNET_DISK_LIB_H
#define GNUNET_DISK_LIB_H #define GNUNET_DISK_LIB_H
#if WINDOWS #if WINDOWS
#define OFF_T uint64_t #define OFF_T uint64_t
#else #else
#define OFF_T off_t #define OFF_T off_t
#endif #endif
skipping to change at line 88 skipping to change at line 88
* Structure for overlapped writing (for pipes) * Structure for overlapped writing (for pipes)
*/ */
OVERLAPPED *oOverlapWrite; OVERLAPPED *oOverlapWrite;
#else #else
/** /**
* File handle on other OSes. * File handle on other OSes.
*/ */
int fd; int fd;
#endif /* #endif
*/
}; };
/* we need size_t, and since it can be both unsigned int /* we need size_t, and since it can be both unsigned int
or unsigned long long, this IS platform dependent; or unsigned long long, this IS platform dependent;
but "stdlib.h" should be portable 'enough' to be but "stdlib.h" should be portable 'enough' to be
unconditionally available... */ unconditionally available... */
#include <stdlib.h> #include <stdlib.h>
#include "gnunet_configuration_lib.h" #include "gnunet_configuration_lib.h"
#include "gnunet_scheduler_lib.h" #include "gnunet_scheduler_lib.h"
skipping to change at line 114 skipping to change at line 113
} }
#endif #endif
#endif #endif
/** /**
* Specifies how a file should be opened. * Specifies how a file should be opened.
*/ */
enum GNUNET_DISK_OpenFlags enum GNUNET_DISK_OpenFlags
{ {
/** /**
* Open the file for reading * Open the file for reading
*/ */
GNUNET_DISK_OPEN_READ = 1, GNUNET_DISK_OPEN_READ = 1,
/** /**
* Open the file for writing * Open the file for writing
*/ */
GNUNET_DISK_OPEN_WRITE = 2, GNUNET_DISK_OPEN_WRITE = 2,
/** /**
* Open the file for both reading and writing * Open the file for both reading and writing
*/ */
GNUNET_DISK_OPEN_READWRITE = 3, GNUNET_DISK_OPEN_READWRITE = 3,
/** /**
* Fail if file already exists * Fail if file already exists
*/ */
GNUNET_DISK_OPEN_FAILIFEXISTS = 4, GNUNET_DISK_OPEN_FAILIFEXISTS = 4,
/** /**
* Truncate file if it exists * Truncate file if it exists
*/ */
GNUNET_DISK_OPEN_TRUNCATE = 8, GNUNET_DISK_OPEN_TRUNCATE = 8,
/** /**
* Create file if it doesn't exist * Create file if it doesn't exist
*/ */
GNUNET_DISK_OPEN_CREATE = 16, GNUNET_DISK_OPEN_CREATE = 16,
/** /**
* Append to the file * Append to the file
*/ */
GNUNET_DISK_OPEN_APPEND = 32 GNUNET_DISK_OPEN_APPEND = 32
}; };
/** /**
* Specifies what type of memory map is desired. * Specifies what type of memory map is desired.
*/ */
enum GNUNET_DISK_MapType enum GNUNET_DISK_MapType
{ {
/** /**
* Read-only memory map. * Read-only memory map.
*/ */
GNUNET_DISK_MAP_TYPE_READ = 1, GNUNET_DISK_MAP_TYPE_READ = 1,
/** /**
* Write-able memory map. * Write-able memory map.
*/ */
GNUNET_DISK_MAP_TYPE_WRITE = 2, GNUNET_DISK_MAP_TYPE_WRITE = 2,
/**
* Read-write memory map. /**
*/ * Read-write memory map.
*/
GNUNET_DISK_MAP_TYPE_READWRITE = 3 GNUNET_DISK_MAP_TYPE_READWRITE = 3
}; };
/** /**
* File access permissions, UNIX-style. * File access permissions, UNIX-style.
*/ */
enum GNUNET_DISK_AccessPermissions enum GNUNET_DISK_AccessPermissions
{ {
/** /**
* Nobody is allowed to do anything to the file. * Nobody is allowed to do anything to the file.
*/ */
GNUNET_DISK_PERM_NONE = 0, GNUNET_DISK_PERM_NONE = 0,
/** /**
* Owner can read. * Owner can read.
*/ */
GNUNET_DISK_PERM_USER_READ = 1, GNUNET_DISK_PERM_USER_READ = 1,
/** /**
* Owner can write. * Owner can write.
*/ */
GNUNET_DISK_PERM_USER_WRITE = 2, GNUNET_DISK_PERM_USER_WRITE = 2,
/** /**
* Owner can execute. * Owner can execute.
*/ */
GNUNET_DISK_PERM_USER_EXEC = 4, GNUNET_DISK_PERM_USER_EXEC = 4,
/** /**
* Group can read. * Group can read.
*/ */
GNUNET_DISK_PERM_GROUP_READ = 8, GNUNET_DISK_PERM_GROUP_READ = 8,
/** /**
* Group can write. * Group can write.
*/ */
GNUNET_DISK_PERM_GROUP_WRITE = 16, GNUNET_DISK_PERM_GROUP_WRITE = 16,
/** /**
* Group can execute. * Group can execute.
*/ */
GNUNET_DISK_PERM_GROUP_EXEC = 32, GNUNET_DISK_PERM_GROUP_EXEC = 32,
/** /**
* Everybody can read. * Everybody can read.
*/ */
GNUNET_DISK_PERM_OTHER_READ = 64, GNUNET_DISK_PERM_OTHER_READ = 64,
/** /**
* Everybody can write. * Everybody can write.
*/ */
GNUNET_DISK_PERM_OTHER_WRITE = 128, GNUNET_DISK_PERM_OTHER_WRITE = 128,
/** /**
* Everybody can execute. * Everybody can execute.
*/ */
GNUNET_DISK_PERM_OTHER_EXEC = 256 GNUNET_DISK_PERM_OTHER_EXEC = 256
}; };
/** /**
* Constants for specifying how to seek. Do not change values or order, * Constants for specifying how to seek. Do not change values or order,
* some of the code depends on the specific numeric values! * some of the code depends on the specific numeric values!
*/ */
enum GNUNET_DISK_Seek enum GNUNET_DISK_Seek
{ {
/** /**
* Seek an absolute position (from the start of the file). * Seek an absolute position (from the start of the file).
*/ */
GNUNET_DISK_SEEK_SET = 0, GNUNET_DISK_SEEK_SET = 0,
/** /**
* Seek a relative position (from the current offset). * Seek a relative position (from the current offset).
*/ */
GNUNET_DISK_SEEK_CUR = 1, GNUNET_DISK_SEEK_CUR = 1,
/** /**
* Seek an absolute position from the end of the file. * Seek an absolute position from the end of the file.
*/ */
GNUNET_DISK_SEEK_END = 2 GNUNET_DISK_SEEK_END = 2
}; };
/** /**
* Enumeration identifying the two ends of a pipe. * Enumeration identifying the two ends of a pipe.
*/ */
enum GNUNET_DISK_PipeEnd enum GNUNET_DISK_PipeEnd
{ {
/** /**
* The reading-end of a pipe. * The reading-end of a pipe.
*/ */
GNUNET_DISK_PIPE_END_READ = 0, GNUNET_DISK_PIPE_END_READ = 0,
/** /**
* The writing-end of a pipe. * The writing-end of a pipe.
*/ */
GNUNET_DISK_PIPE_END_WRITE = 1 GNUNET_DISK_PIPE_END_WRITE = 1
}; };
/** /**
* Get the number of blocks that are left on the partition that * Get the number of blocks that are left on the partition that
* contains the given file (for normal users). * contains the given file (for normal users).
* *
* @param part a file on the partition to check * @param part a file on the partition to check
* @return -1 on errors, otherwise the number of free blocks * @return -1 on errors, otherwise the number of free blocks
*/ */
skipping to change at line 295 skipping to change at line 295
* (of a file that exists and that is not a directory). * (of a file that exists and that is not a directory).
* *
* @param fil filename to check * @param fil filename to check
* @return GNUNET_YES if yes, GNUNET_NO if not a file, GNUNET_SYSERR if som ething * @return GNUNET_YES if yes, GNUNET_NO if not a file, GNUNET_SYSERR if som ething
* else (will print an error message in that case, too). * else (will print an error message in that case, too).
*/ */
int int
GNUNET_DISK_file_test (const char *fil); GNUNET_DISK_file_test (const char *fil);
/** /**
* Move a file out of the way (create a backup) by
* renaming it to "orig.NUM~" where NUM is the smallest
* number that is not used yet.
*
* @param fil name of the file to back up
*/
void
GNUNET_DISK_file_backup (const char *fil);
/**
* Move the read/write pointer in a file * Move the read/write pointer in a file
* @param h handle of an open file * @param h handle of an open file
* @param offset position to move to * @param offset position to move to
* @param whence specification to which position the offset parameter relat es to * @param whence specification to which position the offset parameter relat es to
* @return the new position on success, GNUNET_SYSERR otherwise * @return the new position on success, GNUNET_SYSERR otherwise
*/ */
OFF_T OFF_T
GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, OFF_T offset , GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, OFF_T offset ,
enum GNUNET_DISK_Seek whence); enum GNUNET_DISK_Seek whence);
skipping to change at line 632 skipping to change at line 642
* a file. * a file.
* *
* @param filename name of a file in the directory * @param filename name of a file in the directory
* @returns GNUNET_OK on success, GNUNET_SYSERR on failure, * @returns GNUNET_OK on success, GNUNET_SYSERR on failure,
* GNUNET_NO if directory exists but is not writeable * GNUNET_NO if directory exists but is not writeable
*/ */
int int
GNUNET_DISK_directory_create_for_file (const char *filename); GNUNET_DISK_directory_create_for_file (const char *filename);
/** /**
* Test if "fil" is a directory that can be accessed. * Test if "fil" is a directory and listable. Optionally, also check if the
* Will not print an error message if the directory * directory is readable. Will not print an error message if the directory
* does not exist. Will log errors if GNUNET_SYSERR is does
* returned. * not exist. Will log errors if GNUNET_SYSERR is returned (i.e., a file e
xists
* with the same name).
* *
* @param fil filename to test * @param fil filename to test
* @return GNUNET_YES if yes, GNUNET_NO if does not exist, GNUNET_SYSERR * @param is_readable GNUNET_YES to additionally check if "fil" is readable
* on any error and if exists but not directory ;
* GNUNET_NO to disable this check
* @return GNUNET_YES if yes, GNUNET_NO if not; GNUNET_SYSERR if it
* does not exist or stat'ed
*/ */
int int
GNUNET_DISK_directory_test (const char *fil); GNUNET_DISK_directory_test (const char *fil, int is_readable);
/** /**
* Remove all files in a directory (rm -rf). Call with * Remove all files in a directory (rm -rf). Call with
* caution. * caution.
* *
* @param filename the file to remove * @param filename the file to remove
* @return GNUNET_OK on success, GNUNET_SYSERR on error * @return GNUNET_OK on success, GNUNET_SYSERR on error
*/ */
int int
GNUNET_DISK_directory_remove (const char *filename); GNUNET_DISK_directory_remove (const char *filename);
 End of changes. 33 change blocks. 
86 lines changed or deleted 101 lines changed or added


 gnunet_dnsparser_lib.h   gnunet_dnsparser_lib.h 
skipping to change at line 529 skipping to change at line 529
* This can fail if the ASCII-conversion becomes longer than 63 characters. * This can fail if the ASCII-conversion becomes longer than 63 characters.
* *
* @param label label to check (UTF-8 string) * @param label label to check (UTF-8 string)
* @return GNUNET_OK if the label can be converted to IDNA, * @return GNUNET_OK if the label can be converted to IDNA,
* GNUNET_SYSERR if the label is not valid for DNS names * GNUNET_SYSERR if the label is not valid for DNS names
*/ */
int int
GNUNET_DNSPARSER_check_label (const char *label); GNUNET_DNSPARSER_check_label (const char *label);
/** /**
* Check if a hostname in UTF-8 format can be coded into valid IDNA.
* This can fail if a label becomes longer than 63 characters or if
* the entire name exceeds 253 characters.
*
* @param name name to check (UTF-8 string)
* @return GNUNET_OK if the label can be converted to IDNA,
* GNUNET_SYSERR if the label is not valid for DNS names
*/
int
GNUNET_DNSPARSER_check_name (const char *name);
/**
* Parse a UDP payload of a DNS packet in to a nice struct for further * Parse a UDP payload of a DNS packet in to a nice struct for further
* processing and manipulation. * processing and manipulation.
* *
* @param udp_payload wire-format of the DNS packet * @param udp_payload wire-format of the DNS packet
* @param udp_payload_length number of bytes in udp_payload * @param udp_payload_length number of bytes in udp_payload
* @return NULL on error, otherwise the parsed packet * @return NULL on error, otherwise the parsed packet
*/ */
struct GNUNET_DNSPARSER_Packet * struct GNUNET_DNSPARSER_Packet *
GNUNET_DNSPARSER_parse (const char *udp_payload, GNUNET_DNSPARSER_parse (const char *udp_payload,
size_t udp_payload_length); size_t udp_payload_length);
 End of changes. 1 change blocks. 
0 lines changed or deleted 12 lines changed or added


 gnunet_fs_service.h   gnunet_fs_service.h 
skipping to change at line 69 skipping to change at line 69
/* ******************** 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/"
/** /**
* How often do we signal applications that a probe for a particular
* search result is running? (used to visualize probes).
*/
#define GNUNET_FS_PROBE_UPDATE_FREQUENCY GNUNET_TIME_relative_multiply (GNU
NET_TIME_UNIT_MILLISECONDS, 250)
/**
* A Universal Resource Identifier (URI), opaque. * A Universal Resource Identifier (URI), opaque.
*/ */
struct GNUNET_FS_Uri; struct GNUNET_FS_Uri;
/** /**
* Iterator over keywords * Iterator over keywords
* *
* @param cls closure * @param cls closure
* @param keyword the keyword * @param keyword the keyword
* @param is_mandatory is the keyword mandatory (in a search) * @param is_mandatory is the keyword mandatory (in a search)
skipping to change at line 1231 skipping to change at line 1237
*/ */
uint32_t availability_certainty; uint32_t availability_certainty;
/** /**
* Updated applicability rank (the larger, * Updated applicability rank (the larger,
* the better the result fits the search * the better the result fits the search
* criteria). * criteria).
*/ */
uint32_t applicability_rank; uint32_t applicability_rank;
/**
* How long has the current probe been active?
*/
struct GNUNET_TIME_Relative current_probe_time;
} update; } update;
/** /**
* These values are only valid for * These values are only valid for
* GNUNET_FS_STATUS_SEARCH_RESULT_SUSPEND events. * GNUNET_FS_STATUS_SEARCH_RESULT_SUSPEND events.
* These events are automatically triggered for * These events are automatically triggered for
* each search result before the * each search result before the
* GNUNET_FS_STATUS_SEARCH_SUSPEND event. This * GNUNET_FS_STATUS_SEARCH_SUSPEND event. This
* happens primarily to give the client a chance * happens primarily to give the client a chance
* to clean up the "cctx" (if needed). * to clean up the "cctx" (if needed).
 End of changes. 2 change blocks. 
0 lines changed or deleted 12 lines changed or added


 gnunet_getopt_lib.h   gnunet_getopt_lib.h 
skipping to change at line 282 skipping to change at line 282
*/ */
int int
GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext *ct x, GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext *ct x,
void *scls, const char *option, const char *value); void *scls, const char *option, const char *value);
/** /**
* Set an option of type 'char *' from the command line. * Set an option of type 'char *' 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 'char *'. * type 'char *', which will be allocated with the requested string.
* *
* @param ctx command line processing context * @param ctx command line processing context
* @param scls additional closure (will point to the 'char *', * @param scls additional closure (will point to the 'char *',
* which will be allocated) * which will be allocated)
* @param option name of the option * @param option name of the option
* @param value actual value of the option (a string) * @param value actual value of the option (a string)
* @return GNUNET_OK * @return GNUNET_OK
*/ */
int int
GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 gnunet_gns_service.h   gnunet_gns_service.h 
skipping to change at line 42 skipping to change at line 42
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#if 0 /* keep Emacsens' auto-indent happy */ #if 0 /* keep Emacsens' auto-indent happy */
} }
#endif #endif
#endif #endif
/** /**
* String we use to indicate the local master zone or a
* root entry in the current zone.
*/
#define GNUNET_GNS_MASTERZONE_STR "+"
/**
* Connection to the GNS service. * Connection to the GNS service.
*/ */
struct GNUNET_GNS_Handle; struct GNUNET_GNS_Handle;
/** /**
* Handle to control a lookup operation. * Handle to control a lookup operation.
*/ */
struct GNUNET_GNS_LookupRequest; struct GNUNET_GNS_LookupRequest;
/** /**
 End of changes. 1 change blocks. 
0 lines changed or deleted 6 lines changed or added


 gnunet_hello_lib.h   gnunet_hello_lib.h 
skipping to change at line 42 skipping to change at line 42
{ {
#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_crypto_lib.h" #include "gnunet_crypto_lib.h"
/** /**
* Prefix that every HELLO URI must start with.
*/
#define GNUNET_HELLO_URI_PREFIX "gnunet://hello/"
/**
* An address for communicating with a peer. We frequently * An address for communicating with a peer. We frequently
* need this tuple and the components cannot really be * need this tuple and the components cannot really be
* separated. This is NOT the format that would be used * separated. This is NOT the format that would be used
* on the wire. * on the wire.
*/ */
struct GNUNET_HELLO_Address struct GNUNET_HELLO_Address
{ {
/** /**
* For which peer is this an address? * For which peer is this an address?
skipping to change at line 315 skipping to change at line 320
* Get the header from a HELLO message, used so other code * Get the header from a HELLO message, used so other code
* can correctly send HELLO messages. * can correctly send HELLO messages.
* *
* @param hello the hello message * @param hello the hello message
* *
* @return header or NULL if the HELLO was malformed * @return header or NULL if the HELLO was malformed
*/ */
struct GNUNET_MessageHeader * struct GNUNET_MessageHeader *
GNUNET_HELLO_get_header (struct GNUNET_HELLO_Message *hello); GNUNET_HELLO_get_header (struct GNUNET_HELLO_Message *hello);
typedef struct GNUNET_TRANSPORT_PluginFunctions *
(*GNUNET_HELLO_TransportPluginsFind) (const char *name);
/**
* Compose a hello URI string from a hello message.
*
* @param hello Hello message
* @param plugins_find Function to find transport plugins by name
* @return Hello URI string
*/
char *
GNUNET_HELLO_compose_uri (const struct GNUNET_HELLO_Message *hello,
GNUNET_HELLO_TransportPluginsFind plugins_find);
/**
* Parse a hello URI string to a hello message.
*
* @param uri URI string to parse
* @param pubkey Pointer to struct where public key is parsed
* @param hello Pointer to struct where hello message is parsed
* @param plugins_find Function to find transport plugins by name
* @return GNUNET_OK on success, GNUNET_SYSERR if the URI was invalid, GNUN
ET_NO on other errors
*/
int
GNUNET_HELLO_parse_uri (const char *uri,
struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *pub
key,
struct GNUNET_HELLO_Message **hello,
GNUNET_HELLO_TransportPluginsFind plugins_find);
#if 0 /* keep Emacsens' auto-indent happy */ #if 0 /* keep Emacsens' auto-indent happy */
{ {
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/* ifndef GNUNET_HELLO_LIB_H */ /* ifndef GNUNET_HELLO_LIB_H */
#endif #endif
/* end of gnunet_hello_lib.h */ /* end of gnunet_hello_lib.h */
 End of changes. 2 change blocks. 
0 lines changed or deleted 36 lines changed or added


 gnunet_mesh_service.h   gnunet_mesh_service.h 
skipping to change at line 406 skipping to change at line 406
/** /**
* Cancel the specified transmission-ready notification. * Cancel the specified transmission-ready notification.
* *
* @param th handle that was returned by "notify_transmit_ready". * @param th handle that was returned by "notify_transmit_ready".
*/ */
void void
GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle
*th); *th);
/** /**
* Method called to retrieve information about each tunnel the mesh peer
* is aware of.
*
* @param cls Closure.
* @param initiator Peer that started the tunnel (owner).
* @param tunnel_number Tunnel number.
* @param peers Array of peer identities that participate in the tunnel.
* @param npeers Number of peers in peers.
*/
typedef void (*GNUNET_MESH_TunnelsCB) (void *cls,
const struct GNUNET_PeerIdentity *ow
ner,
unsigned int tunnel_number,
const struct GNUNET_PeerIdentity *pe
ers,
unsigned int npeers);
/**
* Method called to retrieve information about a specific tunnel the mesh p
eer
* is aware of, including all transit nodes.
*
* @param cls Closure.
* @param peer Peer in the tunnel's tree.
* @param parent Parent of the current peer. All 0 when peer is root.
*/
typedef void (*GNUNET_MESH_TunnelCB) (void *cls,
const struct GNUNET_PeerIdentity *pee
r,
const struct GNUNET_PeerIdentity *par
ent);
/**
* Request information about the running mesh peer.
* The callback will be called for every tunnel known to the service,
* listing all active peers that blong to the tunnel.
*
* If called again on the same handle, it will overwrite the previous
* callback and cls. To retrieve the cls, monitor_cancel must be
* called first.
*
* WARNING: unstable API, likely to change in the future!
*
* @param h Handle to the mesh peer.
* @param callback Function to call with the requested data.
* @param callback_cls Closure for @c callback.
*/
void
GNUNET_MESH_get_tunnels (struct GNUNET_MESH_Handle *h,
GNUNET_MESH_TunnelsCB callback,
void *callback_cls);
/**
* Request information about a specific tunnel of the running mesh peer.
*
* WARNING: unstable API, likely to change in the future!
*
* @param h Handle to the mesh peer.
* @param initiator ID of the owner of the tunnel.
* @param tunnel_number Tunnel number.
* @param callback Function to call with the requested data.
* @param callback_cls Closure for @c callback.
*/
void
GNUNET_MESH_show_tunnel (struct GNUNET_MESH_Handle *h,
struct GNUNET_PeerIdentity *initiator,
unsigned int tunnel_number,
GNUNET_MESH_TunnelCB callback,
void *callback_cls);
/**
* Cancel a monitor request. The monitor callback will not be called.
*
* WARNING: unstable API, likely to change in the future!
*
* @param h Mesh handle.
*
* @return Closure given to GNUNET_MESH_monitor, if any.
*/
void *
GNUNET_MESH_get_tunnels_cancel (struct GNUNET_MESH_Handle *h);
/**
* Transition API for tunnel ctx management * Transition API for tunnel ctx management
* *
* FIXME deprecated * FIXME deprecated
*/ */
void void
GNUNET_MESH_tunnel_set_data (struct GNUNET_MESH_Tunnel *tunnel, void *data) ; GNUNET_MESH_tunnel_set_data (struct GNUNET_MESH_Tunnel *tunnel, void *data) ;
/** /**
* Transition API for tunnel ctx management * Transition API for tunnel ctx management
* *
 End of changes. 1 change blocks. 
0 lines changed or deleted 83 lines changed or added


 gnunet_nat_lib.h   gnunet_nat_lib.h 
/* /*
This file is part of GNUnet. This file is part of GNUnet.
(C) 2007, 2008, 2009, 2010, 2011 Christian Grothoff (and other contrib uting authors) (C) 2007, 2008, 2009, 2010, 2011, 2012 Christian Grothoff (and other c ontributing authors)
GNUnet is free software; you can redistribute it and/or modify GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3, or (at your by the Free Software Foundation; either version 3, or (at your
option) any later version. option) any later version.
GNUnet is distributed in the hope that it will be useful, but GNUnet is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. General Public License for more details.
skipping to change at line 239 skipping to change at line 239
* Remove a mapping created with (mini)upnpc. Calling * Remove a mapping created with (mini)upnpc. Calling
* this function will give 'upnpc' 1s to remove tha mapping, * this function will give 'upnpc' 1s to remove tha mapping,
* so while this function is non-blocking, a task will be * so while this function is non-blocking, a task will be
* left with the scheduler for up to 1s past this call. * left with the scheduler for up to 1s past this call.
* *
* @param mini the handle * @param mini the handle
*/ */
void void
GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini); GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini);
/**
* Handle to auto-configuration in progress.
*/
struct GNUNET_NAT_AutoHandle;
/**
* Function called with the result from the autoconfiguration.
*
* @param cls closure
* @param diff minimal suggested changes to the original configuration
* to make it work (as best as we can)
*/
typedef void (*GNUNET_NAT_AutoResultCallback)(void *cls,
const struct GNUNET_CONFIGURAT
ION_Handle *diff);
/**
* Start auto-configuration routine. The resolver service should
* be available when this function is called.
*
* @param cfg initial configuration
* @param cb function to call with autoconfiguration result
* @param cb_cls closure for cb
* @return handle to cancel operation
*/
struct GNUNET_NAT_AutoHandle *
GNUNET_NAT_autoconfig_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
GNUNET_NAT_AutoResultCallback cb,
void *cb_cls);
/**
* Abort autoconfiguration.
*
* @param ah handle for operation to abort
*/
void
GNUNET_NAT_autoconfig_cancel (struct GNUNET_NAT_AutoHandle *ah);
#endif #endif
/* end of gnunet_nat_lib.h */ /* end of gnunet_nat_lib.h */
 End of changes. 2 change blocks. 
1 lines changed or deleted 39 lines changed or added


 gnunet_protocols.h   gnunet_protocols.h 
skipping to change at line 483 skipping to change at line 483
* P2P response with content or active migration of content. Also * P2P response with content or active migration of content. Also
* used between the service and clients (in response to START_SEARCH). * used between the service and clients (in response to START_SEARCH).
*/ */
#define GNUNET_MESSAGE_TYPE_FS_PUT 138 #define GNUNET_MESSAGE_TYPE_FS_PUT 138
/** /**
* Peer asks us to stop migrating content towards it for a while. * Peer asks us to stop migrating content towards it for a while.
*/ */
#define GNUNET_MESSAGE_TYPE_FS_MIGRATION_STOP 139 #define GNUNET_MESSAGE_TYPE_FS_MIGRATION_STOP 139
/**
* P2P request for content (one FS to another via a stream).
*/
#define GNUNET_MESSAGE_TYPE_FS_STREAM_QUERY 140
/**
* P2P answer for content (one FS to another via a stream).
*/
#define GNUNET_MESSAGE_TYPE_FS_STREAM_REPLY 141
/************************************************************************** ***** /************************************************************************** *****
* DHT message types * DHT message types
************************************************************************** ****/ ************************************************************************** ****/
/** /**
* Client wants to store item in DHT. * Client wants to store item in DHT.
*/ */
#define GNUNET_MESSAGE_TYPE_DHT_CLIENT_PUT 142 #define GNUNET_MESSAGE_TYPE_DHT_CLIENT_PUT 142
/** /**
skipping to change at line 557 skipping to change at line 567
/** /**
* Stop information about transiting messages * Stop information about transiting messages
*/ */
#define GNUNET_MESSAGE_TYPE_DHT_MONITOR_STOP 154 #define GNUNET_MESSAGE_TYPE_DHT_MONITOR_STOP 154
/** /**
* Acknowledge receiving PUT request * Acknowledge receiving PUT request
*/ */
#define GNUNET_MESSAGE_TYPE_DHT_CLIENT_PUT_OK 155 #define GNUNET_MESSAGE_TYPE_DHT_CLIENT_PUT_OK 155
/**
* Certain results are already known to the client, filter those.
*/
#define GNUNET_MESSAGE_TYPE_DHT_CLIENT_GET_RESULTS_KNOWN 156
/************************************************************************** ***** /************************************************************************** *****
* HOSTLIST message types * HOSTLIST message types
************************************************************************** ****/ ************************************************************************** ****/
/** /**
* Hostlist advertisement message * Hostlist advertisement message
*/ */
#define GNUNET_MESSAGE_TYPE_HOSTLIST_ADVERTISEMENT 160 #define GNUNET_MESSAGE_TYPE_HOSTLIST_ADVERTISEMENT 160
/************************************************************************** ***** /************************************************************************** *****
skipping to change at line 868 skipping to change at line 883
* Set tunnel buffering off. * Set tunnel buffering off.
*/ */
#define GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_NOBUFFER 285 #define GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_NOBUFFER 285
/** /**
* Local ACK for data. * Local ACK for data.
*/ */
#define GNUNET_MESSAGE_TYPE_MESH_LOCAL_ACK 286 #define GNUNET_MESSAGE_TYPE_MESH_LOCAL_ACK 286
/** /**
* Local information about all tunnels of service.
*/
#define GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_TUNNELS 287
/**
* Local information of service about a specific tunnel.
*/
#define GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_TUNNEL 288
/**
* 640kb should be enough for everybody * 640kb should be enough for everybody
*/ */
#define GNUNET_MESSAGE_TYPE_MESH_RESERVE_END 299 #define GNUNET_MESSAGE_TYPE_MESH_RESERVE_END 299
/************************************************************************** ***** /************************************************************************** *****
* CHAT message types START * CHAT message types START
************************************************************************** ****/ ************************************************************************** ****/
/** /**
* Message sent from client to join a chat room. * Message sent from client to join a chat room.
skipping to change at line 1078 skipping to change at line 1103
* to confirm that an address is used or not used anymore * to confirm that an address is used or not used anymore
*/ */
#define GNUNET_MESSAGE_TYPE_ATS_RESET_BACKOFF 352 #define GNUNET_MESSAGE_TYPE_ATS_RESET_BACKOFF 352
/** /**
* Type of the 'struct AddressUpdateMessage' sent by client to ATS * Type of the 'struct AddressUpdateMessage' sent by client to ATS
* to add a new address * to add a new address
*/ */
#define GNUNET_MESSAGE_TYPE_ATS_ADDRESS_ADD 353 #define GNUNET_MESSAGE_TYPE_ATS_ADDRESS_ADD 353
/**
* Type of the 'struct AddressListRequestMessage' sent by client to ATS
* to request information about addresses
*/
#define GNUNET_MESSAGE_TYPE_ATS_ADDRESSLIST_REQUEST 354
/**
* Type of the 'struct AddressListResponseMessage' sent by ATS to client
* with information about addresses
*/
#define GNUNET_MESSAGE_TYPE_ATS_ADDRESSLIST_RESPONSE 355
/************************************************************************** ***** /************************************************************************** *****
* TRANSPORT message types * TRANSPORT message types
************************************************************************** ****/ ************************************************************************** ****/
/** /**
* Message from the core saying that the transport * Message from the core saying that the transport
* server should start giving it messages. This * server should start giving it messages. This
* should automatically trigger the transmission of * should automatically trigger the transmission of
* a HELLO message. * a HELLO message.
*/ */
skipping to change at line 1567 skipping to change at line 1604
#define GNUNET_MESSAGE_TYPE_GNS_LOOKUP_RESULT 501 #define GNUNET_MESSAGE_TYPE_GNS_LOOKUP_RESULT 501
#define GNUNET_MESSAGE_TYPE_GNS_SHORTEN 502 #define GNUNET_MESSAGE_TYPE_GNS_SHORTEN 502
#define GNUNET_MESSAGE_TYPE_GNS_SHORTEN_RESULT 503 #define GNUNET_MESSAGE_TYPE_GNS_SHORTEN_RESULT 503
#define GNUNET_MESSAGE_TYPE_GNS_GET_AUTH 504 #define GNUNET_MESSAGE_TYPE_GNS_GET_AUTH 504
#define GNUNET_MESSAGE_TYPE_GNS_GET_AUTH_RESULT 505 #define GNUNET_MESSAGE_TYPE_GNS_GET_AUTH_RESULT 505
/**************************************************************************
*****
* CONSENSUS message types
**************************************************************************
****/
/**
* Join a consensus session. Sent by client to service as first message.
*/
#define GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_JOIN 520
/**
* Insert an element. Sent by client to service.
*/
#define GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_INSERT 521
/**
* Begin accepting new elements from other participants.
* Sent by client to service.
*/
#define GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_BEGIN 522
/**
* Sent by service when a new element is added.
*/
#define GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_RECEIVED_ELEMENT 523
/**
* Sent by client to service in order to start the consensus conclusion.
*/
#define GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_CONCLUDE 524
/**
* Sent by service to client in order to signal a completed consensus concl
usion.
* Last message sent in a consensus session.
*/
#define GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_CONCLUDE_DONE 525
/**
* Sent by client to service, telling whether a received element should
* be accepted and propagated further or not.
*/
#define GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_ACK 527
/**
* Update another peer's consensus set with new elements.
*/
#define GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_ELEMENTS 528
/**
* Request elements (by their hash) from another peer.
*/
#define GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_REQUEST_ELEMENTS 529
/**
* Strata estimator.
*/
#define GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_STRATA 530
/**
* IBF containing all elements of a peer.
*/
#define GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_IBF 531
/**
* Request reconcilliation with another peer.
*/
#define GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_RECONCILE 532
/** /**
* Next available: 520 * Next available: 570
*/ */
/************************************************************************** ***** /************************************************************************** *****
* TODO: we need a way to register message types centrally (via some webpag e). * TODO: we need a way to register message types centrally (via some webpag e).
* For now: unofficial extensions should start at 48k, internal extensions * For now: unofficial extensions should start at 48k, internal extensions
* define here should leave some room (4-10 additional messages to the prev ious * define here should leave some room (4-10 additional messages to the prev ious
* extension). * extension).
************************************************************************** ****/ ************************************************************************** ****/
/** /**
 End of changes. 6 change blocks. 
1 lines changed or deleted 108 lines changed or added


 gnunet_regex_lib.h   gnunet_regex_lib.h 
skipping to change at line 95 skipping to change at line 95
* *
* @param regex regular expression string. * @param regex regular expression string.
* @param len length of the regular expression. * @param len length of the regular expression.
* @param max_path_len limit the path compression length to the * @param max_path_len limit the path compression length to the
* given value. If set to 1, no path compression is applied. Set to 0 for * given value. If set to 1, no path compression is applied. Set to 0 for
* maximal possible path compression (generally not desireable). * maximal possible path compression (generally not desireable).
* @return DFA, needs to be freed using GNUNET_REGEX_automaton_destroy. * @return DFA, needs to be freed using GNUNET_REGEX_automaton_destroy.
*/ */
struct GNUNET_REGEX_Automaton * struct GNUNET_REGEX_Automaton *
GNUNET_REGEX_construct_dfa (const char *regex, const size_t len, GNUNET_REGEX_construct_dfa (const char *regex, const size_t len,
int max_path_len); unsigned int max_path_len);
/** /**
* Free the memory allocated by constructing the GNUNET_REGEX_Automaton. * Free the memory allocated by constructing the GNUNET_REGEX_Automaton.
* data structure. * data structure.
* *
* @param a automaton to be destroyed. * @param a automaton to be destroyed.
*/ */
void void
GNUNET_REGEX_automaton_destroy (struct GNUNET_REGEX_Automaton *a); GNUNET_REGEX_automaton_destroy (struct GNUNET_REGEX_Automaton *a);
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 gnunet_server_lib.h   gnunet_server_lib.h 
skipping to change at line 506 skipping to change at line 506
* GNUNET_SYSERR to close the connection (signal * GNUNET_SYSERR to close the connection (signal
* serious error) * serious error)
*/ */
void void
GNUNET_SERVER_transmit_context_destroy (struct GNUNET_SERVER_TransmitContex t GNUNET_SERVER_transmit_context_destroy (struct GNUNET_SERVER_TransmitContex t
*tc, int success); *tc, int success);
/** /**
* The notification context is the key datastructure for a conveniance * The notification context is the key datastructure for a conveniance
* API used for transmission of notifications to the client until the * API used for transmission of notifications to the client until the
* client disconnects (or the notification context is destroyed, in * client disconnects or is disconnected (or the notification context
* which case we disconnect these clients). Essentially, all * is destroyed, in which case we disconnect these clients).
* (notification) messages are queued up until the client is able to * Essentially, all (notification) messages are queued up until the
* read them. * client is able to read them.
*/ */
struct GNUNET_SERVER_NotificationContext; struct GNUNET_SERVER_NotificationContext;
/** /**
* Create a new notification context. * Create a new notification context.
* *
* @param server server for which this function creates the context * @param server server for which this function creates the context
* @param queue_length maximum number of messages to keep in * @param queue_length maximum number of messages to keep in
* the notification queue; optional messages are dropped * the notification queue; optional messages are dropped
* if the queue gets longer than this number of messages * if the queue gets longer than this number of messages
 End of changes. 1 change blocks. 
4 lines changed or deleted 4 lines changed or added


 gnunet_stream_lib.h   gnunet_stream_lib.h 
skipping to change at line 49 skipping to change at line 49
#include "gnunet_mesh_service.h" #include "gnunet_mesh_service.h"
/** /**
* Stream status * Stream status
*/ */
enum GNUNET_STREAM_Status enum GNUNET_STREAM_Status
{ {
/** /**
* All previous read/write operations are successfully done * All previous read/write operations are successfully done
*/ */
GNUNET_STREAM_OK = 0, GNUNET_STREAM_OK,
/** /**
* A timeout occured while reading/writing the stream * A timeout occured while reading/writing the stream
*/ */
GNUNET_STREAM_TIMEOUT = 1, GNUNET_STREAM_TIMEOUT,
/** /**
* Other side has shutdown the socket for this type of operation * Other side has shutdown the socket for this type of operation
* (reading/writing) * (reading/writing)
*/ */
GNUNET_STREAM_SHUTDOWN = 2, GNUNET_STREAM_SHUTDOWN,
/** /**
* A serious error occured while operating on this stream * A serious error occured while operating on this stream
*/ */
GNUNET_STREAM_SYSERR = 3, GNUNET_STREAM_SYSERR
/**
* An error resulted in an unusable stream
*/
GNUNET_STREAM_BROKEN
}; };
/** /**
* Opaque handler for stream * Opaque handler for stream
*/ */
struct GNUNET_STREAM_Socket; struct GNUNET_STREAM_Socket;
/** /**
* Functions of this type will be called when a stream is established * Functions of this type will be called when a stream is established
* *
skipping to change at line 193 skipping to change at line 188
* @param completion_cls the closure for the completion callback * @param completion_cls the closure for the completion callback
* @return the shutdown handle; NULL in case of any error * @return the shutdown handle; NULL in case of any error
*/ */
struct GNUNET_STREAM_ShutdownHandle * struct GNUNET_STREAM_ShutdownHandle *
GNUNET_STREAM_shutdown (struct GNUNET_STREAM_Socket *socket, GNUNET_STREAM_shutdown (struct GNUNET_STREAM_Socket *socket,
int operation, int operation,
GNUNET_STREAM_ShutdownCompletion completion_cb, GNUNET_STREAM_ShutdownCompletion completion_cb,
void *completion_cls); void *completion_cls);
/** /**
* Cancels a pending shutdown * Cancels a pending shutdown. Note that the shutdown messages may already
* be sent and the stream is shutdown already for the operation given to
* GNUNET_STREAM_shutdown(). This function only clears up any retranmission
s of
* shutdown messages and frees the shutdown handle.
* *
* @param handle the shutdown handle returned from GNUNET_STREAM_shutdown * @param handle the shutdown handle returned from GNUNET_STREAM_shutdown
*/ */
void void
GNUNET_STREAM_shutdown_cancel (struct GNUNET_STREAM_ShutdownHandle *handle) ; GNUNET_STREAM_shutdown_cancel (struct GNUNET_STREAM_ShutdownHandle *handle) ;
/** /**
* Closes the stream and frees the associated state. The stream should be * Closes the stream and frees the associated state. The stream should be
* shutdown before closing. * shutdown for both reading and writing before closing.
* *
* @param socket the stream socket * @param socket the stream socket
*/ */
void void
GNUNET_STREAM_close (struct GNUNET_STREAM_Socket *socket); GNUNET_STREAM_close (struct GNUNET_STREAM_Socket *socket);
/** /**
* Functions of this type are called upon new stream connection from other peers * Functions of this type are called upon new stream connection from other peers
* or upon binding error which happen when the app_port given in * or upon binding error which happen when the app_port given in
* GNUNET_STREAM_listen() is already taken. * GNUNET_STREAM_listen() is already taken.
skipping to change at line 235 skipping to change at line 233
/** /**
* A socket for listening. * A socket for listening.
*/ */
struct GNUNET_STREAM_ListenSocket; struct GNUNET_STREAM_ListenSocket;
/** /**
* Listens for stream connections for a specific application ports * Listens for stream connections for a specific application ports
* *
* @param cfg the configuration to use * @param cfg the configuration to use
*
* @param app_port the application port for which new streams will be * @param app_port the application port for which new streams will be
* accepted. If another stream is listening on the same port the * accepted. If another stream is listening on the same port the
* listen_cb will be called to signal binding error and the returne d * listen_cb will be called to signal binding error and the returne d
* ListenSocket will be invalidated. * ListenSocket will be invalidated.
*
* @param listen_cb this function will be called when a peer tries to estab lish * @param listen_cb this function will be called when a peer tries to estab lish
* a stream with us * a stream with us
* @param listen_cb_cls closure for listen_cb * @param listen_cb_cls closure for listen_cb
* @param ... options to the stream, terminated by GNUNET_STREAM_OPTION_END * @param ... options to the stream, terminated by GNUNET_STREAM_OPTION_END
* @return listen socket, NULL for any error * @return listen socket, NULL for any error
*/ */
struct GNUNET_STREAM_ListenSocket * struct GNUNET_STREAM_ListenSocket *
GNUNET_STREAM_listen (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_STREAM_listen (const struct GNUNET_CONFIGURATION_Handle *cfg,
GNUNET_MESH_ApplicationType app_port, GNUNET_MESH_ApplicationType app_port,
GNUNET_STREAM_ListenCallback listen_cb, GNUNET_STREAM_ListenCallback listen_cb,
skipping to change at line 267 skipping to change at line 263
* @param lsocket the listen socket * @param lsocket the listen socket
*/ */
void void
GNUNET_STREAM_listen_close (struct GNUNET_STREAM_ListenSocket *lsocket); GNUNET_STREAM_listen_close (struct GNUNET_STREAM_ListenSocket *lsocket);
/** /**
* Functions of this signature are called whenever writing operations * Functions of this signature are called whenever writing operations
* on a stream are executed * on a stream are executed
* *
* @param cls the closure from GNUNET_STREAM_write * @param cls the closure from GNUNET_STREAM_write
* @param status the status of the stream at the time this function is call * @param status the status of the stream at the time this function is call
ed ed;
* GNUNET_STREAM_OK if writing to stream was completed successfull
y;
* GNUNET_STREAM_TIMEOUT if the given data is not sent successfull
y
* (this doesn't mean that the data is never sent, the receiver ma
y
* have read the data but its ACKs may have been lost);
* GNUNET_STREAM_SHUTDOWN if the stream is shutdown for writing in
the
* mean time; GNUNET_STREAM_SYSERR if the stream is broken and can
not
* be processed.
* @param size the number of bytes written * @param size the number of bytes written
*/ */
typedef void (*GNUNET_STREAM_CompletionContinuation) (void *cls, typedef void (*GNUNET_STREAM_CompletionContinuation) (void *cls,
enum GNUNET_STREAM_Sta tus enum GNUNET_STREAM_Sta tus
status, status,
size_t size); size_t size);
/** /**
* Handle to cancel IO write operations. * Handle to cancel IO write operations.
*/ */
struct GNUNET_STREAM_IOWriteHandle; struct GNUNET_STREAM_WriteHandle;
/** /**
* Handle to cancel IO read operations. * Handle to cancel IO read operations.
*/ */
struct GNUNET_STREAM_IOReadHandle; struct GNUNET_STREAM_ReadHandle;
/** /**
* Tries to write the given data to the stream. The maximum size of data th at * Tries to write the given data to the stream. The maximum size of data th at
* can be written as part of a write operation is (64 * (64000 - sizeof (st ruct * can be written as part of a write operation is (64 * (64000 - sizeof (st ruct
* GNUNET_STREAM_DataMessage))). If size is greater than this it is not an API * GNUNET_STREAM_DataMessage))). If size is greater than this it is not an API
* violation, however only the said number of maximum bytes will be written . * violation, however only the said number of maximum bytes will be written .
* *
* @param socket the socket representing a stream * @param socket the socket representing a stream
* @param data the data buffer from where the data is written into the stre am * @param data the data buffer from where the data is written into the stre am
* @param size the number of bytes to be written from the data buffer * @param size the number of bytes to be written from the data buffer
* @param timeout the timeout period * @param timeout the timeout period
* @param write_cont the function to call upon writing some bytes into the * @param write_cont the function to call upon writing some bytes into the
* stream * stream
* @param write_cont_cls the closure * @param write_cont_cls the closure
* *
* @return handle to cancel the operation; if a previous write is pending o * @return handle to cancel the operation; if a previous write is pending N
r ULL
* the stream has been shutdown for this operation then write_con * is returned. If the stream has been shutdown for this operatio
t is n or
* immediately called and NULL is returned. * is broken then write_cont is immediately called and NULL is
* returned.
*/ */
struct GNUNET_STREAM_IOWriteHandle * struct GNUNET_STREAM_WriteHandle *
GNUNET_STREAM_write (struct GNUNET_STREAM_Socket *socket, GNUNET_STREAM_write (struct GNUNET_STREAM_Socket *socket,
const void *data, const void *data,
size_t size, size_t size,
struct GNUNET_TIME_Relative timeout, struct GNUNET_TIME_Relative timeout,
GNUNET_STREAM_CompletionContinuation write_cont, GNUNET_STREAM_CompletionContinuation write_cont,
void *write_cont_cls); void *write_cont_cls);
/** /**
* Functions of this signature are called whenever data is available from t he * Functions of this signature are called whenever data is available from t he
* stream. * stream.
skipping to change at line 328 skipping to change at line 332
* @param size the number of bytes available in data read; will be 0 on tim eout * @param size the number of bytes available in data read; will be 0 on tim eout
* @return number of bytes of processed from 'data' (any data remaining sho uld be * @return number of bytes of processed from 'data' (any data remaining sho uld be
* given to the next time the read processor is called). * given to the next time the read processor is called).
*/ */
typedef size_t (*GNUNET_STREAM_DataProcessor) (void *cls, typedef size_t (*GNUNET_STREAM_DataProcessor) (void *cls,
enum GNUNET_STREAM_Status st atus, enum GNUNET_STREAM_Status st atus,
const void *data, const void *data,
size_t size); size_t size);
/** /**
* Tries to read data from the stream. * Tries to read data from the stream. Should not be called when another re
ad
* handle is present; the existing read handle should be canceled with
* GNUNET_STREAM_read_cancel(). Only one read handle per socket is present
at
* any time
* *
* @param socket the socket representing a stream * @param socket the socket representing a stream
* @param timeout the timeout period * @param timeout the timeout period
* @param proc function to call with data (once only) * @param proc function to call with data (once only)
* @param proc_cls the closure for proc * @param proc_cls the closure for proc
* * @return handle to cancel the operation; NULL is returned if the stream h
* @return handle to cancel the operation; NULL is returned if: the stream as
has
* been shutdown for this type of opeartion (the DataProcessor is * been shutdown for this type of opeartion (the DataProcessor is
* immediately called with GNUNET_STREAM_SHUTDOWN as status) OR a * immediately called with GNUNET_STREAM_SHUTDOWN as status)
nother
* read handle is present (only one read handle per socket is pre
sent
* at any time)
*/ */
struct GNUNET_STREAM_IOReadHandle * struct GNUNET_STREAM_ReadHandle *
GNUNET_STREAM_read (struct GNUNET_STREAM_Socket *socket, GNUNET_STREAM_read (struct GNUNET_STREAM_Socket *socket,
struct GNUNET_TIME_Relative timeout, struct GNUNET_TIME_Relative timeout,
GNUNET_STREAM_DataProcessor proc, GNUNET_STREAM_DataProcessor proc,
void *proc_cls); void *proc_cls);
/** /**
* Cancels pending write operation. Also cancels packet retransmissions whi ch * Cancels pending write operation. Also cancels packet retransmissions whi ch
* may have resulted otherwise. * may have resulted otherwise.
* *
* CAUTION: Normally a write operation is considered successful if the data * CAUTION: Normally a write operation is considered successful if the data
* given to it is sent and acknowledged by the receiver. As data is divided * given to it is sent and acknowledged by the receiver. As data is divided
* into packets, it is possible that not all packets are received by the * into packets, it is possible that not all packets are received by the
* receiver. Any missing packets are then retransmitted till the receiver * receiver. Any missing packets are then retransmitted till the receiver
* acknowledges all packets or until a timeout . During this scenario if th e * acknowledges all packets or until a timeout . During this scenario if th e
* write operation is cancelled all such retransmissions are also * write operation is cancelled all such retransmissions are also
* cancelled. This may leave the receiver's receive buffer incompletely fil led * cancelled. This may leave the receiver's receive buffer incompletely fil led
* as some missing packets are never retransmitted. So this operation shoul d be * as some missing packets are never retransmitted. So this operation shoul d be
* used before shutting down transmission from our side or before closing t he * used before shutting down transmission from our side or before closing t he
* socket. * socket.
* *
* @param ioh handle to operation to cancel * @param wh write operation handle to cancel
*/ */
void void
GNUNET_STREAM_io_write_cancel (struct GNUNET_STREAM_IOWriteHandle *iowh); GNUNET_STREAM_write_cancel (struct GNUNET_STREAM_WriteHandle *wh);
/** /**
* Cancel pending read operation. * Cancel pending read operation.
* *
* @param ioh handle to operation to cancel * @param rh read operation handle to cancel
*/ */
void void
GNUNET_STREAM_io_read_cancel (struct GNUNET_STREAM_IOReadHandle *iorh); GNUNET_STREAM_read_cancel (struct GNUNET_STREAM_ReadHandle *rh);
#if 0 #if 0
{ {
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* STREAM_PROTOCOL_H */ #endif /* STREAM_PROTOCOL_H */
 End of changes. 21 change blocks. 
37 lines changed or deleted 47 lines changed or added


 gnunet_testbed_service.h   gnunet_testbed_service.h 
skipping to change at line 32 skipping to change at line 32
* @file include/gnunet_testbed_service.h * @file include/gnunet_testbed_service.h
* @brief API for writing tests and creating large-scale * @brief API for writing tests and creating large-scale
* emulation testbeds for GNUnet. * emulation testbeds for GNUnet.
* @author Christian Grothoff * @author Christian Grothoff
*/ */
#ifndef GNUNET_TESTBED_SERVICE_H #ifndef GNUNET_TESTBED_SERVICE_H
#define GNUNET_TESTBED_SERVICE_H #define GNUNET_TESTBED_SERVICE_H
#include "gnunet_util_lib.h" #include "gnunet_util_lib.h"
#include "gnunet_testing_lib-new.h" #include "gnunet_testing_lib.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#if 0 /* keep Emacsens' auto-indent happy */ #if 0 /* keep Emacsens' auto-indent happy */
} }
#endif #endif
#endif #endif
/** /**
skipping to change at line 72 skipping to change at line 72
* controller has at least one master handle which is created when the * controller has at least one master handle which is created when the
* controller is created; this master handle interacts with the * controller is created; this master handle interacts with the
* controller process, destroying it destroys the controller (by * controller process, destroying it destroys the controller (by
* closing stdin of the controller process). Additionally, * closing stdin of the controller process). Additionally,
* controllers can interact with each other (in a P2P fashion); those * controllers can interact with each other (in a P2P fashion); those
* links are established via TCP/IP on the controller's service port. * links are established via TCP/IP on the controller's service port.
*/ */
struct GNUNET_TESTBED_Controller; struct GNUNET_TESTBED_Controller;
/** /**
* Handle to a large-scale testbed that is managed at a high level.
*/
struct GNUNET_TESTBED_Testbed;
/**
* Create a host to run peers and controllers on. * Create a host to run peers and controllers on.
* *
* @param hostname name of the host, use "NULL" for localhost * @param hostname name of the host, use "NULL" for localhost
* @param username username to use for the login; may be NULL * @param username username to use for the login; may be NULL
* @param port port number to use for ssh; use 0 to let ssh decide * @param port port number to use for ssh; use 0 to let ssh decide
* @return handle to the host, NULL on error * @return handle to the host, NULL on error
*/ */
struct GNUNET_TESTBED_Host * struct GNUNET_TESTBED_Host *
GNUNET_TESTBED_host_create (const char *hostname, GNUNET_TESTBED_host_create (const char *hostname,
const char *username, const char *username,
skipping to change at line 129 skipping to change at line 124
/** /**
* Destroy a host handle. Must only be called once everything * Destroy a host handle. Must only be called once everything
* running on that host has been stopped. * running on that host has been stopped.
* *
* @param host handle to destroy * @param host handle to destroy
*/ */
void void
GNUNET_TESTBED_host_destroy (struct GNUNET_TESTBED_Host *host); GNUNET_TESTBED_host_destroy (struct GNUNET_TESTBED_Host *host);
/** /**
* The handle for whether a host is habitable or not
*/
struct GNUNET_TESTBED_HostHabitableCheckHandle;
/**
* Callbacks of this type are called by GNUNET_TESTBED_is_host_habitable to
* inform whether the given host is habitable or not. The Handle returned b
y
* GNUNET_TESTBED_is_host_habitable() is invalid after this callback is cal
led
*
* @param cls the closure given to GNUNET_TESTBED_is_host_habitable()
* @param host the host whose status is being reported; will be NULL if the
host
* given to GNUNET_TESTBED_is_host_habitable() is NULL
* @param status GNUNET_YES if it is habitable; GNUNET_NO if not
*/
typedef void (*GNUNET_TESTBED_HostHabitableCallback) (void *cls,
const struct
GNUNET_TESTBED_Host
*host,
int status);
/**
* Checks whether a host can be used to start testbed service * Checks whether a host can be used to start testbed service
* *
* @param host the host to check * @param host the host to check
* @param config the configuration handle to lookup the path of the testbed * @param config the configuration handle to lookup the path of the testbed
helper * helper
* @return GNUNET_YES if testbed service can be started on the given host * @param cb the callback to call to inform about habitability of the given
* remotely; GNUNET_NO if not host
* @param cb_cls the closure for the callback
* @return NULL upon any error or a handle which can be passed to
* GNUNET_TESTBED_is_host_habitable_cancel()
*/ */
int struct GNUNET_TESTBED_HostHabitableCheckHandle *
GNUNET_TESTBED_is_host_habitable (const struct GNUNET_TESTBED_Host *host, GNUNET_TESTBED_is_host_habitable (const struct GNUNET_TESTBED_Host *host,
const struct GNUNET_CONFIGURATION_Handle const struct GNUNET_CONFIGURATION_Handle
*config); *config,
GNUNET_TESTBED_HostHabitableCallback cb,
void *cb_cls);
/**
* Function to cancel a request started using GNUNET_TESTBED_is_host_habita
ble()
*
* @param struct handle the habitability check handle
*/
void
GNUNET_TESTBED_is_host_habitable_cancel (struct
GNUNET_TESTBED_HostHabitableCheckH
andle
*handle);
/** /**
* Obtain the host's hostname. * Obtain the host's hostname.
* *
* @param host handle to the host, NULL means 'localhost' * @param host handle to the host, NULL means 'localhost'
* @return hostname of the host * @return hostname of the host
*/ */
const char * const char *
GNUNET_TESTBED_host_get_hostname (const struct GNUNET_TESTBED_Host *host); GNUNET_TESTBED_host_get_hostname (const struct GNUNET_TESTBED_Host *host);
skipping to change at line 391 skipping to change at line 423
* @param cfg the configuration with which the controller has been started; * @param cfg the configuration with which the controller has been started;
* NULL if status is not GNUNET_OK * NULL if status is not GNUNET_OK
* @param status GNUNET_OK if the startup is successfull; GNUNET_SYSERR if not, * @param status GNUNET_OK if the startup is successfull; GNUNET_SYSERR if not,
* GNUNET_TESTBED_controller_stop() shouldn't be called in this ca se * GNUNET_TESTBED_controller_stop() shouldn't be called in this ca se
*/ */
typedef void (*GNUNET_TESTBED_ControllerStatusCallback) (void *cls, typedef void (*GNUNET_TESTBED_ControllerStatusCallback) (void *cls,
const struct GNUNET _CONFIGURATION_Handle *cfg, const struct GNUNET _CONFIGURATION_Handle *cfg,
int status); int status);
/** /**
* Starts a controller process at the host. * Starts a controller process at the given host.
* *
* @param controller_ip the ip address of the controller. Will be set as TR * @param trusted_ip the ip address of the controller which will be set as
USTED TRUSTED
* host when starting testbed controller at host * HOST(all connections form this ip are permitted by the testbed)
when
* starting testbed controller at host. This can either be a singl
e ip
* address or a network address in CIDR notation.
* @param host the host where the controller has to be started; NULL for * @param host the host where the controller has to be started; NULL for
* localhost * localhost
* @param cfg template configuration to use for the remote controller; the * @param cfg template configuration to use for the remote controller; the
* remote controller will be started with a slightly modified * remote controller will be started with a slightly modified
* configuration (port numbers, unix domain sockets and service ho me * configuration (port numbers, unix domain sockets and service ho me
* values are changed as per TESTING library on the remote host) * values are changed as per TESTING library on the remote host)
* @param cb function called when the controller is successfully started or * @param cb function called when the controller is successfully started or
* dies unexpectedly; GNUNET_TESTBED_controller_stop shouldn't be * dies unexpectedly; GNUNET_TESTBED_controller_stop shouldn't be
* called if cb is called with GNUNET_SYSERR as status. Will never be * called if cb is called with GNUNET_SYSERR as status. Will never be
* called in the same task as 'GNUNET_TESTBED_controller_start' * called in the same task as 'GNUNET_TESTBED_controller_start'
* (synchronous errors will be signalled by returning NULL). This * (synchronous errors will be signalled by returning NULL). This
* parameter cannot be NULL. * parameter cannot be NULL.
* @param cls closure for above callbacks * @param cls closure for above callbacks
* @return the controller process handle, NULL on errors * @return the controller process handle, NULL on errors
*/ */
struct GNUNET_TESTBED_ControllerProc * struct GNUNET_TESTBED_ControllerProc *
GNUNET_TESTBED_controller_start (const char *controller_ip, GNUNET_TESTBED_controller_start (const char *trusted_ip,
struct GNUNET_TESTBED_Host *host, struct GNUNET_TESTBED_Host *host,
const struct GNUNET_CONFIGURATION_Handle * cfg, const struct GNUNET_CONFIGURATION_Handle * cfg,
GNUNET_TESTBED_ControllerStatusCallback cb , GNUNET_TESTBED_ControllerStatusCallback cb ,
void *cls); void *cls);
/** /**
* Stop the controller process (also will terminate all peers and controlle rs * Stop the controller process (also will terminate all peers and controlle rs
* dependent on this controller). This function blocks until the testbed h as * dependent on this controller). This function blocks until the testbed h as
* been fully terminated (!). The controller status cb from * been fully terminated (!). The controller status cb from
* GNUNET_TESTBED_controller_start() will not be called. * GNUNET_TESTBED_controller_start() will not be called.
skipping to change at line 495 skipping to change at line 529
/** /**
* Callback which will be called to after a host registration succeeded or failed * Callback which will be called to after a host registration succeeded or failed
* *
* @param cls the closure * @param cls the closure
* @param emsg the error message; NULL if host registration is successful * @param emsg the error message; NULL if host registration is successful
*/ */
typedef void (* GNUNET_TESTBED_HostRegistrationCompletion) (void *cls, typedef void (* GNUNET_TESTBED_HostRegistrationCompletion) (void *cls,
const char *ems g); const char *ems g);
/** /**
* Register a host with the controller * Register a host with the controller. This makes the controller aware of
the
* host. A host should be registered at the controller before starting a
* sub-controller on that host using GNUNET_TESTBED_controller_link().
* *
* @param controller the controller handle * @param controller the controller handle
* @param host the host to register * @param host the host to register
* @param cc the completion callback to call to inform the status of * @param cc the completion callback to call to inform the status of
* registration. After calling this callback the registration hand le * registration. After calling this callback the registration hand le
* will be invalid. Cannot be NULL * will be invalid. Cannot be NULL
* @param cc_cls the closure for the cc * @param cc_cls the closure for the cc
* @return handle to the host registration which can be used to cancel the * @return handle to the host registration which can be used to cancel the
* registration; NULL if another registration handle is present a nd * registration; NULL if another registration handle is present a nd
* is not cancelled * is not cancelled
skipping to change at line 662 skipping to change at line 698
* configure the peer; use "GNUNET_TESTBED_peer_start" and * configure the peer; use "GNUNET_TESTBED_peer_start" and
* "GNUNET_TESTBED_peer_stop" to actually start/stop the peer's * "GNUNET_TESTBED_peer_stop" to actually start/stop the peer's
* processes. * processes.
* *
* Note that the given configuration will be adjusted by the * Note that the given configuration will be adjusted by the
* controller to avoid port/path conflicts with other peers. * controller to avoid port/path conflicts with other peers.
* The "final" configuration can be obtained using * The "final" configuration can be obtained using
* 'GNUNET_TESTBED_peer_get_information'. * 'GNUNET_TESTBED_peer_get_information'.
* *
* @param controller controller process to use * @param controller controller process to use
* @param host host to run the peer on * @param host host to run the peer on; cannot be NULL
* @param cfg Template configuration to use for the peer. Should exist unti l * @param cfg Template configuration to use for the peer. Should exist unti l
* operation is cancelled or GNUNET_TESTBED_operation_done() is ca lled * operation is cancelled or GNUNET_TESTBED_operation_done() is ca lled
* @param cb the callback to call when the peer has been created * @param cb the callback to call when the peer has been created
* @param cls the closure to the above callback * @param cls the closure to the above callback
* @return the operation handle * @return the operation handle
*/ */
struct GNUNET_TESTBED_Operation * struct GNUNET_TESTBED_Operation *
GNUNET_TESTBED_peer_create (struct GNUNET_TESTBED_Controller *controller, GNUNET_TESTBED_peer_create (struct GNUNET_TESTBED_Controller *controller,
struct GNUNET_TESTBED_Host *host, struct GNUNET_TESTBED_Host *host,
const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_CONFIGURATION_Handle *cfg,
skipping to change at line 918 skipping to change at line 954
GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI, GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI,
/** /**
* Certain percentage of peers are unable to communicate directly * Certain percentage of peers are unable to communicate directly
* replicating NAT conditions. Followed by the fraction of * replicating NAT conditions. Followed by the fraction of
* NAT'ed peers (float). * NAT'ed peers (float).
*/ */
GNUNET_TESTBED_TOPOLOGY_INTERNAT, GNUNET_TESTBED_TOPOLOGY_INTERNAT,
/** /**
* Scale free topology. FIXME: options? * Scale free topology. No options.
*/ */
GNUNET_TESTBED_TOPOLOGY_SCALE_FREE, GNUNET_TESTBED_TOPOLOGY_SCALE_FREE,
/** /**
* Straight line topology. No options. * Straight line topology. No options.
*/ */
GNUNET_TESTBED_TOPOLOGY_LINE, GNUNET_TESTBED_TOPOLOGY_LINE,
/** /**
* All peers are disconnected. No options. * Read a topology from a given file. Followed by the name of the file ( const char *).
*/ */
GNUNET_TESTBED_TOPOLOGY_NONE, GNUNET_TESTBED_TOPOLOGY_FROM_FILE,
/** /**
* Read a topology from a given file. Followed by the name of the file ( const char *). * All peers are disconnected. No options.
*/ */
GNUNET_TESTBED_TOPOLOGY_FROM_FILE, GNUNET_TESTBED_TOPOLOGY_NONE,
/** /**
* The options should always end with this * The options should always end with this
*/ */
GNUNET_TESTBED_TOPOLOGY_OPTION_END, GNUNET_TESTBED_TOPOLOGY_OPTION_END,
/* The following are not topologies but influence how the topology has to be /* The following are not topologies but influence how the topology has to be
setup. These options should follow the topology specific options (if setup. These options should follow the topology specific options (if
required by the chosen topology). Note that these should be given befo re required by the chosen topology). Note that these should be given befo re
GNUNET_TESTBED_TOPOLOGY_OPTION_END */ GNUNET_TESTBED_TOPOLOGY_OPTION_END */
skipping to change at line 1019 skipping to change at line 1055
struct GNUNET_TESTBED_Peer *p2); struct GNUNET_TESTBED_Peer *p2);
/** /**
* All peers must have been started before calling this function. * All peers must have been started before calling this function.
* This function then connects the given peers in the P2P overlay * This function then connects the given peers in the P2P overlay
* using the given topology. * using the given topology.
* *
* @param op_cls closure argument to give with the operation event * @param op_cls closure argument to give with the operation event
* @param num_peers number of peers in 'peers' * @param num_peers number of peers in 'peers'
* @param peers array of 'num_peers' with the peers to configure * @param peers array of 'num_peers' with the peers to configure
* @param max_connections the maximums number of overlay connections that w
ill
* be made to achieve the given topology
* @param topo desired underlay topology to use * @param topo desired underlay topology to use
* @param va topology-specific options * @param va topology-specific options
* @return handle to the operation, NULL if connecting these * @return handle to the operation, NULL if connecting these
* peers is fundamentally not possible at this time (peers * peers is fundamentally not possible at this time (peers
* not running or underlay disallows) or if num_peers is less than 2 * not running or underlay disallows) or if num_peers is less than 2
*/ */
struct GNUNET_TESTBED_Operation * struct GNUNET_TESTBED_Operation *
GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls, GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls,
unsigned int num_peers, unsigned int num_peers,
struct GNUNET_TESTBED_Peer ** peers, struct GNUNET_TESTBED_Peer ** peers,
unsigned int *max_connections ,
enum GNUNET_TESTBED_TopologyO ption topo, enum GNUNET_TESTBED_TopologyO ption topo,
va_list va); va_list va);
/** /**
* All peers must have been started before calling this function. * All peers must have been started before calling this function.
* This function then connects the given peers in the P2P overlay * This function then connects the given peers in the P2P overlay
* using the given topology. * using the given topology.
* *
* @param op_cls closure argument to give with the operation event * @param op_cls closure argument to give with the operation event
* @param num_peers number of peers in 'peers' * @param num_peers number of peers in 'peers'
* @param peers array of 'num_peers' with the peers to configure * @param peers array of 'num_peers' with the peers to configure
* @param max_connections the maximums number of overlay connections that w
ill
* be made to achieve the given topology
* @param topo desired underlay topology to use * @param topo desired underlay topology to use
* @param ... topology-specific options * @param ... topology-specific options
* @return handle to the operation, NULL if connecting these * @return handle to the operation, NULL if connecting these
* peers is fundamentally not possible at this time (peers * peers is fundamentally not possible at this time (peers
* not running or underlay disallows) or if num_peers is less than 2 * not running or underlay disallows) or if num_peers is less than 2
*/ */
struct GNUNET_TESTBED_Operation * struct GNUNET_TESTBED_Operation *
GNUNET_TESTBED_overlay_configure_topology (void *op_cls, GNUNET_TESTBED_overlay_configure_topology (void *op_cls,
unsigned int num_peers, unsigned int num_peers,
struct GNUNET_TESTBED_Peer **pee rs, struct GNUNET_TESTBED_Peer **pee rs,
unsigned int *max_connections,
enum GNUNET_TESTBED_TopologyOpti on topo, enum GNUNET_TESTBED_TopologyOpti on topo,
...); ...);
/** /**
* Ask the testbed controller to write the current overlay topology to * Ask the testbed controller to write the current overlay topology to
* a file. Naturally, the file will only contain a snapshot as the * a file. Naturally, the file will only contain a snapshot as the
* topology may evolve all the time. * topology may evolve all the time.
* FIXME: needs continuation!? * FIXME: needs continuation!?
* *
* @param controller overlay controller to inspect * @param controller overlay controller to inspect
skipping to change at line 1164 skipping to change at line 1206
* If the operation is generated from GNUNET_TESTBED_service_connect() then * If the operation is generated from GNUNET_TESTBED_service_connect() then
* calling this function on such as operation calls the disconnect adapter if * calling this function on such as operation calls the disconnect adapter if
* the connect adapter was ever called. * the connect adapter was ever called.
* *
* @param operation operation to signal completion or cancellation * @param operation operation to signal completion or cancellation
*/ */
void void
GNUNET_TESTBED_operation_done (struct GNUNET_TESTBED_Operation *operation); GNUNET_TESTBED_operation_done (struct GNUNET_TESTBED_Operation *operation);
/** /**
* Configure and run a testbed using the given
* master controller on 'num_hosts' starting
* 'num_peers' using the given peer configuration.
*
* @param controller master controller for the testbed
* (must not be destroyed until after the
* testbed is destroyed).
* @param num_hosts number of hosts in 'hosts', 0 to only
* use 'localhost'
* @param hosts list of hosts to use for the testbed
* @param num_peers number of peers to start
* @param peer_cfg peer configuration template to use
* @param underlay_topology underlay topology to create
* @param va topology-specific options
* @return handle to the testbed
*/
struct GNUNET_TESTBED_Testbed *
GNUNET_TESTBED_create_va (struct GNUNET_TESTBED_Controller *controller,
unsigned int num_hosts,
struct GNUNET_TESTBED_Host **hosts,
unsigned int num_peers,
const struct GNUNET_CONFIGURATION_Handle *peer_cf
g,
enum GNUNET_TESTBED_TopologyOption underlay_topol
ogy,
va_list va);
/**
* Configure and run a testbed using the given
* master controller on 'num_hosts' starting
* 'num_peers' using the given peer configuration.
*
* @param controller master controller for the testbed
* (must not be destroyed until after the
* testbed is destroyed).
* @param num_hosts number of hosts in 'hosts', 0 to only
* use 'localhost'
* @param hosts list of hosts to use for the testbed
* @param num_peers number of peers to start
* @param peer_cfg peer configuration template to use
* @param underlay_topology underlay topology to create
* @param ... topology-specific options
*/
struct GNUNET_TESTBED_Testbed *
GNUNET_TESTBED_create (struct GNUNET_TESTBED_Controller *controller,
unsigned int num_hosts,
struct GNUNET_TESTBED_Host **hosts,
unsigned int num_peers,
const struct GNUNET_CONFIGURATION_Handle *peer_cfg,
enum GNUNET_TESTBED_TopologyOption underlay_topology
,
...);
/**
* Destroy a testbed. Stops all running peers and then
* destroys all peers. Does NOT destroy the master controller.
*
* @param testbed testbed to destroy
*/
void
GNUNET_TESTBED_destroy (struct GNUNET_TESTBED_Testbed *testbed);
/**
* Callback function to process statistic values from all peers. * Callback function to process statistic values from all peers.
* *
* @param cls closure * @param cls closure
* @param peer the peer the statistic belong to * @param peer the peer the statistic belong to
* @param subsystem name of subsystem that created the statistic * @param subsystem name of subsystem that created the statistic
* @param name the name of the datum * @param name the name of the datum
* @param value the current value * @param value the current value
* @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not
* @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
*/ */
skipping to change at line 1260 skipping to change at line 1242
* @return operation handle to cancel the operation * @return operation handle to cancel the operation
*/ */
struct GNUNET_TESTBED_Operation * struct GNUNET_TESTBED_Operation *
GNUNET_TESTBED_get_statistics (unsigned int num_peers, GNUNET_TESTBED_get_statistics (unsigned int num_peers,
struct GNUNET_TESTBED_Peer **peers, struct GNUNET_TESTBED_Peer **peers,
GNUNET_TESTBED_StatisticsIterator proc, GNUNET_TESTBED_StatisticsIterator proc,
GNUNET_TESTBED_OperationCompletionCallback c ont, GNUNET_TESTBED_OperationCompletionCallback c ont,
void *cls); void *cls);
/** /**
* Signature of a main function for a testcase.
*
* @param cls closure
* @param num_peers number of peers in 'peers'
* @param peers handle to peers run in the testbed
*/
typedef void (*GNUNET_TESTBED_TestMaster)(void *cls,
unsigned int num_peers,
struct GNUNET_TESTBED_Peer **peer
s);
/**
* Convenience method for running a testbed with * Convenience method for running a testbed with
* a single call. Underlay and overlay topology * a single call. Underlay and overlay topology
* are configured using the "UNDERLAY" and "OVERLAY" * are configured using the "UNDERLAY" and "OVERLAY"
* options in the "[testbed]" section of the configuration\ * options in the "[testbed]" section of the configuration\
* (with possible options given in "UNDERLAY_XXX" and/or * (with possible options given in "UNDERLAY_XXX" and/or
* "OVERLAY_XXX"). * "OVERLAY_XXX").
* *
* The testbed is to be terminated using a call to * The testbed is to be terminated using a call to
* "GNUNET_SCHEDULER_shutdown". * "GNUNET_SCHEDULER_shutdown".
* *
skipping to change at line 1284 skipping to change at line 1277
* cfg?; should be greater than 0 * cfg?; should be greater than 0
* @param event_mask bit mask with set of events to call 'cc' for; * @param event_mask bit mask with set of events to call 'cc' for;
* or-ed values of "1LL" shifted by the * or-ed values of "1LL" shifted by the
* respective 'enum GNUNET_TESTBED_EventType' * respective 'enum GNUNET_TESTBED_EventType'
* (i.e. "(1LL << GNUNET_TESTBED_ET_CONNECT) || ...") * (i.e. "(1LL << GNUNET_TESTBED_ET_CONNECT) || ...")
* @param cc controller callback to invoke on events; This callback is call ed * @param cc controller callback to invoke on events; This callback is call ed
* for all peer start events even if GNUNET_TESTBED_ET_PEER_START is n't * for all peer start events even if GNUNET_TESTBED_ET_PEER_START is n't
* set in the event_mask as this is the only way get access to the * set in the event_mask as this is the only way get access to the
* handle of each peer * handle of each peer
* @param cc_cls closure for cc * @param cc_cls closure for cc
* @param master task to run once the testbed is ready * @param test_master this callback will be called once the test is ready
* @param master_cls closure for 'task'. * @param test_master_cls closure for 'test_master'.
*/ */
void void
GNUNET_TESTBED_run (const char *host_filename, GNUNET_TESTBED_run (const char *host_filename,
const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_CONFIGURATION_Handle *cfg,
unsigned int num_peers, unsigned int num_peers,
uint64_t event_mask, uint64_t event_mask,
GNUNET_TESTBED_ControllerCallback cc, GNUNET_TESTBED_ControllerCallback cc,
void *cc_cls, void *cc_cls,
GNUNET_SCHEDULER_Task master, GNUNET_TESTBED_TestMaster test_master,
void *master_cls); void *test_master_cls);
/**
* Signature of a main function for a testcase.
*
* @param cls closure
* @param num_peers number of peers in 'peers'
* @param peers handle to peers run in the testbed
*/
typedef void (*GNUNET_TESTBED_TestMaster)(void *cls,
unsigned int num_peers,
struct GNUNET_TESTBED_Peer **peer
s);
/** /**
* Convenience method for running a "simple" test on the local system * Convenience method for running a "simple" test on the local system
* with a single call from 'main'. Underlay and overlay topology are * with a single call from 'main'. Underlay and overlay topology are
* configured using the "UNDERLAY" and "OVERLAY" options in the * configured using the "UNDERLAY" and "OVERLAY" options in the
* "[testbed]" section of the configuration (with possible options * "[testbed]" section of the configuration (with possible options
* given in "UNDERLAY_XXX" and/or "OVERLAY_XXX"). * given in "UNDERLAY_XXX" and/or "OVERLAY_XXX").
* *
* The test is to be terminated using a call to * The test is to be terminated using a call to
* "GNUNET_SCHEDULER_shutdown". If starting the test fails, * "GNUNET_SCHEDULER_shutdown". If starting the test fails,
skipping to change at line 1337 skipping to change at line 1319
* @param num_peers number of peers to start; should be greter than 0 * @param num_peers number of peers to start; should be greter than 0
* @param event_mask bit mask with set of events to call 'cc' for; * @param event_mask bit mask with set of events to call 'cc' for;
* or-ed values of "1LL" shifted by the * or-ed values of "1LL" shifted by the
* respective 'enum GNUNET_TESTBED_EventType' * respective 'enum GNUNET_TESTBED_EventType'
* (i.e. "(1LL << GNUNET_TESTBED_ET_CONNECT) || ...") * (i.e. "(1LL << GNUNET_TESTBED_ET_CONNECT) || ...")
* @param cc controller callback to invoke on events; This callback is call ed * @param cc controller callback to invoke on events; This callback is call ed
* for all peer start events even if GNUNET_TESTBED_ET_PEER_START is n't * for all peer start events even if GNUNET_TESTBED_ET_PEER_START is n't
* set in the event_mask as this is the only way get access to the * set in the event_mask as this is the only way get access to the
* handle of each peer * handle of each peer
* @param cc_cls closure for cc * @param cc_cls closure for cc
* @param test_master task to run once the test is ready * @param test_master this callback will be called once the test is ready
* @param test_master_cls closure for 'task'. * @param test_master_cls closure for 'test_master'.
* @param GNUNET_SYSERR on error, GNUNET_OK on success
*/ */
void int
GNUNET_TESTBED_test_run (const char *testname, GNUNET_TESTBED_test_run (const char *testname,
const char *cfg_filename, const char *cfg_filename,
unsigned int num_peers, unsigned int num_peers,
uint64_t event_mask, uint64_t event_mask,
GNUNET_TESTBED_ControllerCallback cc, GNUNET_TESTBED_ControllerCallback cc,
void *cc_cls, void *cc_cls,
GNUNET_TESTBED_TestMaster test_master, GNUNET_TESTBED_TestMaster test_master,
void *test_master_cls); void *test_master_cls);
#if 0 /* keep Emacsens' auto-indent happy */ #if 0 /* keep Emacsens' auto-indent happy */
 End of changes. 26 change blocks. 
107 lines changed or deleted 96 lines changed or added


 gnunet_testing_lib.h   gnunet_testing_lib.h 
/* /*
This file is part of GNUnet This file is part of GNUnet
(C) 2008, 2009 Christian Grothoff (and other contributing authors) (C) 2008, 2009, 2012 Christian Grothoff (and other contributing autho rs)
GNUnet is free software; you can redistribute it and/or modify GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3, or (at your by the Free Software Foundation; either version 3, or (at your
option) any later version. option) any later version.
GNUnet is distributed in the hope that it will be useful, but GNUnet is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the along with GNUnet; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
/** /**
* @file include/gnunet_testing_lib.h * @file include/gnunet_testing_lib.h
* @brief convenience API for writing testcases for GNUnet * @brief convenience API for writing testcases for GNUnet;
* Many testcases need to start and stop gnunetd, * can start/stop one or more peers on a system;
* and this library is supposed to make that easier * testing is responsible for managing private keys,
* for TESTCASES. Normal programs should always * ports and paths; it is a low-level library that
* use functions from gnunet_{util,arm}_lib.h. This API is * does not support higher-level functions such as
* ONLY for writing testcases! * P2P connection, topology management or distributed
* testbed maintenance (those are in gnunet_testbed_service.h)
* @author Christian Grothoff * @author Christian Grothoff
*/ */
#ifndef GNUNET_TESTING_LIB_H #ifndef GNUNET_TESTING_LIB_H
#define GNUNET_TESTING_LIB_H #define GNUNET_TESTING_LIB_H
#include "gnunet_util_lib.h" #include "gnunet_util_lib.h"
#include "gnunet_statistics_service.h" #include "gnunet_statistics_service.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#if 0 /* keep Emacsens' auto-indent happy */ #if 0 /* keep Emacsens' auto-indent happy */
} }
#endif #endif
#endif #endif
#define HOSTKEYFILESIZE 914 #define GNUNET_TESTING_HOSTKEYFILESIZE 914
/** /**
* Handle for a GNUnet daemon (technically a set of * Handle for a system on which GNUnet peers are executed;
* daemons; the handle is really for the master ARM * a system is used for reserving unique paths and ports.
* daemon) started by the testing library.
*/ */
struct GNUNET_TESTING_Daemon; struct GNUNET_TESTING_System;
/** /**
* Linked list of hostnames and ports to use for starting daemons. * Handle for a GNUnet peer controlled by testing.
*/ */
struct GNUNET_TESTING_Host struct GNUNET_TESTING_Peer;
{
/**
* Pointer to next item in the list.
*/
struct GNUNET_TESTING_Host *next;
/**
* Hostname to connect to.
*/
char *hostname;
/**
* Username to use when connecting (may be null).
*/
char *username;
/**
* Port to use for SSH connection (used for ssh
* connection forwarding, 0 to let ssh decide)
*/
uint16_t port;
};
/** /**
* Prototype of a function that will be called whenever * Create a system handle. There must only be one system handle per operat
* a daemon was started by the testing library. ing
* system. Uses a default range for allowed ports. Ports are still tested
for
* availability.
* *
* @param cls closure * @param testdir only the directory name without any path. This is used fo
* @param id identifier for the daemon, NULL on error r all
* @param d handle for the daemon * service homes; the directory will be created in a temporary loc
* @param emsg error message (NULL on success) ation
*/ * depending on the underlying OS
typedef void (*GNUNET_TESTING_NotifyHostkeyCreated) (void *cls, * @param trusted_ip the ip address which will be set as TRUSTED HOST in al
const struct l
GNUNET_PeerIdentity * * service configurations generated to allow control connections f
id, rom
struct * this ip. This can either be a single ip address or a network ad
GNUNET_TESTING_Daemon dress
* d, * in CIDR notation.
const char *emsg); * @param hostname the hostname of the system we are using for testing; NUL
L for
/** * localhost
* Prototype of a function that will be called whenever * @return handle to this system, NULL on error
* a daemon was started by the testing library.
*
* @param cls closure
* @param id identifier for the daemon, NULL on error
* @param cfg configuration used by this daemon
* @param d handle for the daemon
* @param emsg error message (NULL on success)
*/ */
typedef void (*GNUNET_TESTING_NotifyDaemonRunning) (void *cls, struct GNUNET_TESTING_System *
const struct GNUNET_TESTING_system_create (const char *testdir,
GNUNET_PeerIdentity * i const char *trusted_ip,
d, const char *hostname);
const struct
GNUNET_CONFIGURATION_Ha
ndle
* cfg,
struct GNUNET_TESTING_D
aemon
* d, const char *emsg);
/**
* Handle to an entire testbed of GNUnet peers.
*/
struct GNUNET_TESTING_Testbed;
/**
* Phases of starting GNUnet on a system.
*/
enum GNUNET_TESTING_StartPhase
{
/**
* Copy the configuration file to the target system.
*/
SP_COPYING,
/**
* Configuration file has been copied, generate hostkey.
*/
SP_COPIED,
/**
* Create the hostkey for the peer.
*/
SP_HOSTKEY_CREATE,
/**
* Hostkey generated, wait for topology to be finished.
*/
SP_HOSTKEY_CREATED,
/**
* Topology has been created, now start ARM.
*/
SP_TOPOLOGY_SETUP,
/**
* ARM has been started, check that it has properly daemonized and
* then try to connect to the CORE service (which should be
* auto-started by ARM).
*/
SP_START_ARMING,
/**
* We're waiting for CORE to start.
*/
SP_START_CORE,
/**
* CORE is up, now make sure we get the HELLO for this peer.
*/
SP_GET_HELLO,
/**
* Core has notified us that we've established a connection to the servic
e.
* The main FSM halts here and waits to be moved to UPDATE or CLEANUP.
*/
SP_START_DONE,
/**
* We've been asked to terminate the instance and are now waiting for
* the remote command to stop the gnunet-arm process and delete temporary
* files.
*/
SP_SHUTDOWN_START,
/**
* We should shutdown a *single* service via gnunet-arm. Call the dead_c
b
* upon notification from gnunet-arm that the service has been stopped.
*/
SP_SERVICE_SHUTDOWN_START,
/**
* We should start a *single* service via gnunet-arm. Call the daemon cb
* upon notification from gnunet-arm that the service has been started.
*/
SP_SERVICE_START,
/**
* We've received a configuration update and are currently waiting for
* the copy process for the update to complete. Once it is, we will
* return to "SP_START_DONE" (and rely on ARM to restart all affected
* services).
*/
SP_CONFIG_UPDATE
};
/** /**
* Prototype of a function that will be called when a * Create a system handle. There must only be one system
* particular operation was completed the testing library. * handle per operating system. Use this function directly
* if multiple system objects are created for the same host
* (only really useful when testing --- or to make the port
* range configureable).
* *
* @param cls closure * @param testdir only the directory name without any path. This is used fo
* @param emsg NULL on success r
* all service homes; the directory will be created in a temporary
* location depending on the underlying OS
* @param trusted_ip the ip address which will be set as TRUSTED HOST in al
l
* service configurations generated to allow control connections f
rom
* this ip. This can either be a single ip address or a network ad
dress
* in CIDR notation.
* @param controller hostname of the controlling host,
* service configurations are modified to allow
* control connections from this host; can be NULL
* @param hostname the hostname of the system we are using for testing; NUL
L for
* localhost
* @param lowport lowest port number this system is allowed to allocate (in
clusive)
* @param highport highest port number this system is allowed to allocate (
exclusive)
* @return handle to this system, NULL on error
*/ */
typedef void (*GNUNET_TESTING_NotifyCompletion) (void *cls, const char *ems struct GNUNET_TESTING_System *
g); GNUNET_TESTING_system_create_with_portrange (const char *testdir,
const char *trusted_ip,
const char *hostname,
uint16_t lowport,
uint16_t highport);
/** /**
* Prototype of a function that will be called with the * Free system resources.
* number of connections created for a particular topology.
* *
* @param cls closure * @param system system to be freed
* @param num_connections the number of connections created * @param remove_paths should the 'testdir' and all subdirectories
*/ * be removed (clean up on shutdown)?
typedef void (*GNUNET_TESTING_NotifyConnections) (void *cls,
unsigned int num_connecti
ons);
/**
* Handle for a GNUnet daemon (technically a set of
* daemons; the handle is really for the master ARM
* daemon) started by the testing library.
*/
struct GNUNET_TESTING_Daemon
{
/**
* Our configuration.
*/
struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* At what time to give up starting the peer
*/
struct GNUNET_TIME_Absolute max_timeout;
/**
* Host to run GNUnet on.
*/
char *hostname;
/**
* Port to use for ssh, NULL to let system choose default.
*/
char *ssh_port_str;
/**
* Result of GNUNET_i2s of this peer,
* for printing
*/
char *shortname;
/**
* Username we are using.
*/
char *username;
/**
* Name of the configuration file
*/
char *cfgfile;
/**
* Callback to inform initiator that the peer's
* hostkey has been created.
*/
GNUNET_TESTING_NotifyHostkeyCreated hostkey_callback;
/**
* Closure for hostkey creation callback.
*/
void *hostkey_cls;
/**
* Function to call when the peer is running.
*/
GNUNET_TESTING_NotifyDaemonRunning cb;
/**
* Closure for cb.
*/
void *cb_cls;
/**
* Arguments from "daemon_stop" call.
*/
GNUNET_TESTING_NotifyCompletion dead_cb;
/**
* Closure for 'dead_cb'.
*/
void *dead_cb_cls;
/**
* Arguments from "daemon_stop" call.
*/
GNUNET_TESTING_NotifyCompletion update_cb;
/**
* Closure for 'update_cb'.
*/
void *update_cb_cls;
/**
* PID of the process we used to run gnunet-arm or SSH to start the peer.
*/
struct GNUNET_OS_Process *proc_arm_start;
/**
* PID of the process we used to run gnunet-arm or SSH to stop the peer.
*/
struct GNUNET_OS_Process *proc_arm_stop;
/**
* PID of the process we used to run gnunet-arm or SSH to manage services
at the peer.
*/
struct GNUNET_OS_Process *proc_arm_srv_start;
/**
* PID of the process we used to run gnunet-arm or SSH to manage services
at the peer.
*/
struct GNUNET_OS_Process *proc_arm_srv_stop;
/**
* PID of the process we used to run copy files
*/
struct GNUNET_OS_Process *proc_arm_copying;
/**
* PID of the process we used to run gnunet-peerinfo.
*/
struct GNUNET_OS_Process *proc_arm_peerinfo;
/**
* Handle to the server.
*/
struct GNUNET_CORE_Handle *server;
/**
* Handle to the transport service of this peer
*/
struct GNUNET_TRANSPORT_Handle *th;
/**
* Handle for getting HELLOs from transport
*/
struct GNUNET_TRANSPORT_GetHelloHandle *ghh;
/**
* HELLO message for this peer
*/
struct GNUNET_HELLO_Message *hello;
/**
* Handle to a pipe for reading the hostkey.
*/
struct GNUNET_DISK_PipeHandle *pipe_stdout;
/**
* Currently, a single char * pointing to a service
* that has been churned off.
*
* FIXME: make this a linked list of services that have been churned off!
!!
*/
char *churned_services;
/**
* ID of the current task.
*/
GNUNET_SCHEDULER_TaskIdentifier task;
/**
* Identity of this peer (once started).
*/
struct GNUNET_PeerIdentity id;
/**
* Flag to indicate that we've already been asked
* to terminate (but could not because some action
* was still pending).
*/
int dead;
/**
* GNUNET_YES if the hostkey has been created
* for this peer, GNUNET_NO otherwise.
*/
int have_hostkey;
/**
* In which phase are we during the start of
* this process?
*/
enum GNUNET_TESTING_StartPhase phase;
/**
* Current position in 'hostkeybuf' (for reading from gnunet-peerinfo)
*/
unsigned int hostkeybufpos;
/**
* Set to GNUNET_YES once the peer is up.
*/
int running;
/**
* Used to tell shutdown not to remove configuration for the peer
* (if it's going to be restarted later)
*/
int churn;
/**
* Output from gnunet-peerinfo is read into this buffer.
*/
char hostkeybuf[105];
};
/**
* Handle to a group of GNUnet peers.
*/
struct GNUNET_TESTING_PeerGroup;
/**
* Prototype of a function that will be called whenever
* two daemons are connected by the testing library.
*
* @param cls closure
* @param first peer id for first daemon
* @param second peer id for the second daemon
* @param distance distance between the connected peers
* @param first_cfg config for the first daemon
* @param second_cfg config for the second daemon
* @param first_daemon handle for the first daemon
* @param second_daemon handle for the second daemon
* @param emsg error message (NULL on success)
*/
typedef void (*GNUNET_TESTING_NotifyConnection) (void *cls,
const struct
GNUNET_PeerIdentity * firs
t,
const struct
GNUNET_PeerIdentity * seco
nd,
uint32_t distance,
const struct
GNUNET_CONFIGURATION_Handl
e *
first_cfg,
const struct
GNUNET_CONFIGURATION_Handl
e *
second_cfg,
struct GNUNET_TESTING_Daem
on *
first_daemon,
struct GNUNET_TESTING_Daem
on *
second_daemon,
const char *emsg);
/**
* Prototype of a callback function indicating that two peers
* are currently connected.
*
* @param cls closure
* @param first peer id for first daemon
* @param second peer id for the second daemon
* @param distance distance between the connected peers
* @param emsg error message (NULL on success)
*/
typedef void (*GNUNET_TESTING_NotifyTopology) (void *cls,
const struct GNUNET_PeerIden
tity
* first,
const struct GNUNET_PeerIden
tity
* second, const char *emsg);
/**
* Starts a GNUnet daemon. GNUnet must be installed on the target
* system and available in the PATH. The machine must furthermore be
* reachable via "ssh" (unless the hostname is "NULL") without the
* need to enter a password.
*
* @param cfg configuration to use
* @param timeout how long to wait starting up peers
* @param pretend GNUNET_YES to set up files but not start peer GNUNET_NO
* to really start the peer (default)
* @param hostname name of the machine where to run GNUnet
* (use NULL for localhost).
* @param ssh_username ssh username to use when connecting to hostname
* @param sshport port to pass to ssh process when connecting to hostname
* @param hostkey pointer to a hostkey to be written to disk (instead of be
ing generated)
* @param hostkey_callback function to call once the hostkey has been
* generated for this peer, but it hasn't yet been started
* (NULL to start immediately, otherwise waits on GNUNET_TESTING_dae
mon_continue_start)
* @param hostkey_cls closure for hostkey callback
* @param cb function to call once peer is up, or failed to start
* @param cb_cls closure for cb
* @return handle to the daemon (actual start will be completed asynchronou
sly)
*/
struct GNUNET_TESTING_Daemon *
GNUNET_TESTING_daemon_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
struct GNUNET_TIME_Relative timeout, int prete
nd,
const char *hostname, const char *ssh_username
,
uint16_t sshport, const char *hostkey,
GNUNET_TESTING_NotifyHostkeyCreated
hostkey_callback, void *hostkey_cls,
GNUNET_TESTING_NotifyDaemonRunning cb,
void *cb_cls);
/**
* Continues GNUnet daemon startup when user wanted to be notified
* once a hostkey was generated (for creating friends files, blacklists,
* etc.).
*
* @param daemon the daemon to finish starting
*/ */
void void
GNUNET_TESTING_daemon_continue_startup (struct GNUNET_TESTING_Daemon *daemo GNUNET_TESTING_system_destroy (struct GNUNET_TESTING_System *system,
n); int remove_paths);
/** /**
* Check whether the given daemon is running. * Testing includes a number of pre-created hostkeys for
* faster peer startup. This function can be used to
* access the n-th key of those pre-created hostkeys; note
* that these keys are ONLY useful for testing and not
* secure as the private keys are part of the public
* GNUnet source code.
* *
* @param daemon the daemon to check * This is primarily a helper function used internally
* @return GNUNET_YES if the daemon is up, GNUNET_NO if the * by 'GNUNET_TESTING_peer_configure'.
* daemon is down, GNUNET_SYSERR on error.
*/
int
GNUNET_TESTING_test_daemon_running (struct GNUNET_TESTING_Daemon *daemon);
/**
* Obtain the peer identity of the peer with the given configuration
* handle. This function reads the private key of the peer, obtains
* the public key and hashes it.
*
* @param cfg configuration of the peer
* @param pid where to store the peer identity
* @return GNUNET_OK on success, GNUNET_SYSERR on failure
*/
int
GNUNET_TESTING_get_peer_identity (const struct GNUNET_CONFIGURATION_Handle
*cfg,
struct GNUNET_PeerIdentity *pid);
/**
* Restart (stop and start) a GNUnet daemon.
*
* @param d the daemon that should be restarted
* @param cb function called once the daemon is (re)started
* @param cb_cls closure for cb
*/
void
GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d,
GNUNET_TESTING_NotifyDaemonRunning cb,
void *cb_cls);
/**
* Start a peer that has previously been stopped using the daemon_stop
* call (and files weren't deleted and the allow restart flag)
*
* @param daemon the daemon to start (has been previously stopped)
* @param timeout how long to wait for restart
* @param cb the callback for notification when the peer is running
* @param cb_cls closure for the callback
*/
void
GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon,
struct GNUNET_TIME_Relative timeout,
GNUNET_TESTING_NotifyDaemonRunning cb,
void *cb_cls);
/**
* Starts a GNUnet daemon's service.
*
* @param d the daemon for which the service should be started
* @param service the name of the service to start
* @param timeout how long to wait for process for startup
* @param cb function called once gnunet-arm returns
* @param cb_cls closure for cb
*/
void
GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d,
const char *service,
struct GNUNET_TIME_Relative timeout,
GNUNET_TESTING_NotifyDaemonRunning cb,
void *cb_cls);
/**
* Starts a GNUnet daemon's service which has been previously turned off.
*
* @param d the daemon for which the service should be started
* @param service the name of the service to start
* @param timeout how long to wait for process for startup
* @param cb function called once gnunet-arm returns
* @param cb_cls closure for cb
*/
void
GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon *
d,
char *service,
struct GNUNET_TIME_Relative
timeout,
GNUNET_TESTING_NotifyDaemonRun
ning
cb, void *cb_cls);
/**
* Get a certain testing daemon handle.
* *
* @param pg handle to the set of running peers * @param system the testing system handle
* @param position the number of the peer to return * @param key_number desired pre-created hostkey to obtain
* @param id set to the peer's identity (hash of the public
* key; if NULL, GNUNET_SYSERR is returned immediately
* @return NULL on error (not enough keys)
*/ */
struct GNUNET_TESTING_Daemon * struct GNUNET_CRYPTO_RsaPrivateKey *
GNUNET_TESTING_daemon_get (struct GNUNET_TESTING_PeerGroup *pg, GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system,
unsigned int position); uint32_t key_number,
struct GNUNET_PeerIdentity *id);
/** /**
* Get a daemon by peer identity, so callers can * Reserve a TCP or UDP port for a peer.
* retrieve the daemon without knowing it's offset.
* *
* @param pg the peer group to retrieve the daemon from * @param system system to use for reservation tracking
* @param peer_id the peer identity of the daemon to retrieve * @param is_tcp GNUNET_YES for TCP ports, GNUNET_NO for UDP
* * @return 0 if no free port was available
* @return the daemon on success, or NULL if no such peer identity is found
*/ */
struct GNUNET_TESTING_Daemon * uint16_t
GNUNET_TESTING_daemon_get_by_id (struct GNUNET_TESTING_PeerGroup *pg, GNUNET_TESTING_reserve_port (struct GNUNET_TESTING_System *system,
const struct GNUNET_PeerIdentity *peer_id) int is_tcp);
;
/** /**
* Stops a GNUnet daemon. * Release reservation of a TCP or UDP port for a peer
* (used during GNUNET_TESTING_peer_destroy).
* *
* @param d the daemon that should be stopped * @param system system to use for reservation tracking
* @param timeout how long to wait for process for shutdown to complete * @param is_tcp GNUNET_YES for TCP ports, GNUNET_NO for UDP
* @param cb function called once the daemon was stopped * @param port reserved port to release
* @param cb_cls closure for cb
* @param delete_files GNUNET_YES to remove files, GNUNET_NO
* to leave them (i.e. for restarting at a later time,
* or logfile inspection once finished)
* @param allow_restart GNUNET_YES to restart peer later (using this API)
* GNUNET_NO to kill off and clean up for good
*/
void
GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d,
struct GNUNET_TIME_Relative timeout,
GNUNET_TESTING_NotifyCompletion cb, void *cb_cl
s,
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.
*
* @param d the daemon that should be modified
* @param cfg the new configuration for the daemon
* @param cb function called once the configuration was changed
* @param cb_cls closure for cb
*/ */
void void
GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, GNUNET_TESTING_release_port (struct GNUNET_TESTING_System *system,
struct GNUNET_CONFIGURATION_Handle *cfg, int is_tcp,
GNUNET_TESTING_NotifyCompletion cb, uint16_t port);
void *cb_cls);
/**
* Stops a single service of a GNUnet daemon. Used like daemon_stop,
* only doesn't stop the entire peer in any case. If the service
* is not currently running, this call is likely to fail after
* timeout!
*
* @param d the daemon that should be stopped
* @param service the name of the service to stop
* @param timeout how long to wait for process for shutdown to complete
* @param cb function called once the service was stopped
* @param cb_cls closure for cb
*/
void
GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d,
const char *service,
struct GNUNET_TIME_Relative timeout,
GNUNET_TESTING_NotifyCompletion cb,
void *cb_cls);
/**
* Read a testing hosts file based on a configuration.
* Returns a DLL of hosts (caller must free!) on success
* or NULL on failure.
*
* @param cfg a configuration with a testing section
*
* @return DLL of hosts on success, NULL on failure
*/
struct GNUNET_TESTING_Host *
GNUNET_TESTING_hosts_load (const struct GNUNET_CONFIGURATION_Handle *cfg);
/**
* Start count gnunet instances with the same set of transports and
* applications. The port numbers (any option called "PORT") will be
* adjusted to ensure that no two peers running on the same system
* have the same port(s) in their respective configurations.
*
* @param cfg configuration template to use
* @param total number of daemons to start
* @param max_concurrent_connections for testing, how many peers can
* we connect to simultaneously
* @param max_concurrent_ssh when starting with ssh, how many ssh
* connections will we allow at once (based on remote hosts allowed!
)
* @param timeout total time allowed for peers to start
* @param hostkey_callback function to call on each peers hostkey generatio
n
* if NULL, peers will be started by this call, if non-null,
* GNUNET_TESTING_daemons_continue_startup must be called after
* successful hostkey generation
* @param hostkey_cls closure for hostkey callback
* @param cb function to call on each daemon that was started
* @param cb_cls closure for cb
* @param connect_callback function to call each time two hosts are connect
ed
* @param connect_callback_cls closure for connect_callback
* @param hostnames linked list of host structs to use to start peers on
* (NULL to run on localhost only)
*
* @return NULL on error, otherwise handle to control peer group
*/
struct GNUNET_TESTING_PeerGroup *
GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg
,
unsigned int total,
unsigned int max_concurrent_connections,
unsigned int max_concurrent_ssh,
struct GNUNET_TIME_Relative timeout,
GNUNET_TESTING_NotifyHostkeyCreated
hostkey_callback, void *hostkey_cls,
GNUNET_TESTING_NotifyDaemonRunning cb,
void *cb_cls,
GNUNET_TESTING_NotifyConnection connect_callb
ack,
void *connect_callback_cls,
const struct GNUNET_TESTING_Host *hostnames);
/** /**
* Function which continues a peer group starting up * Create a new configuration using the given configuration as a template;
* after successfully generating hostkeys for each peer. * ports and paths will be modified to select available ports on the local
* system. The default configuration will be available in PATHS section und
er
* the option DEFAULTCONFIG after the call. SERVICE_HOME is also set in PAT
HS
* section to the temporary directory specific to this configuration. If we
run
* out of "*port" numbers, return SYSERR.
* *
* @param pg the peer group to continue starting * This is primarily a helper function used internally
*/ * by 'GNUNET_TESTING_peer_configure'.
void
GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup *p
g);
/**
* Handle for an active request to connect two peers.
*/
struct GNUNET_TESTING_ConnectContext;
/**
* Establish a connection between two GNUnet daemons. The daemons
* must both be running and not be stopped until either the
* 'cb' callback is called OR the connection request has been
* explicitly cancelled.
* *
* @param d1 handle for the first daemon * @param system system to use to coordinate resource usage
* @param d2 handle for the second daemon * @param cfg template configuration to update
* @param timeout how long is the connection attempt * @return GNUNET_OK on success, GNUNET_SYSERR on error - the configuration
* allowed to take? will
* @param max_connect_attempts how many times should we try to reconnect * be incomplete and should not be used there upon
* (within timeout)
* @param send_hello GNUNET_YES to send the HELLO, GNUNET_NO to assume
* the HELLO has already been exchanged
* @param cb function to call at the end
* @param cb_cls closure for cb
* @return handle to cancel the request, NULL on error
*/ */
struct GNUNET_TESTING_ConnectContext * int
GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, GNUNET_TESTING_configuration_create (struct GNUNET_TESTING_System *system,
struct GNUNET_TESTING_Daemon *d2, struct GNUNET_CONFIGURATION_Handle *cfg
struct GNUNET_TIME_Relative timeout, );
unsigned int max_connect_attempts, // FIXME: add dual to 'release' ports again...
int send_hello,
GNUNET_TESTING_NotifyConnection cb,
void *cb_cls);
/** /**
* Cancel an attempt to connect two daemons. * Configure a GNUnet peer. GNUnet must be installed on the local
* system and available in the PATH.
* *
* @param cc connect context * @param system system to use to coordinate resource usage
* @param cfg configuration to use; will be UPDATED (to reflect needed
* changes in port numbers and paths)
* @param key_number number of the hostkey to use for the peer
* @param id identifier for the daemon, will be set, can be NULL
* @param emsg set to freshly allocated error message (set to NULL on succe
ss),
* can be NULL
* @return handle to the peer, NULL on error
*/ */
void struct GNUNET_TESTING_Peer *
GNUNET_TESTING_daemons_connect_cancel (struct GNUNET_TESTING_ConnectContext GNUNET_TESTING_peer_configure (struct GNUNET_TESTING_System *system,
*cc); struct GNUNET_CONFIGURATION_Handle *cfg,
uint32_t key_number,
struct GNUNET_PeerIdentity *id,
char **emsg);
/** /**
* Restart all peers in the given group. * Obtain the peer identity from a peer handle.
* *
* @param pg the handle to the peer group * @param peer peer handle for which we want the peer's identity
* @param callback function to call on completion (or failure) * @param id identifier for the daemon, will be set
* @param callback_cls closure for the callback function
*/ */
void void
GNUNET_TESTING_daemons_restart (struct GNUNET_TESTING_PeerGroup *pg, GNUNET_TESTING_peer_get_identity (const struct GNUNET_TESTING_Peer *peer,
GNUNET_TESTING_NotifyCompletion callback, struct GNUNET_PeerIdentity *id);
void *callback_cls);
/** /**
* Shutdown all peers started in the given group. * Start the peer.
* *
* @param pg handle to the peer group * @param peer peer to start
* @param timeout how long to wait for shutdown * @return GNUNET_OK on success, GNUNET_SYSERR on error (i.e. peer already
* @param cb callback to notify upon success or failure running)
* @param cb_cls closure for cb
*/
void
GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg,
struct GNUNET_TIME_Relative timeout,
GNUNET_TESTING_NotifyCompletion cb, void *cb_c
ls);
/**
* Count the number of running peers.
*
* @param pg handle for the peer group
*
* @return the number of currently running peers in the peer group
*/
unsigned int
GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup *pg);
/**
* Simulate churn by stopping some peers (and possibly
* re-starting others if churn is called multiple times). This
* function can only be used to create leave-join churn (peers "never"
* leave for good). First "voff" random peers that are currently
* online will be taken offline; then "von" random peers that are then
* offline will be put back online. No notifications will be
* generated for any of these operations except for the callback upon
* completion. Note that the implementation is at liberty to keep
* the ARM service itself (but none of the other services or daemons)
* running even though the "peer" is being varied offline.
*
* @param pg handle for the peer group
* @param service the service to churn on/off, NULL for all
* @param voff number of peers that should go offline
* @param von number of peers that should come back online;
* must be zero on first call (since "testbed_start"
* always starts all of the peers)
* @param timeout how long to wait for operations to finish before
* giving up
* @param cb function to call at the end
* @param cb_cls closure for cb
*/ */
void int
GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg, GNUNET_TESTING_peer_start (struct GNUNET_TESTING_Peer *peer);
char *service, unsigned int voff,
unsigned int von,
struct GNUNET_TIME_Relative timeout,
GNUNET_TESTING_NotifyCompletion cb, void *cb_
cls);
/** /**
* Start a given service for each of the peers in the peer group. * Stop the peer.
*
* @param pg handle for the peer group
* @param service the service to start
* @param timeout how long to wait for operations to finish before
* giving up
* @param cb function to call once finished
* @param cb_cls closure for cb
* *
* @param peer peer to stop
* @return GNUNET_OK on success, GNUNET_SYSERR on error (i.e. peer not runn
ing)
*/ */
void int
GNUNET_TESTING_daemons_start_service (struct GNUNET_TESTING_PeerGroup *pg, GNUNET_TESTING_peer_stop (struct GNUNET_TESTING_Peer *peer);
char *service,
struct GNUNET_TIME_Relative timeout,
GNUNET_TESTING_NotifyCompletion cb,
void *cb_cls);
/** /**
* Callback function to process statistic values. * Destroy the peer. Releases resources locked during peer configuration.
* If the peer is still running, it will be stopped AND a warning will be
* printed (users of the API should stop the peer explicitly first).
* *
* @param cls closure * @param peer peer to destroy
* @param peer the peer the statistics belong to
* @param subsystem name of subsystem that created the statistic
* @param name the name of the datum
* @param value the current value
* @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if
not
* @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
*/
typedef int (*GNUNET_TESTING_STATISTICS_Iterator) (void *cls,
const struct
GNUNET_PeerIdentity * pe
er,
const char *subsystem,
const char *name,
uint64_t value,
int is_persistent);
/**
* Iterate over all (running) peers in the peer group, retrieve
* all statistics from each.
*
* @param pg the peergroup to iterate statistics of
* @param cont continuation to call once call is completed(?)
* @param proc processing function for each statistic retrieved
* @param cls closure to pass to proc
*/ */
void void
GNUNET_TESTING_get_statistics (struct GNUNET_TESTING_PeerGroup *pg, GNUNET_TESTING_peer_destroy (struct GNUNET_TESTING_Peer *peer);
GNUNET_STATISTICS_Callback cont,
GNUNET_TESTING_STATISTICS_Iterator proc,
void *cls);
/** /**
* Topologies supported for testbeds. * Sends SIGTERM to the peer's main process
*/
enum GNUNET_TESTING_Topology
{
/**
* A clique (everyone connected to everyone else).
*/
GNUNET_TESTING_TOPOLOGY_CLIQUE,
/**
* Small-world network (2d torus plus random links).
*/
GNUNET_TESTING_TOPOLOGY_SMALL_WORLD,
/**
* Small-world network (ring plus random links).
*/
GNUNET_TESTING_TOPOLOGY_SMALL_WORLD_RING,
/**
* Ring topology.
*/
GNUNET_TESTING_TOPOLOGY_RING,
/**
* 2-d torus.
*/
GNUNET_TESTING_TOPOLOGY_2D_TORUS,
/**
* Random graph.
*/
GNUNET_TESTING_TOPOLOGY_ERDOS_RENYI,
/**
* Certain percentage of peers are unable to communicate directly
* replicating NAT conditions
*/
GNUNET_TESTING_TOPOLOGY_INTERNAT,
/**
* Scale free topology.
*/
GNUNET_TESTING_TOPOLOGY_SCALE_FREE,
/**
* Straight line topology.
*/
GNUNET_TESTING_TOPOLOGY_LINE,
/**
* All peers are disconnected.
*/
GNUNET_TESTING_TOPOLOGY_NONE,
/**
* Read a topology from a given file.
*/
GNUNET_TESTING_TOPOLOGY_FROM_FILE
};
/**
* Options for connecting a topology.
*/
enum GNUNET_TESTING_TopologyOption
{
/**
* Try to connect all peers specified in the topology.
*/
GNUNET_TESTING_TOPOLOGY_OPTION_ALL,
/**
* Choose a random subset of connections to create.
*/
GNUNET_TESTING_TOPOLOGY_OPTION_RANDOM,
/**
* Create at least X connections for each peer.
*/
GNUNET_TESTING_TOPOLOGY_OPTION_MINIMUM,
/**
* Using a depth first search, create one connection
* per peer. If any are missed (graph disconnected)
* start over at those peers until all have at least one
* connection.
*/
GNUNET_TESTING_TOPOLOGY_OPTION_DFS,
/**
* Find the N closest peers to each allowed peer in the
* topology and make sure a connection to those peers
* exists in the connect topology.
*/
GNUNET_TESTING_TOPOLOGY_OPTION_ADD_CLOSEST,
/**
* No options specified.
*/
GNUNET_TESTING_TOPOLOGY_OPTION_NONE
};
/**
* Get a topology from a string input.
*
* @param topology where to write the retrieved topology
* @param topology_string The string to attempt to
* get a configuration value from
* @return GNUNET_YES if topology string matched a
* known topology, GNUNET_NO if not
*/
int
GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology,
const char *topology_string);
/**
* Get connect topology option from string input.
* *
* @param topology_option where to write the retrieved topology * @param peer the handle to the peer
* @param topology_string The string to attempt to * @return GNUNET_OK if successful; GNUNET_SYSERR if the main process is NU
* get a configuration value from LL
* @return GNUNET_YES if topology string matched a * or upon any error while sending SIGTERM
* known topology, GNUNET_NO if not
*/ */
int int
GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption GNUNET_TESTING_peer_kill (struct GNUNET_TESTING_Peer *peer);
*topology_option,
const char *topology_string);
/**
* Takes a peer group and creates a topology based on the
* one specified. Creates a topology means generates friend
* files for the peers so they can only connect to those allowed
* by the topology. This will only have an effect once peers
* are started if the FRIENDS_ONLY option is set in the base
* config.
*
* Also takes an optional restrict topology which
* disallows direct connections UNLESS they are specified in
* the restricted topology.
*
* A simple example; if the topology option is set to LINE
* peers can ONLY connect in a LINE. However, if the topology
* option is set to 2D-torus and the restrict option is set to
* line with restrict_transports equal to "tcp udp", then peers
* may connect in a 2D-torus, but will be restricted to tcp and
* udp connections only in a LINE. Generally it only makes
* sense to do this if restrict_topology is a subset of topology.
*
* For testing peer discovery, etc. it is generally better to
* leave restrict_topology as GNUNET_TESTING_TOPOLOGY_NONE and
* then use the connect_topology function to restrict the initial
* connection set.
*
* @param pg the peer group struct representing the running peers
* @param topology which topology to connect the peers in
* @param restrict_topology allow only direct connections in this topology,
* based on those listed in restrict_transports, set to
* GNUNET_TESTING_TOPOLOGY_NONE for no restrictions
* @param restrict_transports space delimited list of transports to blackli
st
* to create restricted topology, NULL for none
*
* @return the maximum number of connections were all allowed peers
* connected to each other
*/
unsigned int
GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg,
enum GNUNET_TESTING_Topology topology,
enum GNUNET_TESTING_Topology restrict_topol
ogy,
const char *restrict_transports);
/**
* Iterate over all (running) peers in the peer group, retrieve
* all connections that each currently has.
*
* @param pg the peer group we are concerned with
* @param cb callback for topology information
* @param cls closure for callback
*/
void
GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg,
GNUNET_TESTING_NotifyTopology cb, void *cls);
/** /**
* Stop the connection process temporarily. * Waits for a peer to terminate. The peer's main process will also be dest royed.
* *
* @param pg the peer group to stop connecting * @param peer the handle to the peer
* @return GNUNET_OK if successful; GNUNET_SYSERR if the main process is NU
LL
* or upon any error while waiting
*/ */
void int
GNUNET_TESTING_stop_connections (struct GNUNET_TESTING_PeerGroup *pg); GNUNET_TESTING_peer_wait (struct GNUNET_TESTING_Peer *peer);
/** /**
* Resume the connection process. * Signature of the 'main' function for a (single-peer) testcase that
* is run using 'GNUNET_TESTING_peer_run'.
* *
* @param pg the peer group to resume connecting * @param cls closure
* @param cfg configuration of the peer that was started
* @param peer identity of the peer that was created
*/ */
void typedef void (*GNUNET_TESTING_TestMain)(void *cls,
GNUNET_TESTING_resume_connections (struct GNUNET_TESTING_PeerGroup *pg); const struct GNUNET_CONFIGURATION_Ha
ndle *cfg,
/** struct GNUNET_TESTING_Peer *peer);
* There are many ways to connect peers that are supported by this function
. /**
* To connect peers in the same topology that was created via the * Start a single peer and run a test using the testing library.
* GNUNET_TESTING_create_topology, the topology variable must be set to * Starts a peer using the given configuration and then invokes the
* GNUNET_TESTING_TOPOLOGY_NONE. If the topology variable is specified, * given callback. This function ALSO initializes the scheduler loop
* a new instance of that topology will be generated and attempted to be * and should thus be called directly from "main". The testcase
* connected. This could result in some connections being impossible, * should self-terminate by invoking 'GNUNET_SCHEDULER_shutdown'.
* because some topologies are non-deterministic. *
* * @param testdir only the directory name without any path. This is used fo
* @param pg the peer group struct representing the running peers r
* @param topology which topology to connect the peers in * all service homes; the directory will be created in a temporary
* @param options options for connecting the topology * location depending on the underlying OS
* @param option_modifier modifier for options that take a parameter * @param cfgfilename name of the configuration file to use;
* @param connect_timeout how long to wait before giving up on connecting * use NULL to only run with defaults
* two peers * @param tm main function of the testcase
* @param connect_attempts how many times to attempt to connect two peers * @param tm_cls closure for 'tm'
* over the connect_timeout duration * @return 0 on success, 1 on error
* @param notify_callback notification to be called once all connections co
mpleted
* @param notify_cls closure for notification callback
*
* @return the number of connections that will be attempted, GNUNET_SYSERR
on error
*/ */
int int
GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg, GNUNET_TESTING_peer_run (const char *testdir,
enum GNUNET_TESTING_Topology topology, const char *cfgfilename,
enum GNUNET_TESTING_TopologyOption options GNUNET_TESTING_TestMain tm,
, void *tm_cls);
double option_modifier,
struct GNUNET_TIME_Relative connect_timeou /**
t, * Start a single service (no ARM, except of course if the given
unsigned int connect_attempts, * service name is 'arm') and run a test using the testing library.
GNUNET_TESTING_NotifyCompletion * Starts a service using the given configuration and then invokes the
notify_callback, void *notify_cls); * given callback. This function ALSO initializes the scheduler loop
* and should thus be called directly from "main". The testcase
/** * should self-terminate by invoking 'GNUNET_SCHEDULER_shutdown'.
* Start or stop an individual peer from the given group. *
* * This function is useful if the testcase is for a single service
* @param pg handle to the peer group * and if that service doesn't itself depend on other services.
* @param offset which peer to start or stop *
* @param desired_status GNUNET_YES to have it running, GNUNET_NO to stop i * @param testdir only the directory name without any path. This is used fo
t r
* @param timeout how long to wait for shutdown * all service homes; the directory will be created in a temporary
* @param cb function to call at the end * location depending on the underlying OS
* @param cb_cls closure for cb * @param service_name name of the service to run
* @param cfgfilename name of the configuration file to use;
* use NULL to only run with defaults
* @param tm main function of the testcase
* @param tm_cls closure for 'tm'
* @return 0 on success, 1 on error
*/ */
void int
GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, GNUNET_TESTING_service_run (const char *testdir,
unsigned int offset, int desired_status, const char *service_name,
struct GNUNET_TIME_Relative timeout, const char *cfgfilename,
GNUNET_TESTING_NotifyCompletion cb, void *cb_c GNUNET_TESTING_TestMain tm,
ls); void *tm_cls);
/** /**
* Start a peer group with a given number of peers. Notify * Sometimes we use the binary name to determine which specific
* on completion of peer startup and connection based on given * test to run. In those cases, the string after the last "_"
* topological constraints. Optionally notify on each * in 'argv[0]' specifies a string that determines the configuration
* established connection. * file or plugin to use.
* *
* @param cfg configuration template to use * This function returns the respective substring, taking care
* @param total number of daemons to start * of issues such as binaries ending in '.exe' on W32.
* @param timeout total time allowed for peers to start *
* @param connect_cb function to call each time two daemons are connected * @param argv0 the name of the binary
* @param peergroup_cb function to call once all peers are up and connected * @return string between the last '_' and the '.exe' (or the end of the st
* @param peergroup_cls closure for peergroup callbacks ring),
* @param hostnames linked list of host structs to use to start peers on * NULL if argv0 has no '_'
* (NULL to run on localhost only)
*
* @return NULL on error, otherwise handle to control peer group
*/
struct GNUNET_TESTING_PeerGroup *
GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *c
fg,
unsigned int total,
struct GNUNET_TIME_Relative timeout,
GNUNET_TESTING_NotifyConnection connect_cb,
GNUNET_TESTING_NotifyCompletion peergroup_c
b,
void *peergroup_cls,
const struct GNUNET_TESTING_Host *hostnames
);
/**
* Print current topology to a graphviz readable file.
*
* @param pg a currently running peergroup to print to file
* @param output_filename the file to write the topology to
* @param notify_cb callback to call upon completion or failure
* @param notify_cb_cls closure for notify_cb
*
*/ */
void char *
GNUNET_TESTING_peergroup_topology_to_file (struct GNUNET_TESTING_PeerGroup GNUNET_TESTING_get_testname_from_underscore (const char *argv0);
*pg,
const char *output_filename,
GNUNET_TESTING_NotifyCompletion
notify_cb, void *notify_cb_cls);
#if 0 /* keep Emacsens' auto-indent happy */ #if 0 /* keep Emacsens' auto-indent happy */
{ {
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 57 change blocks. 
1147 lines changed or deleted 257 lines changed or added


 gnunet_transport_service.h   gnunet_transport_service.h 
skipping to change at line 98 skipping to change at line 98
* peer disconnected from us. * peer disconnected from us.
* *
* @param cls closure * @param cls closure
* @param peer the peer that disconnected * @param peer the peer that disconnected
*/ */
typedef void (*GNUNET_TRANSPORT_NotifyDisconnect) (void *cls, typedef void (*GNUNET_TRANSPORT_NotifyDisconnect) (void *cls,
const struct const struct
GNUNET_PeerIdentity * pe er); GNUNET_PeerIdentity * pe er);
/** /**
* Function to call with result of the try connect request.
*
*
* @param cls closure
* @param result GNUNET_OK if message was transmitted to transport service
* GNUNET_SYSERR if message was not transmitted to transport
service
*/
typedef void (*GNUNET_TRANSPORT_TryConnectCallback) (void *cls,
const int result);
/**
* Function to call with a textual representation of an address. * Function to call with a textual representation of an address.
* This function will be called several times with different possible * This function will be called several times with different possible
* textual representations, and a last time with NULL to signal the end * textual representations, and a last time with NULL to signal the end
* of the iteration. * of the iteration.
* *
* @param cls closure * @param cls closure
* @param address NULL on error or end of iteration, * @param address NULL on error or end of iteration,
* otherwise 0-terminated printable UTF-8 string * otherwise 0-terminated printable UTF-8 string
*/ */
typedef void (*GNUNET_TRANSPORT_AddressToStringCallback) (void *cls, typedef void (*GNUNET_TRANSPORT_AddressToStringCallback) (void *cls,
skipping to change at line 154 skipping to change at line 165
/** /**
* Disconnect from the transport service. * Disconnect from the transport service.
* *
* @param handle handle returned from connect * @param handle handle returned from connect
*/ */
void void
GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle); GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle);
/** /**
* Opaque handle for a transmission-ready request.
*/
struct GNUNET_TRANSPORT_TryConnectHandle;
/**
* Ask the transport service to establish a connection to * Ask the transport service to establish a connection to
* the given peer. * the given peer.
* *
* @param handle connection to transport service * @param handle connection to transport service
* @param target who we should try to connect to * @param target who we should try to connect to
* @return GNUNET_OK if request can be scheduled * @param cb callback to be called when request was transmitted to transpor
* GNUNET_NO please retry later because we are reconnecting t
* GNUNET_SYSERR on failure * service
* @param cb_cls closure for the callback
* @return a GNUNET_TRANSPORT_TryConnectHandle handle or
* NULL on failure (cb will not be called)
*/ */
int struct GNUNET_TRANSPORT_TryConnectHandle *
GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle,
const struct GNUNET_PeerIdentity *target); const struct GNUNET_PeerIdentity *target,
GNUNET_TRANSPORT_TryConnectCallback cb,
void *cb_cls);
/**
* Cancel the request to transport to try a connect
* Callback will not be called
*
* @param tch GNUNET_TRANSPORT_TryConnectHandle handle to cancel
*/
void
GNUNET_TRANSPORT_try_connect_cancel (struct GNUNET_TRANSPORT_TryConnectHand
le *tch);
/** /**
* Opaque handle for a transmission-ready request. * Opaque handle for a transmission-ready request.
*/ */
struct GNUNET_TRANSPORT_TransmitHandle; struct GNUNET_TRANSPORT_TransmitHandle;
/** /**
* Check if we could queue a message of the given size for * Check if we could queue a message of the given size for
* transmission. The transport service will take both its internal * transmission. The transport service will take both its internal
* buffers and bandwidth limits imposed by the other peer into * buffers and bandwidth limits imposed by the other peer into
skipping to change at line 242 skipping to change at line 271
* @return handle to cancel the operation * @return handle to cancel the operation
*/ */
struct GNUNET_TRANSPORT_GetHelloHandle * struct GNUNET_TRANSPORT_GetHelloHandle *
GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle, GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle,
GNUNET_TRANSPORT_HelloUpdateCallback rec, GNUNET_TRANSPORT_HelloUpdateCallback rec,
void *rec_cls); void *rec_cls);
/** /**
* Stop receiving updates about changes to our HELLO message. * Stop receiving updates about changes to our HELLO message.
* *
* @param ghh handle returned from 'GNUNET_TRANSPORT_get_hello') * @param ghh handle to cancel
*/ */
void void
GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_GetHelloHandle * ghh); GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_GetHelloHandle * ghh);
/** /**
* Offer the transport service the HELLO of another peer. Note that * Offer the transport service the HELLO of another peer. Note that
* the transport service may just ignore this message if the HELLO is * the transport service may just ignore this message if the HELLO is
* malformed or useless due to our local configuration. * malformed or useless due to our local configuration.
* *
* @param handle connection to transport service * @param handle connection to transport service
* @param hello the hello message * @param hello the hello message
* @param cont continuation to call when HELLO has been sent * @param cont continuation to call when HELLO has been sent,
* tc reason GNUNET_SCHEDULER_REASON_TIMEOUT for fail
* tc reasong GNUNET_SCHEDULER_REASON_READ_READY for success
* @param cls closure for continuation * @param cls closure for continuation
* @return a GNUNET_TRANSPORT_OfferHelloHandle handle or NULL on failure,
* in case of failure cont will not be called
*
*/ */
void struct GNUNET_TRANSPORT_OfferHelloHandle *
GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle,
const struct GNUNET_MessageHeader *hello, const struct GNUNET_MessageHeader *hello,
GNUNET_SCHEDULER_Task cont, void *cls); GNUNET_SCHEDULER_Task cont, void *cls);
/** /**
* Cancel the request to transport to offer the HELLO message
*
* @param ohh the GNUNET_TRANSPORT_OfferHelloHandle to cancel
*/
void
GNUNET_TRANSPORT_offer_hello_cancel (struct GNUNET_TRANSPORT_OfferHelloHand
le *ohh);
/**
* Handle to cancel a pending address lookup. * Handle to cancel a pending address lookup.
*/ */
struct GNUNET_TRANSPORT_AddressToStringContext; struct GNUNET_TRANSPORT_AddressToStringContext;
/** /**
* Convert a binary address into a human readable address. * Convert a binary address into a human readable address.
* *
* @param cfg configuration to use * @param cfg configuration to use
* @param address address to convert (binary format) * @param address address to convert (binary format)
* @param numeric should (IP) addresses be displayed in numeric form * @param numeric should (IP) addresses be displayed in numeric form
 End of changes. 10 change blocks. 
8 lines changed or deleted 54 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/