GNUnet  0.20.0
gnunet-cadet.c File Reference

Print information about cadet tunnels and peers. More...

#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_cadet_service.h"
#include "cadet.h"
Include dependency graph for gnunet-cadet.c:

Go to the source code of this file.

Macros

#define STREAM_BUFFER_SIZE   1024
 

Functions

static void listen_stdio (void)
 Wait for input on STDIO and send it out over the ch. More...
 
static const char * enc_2s (uint16_t status)
 Convert encryption status to human readable string. More...
 
static const char * conn_2s (uint16_t status)
 Convert connection status to human readable string. More...
 
static void shutdown_task (void *cls)
 Task to shut down this application. More...
 
void mq_cb (void *cls)
 
static void read_stdio (void *cls)
 Task run in stdio mode, after some data is available at stdin. More...
 
static void channel_ended (void *cls, const struct GNUNET_CADET_Channel *channel)
 Function called whenever a channel is destroyed. More...
 
static void * channel_incoming (void *cls, struct GNUNET_CADET_Channel *channel, const struct GNUNET_PeerIdentity *initiator)
 Method called whenever another peer has added us to a channel the other peer initiated. More...
 
static void send_echo (void *cls)
 Send an echo request to the remote peer. More...
 
static int check_data (void *cls, const struct GNUNET_MessageHeader *message)
 Check data message sanity. More...
 
static void handle_data (void *cls, const struct GNUNET_MessageHeader *message)
 Function called whenever a message is received. More...
 
static void peers_callback (void *cls, const struct GNUNET_CADET_PeerListEntry *ple)
 Method called to retrieve information about all peers in CADET, called once per peer. More...
 
static void path_callback (void *cls, const struct GNUNET_CADET_PeerPathDetail *ppd)
 Method called to retrieve information about paths to a specific peer known to the service. More...
 
static void tunnels_callback (void *cls, const struct GNUNET_CADET_TunnelDetails *td)
 Method called to retrieve information about all tunnels in CADET. More...
 
static void get_peers (void *cls)
 Call CADET's meta API, get all peers known to a peer. More...
 
static void show_peer (void *cls)
 Call CADET's monitor API, get info of one peer. More...
 
static void get_tunnels (void *cls)
 Call CADET's meta API, get all tunnels known to a peer. More...
 
static void show_channel (void *cls)
 Call CADET's monitor API, get info of one channel. More...
 
static void show_connection (void *cls)
 Call CADET's monitor API, get info of one connection. More...
 
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. More...
 
int main (int argc, char *const *argv)
 The main function to obtain peer information. More...
 

Variables

static int request_peers
 Option -P. More...
 
static char * peer_id
 Option –peer. More...
 
static int request_tunnels
 Option -T. More...
 
static char * conn_id
 Option –connection. More...
 
static char * channel_id
 Option –channel. More...
 
static char * listen_port
 Port to listen on (-o). More...
 
static int echo
 Request echo service. More...
 
static struct GNUNET_TIME_Absolute echo_time
 Time of last echo request. More...
 
static struct GNUNET_SCHEDULER_Taskecho_task
 Task for next echo request. More...
 
static char * target_id
 Peer to connect to. More...
 
static char * target_port = "default"
 Port to connect to. More...
 
static struct GNUNET_CADET_Handlemh
 Cadet handle. More...
 
static const struct GNUNET_CONFIGURATION_Handlemy_cfg
 Our configuration. More...
 
static struct GNUNET_CADET_GetPathgpo
 Active get path operation. More...
 
static struct GNUNET_CADET_PeersListerplo
 Active peer listing operation. More...
 
static struct GNUNET_CADET_ListTunnelstio
 Active tunnel listing operation. More...
 
static struct GNUNET_CADET_Channelch
 Channel handle. More...
 
static struct GNUNET_HashCode porthash
 HashCode of the given port string. More...
 
struct GNUNET_CADET_Portlp
 Data structure for ongoing reception of incoming virtual circuits. More...
 
static struct GNUNET_SCHEDULER_Taskrd_task
 Task for reading from stdin. More...
 
static struct GNUNET_SCHEDULER_Taskjob
 Task for main job. More...
 
static unsigned int sent_pkt
 

Detailed Description

Print information about cadet tunnels and peers.

Author
Bartlomiej Polot
Christian Grothoff

Definition in file gnunet-cadet.c.

Macro Definition Documentation

◆ STREAM_BUFFER_SIZE

#define STREAM_BUFFER_SIZE   1024

Definition at line 32 of file gnunet-cadet.c.

Function Documentation

◆ listen_stdio()

static void listen_stdio ( void  )
static

Wait for input on STDIO and send it out over the ch.

Definition at line 332 of file gnunet-cadet.c.

