#define MTYPE 12345
+GNUNET_NETWORK_STRUCT_BEGIN
+
struct GNUNET_TestMessage
{
/**
*/
uint32_t uid;
};
+GNUNET_NETWORK_STRUCT_END
struct PeerContext
{
#endif
if (dotOutFile != NULL)
{
- fprintf (dotOutFile, "}");
- fclose (dotOutFile);
+ FPRINTF (dotOutFile, "%s", "}");
+ FCLOSE (dotOutFile);
}
ok = 0;
if (dotOutFile != NULL)
{
- fprintf (dotOutFile, "}");
- fclose (dotOutFile);
+ FPRINTF (dotOutFile, "%s", "}");
+ FCLOSE (dotOutFile);
}
}
* @return connected transport distance
*/
static uint32_t
-get_atsi_distance (const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count)
+get_atsi_distance (const struct GNUNET_ATS_Information *atsi,
+ unsigned int atsi_count)
{
unsigned int i;
for (i = 0; i < atsi_count; i++)
- {
- if (ntohl (atsi->type) == GNUNET_ATS_QUALITY_NET_DISTANCE)
- return ntohl (atsi->value);
- }
+ {
+ if (ntohl (atsi->type) == GNUNET_ATS_QUALITY_NET_DISTANCE)
+ return ntohl (atsi->value);
+ }
GNUNET_break (0);
/* FIXME: we do not have distance data? Assume direct neighbor. */
static int
-process_mtype (void *cls,
- const struct GNUNET_PeerIdentity *peer,
+process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message,
const struct GNUNET_ATS_Information *atsi,
unsigned int atsi_count)
{
GNUNET_SCHEDULER_cancel (die_task);
#if VERBOSE
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Scheduling timeout from DV connections.\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Scheduling timeout from DV connections.\n");
#endif
die_task =
GNUNET_SCHEDULER_add_delayed (TEST_TIMEOUT, &end_badly,
if (dotOutFile != NULL)
{
if (distance == 1)
- fprintf (dotOutFile, "\tn%s -- n%s;\n", d->shortname, second_shortname);
+ FPRINTF (dotOutFile, "\tn%s -- n%s;\n", d->shortname, second_shortname);
else if (distance == 2)
- fprintf (dotOutFile, "\tn%s -- n%s [color=blue];\n", d->shortname,
+ FPRINTF (dotOutFile, "\tn%s -- n%s [color=blue];\n", d->shortname,
second_shortname);
else if (distance == 3)
- fprintf (dotOutFile, "\tn%s -- n%s [color=red];\n", d->shortname,
+ FPRINTF (dotOutFile, "\tn%s -- n%s [color=red];\n", d->shortname,
second_shortname);
else if (distance == 4)
- fprintf (dotOutFile, "\tn%s -- n%s [color=green];\n", d->shortname,
+ FPRINTF (dotOutFile, "\tn%s -- n%s [color=green];\n", d->shortname,
second_shortname);
else
- fprintf (dotOutFile, "\tn%s -- n%s [color=brown];\n", d->shortname,
+ FPRINTF (dotOutFile, "\tn%s -- n%s [color=brown];\n", d->shortname,
second_shortname);
}
GNUNET_free (second_shortname);
dotOutFile = fopen (dotOutFileName, "w");
if (dotOutFile != NULL)
{
- fprintf (dotOutFile, "strict graph G {\n");
+ FPRINTF (dotOutFile, "%s", "strict graph G {\n");
}
#if VERBOSE
"connect_topology_option_modifier",
&connect_topology_option_modifier_string))
{
- if (sscanf
+ if (SSCANF
(connect_topology_option_modifier_string, "%lf",
&connect_topology_option_modifier) != 1)
{