120 _ (
" routed: %s over %s (%u queue(s))\n"),
125 _ (
" established: %s\n"),
128 _ (
" CORE receive window: %d\n"),
131 _ (
" stalled for CORE: %u message(s)\n"),
134 _ (
" pending transmission: %u message(s)\n"),
138 fprintf (stdout,
_ (
" inbound window used: %s of %s\n"), s1, s2);
143 fprintf (stdout,
_ (
" outbound window used: %s of %s\n"), s1, s2);
148 fprintf (stdout,
_ (
" buffer used: %s of %s\n"), s1, s2);
152 _ (
" estimated loss: %lld byte(s)\n"),
155 _ (
" flow control RTT: %s (peer reports %s)\n"),
161 _ (
" last flow control: %s ago (%u retransmission(s))\n"),
166 fprintf (stdout,
"\n");
191 fprintf (stdout,
"%s\n",
_ (
"No virtual links."));
203 "%-10s %-14s %-12s %9s %8s %8s %10s\n",
213 "%-10s %-14s %-12s %9d %8u %8u %10s\n",
246 fprintf (stderr,
_ (
"Invalid command line argument `%s'\n"), args[0]);
257 fprintf (stderr,
_ (
"Invalid peer ID `%s'\n"),
peer_id);
272 fprintf (stderr,
"%s",
_ (
"Failed to connect to transport service!\n"));
287main (
int argc,
char *
const *argv)
294 gettext_noop (
"also show links that are not established yet"),
305 gettext_noop (
"show the full flow control state of every link"),
315 "Print information about the virtual links of "
316 "the transport service."),
struct GNUNET_GETOPT_CommandLineOption options[]
int main()
Program to simulate results from GCP_get_desirability_of_path() for various plausible inputs.
#define gettext_noop(String)
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
struct GNUNET_SCHEDULER_Task * shutdown_task
static char * res
Currently read line or NULL on EOF.
static unsigned int num_links
Number of links reported so far.
static int verbose
Option -V: show the full flow control state of every link.
static void link_cb(void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_TRANSPORT_LinkInformation *li)
Function called once per virtual link, and a final time with both arguments NULL.
static char * peer_id
Option -p: restrict the listing to this peer.
static void print_link_verbose(const struct GNUNET_PeerIdentity *peer, const struct GNUNET_TRANSPORT_LinkInformation *li)
Print everything we know about li, one field per line.
static int ret
Return code.
static struct GNUNET_TRANSPORT_LinkListContext * llc
Handle to the running listing, NULL once it completed.
static int include_unconfirmed
Option -a: also show links that are not established yet.
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
Main function that will be run by the scheduler.
static const char * route_to_string(const struct GNUNET_TRANSPORT_LinkInformation *li, char *buf, size_t buf_size)
Render how a link is routed into buf.
Monitoring / diagnostics API for the transport service.
void GNUNET_TRANSPORT_links_list_cancel(struct GNUNET_TRANSPORT_LinkListContext *llc)
Cancel a request to list virtual links.
struct GNUNET_TRANSPORT_LinkListContext * GNUNET_TRANSPORT_links_list(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_PeerIdentity *peer, int include_unconfirmed, GNUNET_TRANSPORT_LinkCallback cb, void *cb_cls)
Ask the transport service for the virtual links it currently has.
@ GNUNET_TRANSPORT_LINK_ROUTE_DIRECT
Over one or more queues to a directly connected neighbour.
#define GNUNET_GETOPT_OPTION_END
Marker for the end of the list of options.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_flag(char shortName, const char *name, const char *description, int *val)
Allow user to specify a flag (which internally means setting an integer to 1/GNUNET_YES/GNUNET_OK.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_string(char shortName, const char *name, const char *argumentHelp, const char *description, char **str)
Allow user to specify a string.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_public_key_from_string(const char *enc, size_t enclen, struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Convert a string representing a public key to a public key.
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
const char * GNUNET_i2s_full(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
int GNUNET_snprintf(char *buf, size_t size, const char *format,...) __attribute__((format(printf
Like snprintf, just aborts if the buffer is of insufficient size.
#define GNUNET_free(ptr)
Wrapper around free.
const struct GNUNET_OS_ProjectData * GNUNET_OS_project_data_gnunet(void)
Return default project data used by 'libgnunetutil' for GNUnet.
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run(const struct GNUNET_OS_ProjectData *pd, int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls)
Run a standard GNUnet command startup sequence (initialize loggers and configuration,...
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received,...
char * GNUNET_STRINGS_byte_size_fancy(unsigned long long size)
Convert a given filesize into a fancy human-readable format.
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence)
Get the duration of an operation as the difference of the current time and the given start time "henc...
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
Definition of a command line option.
The identity of the host (wraps the signing key of the peer).
struct GNUNET_CRYPTO_EddsaPublicKey public_key
Opaque handle for a GNUNET_TRANSPORT_links_list() operation.