333 {
334  struct GNUNET_NETWORK_FDSet *rs;
335 
336  /* FIXME: why use 'rs' here, seems overly complicated... */
338  GNUNET_NETWORK_fdset_set_native (rs, 0); /* STDIN */
341  rs,
342  NULL,
343  &read_stdio,
344  NULL);
346 }
static struct GNUNET_SCHEDULER_Task * rd_task
Task for reading from stdin.
Definition: gnunet-cadet.c:132
static void read_stdio(void *cls)
Task run in stdio mode, after some data is available at stdin.
Definition: gnunet-cadet.c:282
@ GNUNET_SCHEDULER_PRIORITY_DEFAULT
Run with the default priority (normal P2P operations).
struct GNUNET_NETWORK_FDSet * GNUNET_NETWORK_fdset_create(void)
Creates an fd set.
Definition: network.c:1171
void GNUNET_NETWORK_fdset_destroy(struct GNUNET_NETWORK_FDSet *fds)
Releases the associated memory of an fd set.
Definition: network.c:1187
void GNUNET_NETWORK_fdset_set_native(struct GNUNET_NETWORK_FDSet *to, int nfd)
Set a native fd in a set.
Definition: network.c:1058
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_select(enum GNUNET_SCHEDULER_Priority prio, struct GNUNET_TIME_Relative delay, const struct GNUNET_NETWORK_FDSet *rs, const struct GNUNET_NETWORK_FDSet *ws, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay or when any of the specified file descriptor set...
Definition: scheduler.c:1830
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".
collection of IO descriptors

References GNUNET_NETWORK_fdset_create(), GNUNET_NETWORK_fdset_destroy(), GNUNET_NETWORK_fdset_set_native(), GNUNET_SCHEDULER_add_select(), GNUNET_SCHEDULER_PRIORITY_DEFAULT, GNUNET_TIME_UNIT_FOREVER_REL, rd_task, and read_stdio().

Referenced by channel_incoming(), mq_cb(), read_stdio(), and run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enc_2s()

static const char* enc_2s ( uint16_t  status)
static

Convert encryption status to human readable string.

Parameters
statusEncryption status.
Returns
Human readable string.

Definition at line 157 of file gnunet-cadet.c.

158 {
159  switch (status)
160  {
161  case 0:
162  return "NULL ";
163 
164  case 1:
165  return "KSENT";
166 
167  case 2:
168  return "KRECV";
169 
170  case 3:
171  return "READY";
172 
173  default:
174  return "";
175  }
176 }
uint16_t status
See PRISM_STATUS_*-constants.

References status.

Referenced by tunnels_callback().

Here is the caller graph for this function:

◆ conn_2s()

static const char* conn_2s ( uint16_t  status)
static

Convert connection status to human readable string.

Parameters
statusConnection status.
Returns
Human readable string.

Definition at line 187 of file gnunet-cadet.c.

188 {
189  switch (status)
190  {
191  case 0:
192  return "NEW ";
193 
194  case 1:
195  return "SRCH ";
196 
197  case 2:
198  return "WAIT ";
199 
200  case 3:
201  return "READY";
202 
203  case 4:
204  return "SHUTD";
205 
206  default:
207  return "";
208  }
209 }

References status.

Referenced by tunnels_callback().

Here is the caller graph for this function:

◆ shutdown_task()

static void shutdown_task ( void *  cls)
static

Task to shut down this application.

Parameters
clsClosure (unused).

Definition at line 218 of file gnunet-cadet.c.

219 {
220  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown\n");
221  if (NULL != lp)
222  {
224  lp = NULL;
225  }
226  if (NULL != ch)
227  {
229  ch = NULL;
230  }
231  if (NULL != gpo)
232  {
234  gpo = NULL;
235  }
236  if (NULL != plo)
237  {
239  plo = NULL;
240  }
241  if (NULL != tio)
242  {
244  tio = NULL;
245  }
246  if (NULL != mh)
247  {
249  mh = NULL;
250  }
251  if (NULL != rd_task)
252  {
254  rd_task = NULL;
255  }
256  if (NULL != echo_task)
257  {
259  echo_task = NULL;
260  }
261  if (NULL != job)
262  {
264  job = NULL;
265  }
266 }
static struct GNUNET_SCHEDULER_Task * echo_task
Task for next echo request.
Definition: gnunet-cadet.c:77
static struct GNUNET_SCHEDULER_Task * job
Task for main job.
Definition: gnunet-cadet.c:137
struct GNUNET_CADET_Port * lp
Data structure for ongoing reception of incoming virtual circuits.
Definition: gnunet-cadet.c:127
static struct GNUNET_CADET_ListTunnels * tio
Active tunnel listing operation.
Definition: gnunet-cadet.c:112
static struct GNUNET_CADET_GetPath * gpo
Active get path operation.
Definition: gnunet-cadet.c:102
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
static struct GNUNET_CADET_Handle * mh
Cadet handle.
Definition: gnunet-cadet.c:92
static struct GNUNET_CADET_PeersLister * plo
Active peer listing operation.
Definition: gnunet-cadet.c:107
void GNUNET_CADET_channel_destroy(struct GNUNET_CADET_Channel *channel)
Destroy an existing channel.
Definition: cadet_api.c:830
void * GNUNET_CADET_list_tunnels_cancel(struct GNUNET_CADET_ListTunnels *lt)
Cancel a monitor request.
void GNUNET_CADET_disconnect(struct GNUNET_CADET_Handle *handle)
Disconnect from the cadet service.
Definition: cadet_api.c:774
void GNUNET_CADET_close_port(struct GNUNET_CADET_Port *p)
Close a port opened with GNUNET_CADET_open_port.
Definition: cadet_api.c:801
void * GNUNET_CADET_get_path_cancel(struct GNUNET_CADET_GetPath *gp)
Cancel gp operation.
void * GNUNET_CADET_list_peers_cancel(struct GNUNET_CADET_PeersLister *pl)
Cancel a peer info request.
#define GNUNET_log(kind,...)
@ GNUNET_ERROR_TYPE_DEBUG
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:975

References ch, echo_task, GNUNET_CADET_channel_destroy(), GNUNET_CADET_close_port(), GNUNET_CADET_disconnect(), GNUNET_CADET_get_path_cancel(), GNUNET_CADET_list_peers_cancel(), GNUNET_CADET_list_tunnels_cancel(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_SCHEDULER_cancel(), gpo, job, lp, mh, plo, rd_task, and tio.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mq_cb()

void mq_cb ( void *  cls)

Definition at line 270 of file gnunet-cadet.c.

271 {
272  listen_stdio ();
273 }
static void listen_stdio(void)
Wait for input on STDIO and send it out over the ch.
Definition: gnunet-cadet.c:332

References listen_stdio().

Referenced by read_stdio().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_stdio()

static void read_stdio ( void *  cls)
static

Task run in stdio mode, after some data is available at stdin.

Parameters
clsClosure (unused).

Definition at line 282 of file gnunet-cadet.c.

283 {
284  struct GNUNET_MQ_Envelope *env;
285  struct GNUNET_MessageHeader *msg;
286  char buf[60000];
287  ssize_t data_size;
288 
289  rd_task = NULL;
290  data_size = read (0, buf, 60000);
291  if (data_size < 1)
292  {
294  "read() returned %s\n",
295  strerror (errno));
297  return;
298  }
300  "Read %u bytes from stdio\n",
301  (unsigned int) data_size);
303  GNUNET_memcpy (&msg[1], buf, data_size);
305 
306  sent_pkt++;
307 
308  if (GNUNET_NO == echo)
309  {
310  // Use MQ's notification if too much data of stdin is pooring in too fast.
312  {
314  sent_pkt = 0;
315  }
316  else
317  {
318  listen_stdio ();
319  }
320  }
321  else
322  {
324  }
325 }
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
static size_t data_size
Number of bytes in data.
Definition: gnunet-abd.c:187
#define STREAM_BUFFER_SIZE
Definition: gnunet-cadet.c:32
static struct GNUNET_TIME_Absolute echo_time
Time of last echo request.
Definition: gnunet-cadet.c:72
static int echo
Request echo service.
Definition: gnunet-cadet.c:67
void mq_cb(void *cls)
Definition: gnunet-cadet.c:270
static unsigned int sent_pkt
Definition: gnunet-cadet.c:139
static char buf[2048]
struct GNUNET_MQ_Handle * GNUNET_CADET_get_mq(const struct GNUNET_CADET_Channel *channel)
Obtain the message queue for a connected peer.
Definition: cadet_api.c:1066
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
@ GNUNET_NO
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:304
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
Definition: gnunet_mq_lib.h:63
void GNUNET_MQ_notify_sent(struct GNUNET_MQ_Envelope *ev, GNUNET_SCHEDULER_TaskCallback cb, void *cb_cls)
Call a callback once the envelope has been sent, that is, sending it can not be canceled anymore.
Definition: mq.c:638
#define GNUNET_MESSAGE_TYPE_CADET_CLI
Traffic (net-cat style) used by the Command Line Interface.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:562
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
Definition: time.c:111
Header for all communications.

