38 #define LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__)
62 unsigned int con_num = 0;
88 pos_connection = pos_connection->
next)
103 "0 validating peer number %s %s %s\n",
109 "validating memcmp\n");
112 "validating broadcast\n");
118 else if (NULL == natted_p)
122 else if (NULL != natted_p)
129 prefix = strtok (addr,
"_");
130 rest = strtok (NULL,
"_");
131 rest2 = strtok (rest,
"-");
142 "validating peer number %u with identity %s and address %s %u %s\n",
176 unsigned int con_num;
185 NULL != pos_connection;
186 pos_connection = pos_connection->
next)
201 "con_num: %u add: %u num_notified: %u add_notified: %u peer: %s\n",
253 const char *start_peer_label,
254 const char *create_label,
261 unsigned int node_additional_connects;
267 "global: %u and local: %u additional_connects\n",
269 node_additional_connects);
271 if (0 != node_additional_connects)
enum GNUNET_TESTBED_TopologyOption topology
The topology to generate.
static int ret
Return value of the commandline.
struct GNUNET_TESTING_Interpreter * is
static int prefix
If printing the value of PREFIX has been requested.
static char * address
GNS address for this phone.
static struct GNUNET_NAT_AUTO_AutoHandle * ah
Handle to ongoing autoconfiguration.
static struct GNUNET_NAT_AUTO_Test * nt
Handle to a NAT test operation.
Helper library for handling HELLOs.
unsigned int GNUNET_TESTING_get_additional_connects(unsigned int num, struct GNUNET_TESTING_NetjailTopology *topology)
Get the number of unintentional additional connections the node waits for.
struct GNUNET_TESTING_NodeConnection * GNUNET_TESTING_get_connections(unsigned int num, const struct GNUNET_TESTING_NetjailTopology *topology)
Get the connections to other nodes for a specific node.
unsigned int GNUNET_TESTING_calculate_num(struct GNUNET_TESTING_NodeConnection *node_connection, struct GNUNET_TESTING_NetjailTopology *topology)
Calculate the unique id identifying a node from a given connection.
char * GNUNET_TESTING_get_address(struct GNUNET_TESTING_NodeConnection *connection, const char *prefix)
Get the address for a specific communicator from a connection.
enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_test_system(const struct GNUNET_TESTING_Command *cmd, const struct GNUNET_TESTING_System **ret)
struct GNUNET_PeerIdentity * GNUNET_TESTING_get_peer(unsigned int num, const struct GNUNET_TESTING_System *tl_system)
Retrieve peer identity from the test system with the unique node id.
void GNUNET_TESTING_async_finish(struct GNUNET_TESTING_AsyncContext *ac)
The asynchronous command of ac has finished.
struct GNUNET_TESTING_Command GNUNET_TESTING_command_new(void *cls, const char *label, GNUNET_TESTING_CommandRunRoutine run, GNUNET_TESTING_CommandCleanupRoutine cleanup, GNUNET_TESTING_CommandGetTraits traits, struct GNUNET_TESTING_AsyncContext *ac)
Create a new command.
const struct GNUNET_TESTING_Command * GNUNET_TESTING_interpreter_lookup_command_all(struct GNUNET_TESTING_Interpreter *is, const char *label)
Lookup command by label.
struct GNUNET_TESTING_Trait GNUNET_TESTING_trait_end(void)
"end" trait.
const struct GNUNET_TESTING_Command * GNUNET_TESTING_interpreter_lookup_command(struct GNUNET_TESTING_Interpreter *is, const char *label)
Lookup command by label.
enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait(const struct GNUNET_TESTING_Trait *traits, const void **ret, const char *trait, unsigned int index)
Extract a trait.
Bandwidth allocation API for applications to interact with.
void GNUNET_TRANSPORT_application_validate(struct GNUNET_TRANSPORT_ApplicationHandle *ch, const struct GNUNET_PeerIdentity *peer, enum GNUNET_NetworkType nt, const char *addr)
An application (or a communicator) has received a HELLO (or other address data of another peer) and w...
#define GNUNET_log(kind,...)
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
GNUNET_GenericReturnValue
Named constants for return values.
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
@ GNUNET_ERROR_TYPE_DEBUG
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
GNUNET_NetworkType
Types of networks (with separate quotas) we support.
The identity of the host (wraps the signing key of the peer).
Protocol address prefix für a connection between nodes.
struct GNUNET_TESTING_AddressPrefix * next
Pointer to the next prefix in the DLL.
char * address_prefix
The address prefix.
A command to be run by the interpreter.
char label[127+1]
Label for the command.
void * cls
Closure for all commands with command-specific context information.
Global state of the interpreter, used by a command to access information about other commands.
Toplogy of our netjail setup.
unsigned int additional_connects
Additional connects we do expect, beside the connects which are configured in the topology.
Connection to another node.
struct GNUNET_TESTING_NodeConnection * next
Pointer to the next connection in the DLL.
struct GNUNET_TESTING_AddressPrefix * address_prefixes_head
Head of the DLL with the address prefixes for the protocolls this node is reachable.
Handle for a system on which GNUnet peers are executed; a system is used for reserving unique paths a...
A struct GNUNET_TESTING_Trait can be used to exchange data between cmds.
unsigned int index
Index number associated with the trait.
Handle to the TRANSPORT subsystem for application management.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_get_trait_application_handle(const struct GNUNET_TESTING_Command *cmd, const struct GNUNET_TRANSPORT_ApplicationHandle **ret)
struct GNUNET_TESTING_Trait GNUNET_TRANSPORT_make_trait_connect_peer_state(const struct ConnectPeersState *value)
enum GNUNET_GenericReturnValue GNUNET_TRANSPORT_get_trait_broadcast(const struct GNUNET_TESTING_Command *cmd, const enum GNUNET_GenericReturnValue **ret)
static void connect_peers_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
The run method of this cmd will connect to peers.
static void * notify_connect(struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_PeerIdentity *peer)
Callback from start peer cmd for signaling a peer got connected.
#define LOG(kind,...)
Generic logging shortcut.
static void connect_peers_cleanup(void *cls)
The cleanup function of this cmd frees resources the cmd allocated.
enum GNUNET_GenericReturnValue connect_peers_traits(void *cls, const void **ret, const char *trait, unsigned int index)
This function prepares an array with traits.
struct GNUNET_TESTING_Command GNUNET_TRANSPORT_cmd_connect_peers(const char *label, const char *start_peer_label, const char *create_label, uint32_t num, struct GNUNET_TESTING_NetjailTopology *topology, unsigned int additional_connects)
Create command.