References buf, ch, data_size, echo, echo_time, env, GNUNET_CADET_get_mq(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_CADET_CLI, GNUNET_MQ_msg_extra, GNUNET_MQ_notify_sent(), GNUNET_MQ_send(), GNUNET_NO, GNUNET_SCHEDULER_shutdown(), GNUNET_TIME_absolute_get(), listen_stdio(), mq_cb(), msg, rd_task, sent_pkt, and STREAM_BUFFER_SIZE.

Referenced by listen_stdio().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ channel_ended()

static void channel_ended ( void *  cls,
const struct GNUNET_CADET_Channel channel 
)
static

Function called whenever a channel is destroyed.

Should clean up any associated state.

It must NOT call GNUNET_CADET_channel_destroy on the channel.

Parameters
clsclosure
channelconnection to the other end (henceforth invalid)

Definition at line 359 of file gnunet-cadet.c.

360 {
361  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Channel ended!\n");
362  GNUNET_assert (channel == ch);
363  ch = NULL;
365 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.

References ch, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, and GNUNET_SCHEDULER_shutdown().

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ channel_incoming()

static void* channel_incoming ( void *  cls,
struct GNUNET_CADET_Channel channel,
const struct GNUNET_PeerIdentity initiator 
)
static

Method called whenever another peer has added us to a channel the other peer initiated.

Only called (once) upon reception of data with a message type which was subscribed to in GNUNET_CADET_connect.

A call to GNUNET_CADET_channel_destroy causes the channel to be ignored. In this case the handler MUST return NULL.

Parameters
clsclosure
channelnew handle to the channel
initiatorpeer that started the channel
Returns
initial channel context for the channel, we use channel

Definition at line 383 of file gnunet-cadet.c.

386 {
388  "Incoming connection from %s\n",
389  GNUNET_i2s_full (initiator));
390  GNUNET_assert (NULL == ch);
391  GNUNET_assert (NULL != lp);
393  lp = NULL;
394  ch = channel;
395  if (GNUNET_NO == echo)
396  listen_stdio ();
397  return channel;
398 }
const char * GNUNET_i2s_full(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
@ GNUNET_ERROR_TYPE_MESSAGE

References ch, echo, GNUNET_assert, GNUNET_CADET_close_port(), GNUNET_ERROR_TYPE_MESSAGE, GNUNET_i2s_full(), GNUNET_log, GNUNET_NO, listen_stdio(), and lp.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_echo()

static void send_echo ( void *  cls)
static

Send an echo request to the remote peer.

Parameters
clsClosure (NULL).

Definition at line 407 of file gnunet-cadet.c.

408 {
409  struct GNUNET_MQ_Envelope *env;
410  struct GNUNET_MessageHeader *msg;
411 
412  echo_task = NULL;
413  if (NULL == ch)
414  return;
417 }
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:78

References ch, echo_task, env, GNUNET_CADET_get_mq(), GNUNET_MESSAGE_TYPE_CADET_CLI, GNUNET_MQ_msg, GNUNET_MQ_send(), and msg.

Referenced by handle_data(), and run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_data()

static int check_data ( void *  cls,
const struct GNUNET_MessageHeader message 
)
static

Check data message sanity.

Does nothing so far (all messages are OK).

Parameters
clsClosure (unused).
messageThe message to check.
Returns
GNUNET_OK to keep the channel open, GNUNET_SYSERR to close it (signal serious error).

Definition at line 429 of file gnunet-cadet.c.

430 {
431  return GNUNET_OK; /* all is well-formed */
432 }
@ GNUNET_OK

References GNUNET_OK.

◆ handle_data()

static void handle_data ( void *  cls,
const struct GNUNET_MessageHeader message 
)
static

Function called whenever a message is received.

Each time the function must call GNUNET_CADET_receive_done on the channel in order to receive the next message. This doesn't need to be immediate: can be delayed if some processing is done on the message.

Parameters
clsNULL
messageThe actual message.

Definition at line 446 of file gnunet-cadet.c.

447 {
448  size_t payload_size = ntohs (message->size) - sizeof(*message);
449  uint16_t len;
450  ssize_t done;
451  uint16_t off;
452  const char *buf;
453 
455  if (GNUNET_YES == echo)
456  {
457  if (NULL != listen_port)
458  {
459  struct GNUNET_MQ_Envelope *env;
460  struct GNUNET_MessageHeader *msg;
461 
462  env =
464  GNUNET_memcpy (&msg[1], &message[1], payload_size);
466  return;
467  }
468  else
469  {
470  struct GNUNET_TIME_Relative latency;
471 
475  "time: %s\n",
478  &send_echo,
479  NULL);
480  }
481  }
482 
483  len = ntohs (message->size) - sizeof(*message);
484  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got %u bytes\n", len);
485  buf = (const char *) &message[1];
486  off = 0;
487  while (off < len)
488  {
489  done = write (1, &buf[off], len - off);
490  if (done <= 0)
491  {
492  if (-1 == done)
495  return;
496  }
497  off += done;
498  }
499 }
static void done()
static char * listen_port
Port to listen on (-o).
Definition: gnunet-cadet.c:62
static void send_echo(void *cls)
Send an echo request to the remote peer.
Definition: gnunet-cadet.c:407
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...
void GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel)
Send an ack on the channel to confirm the processing of a message.
Definition: cadet_api.c:872
@ GNUNET_YES
#define GNUNET_log_strerror(level, cmd)
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the mess...
@ GNUNET_ERROR_TYPE_WARNING
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
Definition: scheduler.c:1272
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...
Definition: time.c:436
#define GNUNET_TIME_UNIT_SECONDS
One second.
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: strings.c:569
#define GNUNET_TIME_UNIT_FOREVER_ABS
Constant used to specify "forever".
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
Time for relative time used by GNUnet, in microseconds.

References buf, ch, done(), echo, echo_task, echo_time, env, GNUNET_CADET_get_mq(), GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_MESSAGE, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_log_strerror, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_CADET_CLI, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_NO, GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_shutdown(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_TIME_UNIT_SECONDS, GNUNET_YES, len, listen_port, msg, send_echo(), and GNUNET_MessageHeader::size.

Here is the call graph for this function:

◆ peers_callback()

static void peers_callback ( void *  cls,
const struct GNUNET_CADET_PeerListEntry ple 
)
static

Method called to retrieve information about all peers in CADET, called once per peer.

After last peer has been reported, an additional call with NULL is done.

Parameters
clsClosure.
pleinformation about peer, or NULL on "EOF".

Definition at line 512 of file gnunet-cadet.c.

513 {
514  if (NULL == ple)
515  {
516  plo = NULL;
518  return;
519  }
520  fprintf (stdout,
521  "%s tunnel: %c, paths: %u\n",
522  GNUNET_i2s_full (&ple->peer),
523  ple->have_tunnel ? 'Y' : 'N',
524  ple->n_paths);
525 }
unsigned int n_paths
Number of disjoint known paths to peer.
struct GNUNET_PeerIdentity peer
Which peer is the information about?
int have_tunnel
Do we have a tunnel to this peer?

References GNUNET_i2s_full(), GNUNET_SCHEDULER_shutdown(), GNUNET_CADET_PeerListEntry::have_tunnel, GNUNET_CADET_PeerListEntry::n_paths, GNUNET_CADET_PeerListEntry::peer, and plo.

Referenced by get_peers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ path_callback()

static void path_callback ( void *  cls,
const struct GNUNET_CADET_PeerPathDetail ppd 
)
static

Method called to retrieve information about paths to a specific peer known to the service.

Parameters
clsClosure.
ppdpath detail

Definition at line 536 of file gnunet-cadet.c.

537 {
538  if (NULL == ppd)
539  {
540  gpo = NULL;
542  return;
543  }
544  fprintf (stdout, "Path of length %u: ", ppd->path_length);
545  for (unsigned int i = 0; i < ppd->path_length; i++)
546  fprintf (stdout,
547  (i == ppd->target_offset) ? "*%s* " : "%s ",
548  GNUNET_i2s (&ppd->path[i]));
549  fprintf (stdout, "\n");
550 }
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
unsigned int path_length
Number of entries on the path.
const struct GNUNET_PeerIdentity * path
Array of PEER_IDs representing all paths to reach the peer.
unsigned int target_offset
Offset of the target peer on the path.

References GNUNET_i2s(), GNUNET_SCHEDULER_shutdown(), gpo, GNUNET_CADET_PeerPathDetail::path, GNUNET_CADET_PeerPathDetail::path_length, and GNUNET_CADET_PeerPathDetail::target_offset.

Referenced by show_peer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tunnels_callback()

static void tunnels_callback ( void *  cls,
const struct GNUNET_CADET_TunnelDetails td 
)
static

Method called to retrieve information about all tunnels in CADET.

Parameters
clsClosure.
tdtunnel details

Definition at line 560 of file gnunet-cadet.c.

561 {
562  if (NULL == td)
563  {
564  tio = NULL;
566  return;
567  }
568  fprintf (stdout,
569  "%s [ENC: %s, CON: %s] CHs: %u, CONNs: %u\n",
570  GNUNET_i2s_full (&td->peer),
571  enc_2s (td->estate),
572  conn_2s (td->cstate),
573  td->channels,
574  td->connections);
575 }
static const char * conn_2s(uint16_t status)
Convert connection status to human readable string.
Definition: gnunet-cadet.c:187
static const char * enc_2s(uint16_t status)
Convert encryption status to human readable string.
Definition: gnunet-cadet.c:157
uint16_t cstate
What is our connectivity state?
uint32_t channels
How many channels use the tunnel.
uint16_t estate
What is our encryption state?
struct GNUNET_PeerIdentity peer
Target of the tunnel.
uint32_t connections
How many connections support the tunnel.

References GNUNET_CADET_TunnelDetails::channels, conn_2s(), GNUNET_CADET_TunnelDetails::connections, GNUNET_CADET_TunnelDetails::cstate, enc_2s(), GNUNET_CADET_TunnelDetails::estate, GNUNET_i2s_full(), GNUNET_SCHEDULER_shutdown(), GNUNET_CADET_TunnelDetails::peer, and tio.

Referenced by get_tunnels().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_peers()

static void get_peers ( void *  cls)
static

Call CADET's meta API, get all peers known to a peer.

Parameters
clsClosure (unused).

Definition at line 584 of file gnunet-cadet.c.

585 {
586  job = NULL;
588 }
static void peers_callback(void *cls, const struct GNUNET_CADET_PeerListEntry *ple)
Method called to retrieve information about all peers in CADET, called once per peer.
Definition: gnunet-cadet.c:512
static const struct GNUNET_CONFIGURATION_Handle * my_cfg
Our configuration.
Definition: gnunet-cadet.c:97
struct GNUNET_CADET_PeersLister * GNUNET_CADET_list_peers(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CADET_PeersCB callback, void *callback_cls)
Request information about peers known to the running cadet service.

References GNUNET_CADET_list_peers(), job, my_cfg, peers_callback(), and plo.

Referenced by reconnect(), and run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ show_peer()

static void show_peer ( void *  cls)
static

Call CADET's monitor API, get info of one peer.

Parameters
clsClosure (unused).

Definition at line 597 of file gnunet-cadet.c.

598 {
599  struct GNUNET_PeerIdentity pid;
600 
601  job = NULL;
603  strlen (peer_id),
604  &pid.public_key))
605  {
606  fprintf (stderr, _ ("Invalid peer ID `%s'\n"), peer_id);
608  return;
609  }
611 }
static void path_callback(void *cls, const struct GNUNET_CADET_PeerPathDetail *ppd)
Method called to retrieve information about paths to a specific peer known to the service.
Definition: gnunet-cadet.c:536
static char * peer_id
Option –peer.
Definition: gnunet-cadet.c:42
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
struct GNUNET_CADET_GetPath * GNUNET_CADET_get_path(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_PeerIdentity *id, GNUNET_CADET_PathCB callback, void *callback_cls)
Request information about a peer known to the running cadet peer.
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.
Definition: crypto_ecc.c:358
#define _(String)
GNU gettext support macro.
Definition: platform.h:178
The identity of the host (wraps the signing key of the peer).
struct GNUNET_CRYPTO_EddsaPublicKey public_key

References _, GNUNET_CADET_get_path(), GNUNET_CRYPTO_eddsa_public_key_from_string(), GNUNET_OK, GNUNET_SCHEDULER_shutdown(), gpo, job, my_cfg, path_callback(), peer_id, pid, and GNUNET_PeerIdentity::public_key.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_tunnels()

static void get_tunnels ( void *  cls)
static

Call CADET's meta API, get all tunnels known to a peer.

Parameters
clsClosure (unused).

Definition at line 620 of file gnunet-cadet.c.

621 {
622  job = NULL;
624 }
static void tunnels_callback(void *cls, const struct GNUNET_CADET_TunnelDetails *td)
Method called to retrieve information about all tunnels in CADET.
Definition: gnunet-cadet.c:560
struct GNUNET_CADET_ListTunnels * GNUNET_CADET_list_tunnels(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CADET_TunnelsCB callback, void *callback_cls)
Request information about tunnels of the running cadet peer.

References GNUNET_CADET_list_tunnels(), job, my_cfg, tio, and tunnels_callback().

Referenced by reconnect(), and run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ show_channel()

static void show_channel ( void *  cls)
static

Call CADET's monitor API, get info of one channel.

Parameters
clsClosure (unused).

Definition at line 633 of file gnunet-cadet.c.

634 {
635  job = NULL;
636  GNUNET_break (0);
637 }
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.

References GNUNET_break, and job.

Referenced by run().

Here is the caller graph for this function:

◆ show_connection()

static void show_connection ( void *  cls)
static

Call CADET's monitor API, get info of one connection.

Parameters
clsClosure (unused).

Definition at line 646 of file gnunet-cadet.c.

647 {
648  job = NULL;
649  GNUNET_break (0);
650 }

References GNUNET_break, and job.

Referenced by run().

Here is the caller graph for this function:

◆ run()

static void run ( void *  cls,
char *const *  args,
const char *  cfgfile,
const struct GNUNET_CONFIGURATION_Handle cfg 
)
static

Main function that will be run by the scheduler.

Parameters
clsclosure
argsremaining command-line arguments
cfgfilename of the configuration file used (for saving, can be NULL!)
cfgconfiguration

Definition at line 662 of file gnunet-cadet.c.

666 {
670  struct GNUNET_MessageHeader,
671  NULL),
673 
674  /* FIXME add option to monitor apps */
675  my_cfg = cfg;
676  target_id = args[0];
677  if (target_id && args[1])
678  target_port = args[1];
679 
680  if (((0 != (request_peers | request_tunnels)) || (NULL != conn_id) ||
681  (NULL != channel_id) ) &&
682  (target_id != NULL) )
683  {
684  fprintf (stderr,
685  _ ("Extra arguments are not applicable "
686  "in combination with this option.\n"));
687  return;
688  }
689 
690  if (NULL != peer_id)
691  {
692  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Show peer\n");
694  }
695  else if (NULL != channel_id)
696  {
697  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Show channel\n");
699  }
700  else if (NULL != conn_id)
701  {
702  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Show connection\n");
704  }
705  else if (GNUNET_YES == request_peers)
706  {
707  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Show all peers\n");
709  }
710  else if (GNUNET_YES == request_tunnels)
711  {
712  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Show all tunnels\n");
714  }
715 
716  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting to CADET service\n");
719  if (NULL == mh)
720  {
722  return;
723  }
724  if (NULL != listen_port)
725  {
726  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Opening CADET listen port\n");
729  &porthash,
731  NULL,
732  NULL /* window changes */,
733  &channel_ended,
734  handlers);
735  }
736  if (NULL != target_id)
737  {
738  struct GNUNET_PeerIdentity pid;
739 
740  if (GNUNET_OK !=
742  strlen (target_id),
743  &pid.public_key))
744  {
746  _ ("Invalid target `%s'\n"),
747  target_id);
749  return;
750  }
752  "Connecting to `%s:%s'\n",
753  target_id,
754  target_port);
757  NULL,
758  &pid,
759  &porthash,
760  NULL /* window changes */,
761  &channel_ended,
762  handlers);
763  if (GNUNET_YES == echo)
764  {
766  }
767  else
768  {
769  listen_stdio ();
770  }
771  }
772 
773  if ((NULL == lp) && (NULL == job) && (NULL == ch))
774  {
775  GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, _ ("No action requested\n"));
777  return;
778  }
779 }
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static struct GNUNET_CADET_MessageHandler handlers[]
Handlers, for diverse services.
static struct GNUNET_HashCode porthash
HashCode of the given port string.
Definition: gnunet-cadet.c:122
static char * channel_id
Option –channel.
Definition: gnunet-cadet.c:57
static void get_peers(void *cls)
Call CADET's meta API, get all peers known to a peer.
Definition: gnunet-cadet.c:584
static void show_connection(void *cls)
Call CADET's monitor API, get info of one connection.
Definition: gnunet-cadet.c:646
static void * channel_incoming(void *cls, struct GNUNET_CADET_Channel *channel, const struct GNUNET_PeerIdentity *initiator)
Method called whenever another peer has added us to a channel the other peer initiated.
Definition: gnunet-cadet.c:383
static void channel_ended(void *cls, const struct GNUNET_CADET_Channel *channel)
Function called whenever a channel is destroyed.
Definition: gnunet-cadet.c:359
static char * target_port
Port to connect to.
Definition: gnunet-cadet.c:87
static void shutdown_task(void *cls)
Task to shut down this application.
Definition: gnunet-cadet.c:218
static int request_peers
Option -P.
Definition: gnunet-cadet.c:37
static void get_tunnels(void *cls)
Call CADET's meta API, get all tunnels known to a peer.
Definition: gnunet-cadet.c:620
static char * target_id
Peer to connect to.
Definition: gnunet-cadet.c:82
static char * conn_id
Option –connection.
Definition: gnunet-cadet.c:52
static void show_peer(void *cls)
Call CADET's monitor API, get info of one peer.
Definition: gnunet-cadet.c:597
static int request_tunnels
Option -T.
Definition: gnunet-cadet.c:47
static void show_channel(void *cls)
Call CADET's monitor API, get info of one channel.
Definition: gnunet-cadet.c:633
uint32_t data
The data value.
struct GNUNET_CADET_Channel * GNUNET_CADET_channel_create(struct GNUNET_CADET_Handle *h, void *channel_cls, const struct GNUNET_PeerIdentity *destination, const struct GNUNET_HashCode *port, GNUNET_CADET_WindowSizeEventHandler window_changes, GNUNET_CADET_DisconnectEventHandler disconnects, const struct GNUNET_MQ_MessageHandler *handlers)
Create a new channel towards a remote peer.
Definition: cadet_api.c:1015
struct GNUNET_CADET_Handle * GNUNET_CADET_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the MQ-based cadet service.
Definition: cadet_api.c:894
struct GNUNET_CADET_Port * GNUNET_CADET_open_port(struct GNUNET_CADET_Handle *h, const struct GNUNET_HashCode *port, GNUNET_CADET_ConnectEventHandler connects, void *connects_cls, GNUNET_CADET_WindowSizeEventHandler window_changes, GNUNET_CADET_DisconnectEventHandler disconnects, const struct GNUNET_MQ_MessageHandler *handlers)
Open a port to receive incoming MQ-based channels.
Definition: cadet_api.c:954
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
Definition: crypto_hash.c:41
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
Definition: scheduler.c:1299
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,...
Definition: scheduler.c:1334
Message handler for a specific message type.

References _, consensus-simulation::args, cfg, ch, channel_ended(), channel_id, channel_incoming(), conn_id, data, echo, echo_task, get_peers(), get_tunnels(), GNUNET_CADET_channel_create(), GNUNET_CADET_connect(), GNUNET_CADET_open_port(), GNUNET_CRYPTO_eddsa_public_key_from_string(), GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_MESSAGE, GNUNET_log, GNUNET_MESSAGE_TYPE_CADET_CLI, GNUNET_MQ_handler_end, GNUNET_MQ_hd_var_size, GNUNET_OK, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_SCHEDULER_shutdown(), GNUNET_YES, handlers, job, listen_port, listen_stdio(), lp, mh, my_cfg, peer_id, pid, porthash, GNUNET_PeerIdentity::public_key, request_peers, request_tunnels, send_echo(), show_channel(), show_connection(), show_peer(), shutdown_task(), target_id, and target_port.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *const *  argv 
)

The main function to obtain peer information.

Parameters
argcnumber of arguments from the command line
argvcommand line arguments
Returns
0 ok, 1 on error

Definition at line 790 of file gnunet-cadet.c.

791 {
792  int res;
793  const char helpstr[] =
794  "Create tunnels and retrieve info about CADET's status.";
795  struct GNUNET_GETOPT_CommandLineOption options[] = { /* I would use the terminology 'circuit' here... --lynX */
797  'C',
798  "connection",
799  "CONNECTION_ID",
800  gettext_noop ("Provide information about a particular connection"),
801  &conn_id),
803  "echo",
804  gettext_noop ("Activate echo mode"),
805  &echo),
807  'o',
808  "open-port",
809  "SHARED_SECRET",
810  gettext_noop (
811  "Listen for connections using a shared secret among sender and recipient"),
812  &listen_port),
814  "peer",
815  "PEER_ID",
816  gettext_noop (
817  "Provide information about a patricular peer"),
818  &peer_id),
820  "peers",
821  gettext_noop (
822  "Provide information about all peers"),
823  &request_peers),
825  "tunnels",
826  gettext_noop (
827  "Provide information about all tunnels"),
828  &request_tunnels),
830  };
831 
832  if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
833  return 2;
834 
835  res = GNUNET_PROGRAM_run (argc,
836  argv,
837  "gnunet-cadet (OPTIONS | PEER_ID SHARED_SECRET)",
838  gettext_noop (helpstr),
839  options,
840  &run,
841  NULL);
842 
843  GNUNET_free_nz ((void *) argv);
844 
845  if (GNUNET_OK == res)
846  return 0;
847  return 1;
848 }
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
Definition: 002.c:13
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
#define gettext_noop(String)
Definition: gettext.h:70
static int res
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.
Definition: gnunet-cadet.c:662
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.
#define GNUNET_free_nz(ptr)
Wrapper around free.
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run(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,...
Definition: program.c:400
enum GNUNET_GenericReturnValue GNUNET_STRINGS_get_utf8_args(int argc, char *const *argv, int *u8argc, char *const **u8argv)
Returns utf-8 encoded arguments.
Definition: strings.c:1222
Definition of a command line option.

References conn_id, echo, gettext_noop, GNUNET_free_nz, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_string(), GNUNET_OK, GNUNET_PROGRAM_run(), GNUNET_STRINGS_get_utf8_args(), listen_port, options, peer_id, request_peers, request_tunnels, res, and run().

Here is the call graph for this function:

Variable Documentation

◆ request_peers

int request_peers
static

Option -P.

Definition at line 37 of file gnunet-cadet.c.

Referenced by main(), and run().

◆ peer_id

◆ request_tunnels

int request_tunnels
static

Option -T.

Definition at line 47 of file gnunet-cadet.c.

Referenced by main(), and run().

◆ conn_id

char* conn_id
static

Option –connection.

Definition at line 52 of file gnunet-cadet.c.

Referenced by main(), and run().

◆ channel_id

char* channel_id
static

Option –channel.

Definition at line 57 of file gnunet-cadet.c.

Referenced by run().

◆ listen_port

char* listen_port
static

Port to listen on (-o).

Definition at line 62 of file gnunet-cadet.c.

Referenced by handle_data(), main(), and run().

◆ echo

int echo
static

◆ echo_time

struct GNUNET_TIME_Absolute echo_time
static

Time of last echo request.

Definition at line 67 of file gnunet-cadet.c.

Referenced by handle_data(), and read_stdio().

◆ echo_task

struct GNUNET_SCHEDULER_Task* echo_task
static

Task for next echo request.

Definition at line 77 of file gnunet-cadet.c.

Referenced by handle_data(), run(), send_echo(), and shutdown_task().

◆ target_id

char* target_id
static

Peer to connect to.

Definition at line 82 of file gnunet-cadet.c.

Referenced by run().

◆ target_port

char* target_port = "default"
static

Port to connect to.

Definition at line 87 of file gnunet-cadet.c.

Referenced by run().

◆ mh

◆ my_cfg

const struct GNUNET_CONFIGURATION_Handle* my_cfg
static

Our configuration.

Definition at line 97 of file gnunet-cadet.c.

Referenced by get_peers(), get_tunnels(), run(), and show_peer().

◆ gpo

struct GNUNET_CADET_GetPath* gpo
static

Active get path operation.

Definition at line 102 of file gnunet-cadet.c.

Referenced by path_callback(), show_peer(), and shutdown_task().

◆ plo

struct GNUNET_CADET_PeersLister* plo
static

Active peer listing operation.

Definition at line 107 of file gnunet-cadet.c.

Referenced by get_peers(), peers_callback(), and shutdown_task().

◆ tio

struct GNUNET_CADET_ListTunnels* tio
static

Active tunnel listing operation.

Definition at line 112 of file gnunet-cadet.c.

Referenced by get_tunnels(), handle_issue_ticket_message(), issue_ticket_result_cb(), shutdown_task(), and tunnels_callback().

◆ ch

struct GNUNET_CADET_Channel* ch
static

Channel handle.

Definition at line 117 of file gnunet-cadet.c.

Referenced by adjust_running_peers(), bind_loose_channel(), cadet_mq_cancel_impl(), cadet_mq_destroy_impl(), cadet_mq_error_handler(), cadet_mq_send_impl(), cadet_mq_send_now(), channel_audio_sent_notify(), channel_destroy(), channel_destroy_iterator(), channel_ended(), channel_incoming(), channel_open_sent_cb(), check_cadet_ring_message(), check_client_call_message(), check_dht_local_get_result_seen(), check_dht_local_hello_offer(), check_notify_client(), clean_up_channel(), client_connect_cb(), client_disconnect_cb(), conclude_autoconfig_request(), create_channel(), data_sent_cb(), debug_channel(), destroy_channel(), destroy_channel_cb(), destroy_line_cadet_channels(), destroy_remaining_channels(), disconnect(), disconnect_cadet_peers(), dyndns_lookup(), error_handler(), find_channel_by_line(), force_reconnect(), forward_reply(), GCCH_2s(), GCCH_assign_type_to_drop(), GCCH_bind(), GCCH_channel_incoming_new(), GCCH_channel_local_destroy(), GCCH_channel_local_new(), GCCH_debug(), GCCH_handle_channel_open_ack(), GCCH_handle_channel_plaintext_data(), GCCH_handle_channel_plaintext_data_ack(), GCCH_handle_duplicate_open(), GCCH_handle_local_ack(), GCCH_handle_local_data(), GCCH_handle_remote_destroy(), GCCH_is_type_to_drop(), GCCH_tunnel_up(), GCT_remove_channel(), GCT_send(), GNUNET_ATS_connectivity_done(), GNUNET_ATS_connectivity_init(), GNUNET_ATS_connectivity_suggest(), GNUNET_CADET_channel_create(), GNUNET_HOSTLIST_client_start(), GNUNET_TRANSPORT_application_done(), GNUNET_TRANSPORT_application_init(), GNUNET_TRANSPORT_application_suggest(), GNUNET_TRANSPORT_application_suggest_cancel(), GNUNET_TRANSPORT_communicator_address_add(), GNUNET_TRANSPORT_communicator_address_remove(), GNUNET_TRANSPORT_communicator_address_remove_all(), GNUNET_TRANSPORT_communicator_connect(), GNUNET_TRANSPORT_communicator_disconnect(), GNUNET_TRANSPORT_communicator_mq_add(), GNUNET_TRANSPORT_communicator_mq_del(), GNUNET_TRANSPORT_communicator_mq_update(), GNUNET_TRANSPORT_communicator_notify(), GNUNET_TRANSPORT_communicator_receive(), GSC_drop_loose_channel(), GSC_handle_remote_channel_destroy(), handle_autoconfig_request(), handle_backchannel_incoming(), handle_cadet_audio_message(), handle_cadet_hangup_message(), handle_cadet_pickup_message(), handle_cadet_resume_message(), handle_cadet_ring_message(), handle_cadet_suspend_message(), handle_channel_create(), handle_channel_created(), handle_channel_destroy(), handle_client_call_message(), handle_client_hangup_message(), handle_client_pickup_message(), handle_client_resume_message(), handle_client_suspend_message(), handle_create_queue(), handle_data(), handle_dht_local_get_result_seen(), handle_dht_local_hello_offer(), handle_dht_local_monitor(), handle_dht_local_monitor_stop(), handle_dht_local_put(), handle_drop_message(), handle_incoming_ack(), handle_local_ack(), handle_local_data(), handle_matching_ack(), handle_plaintext_channel_destroy(), handle_plaintext_channel_open(), handle_plaintext_channel_open_ack(), handle_plaintext_data(), handle_plaintext_data_ack(), handle_register(), handle_request_connection_reversal(), handle_send_msg(), handle_stun(), inbound_channel(), iterate_channels_cb(), lookup_hole_external(), mq_done_finish_caller_shutdown(), notify_client(), notify_client_external_ipv4_change(), notify_clients(), notify_clients_stun_change(), notify_tunnel_up_cb(), notify_window_size(), occ_cache_get_handle_core_cb(), process_external_ip(), read_stdio(), reconnect(), reconnect_task(), remove_client_query_record(), retry_transmission(), reversal_callback(), run(), send_ack(), send_ack_cb(), send_ack_to_client(), send_channel_data_ack(), send_channel_open(), send_echo(), send_open_ack(), shutdown_task(), signal_remote_destroy_cb(), start_test(), timeout_closed_cb(), transmit_suggestion(), and upnp_addr_change_cb().

◆ porthash

struct GNUNET_HashCode porthash
static

HashCode of the given port string.

Definition at line 117 of file gnunet-cadet.c.

Referenced by run().

◆ lp

struct GNUNET_CADET_Port* lp

Data structure for ongoing reception of incoming virtual circuits.

Definition at line 127 of file gnunet-cadet.c.

Referenced by channel_incoming(), run(), and shutdown_task().

◆ rd_task

struct GNUNET_SCHEDULER_Task* rd_task
static

Task for reading from stdin.

Definition at line 132 of file gnunet-cadet.c.

Referenced by listen_stdio(), read_stdio(), and shutdown_task().

◆ job

◆ sent_pkt

unsigned int sent_pkt
static

Definition at line 139 of file gnunet-cadet.c.

Referenced by read_stdio().