GNUnet  0.10.x
Data Structures | Macros | Enumerations | Functions | Variables
gnunet-service-conversation.c File Reference

conversation service implementation More...

#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_applications.h"
#include "gnunet_constants.h"
#include "gnunet_signatures.h"
#include "gnunet_cadet_service.h"
#include "gnunet_conversation_service.h"
#include "conversation.h"
Include dependency graph for gnunet-service-conversation.c:

Go to the source code of this file.

Data Structures

struct  Channel
 A struct Channel represents a cadet channel, which is a P2P connection to another conversation service. More...
 
struct  Line
 A struct Line connects a local client with cadet channels. More...
 

Macros

#define RING_TIMEOUT   GNUNET_TIME_UNIT_DAYS
 How long is our signature on a call valid? Needs to be long enough for time zone differences and network latency to not matter. More...
 

Enumerations

enum  ChannelStatus {
  CS_CALLEE_INIT, CS_CALLEE_RINGING, CS_CALLEE_CONNECTED, CS_CALLEE_SHUTDOWN,
  CS_CALLER_CALLING, CS_CALLER_CONNECTED, CS_CALLER_SHUTDOWN
}
 The possible connection status. More...
 

Functions

static struct Channelfind_channel_by_line (struct Line *line, uint32_t cid)
 Given a cid, find the corresponding channel given a line. More...
 
static void handle_client_pickup_message (void *cls, const struct ClientPhonePickupMessage *msg)
 Function to handle a pickup request message from the client. More...
 
static void clean_up_channel (struct Channel *ch)
 Channel went down, notify client and free data structure. More...
 
static void destroy_line_cadet_channels (struct Channel *ch)
 Destroy a channel. More...
 
static void mq_done_finish_caller_shutdown (void *cls)
 We are done signalling shutdown to the other peer. More...
 
static void handle_client_hangup_message (void *cls, const struct ClientPhoneHangupMessage *msg)
 Function to handle a hangup request message from the client. More...
 
static void handle_client_suspend_message (void *cls, const struct ClientPhoneSuspendMessage *msg)
 Function to handle a suspend request message from the client. More...
 
static void handle_client_resume_message (void *cls, const struct ClientPhoneResumeMessage *msg)
 Function to handle a resume request message from the client. More...
 
static void channel_audio_sent_notify (void *cls)
 Transmission of audio data via cadet channel finished. More...
 
static int check_client_audio_message (void *cls, const struct ClientAudioMessage *msg)
 Function to check audio data from the client. More...
 
static void handle_client_audio_message (void *cls, const struct ClientAudioMessage *msg)
 Function to handle audio data from the client. More...
 
static void handle_cadet_ring_message (void *cls, const struct CadetPhoneRingMessage *msg)
 Function to handle a ring message incoming over cadet. More...
 
static void handle_cadet_hangup_message (void *cls, const struct CadetPhoneHangupMessage *message)
 Function to handle a hangup message incoming over cadet. More...
 
static void handle_cadet_pickup_message (void *cls, const struct CadetPhonePickupMessage *message)
 Function to handle a pickup message incoming over cadet. More...
 
static void handle_cadet_suspend_message (void *cls, const struct CadetPhoneSuspendMessage *message)
 Function to handle a suspend message incoming over cadet. More...
 
static void handle_cadet_resume_message (void *cls, const struct CadetPhoneResumeMessage *msg)
 Function to handle a resume message incoming over cadet. More...
 
static int check_cadet_audio_message (void *cls, const struct CadetAudioMessage *msg)
 Function to check an audio message incoming over cadet. More...
 
static void handle_cadet_audio_message (void *cls, const struct CadetAudioMessage *msg)
 Function to handle an audio message incoming over cadet. More...
 
static void inbound_end (void *cls, const struct GNUNET_CADET_Channel *channel)
 Function called whenever an inbound channel is destroyed. More...
 
static void handle_client_call_message (void *cls, const struct ClientCallMessage *msg)
 Function to handle call request from the client. More...
 
static void * inbound_channel (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 * client_connect_cb (void *cls, struct GNUNET_SERVICE_Client *client, struct GNUNET_MQ_Handle *mq)
 A client connected. More...
 
static void client_disconnect_cb (void *cls, struct GNUNET_SERVICE_Client *client, void *app_ctx)
 A client disconnected. More...
 
static void handle_client_register_message (void *cls, const struct ClientPhoneRegisterMessage *msg)
 Function to register a phone. More...
 
static void do_shutdown (void *cls)
 Shutdown nicely. More...
 
static void run (void *cls, const struct GNUNET_CONFIGURATION_Handle *c, struct GNUNET_SERVICE_Handle *service)
 Main function that will be run by the scheduler. More...
 
 GNUNET_SERVICE_MAIN ("conversation", GNUNET_SERVICE_OPTION_NONE, &run, &client_connect_cb, &client_disconnect_cb, NULL, GNUNET_MQ_hd_fixed_size(client_register_message, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER, struct ClientPhoneRegisterMessage, NULL), GNUNET_MQ_hd_fixed_size(client_pickup_message, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP, struct ClientPhonePickupMessage, NULL), GNUNET_MQ_hd_fixed_size(client_suspend_message, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND, struct ClientPhoneSuspendMessage, NULL), GNUNET_MQ_hd_fixed_size(client_resume_message, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME, struct ClientPhoneResumeMessage, NULL), GNUNET_MQ_hd_fixed_size(client_hangup_message, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP, struct ClientPhoneHangupMessage, NULL), GNUNET_MQ_hd_fixed_size(client_call_message, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL, struct ClientCallMessage, NULL), GNUNET_MQ_hd_var_size(client_audio_message, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO, struct ClientAudioMessage, NULL), GNUNET_MQ_handler_end())
 Define "main" method using service macro. More...
 

Variables

static const struct GNUNET_CONFIGURATION_Handlecfg
 Our configuration. More...
 
static struct GNUNET_CADET_Handlecadet
 Handle for cadet. More...
 
static struct GNUNET_PeerIdentity my_identity
 Identity of this peer. More...
 

Detailed Description

conversation service implementation

Author
Simon Dieterle
Andreas Fuchs
Christian Grothoff

Definition in file gnunet-service-conversation.c.

Macro Definition Documentation

◆ RING_TIMEOUT

#define RING_TIMEOUT   GNUNET_TIME_UNIT_DAYS

How long is our signature on a call valid? Needs to be long enough for time zone differences and network latency to not matter.

No strong need for it to be short, but we simply like all signatures to eventually expire.

Definition at line 43 of file gnunet-service-conversation.c.

Referenced by handle_client_call_message().

Enumeration Type Documentation

◆ ChannelStatus

The possible connection status.

Enumerator
CS_CALLEE_INIT 

We just got the connection, but no introduction yet.

CS_CALLEE_RINGING 

Our phone is ringing, waiting for the client to pick up.

CS_CALLEE_CONNECTED 

We are talking!

CS_CALLEE_SHUTDOWN 

We're in shutdown, sending hangup messages before cleaning up.

CS_CALLER_CALLING 

We are waiting for the phone to be picked up.

CS_CALLER_CONNECTED 

We are talking!

CS_CALLER_SHUTDOWN 

We're in shutdown, sending hangup messages before cleaning up.

Definition at line 55 of file gnunet-service-conversation.c.

56 {
61 
66 
71 
76 
81 
86 
91 
92 };
We're in shutdown, sending hangup messages before cleaning up.
We are waiting for the phone to be picked up.
We just got the connection, but no introduction yet.
Our phone is ringing, waiting for the client to pick up.
We're in shutdown, sending hangup messages before cleaning up.

Function Documentation

◆ find_channel_by_line()

static struct Channel* find_channel_by_line ( struct Line line,
uint32_t  cid 
)
static

Given a cid, find the corresponding channel given a line.

Parameters
linea line to search
cidwhat to search for
Returns
NULL for not found

Definition at line 226 of file gnunet-service-conversation.c.

References ch, and Line::channel_head.

Referenced by handle_client_audio_message().

228 {
229  for (struct Channel *ch = line->channel_head;
230  NULL != ch;
231  ch = ch->next)
232  if (cid == ch->cid)
233  return ch;
234  return NULL;
235 }
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
struct Channel * channel_head
This is a DLL.
Here is the caller graph for this function:

◆ handle_client_pickup_message()

static void handle_client_pickup_message ( void *  cls,
const struct ClientPhonePickupMessage msg 
)
static

Function to handle a pickup request message from the client.

Parameters
clsthe struct Line of the client from which the message is
msgthe message from the client

Definition at line 245 of file gnunet-service-conversation.c.

References ch, Line::channel_head, Channel::cid, ClientPhonePickupMessage::cid, Line::client, CS_CALLEE_CONNECTED, CS_CALLEE_INIT, CS_CALLEE_RINGING, CS_CALLEE_SHUTDOWN, CS_CALLER_CALLING, CS_CALLER_CONNECTED, CS_CALLER_SHUTDOWN, Channel::env, GNUNET_break, GNUNET_break_op, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), Channel::line, Channel::mq, Channel::next, Line::port, and Channel::status.

247 {
248  struct Line *line = cls;
249  struct CadetPhonePickupMessage *mppm;
250  struct GNUNET_MQ_Envelope *env;
251  struct Channel *ch;
252 
253  if (NULL == line->port)
254  {
255  /* we never opened the port, bad client! */
256  GNUNET_break_op (0);
258  return;
259  }
260  for (ch = line->channel_head; NULL != ch; ch = ch->next)
261  if (msg->cid == ch->cid)
262  break;
263  if (NULL == ch)
264  {
265  /* could have been destroyed asynchronously, ignore message */
267  "Channel %u not found\n",
268  msg->cid);
270  return;
271  }
272  switch (ch->status)
273  {
274  case CS_CALLEE_INIT:
275  GNUNET_break (0);
277  return;
278  case CS_CALLEE_RINGING:
280  break;
281  case CS_CALLEE_CONNECTED:
282  GNUNET_break (0);
284  return;
285  case CS_CALLEE_SHUTDOWN:
287  "Ignoring client's PICKUP message, line is in SHUTDOWN\n");
288  break;
289  case CS_CALLER_CALLING:
290  case CS_CALLER_CONNECTED:
291  case CS_CALLER_SHUTDOWN:
292  GNUNET_break (0);
294  return;
295  }
298  "Sending PICK_UP message to cadet\n");
299  env = GNUNET_MQ_msg (mppm,
301  GNUNET_MQ_send (ch->mq,
302  env);
304 }
enum ChannelStatus status
Current status of this line.
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
struct GNUNET_CADET_Port * port
Our open port.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
We're in shutdown, sending hangup messages before cleaning up.
We are waiting for the phone to be picked up.
static char * line
Desired phone line (string to be converted to a hash).
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
We just got the connection, but no introduction yet.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP
Cadet: pick up phone (establish audio channel)
Our phone is ringing, waiting for the client to pick up.
void GNUNET_SERVICE_client_drop(struct GNUNET_SERVICE_Client *c)
Ask the server to disconnect from the given client.
Definition: service.c:2618
A struct Line connects a local client with cadet channels.
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
struct GNUNET_SERVICE_Client * client
Handle to the line client.
uint32_t cid
CID, internal caller ID to identify which active call we are talking about.
Definition: conversation.h:165
struct Channel * channel_head
This is a DLL.
#define GNUNET_log(kind,...)
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:353
We're in shutdown, sending hangup messages before cleaning up.
struct GNUNET_MQ_Handle * mq
Message queue for control messages.
Cadet message for picking up.
Definition: conversation.h:342
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
Definition: service.c:2533
struct Channel * next
This is a DLL.
uint32_t cid
Channel identifier we use for this call with the client.
Here is the call graph for this function:

◆ clean_up_channel()

static void clean_up_channel ( struct Channel ch)
static

Channel went down, notify client and free data structure.

Parameters
chchannel that went down

Definition at line 314 of file gnunet-service-conversation.c.

References Line::channel_head, Line::channel_tail, Channel::cid, ClientPhoneHangupMessage::cid, CS_CALLEE_CONNECTED, CS_CALLEE_INIT, CS_CALLEE_RINGING, CS_CALLEE_SHUTDOWN, CS_CALLER_CALLING, CS_CALLER_CONNECTED, CS_CALLER_SHUTDOWN, Channel::env, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP, GNUNET_MQ_msg, GNUNET_MQ_send(), Channel::line, Line::mq, and Channel::status.

Referenced by destroy_line_cadet_channels(), and inbound_end().

315 {
316  struct Line *line = ch->line;
317  struct GNUNET_MQ_Envelope *env;
318  struct ClientPhoneHangupMessage *hup;
319 
320  switch (ch->status)
321  {
322  case CS_CALLEE_INIT:
323  case CS_CALLEE_SHUTDOWN:
324  case CS_CALLER_SHUTDOWN:
325  break;
326  case CS_CALLEE_RINGING:
327  case CS_CALLEE_CONNECTED:
328  case CS_CALLER_CALLING:
329  case CS_CALLER_CONNECTED:
330  if (NULL != line)
331  {
332  env = GNUNET_MQ_msg (hup,
334  hup->cid = ch->cid;
335  GNUNET_MQ_send (line->mq,
336  env);
337  }
338  break;
339  }
340  if (NULL != line)
342  line->channel_tail,
343  ch);
344  GNUNET_free (ch);
345 }
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
enum ChannelStatus status
Current status of this line.
uint32_t cid
CID, internal caller ID to identify which active call we are talking about.
Definition: conversation.h:185
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
struct Channel * channel_tail
This is a DLL.
We're in shutdown, sending hangup messages before cleaning up.
We are waiting for the phone to be picked up.
struct Line * line
Line associated with the channel.
static char * line
Desired phone line (string to be converted to a hash).
Client <-> Service hang up phone that may or may not be ringing.
Definition: conversation.h:174
We just got the connection, but no introduction yet.
Our phone is ringing, waiting for the client to pick up.
A struct Line connects a local client with cadet channels.
struct GNUNET_MQ_Handle * mq
Message queue for client.
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
struct Channel * channel_head
This is a DLL.
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:353
We&#39;re in shutdown, sending hangup messages before cleaning up.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP
Client -> Server message to reject/hangup a call.
#define GNUNET_free(ptr)
Wrapper around free.
uint32_t cid
Channel identifier we use for this call with the client.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroy_line_cadet_channels()

static void destroy_line_cadet_channels ( struct Channel ch)
static

Destroy a channel.

Parameters
chchannel to destroy.

Definition at line 354 of file gnunet-service-conversation.c.

References Channel::channel, clean_up_channel(), GNUNET_CADET_channel_destroy(), GNUNET_ERROR_TYPE_DEBUG, and GNUNET_log.

Referenced by client_disconnect_cb(), handle_cadet_hangup_message(), handle_cadet_pickup_message(), handle_cadet_resume_message(), handle_cadet_ring_message(), and mq_done_finish_caller_shutdown().

355 {
357  "Destroying cadet channels\n");
358  if (NULL != ch->channel)
359  {
361  ch->channel = NULL;
362  }
363  clean_up_channel (ch);
364 }
struct GNUNET_CADET_Channel * channel
Handle for the channel.
static void clean_up_channel(struct Channel *ch)
Channel went down, notify client and free data structure.
#define GNUNET_log(kind,...)
void GNUNET_CADET_channel_destroy(struct GNUNET_CADET_Channel *channel)
Destroy an existing channel.
Definition: cadet_api.c:911
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mq_done_finish_caller_shutdown()

static void mq_done_finish_caller_shutdown ( void *  cls)
static

We are done signalling shutdown to the other peer.

Close down the channel.

Parameters
clsthe struct Channel to reset/terminate

Definition at line 374 of file gnunet-service-conversation.c.

References ch, CS_CALLEE_CONNECTED, CS_CALLEE_INIT, CS_CALLEE_RINGING, CS_CALLEE_SHUTDOWN, CS_CALLER_CALLING, CS_CALLER_CONNECTED, CS_CALLER_SHUTDOWN, destroy_line_cadet_channels(), GNUNET_break, and Channel::status.

Referenced by handle_cadet_pickup_message(), and handle_client_hangup_message().

375 {
376  struct Channel *ch = cls;
377 
378  switch (ch->status)
379  {
380  case CS_CALLEE_INIT:
381  GNUNET_break (0);
382  break;
383  case CS_CALLEE_RINGING:
384  GNUNET_break (0);
385  break;
386  case CS_CALLEE_CONNECTED:
387  GNUNET_break (0);
388  break;
389  case CS_CALLEE_SHUTDOWN:
391  break;
392  case CS_CALLER_CALLING:
393  GNUNET_break (0);
394  break;
395  case CS_CALLER_CONNECTED:
396  GNUNET_break (0);
397  break;
398  case CS_CALLER_SHUTDOWN:
400  break;
401  }
402 }
enum ChannelStatus status
Current status of this line.
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
We&#39;re in shutdown, sending hangup messages before cleaning up.
We are waiting for the phone to be picked up.
We just got the connection, but no introduction yet.
Our phone is ringing, waiting for the client to pick up.
static void destroy_line_cadet_channels(struct Channel *ch)
Destroy a channel.
We&#39;re in shutdown, sending hangup messages before cleaning up.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_client_hangup_message()

static void handle_client_hangup_message ( void *  cls,
const struct ClientPhoneHangupMessage msg 
)
static

Function to handle a hangup request message from the client.

Parameters
clsthe struct Line the hangup is for
msgthe message from the client

Definition at line 412 of file gnunet-service-conversation.c.

References ch, Line::channel_head, Channel::cid, ClientPhoneHangupMessage::cid, Line::client, CS_CALLEE_CONNECTED, CS_CALLEE_INIT, CS_CALLEE_RINGING, CS_CALLEE_SHUTDOWN, CS_CALLER_CALLING, CS_CALLER_CONNECTED, CS_CALLER_SHUTDOWN, e, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP, GNUNET_MQ_msg, GNUNET_MQ_notify_sent(), GNUNET_MQ_send(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), Channel::line, Channel::mq, mq_done_finish_caller_shutdown(), Channel::next, and Channel::status.

414 {
415  struct Line *line = cls;
416  struct GNUNET_MQ_Envelope *e;
417  struct CadetPhoneHangupMessage *mhum;
418  struct Channel *ch;
419 
420  for (ch = line->channel_head; NULL != ch; ch = ch->next)
421  if (msg->cid == ch->cid)
422  break;
423  if (NULL == ch)
424  {
425  /* could have been destroyed asynchronously, ignore message */
427  "Channel %u not found\n",
428  msg->cid);
430  return;
431  }
433  "Received HANGUP for channel %u which is in state %d\n",
434  msg->cid,
435  ch->status);
436  switch (ch->status)
437  {
438  case CS_CALLEE_INIT:
439  GNUNET_break (0);
441  return;
442  case CS_CALLEE_RINGING:
444  break;
445  case CS_CALLEE_CONNECTED:
447  break;
448  case CS_CALLEE_SHUTDOWN:
449  /* maybe the other peer closed asynchronously... */
451  return;
452  case CS_CALLER_CALLING:
454  break;
455  case CS_CALLER_CONNECTED:
457  break;
458  case CS_CALLER_SHUTDOWN:
459  /* maybe the other peer closed asynchronously... */
461  return;
462  }
464  "Sending HANG_UP message via cadet\n");
465  e = GNUNET_MQ_msg (mhum,
469  ch);
470  GNUNET_MQ_send (ch->mq,
471  e);
473 }
enum ChannelStatus status
Current status of this line.
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
uint32_t cid
CID, internal caller ID to identify which active call we are talking about.
Definition: conversation.h:185
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
static struct Experiment * e
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP
Cadet: hang up / refuse call.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
We&#39;re in shutdown, sending hangup messages before cleaning up.
We are waiting for the phone to be picked up.
static char * line
Desired phone line (string to be converted to a hash).
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:774
We just got the connection, but no introduction yet.
Our phone is ringing, waiting for the client to pick up.
void GNUNET_SERVICE_client_drop(struct GNUNET_SERVICE_Client *c)
Ask the server to disconnect from the given client.
Definition: service.c:2618
static void mq_done_finish_caller_shutdown(void *cls)
We are done signalling shutdown to the other peer.
A struct Line connects a local client with cadet channels.
struct GNUNET_SERVICE_Client * client
Handle to the line client.
struct Channel * channel_head
This is a DLL.
#define GNUNET_log(kind,...)
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:353
Cadet message for hanging up.
Definition: conversation.h:329
We&#39;re in shutdown, sending hangup messages before cleaning up.
struct GNUNET_MQ_Handle * mq
Message queue for control messages.
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
Definition: service.c:2533
struct Channel * next
This is a DLL.
uint32_t cid
Channel identifier we use for this call with the client.
Here is the call graph for this function:

◆ handle_client_suspend_message()

static void handle_client_suspend_message ( void *  cls,
const struct ClientPhoneSuspendMessage msg 
)
static

Function to handle a suspend request message from the client.

Parameters
clsthe struct Line the message is about
msgthe message from the client

Definition at line 483 of file gnunet-service-conversation.c.

References ch, Line::channel_head, ClientPhoneSuspendMessage::cid, Channel::cid, Line::client, CS_CALLEE_CONNECTED, CS_CALLEE_INIT, CS_CALLEE_RINGING, CS_CALLEE_SHUTDOWN, CS_CALLER_CALLING, CS_CALLER_CONNECTED, CS_CALLER_SHUTDOWN, e, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_YES, Channel::line, Channel::mq, Channel::next, Channel::status, and Channel::suspended_local.

485 {
486  struct Line *line = cls;
487  struct GNUNET_MQ_Envelope *e;
488  struct CadetPhoneSuspendMessage *mhum;
489  struct Channel *ch;
490 
491  for (ch = line->channel_head; NULL != ch; ch = ch->next)
492  if (msg->cid == ch->cid)
493  break;
494  if (NULL == ch)
495  {
496  /* could have been destroyed asynchronously, ignore message */
498  "Channel %u not found\n",
499  msg->cid);
501  return;
502  }
503  if (GNUNET_YES == ch->suspended_local)
504  {
505  GNUNET_break (0);
507  return;
508  }
510  "Received SUSPEND for channel %u which is in state %d\n",
511  msg->cid,
512  ch->status);
513  switch (ch->status)
514  {
515  case CS_CALLEE_INIT:
516  GNUNET_break (0);
518  return;
519  case CS_CALLEE_RINGING:
520  GNUNET_break (0);
522  return;
523  case CS_CALLEE_CONNECTED:
525  break;
526  case CS_CALLEE_SHUTDOWN:
527  /* maybe the other peer closed asynchronously... */
529  return;
530  case CS_CALLER_CALLING:
531  GNUNET_break (0);
533  return;
534  case CS_CALLER_CONNECTED:
536  break;
537  case CS_CALLER_SHUTDOWN:
538  /* maybe the other peer closed asynchronously... */
540  return;
541  }
543  "Sending SUSPEND message via cadet\n");
544  e = GNUNET_MQ_msg (mhum,
546  GNUNET_MQ_send (ch->mq,
547  e);
549 }
enum ChannelStatus status
Current status of this line.
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND
Cadet: phone suspended.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
static struct Experiment * e
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
We&#39;re in shutdown, sending hangup messages before cleaning up.
We are waiting for the phone to be picked up.
int8_t suspended_local
GNUNET_YES if the channel was suspended by the local client.
static char * line
Desired phone line (string to be converted to a hash).
We just got the connection, but no introduction yet.
Our phone is ringing, waiting for the client to pick up.
void GNUNET_SERVICE_client_drop(struct GNUNET_SERVICE_Client *c)
Ask the server to disconnect from the given client.
Definition: service.c:2618
A struct Line connects a local client with cadet channels.
Cadet message for phone suspended.
Definition: conversation.h:355
struct GNUNET_SERVICE_Client * client
Handle to the line client.
struct Channel * channel_head
This is a DLL.
#define GNUNET_log(kind,...)
#define GNUNET_YES
Definition: gnunet_common.h:80
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:353
We&#39;re in shutdown, sending hangup messages before cleaning up.
struct GNUNET_MQ_Handle * mq
Message queue for control messages.
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
Definition: service.c:2533
struct Channel * next
This is a DLL.
uint32_t cid
CID, internal caller ID to identify which active call we are talking about.
Definition: conversation.h:127
uint32_t cid
Channel identifier we use for this call with the client.
Here is the call graph for this function:

◆ handle_client_resume_message()

static void handle_client_resume_message ( void *  cls,
const struct ClientPhoneResumeMessage msg 
)
static

Function to handle a resume request message from the client.

Parameters
clsthe struct Line the message is about
msgthe message from the client

Definition at line 559 of file gnunet-service-conversation.c.

References ch, Line::channel_head, Channel::cid, ClientPhoneResumeMessage::cid, Line::client, CS_CALLEE_CONNECTED, CS_CALLEE_INIT, CS_CALLEE_RINGING, CS_CALLEE_SHUTDOWN, CS_CALLER_CALLING, CS_CALLER_CONNECTED, CS_CALLER_SHUTDOWN, e, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_NO, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_YES, Channel::line, Channel::mq, Channel::next, Channel::status, and Channel::suspended_local.

561 {
562  struct Line *line = cls;
563  struct GNUNET_MQ_Envelope *e;
564  struct CadetPhoneResumeMessage *mhum;
565  struct Channel *ch;
566 
567  for (ch = line->channel_head; NULL != ch; ch = ch->next)
568  if (msg->cid == ch->cid)
569  break;
570  if (NULL == ch)
571  {
572  /* could have been destroyed asynchronously, ignore message */
574  "Channel %u not found\n",
575  msg->cid);
577  return;
578  }
579  if (GNUNET_YES != ch->suspended_local)
580  {
581  GNUNET_break (0);
583  return;
584  }
586  "Received RESUME for channel %u which is in state %d\n",
587  msg->cid,
588  ch->status);
589  switch (ch->status)
590  {
591  case CS_CALLEE_INIT:
592  GNUNET_break (0);
594  return;
595  case CS_CALLEE_RINGING:
596  GNUNET_break (0);
598  return;
599  case CS_CALLEE_CONNECTED:
601  break;
602  case CS_CALLEE_SHUTDOWN:
603  /* maybe the other peer closed asynchronously... */
605  return;
606  case CS_CALLER_CALLING:
607  GNUNET_break (0);
609  return;
610  case CS_CALLER_CONNECTED:
612  break;
613  case CS_CALLER_SHUTDOWN:
614  /* maybe the other peer closed asynchronously... */
616  return;
617  }
619  "Sending RESUME message via cadet\n");
620  e = GNUNET_MQ_msg (mhum,
622  GNUNET_MQ_send (ch->mq,
623  e);
625 }
uint32_t cid
CID, internal caller ID to identify which active call we are talking about.
Definition: conversation.h:146
enum ChannelStatus status
Current status of this line.
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
static struct Experiment * e
#define GNUNET_NO
Definition: gnunet_common.h:81
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
We&#39;re in shutdown, sending hangup messages before cleaning up.
We are waiting for the phone to be picked up.
int8_t suspended_local
GNUNET_YES if the channel was suspended by the local client.
static char * line
Desired phone line (string to be converted to a hash).
We just got the connection, but no introduction yet.
Our phone is ringing, waiting for the client to pick up.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME
Cadet: phone resumed.
void GNUNET_SERVICE_client_drop(struct GNUNET_SERVICE_Client *c)
Ask the server to disconnect from the given client.
Definition: service.c:2618
A struct Line connects a local client with cadet channels.
struct GNUNET_SERVICE_Client * client
Handle to the line client.
Cadet message for phone resumed.
Definition: conversation.h:368
struct Channel * channel_head
This is a DLL.
#define GNUNET_log(kind,...)
#define GNUNET_YES
Definition: gnunet_common.h:80
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:353
We&#39;re in shutdown, sending hangup messages before cleaning up.
struct GNUNET_MQ_Handle * mq
Message queue for control messages.
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
Definition: service.c:2533
struct Channel * next
This is a DLL.
uint32_t cid
Channel identifier we use for this call with the client.
Here is the call graph for this function:

◆ channel_audio_sent_notify()

static void channel_audio_sent_notify ( void *  cls)
static

Transmission of audio data via cadet channel finished.

Parameters
clsthe struct Channel we are transmitting for

Definition at line 634 of file gnunet-service-conversation.c.

References ch, and Channel::env.

Referenced by handle_client_audio_message().

635 {
636  struct Channel *ch = cls;
637 
638  ch->env = NULL;
639 }
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
struct GNUNET_MQ_Envelope * env
Temporary buffer for audio data in the mq.
Here is the caller graph for this function:

◆ check_client_audio_message()

static int check_client_audio_message ( void *  cls,
const struct ClientAudioMessage msg 
)
static

Function to check audio data from the client.

Parameters
clsthe struct Line the message is about
msgthe message from the client
Returns
GNUNET_OK (any data is ok)

Definition at line 650 of file gnunet-service-conversation.c.

References GNUNET_OK.

652 {
653  (void) cls;
654  (void) msg;
655  return GNUNET_OK;
656 }
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78

◆ handle_client_audio_message()

static void handle_client_audio_message ( void *  cls,
const struct ClientAudioMessage msg 
)
static

Function to handle audio data from the client.

Parameters
clsthe struct Line the message is about
msgthe message from the client

Definition at line 666 of file gnunet-service-conversation.c.

References ch, channel_audio_sent_notify(), ClientAudioMessage::cid, Line::client, CS_CALLEE_CONNECTED, CS_CALLEE_INIT, CS_CALLEE_RINGING, CS_CALLEE_SHUTDOWN, CS_CALLER_CALLING, CS_CALLER_CONNECTED, CS_CALLER_SHUTDOWN, Channel::env, find_channel_by_line(), GNUNET_break, GNUNET_ERROR_TYPE_BULK, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO, GNUNET_MQ_msg_extra, GNUNET_MQ_notify_sent(), GNUNET_MQ_send(), GNUNET_MQ_send_cancel(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_YES, ClientAudioMessage::header, Channel::line, Channel::mq, size, GNUNET_MessageHeader::size, Channel::status, and Channel::suspended_local.

668 {
669  struct Line *line = cls;
670  struct CadetAudioMessage *mam;
671  struct Channel *ch;
672  size_t size;
673 
674  size = ntohs (msg->header.size) - sizeof (struct ClientAudioMessage);
675  ch = find_channel_by_line (line,
676  msg->cid);
677  if (NULL == ch)
678  {
679  /* could have been destroyed asynchronously, ignore message */
681  "Channel %u not found\n",
682  msg->cid);
684  return;
685  }
686 
687  switch (ch->status)
688  {
689  case CS_CALLEE_INIT:
690  case CS_CALLEE_RINGING:
691  case CS_CALLER_CALLING:
692  GNUNET_break (0);
694  return;
695  case CS_CALLEE_CONNECTED:
696  case CS_CALLER_CONNECTED:
697  /* common case, handled below */
698  break;
699  case CS_CALLEE_SHUTDOWN:
700  case CS_CALLER_SHUTDOWN:
702  "Cadet audio channel in shutdown; audio data dropped\n");
704  return;
705  }
706  if (GNUNET_YES == ch->suspended_local)
707  {
709  "This channel is suspended locally\n");
711  return;
712  }
713  if (NULL != ch->env)
714  {
715  /* NOTE: we may want to not do this and instead combine the data */
717  "Bandwidth insufficient; dropping previous audio data segment\n");
719  ch->env = NULL;
720  }
721 
723  "Received %u bytes of AUDIO data from client CID %u\n",
724  (unsigned int) size,
725  msg->cid);
726  ch->env = GNUNET_MQ_msg_extra (mam,
727  size,
729  GNUNET_memcpy (&mam[1],
730  &msg[1],
731  size);
732  /* FIXME: set options for unreliable transmission */
735  ch);
736  GNUNET_MQ_send (ch->mq,
737  ch->env);
739 }
enum ChannelStatus status
Current status of this line.
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO
Cadet: audio data.
static void channel_audio_sent_notify(void *cls)
Transmission of audio data via cadet channel finished.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
We&#39;re in shutdown, sending hangup messages before cleaning up.
We are waiting for the phone to be picked up.
int8_t suspended_local
GNUNET_YES if the channel was suspended by the local client.
#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:52
#define GNUNET_memcpy(dst, src, n)
static char * line
Desired phone line (string to be converted to a hash).
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:774
struct GNUNET_MQ_Envelope * env
Temporary buffer for audio data in the mq.
We just got the connection, but no introduction yet.
Our phone is ringing, waiting for the client to pick up.
static struct Channel * find_channel_by_line(struct Line *line, uint32_t cid)
Given a cid, find the corresponding channel given a line.
void GNUNET_SERVICE_client_drop(struct GNUNET_SERVICE_Client *c)
Ask the server to disconnect from the given client.
Definition: service.c:2618
A struct Line connects a local client with cadet channels.
static unsigned int size
Size of the "table".
Definition: peer.c:67
struct GNUNET_SERVICE_Client * client
Handle to the line client.
#define GNUNET_log(kind,...)
Message Client <-> Service to transmit the audio.
Definition: conversation.h:193
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO.
Definition: conversation.h:198
#define GNUNET_YES
Definition: gnunet_common.h:80
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:353
We&#39;re in shutdown, sending hangup messages before cleaning up.
struct GNUNET_MQ_Handle * mq
Message queue for control messages.
void GNUNET_MQ_send_cancel(struct GNUNET_MQ_Envelope *ev)
Cancel sending the message.
Definition: mq.c:916
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
Definition: service.c:2533
Cadet message to transmit the audio.
Definition: conversation.h:381
uint32_t cid
CID, internal caller ID to identify which active call we are sending data to.
Definition: conversation.h:204
Here is the call graph for this function:

◆ handle_cadet_ring_message()

static void handle_cadet_ring_message ( void *  cls,
const struct CadetPhoneRingMessage msg 
)
static

Function to handle a ring message incoming over cadet.

Parameters
clsclosure, NULL
msgthe incoming message

Definition at line 749 of file gnunet-service-conversation.c.

References ClientPhoneRingMessage::caller_id, CadetPhoneRingMessage::caller_id, ch, Channel::channel, ClientPhoneRingMessage::cid, Channel::cid, CS_CALLEE_INIT, CS_CALLEE_RINGING, destroy_line_cadet_channels(), Channel::env, CadetPhoneRingInfoPS::expiration_time, CadetPhoneRingMessage::expiration_time, GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_CRYPTO_ecdsa_verify(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_OK, GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING, GNUNET_TIME_absolute_get_remaining(), GNUNET_TIME_absolute_ntoh(), Channel::line, Line::line_port, CadetPhoneRingInfoPS::line_port, Line::mq, my_identity, GNUNET_CRYPTO_EccSignaturePurpose::purpose, CadetPhoneRingInfoPS::purpose, GNUNET_TIME_Relative::rel_value_us, CadetPhoneRingMessage::signature, GNUNET_CRYPTO_EccSignaturePurpose::size, Channel::status, and CadetPhoneRingInfoPS::target_peer.

751 {
752  struct Channel *ch = cls;
753  struct Line *line = ch->line;
754  struct GNUNET_MQ_Envelope *env;
755  struct ClientPhoneRingMessage *cring;
756  struct CadetPhoneRingInfoPS rs;
757 
759  rs.purpose.size = htonl (sizeof (struct CadetPhoneRingInfoPS));
760  rs.line_port = line->line_port;
761  rs.target_peer = my_identity;
762  rs.expiration_time = msg->expiration_time;
763 
764  if (GNUNET_OK !=
766  &rs.purpose,
767  &msg->signature,
768  &msg->caller_id))
769  {
770  GNUNET_break_op (0);
772  return;
773  }
775  {
776  /* ancient call, replay? */
777  GNUNET_break_op (0);
778  /* Note that our reliance on time here is awkward; better would be
779  to use a more complex challenge-response protocol against
780  replay attacks. Left for future work ;-). */
782  return;
783  }
784  if (CS_CALLEE_INIT != ch->status)
785  {
786  GNUNET_break_op (0);
788  return;
789  }
792  env = GNUNET_MQ_msg (cring,
794  cring->cid = ch->cid;
795  cring->caller_id = msg->caller_id;
797  "Sending RING message to client. CID is %u\n",
798  (unsigned int) ch->cid);
799  GNUNET_MQ_send (line->mq,
800  env);
801 }
enum ChannelStatus status
Current status of this line.
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
Definition: time.c:670
uint64_t rel_value_us
The actual value.
int GNUNET_CRYPTO_ecdsa_verify(uint32_t purpose, const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, const struct GNUNET_CRYPTO_EcdsaSignature *sig, const struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Verify ECDSA signature.
Definition: crypto_ecc.c:1048
uint32_t purpose
What does this signature vouch for? This must contain a GNUNET_SIGNATURE_PURPOSE_XXX constant (from g...
struct GNUNET_CRYPTO_EcdsaPublicKey caller_id
Who is calling us?
Definition: conversation.h:108
#define GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING
Signature of a conversation ring.
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
Information signed in a struct CadetPhoneRingMessage whereby the caller self-identifies to the receiv...
Definition: conversation.h:267
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
static struct GNUNET_PeerIdentity my_identity
Identity of this peer.
struct GNUNET_CADET_Channel * channel
Handle for the channel.
struct GNUNET_CRYPTO_EcdsaSignature signature
Signature over a struct CadetPhoneRingInfoPS
Definition: conversation.h:321
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING
Client <- Server message to indicate a ringing phone.
struct Line * line
Line associated with the channel.
static char * line
Desired phone line (string to be converted to a hash).
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
We just got the connection, but no introduction yet.
Our phone is ringing, waiting for the client to pick up.
static void destroy_line_cadet_channels(struct Channel *ch)
Destroy a channel.
A struct Line connects a local client with cadet channels.
uint32_t cid
CID, internal caller ID number used in the future to identify which active call we are talking about...
Definition: conversation.h:103
struct GNUNET_MQ_Handle * mq
Message queue for client.
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
struct GNUNET_CRYPTO_EccSignaturePurpose purpose
Purpose for the signature, must be GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING.
Definition: conversation.h:273
struct GNUNET_HashCode line_port
Port number we are listening on (to verify signatures).
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:973
Service -> Client message for phone is ringing.
Definition: conversation.h:92
#define GNUNET_log(kind,...)
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining(struct GNUNET_TIME_Absolute future)
Given a timestamp in the future, how much time remains until then?
Definition: time.c:331
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:353
struct GNUNET_TIME_AbsoluteNBO expiration_time
When does the signature expire?
Definition: conversation.h:316
struct GNUNET_CRYPTO_EcdsaPublicKey caller_id
Who is calling us? (also who is signing).
Definition: conversation.h:311
uint32_t cid
Channel identifier we use for this call with the client.
Here is the call graph for this function:

◆ handle_cadet_hangup_message()

static void handle_cadet_hangup_message ( void *  cls,
const struct CadetPhoneHangupMessage message 
)
static

Function to handle a hangup message incoming over cadet.

Parameters
clsclosure, our struct Channel *
messagethe incoming message

Definition at line 811 of file gnunet-service-conversation.c.

References ch, Channel::channel, Channel::cid, ClientPhoneHangupMessage::cid, CS_CALLEE_CONNECTED, CS_CALLEE_INIT, CS_CALLEE_RINGING, CS_CALLEE_SHUTDOWN, CS_CALLER_CALLING, CS_CALLER_CONNECTED, CS_CALLER_SHUTDOWN, destroy_line_cadet_channels(), Channel::env, GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP, GNUNET_MQ_msg, GNUNET_MQ_send(), Channel::line, Line::mq, and Channel::status.

813 {
814  struct Channel *ch = cls;
815  struct Line *line = ch->line;
816  struct GNUNET_MQ_Envelope *env;
817  struct ClientPhoneHangupMessage *hup;
818  enum ChannelStatus status;
819  uint32_t cid;
820 
821  (void) message;
823  cid = ch->cid;
824  status = ch->status;
826  switch (status)
827  {
828  case CS_CALLEE_INIT:
829  GNUNET_break_op (0);
830  return;
831  case CS_CALLEE_RINGING:
832  case CS_CALLEE_CONNECTED:
833  break;
834  case CS_CALLEE_SHUTDOWN:
835  return;
836  case CS_CALLER_CALLING:
837  case CS_CALLER_CONNECTED:
838  break;
839  case CS_CALLER_SHUTDOWN:
840  return;
841  }
843  "Sending HANG UP message to client\n");
844  env = GNUNET_MQ_msg (hup,
846  hup->cid = cid;
847  GNUNET_MQ_send (line->mq,
848  env);
849 }
ChannelStatus
The possible connection status.
enum ChannelStatus status
Current status of this line.
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
uint32_t cid
CID, internal caller ID to identify which active call we are talking about.
Definition: conversation.h:185
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
struct GNUNET_CADET_Channel * channel
Handle for the channel.
We&#39;re in shutdown, sending hangup messages before cleaning up.
We are waiting for the phone to be picked up.
struct Line * line
Line associated with the channel.
static char * line
Desired phone line (string to be converted to a hash).
Client <-> Service hang up phone that may or may not be ringing.
Definition: conversation.h:174
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
We just got the connection, but no introduction yet.
uint16_t status
See PRISM_STATUS_*-constants.
Our phone is ringing, waiting for the client to pick up.
static void destroy_line_cadet_channels(struct Channel *ch)
Destroy a channel.
A struct Line connects a local client with cadet channels.
struct GNUNET_MQ_Handle * mq
Message queue for client.
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
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:973
#define GNUNET_log(kind,...)
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:353
We&#39;re in shutdown, sending hangup messages before cleaning up.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP
Client -> Server message to reject/hangup a call.
uint32_t cid
Channel identifier we use for this call with the client.
Here is the call graph for this function:

◆ handle_cadet_pickup_message()

static void handle_cadet_pickup_message ( void *  cls,
const struct CadetPhonePickupMessage message 
)
static

Function to handle a pickup message incoming over cadet.

Parameters
clsclosure, our struct Channel *
messagethe incoming message

Definition at line 859 of file gnunet-service-conversation.c.

References ch, Channel::channel, Channel::cid, ClientPhonePickedupMessage::cid, CS_CALLEE_CONNECTED, CS_CALLEE_INIT, CS_CALLEE_RINGING, CS_CALLEE_SHUTDOWN, CS_CALLER_CALLING, CS_CALLER_CONNECTED, CS_CALLER_SHUTDOWN, destroy_line_cadet_channels(), Channel::env, GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP, GNUNET_MQ_msg, GNUNET_MQ_send(), Channel::line, Line::mq, mq_done_finish_caller_shutdown(), and Channel::status.

861 {
862  struct Channel *ch = cls;
863  struct Line *line = ch->line;
864  struct GNUNET_MQ_Envelope *env;
865  struct ClientPhonePickedupMessage *pick;
866 
867  (void) message;
869  switch (ch->status)
870  {
871  case CS_CALLEE_INIT:
872  case CS_CALLEE_RINGING:
873  case CS_CALLEE_CONNECTED:
874  GNUNET_break_op (0);
876  return;
877  case CS_CALLEE_SHUTDOWN:
878  GNUNET_break_op (0);
880  return;
881  case CS_CALLER_CALLING:
883  break;
884  case CS_CALLER_CONNECTED:
885  GNUNET_break_op (0);
886  return;
887  case CS_CALLER_SHUTDOWN:
888  GNUNET_break_op (0);
890  return;
891  }
893  "Sending PICKED UP message to client\n");
894  env = GNUNET_MQ_msg (pick,
896  pick->cid = ch->cid;
897  GNUNET_MQ_send (line->mq,
898  env);
899 }
enum ChannelStatus status
Current status of this line.
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
struct GNUNET_CADET_Channel * channel
Handle for the channel.
We&#39;re in shutdown, sending hangup messages before cleaning up.
We are waiting for the phone to be picked up.
struct Line * line
Line associated with the channel.
static char * line
Desired phone line (string to be converted to a hash).
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
uint32_t cid
Call ID of the corresponding GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL.
Definition: conversation.h:258
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP
Service -> Client message to notify that phone was picked up.
We just got the connection, but no introduction yet.
Our phone is ringing, waiting for the client to pick up.
static void destroy_line_cadet_channels(struct Channel *ch)
Destroy a channel.
static void mq_done_finish_caller_shutdown(void *cls)
We are done signalling shutdown to the other peer.
A struct Line connects a local client with cadet channels.
struct GNUNET_MQ_Handle * mq
Message queue for client.
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
Service -> Client: other peer has picked up the phone, we are now talking.
Definition: conversation.h:247
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:973
#define GNUNET_log(kind,...)
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:353
We&#39;re in shutdown, sending hangup messages before cleaning up.
uint32_t cid
Channel identifier we use for this call with the client.
Here is the call graph for this function:

◆ handle_cadet_suspend_message()

static void handle_cadet_suspend_message ( void *  cls,
const struct CadetPhoneSuspendMessage message 
)
static

Function to handle a suspend message incoming over cadet.

Parameters
clsclosure, our struct Channel *
messagethe incoming message

Definition at line 909 of file gnunet-service-conversation.c.

References ch, Channel::channel, ClientPhoneSuspendMessage::cid, Channel::cid, CS_CALLEE_CONNECTED, CS_CALLEE_INIT, CS_CALLEE_RINGING, CS_CALLEE_SHUTDOWN, CS_CALLER_CALLING, CS_CALLER_CONNECTED, CS_CALLER_SHUTDOWN, Channel::env, GNUNET_break_op, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_YES, Channel::line, Line::mq, Channel::status, and Channel::suspended_remote.

911 {
912  struct Channel *ch = cls;
913  struct Line *line = ch->line;
914  struct GNUNET_MQ_Envelope *env;
915  struct ClientPhoneSuspendMessage *suspend;
916 
917  (void) message;
920  "Suspending channel CID: %u\n",
921  ch->cid);
922  switch (ch->status)
923  {
924  case CS_CALLEE_INIT:
925  GNUNET_break_op (0);
926  break;
927  case CS_CALLEE_RINGING:
928  GNUNET_break_op (0);
929  break;
930  case CS_CALLEE_CONNECTED:
932  break;
933  case CS_CALLEE_SHUTDOWN:
934  return;
935  case CS_CALLER_CALLING:
936  GNUNET_break_op (0);
937  break;
938  case CS_CALLER_CONNECTED:
940  break;
941  case CS_CALLER_SHUTDOWN:
942  return;
943  }
944  env = GNUNET_MQ_msg (suspend,
946  suspend->cid = ch->cid;
947  GNUNET_MQ_send (line->mq,
948  env);
949 }
enum ChannelStatus status
Current status of this line.
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
struct GNUNET_CADET_Channel * channel
Handle for the channel.
We&#39;re in shutdown, sending hangup messages before cleaning up.
We are waiting for the phone to be picked up.
struct Line * line
Line associated with the channel.
static char * line
Desired phone line (string to be converted to a hash).
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
We just got the connection, but no introduction yet.
Our phone is ringing, waiting for the client to pick up.
A struct Line connects a local client with cadet channels.
struct GNUNET_MQ_Handle * mq
Message queue for client.
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
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:973
#define GNUNET_log(kind,...)
#define GNUNET_YES
Definition: gnunet_common.h:80
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:353
We&#39;re in shutdown, sending hangup messages before cleaning up.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND
Client <-> Server message to suspend connection.
Service <-> Client message for phone was suspended.
Definition: conversation.h:116
int8_t suspended_remote
GNUNET_YES if the channel was suspended by the other peer.
uint32_t cid
CID, internal caller ID to identify which active call we are talking about.
Definition: conversation.h:127
uint32_t cid
Channel identifier we use for this call with the client.
Here is the call graph for this function:

◆ handle_cadet_resume_message()

static void handle_cadet_resume_message ( void *  cls,
const struct CadetPhoneResumeMessage msg 
)
static

Function to handle a resume message incoming over cadet.

Parameters
clsclosure, our struct Channel *
msgthe incoming message

Definition at line 959 of file gnunet-service-conversation.c.

References ch, Channel::channel, Channel::cid, ClientPhoneResumeMessage::cid, CS_CALLEE_CONNECTED, CS_CALLEE_INIT, CS_CALLEE_RINGING, CS_CALLEE_SHUTDOWN, CS_CALLER_CALLING, CS_CALLER_CONNECTED, CS_CALLER_SHUTDOWN, destroy_line_cadet_channels(), Channel::env, GNUNET_break, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_NO, GNUNET_YES, Channel::line, Line::mq, Channel::status, and Channel::suspended_remote.

961 {
962  struct Channel *ch = cls;
963  struct Line *line;
964  struct GNUNET_MQ_Envelope *env;
965  struct ClientPhoneResumeMessage *resume;
966 
967  (void) msg;
968  line = ch->line;
970  if (GNUNET_YES != ch->suspended_remote)
971  {
973  "RESUME message received for non-suspended channel, dropping channel.\n");
975  return;
976  }
977  switch (ch->status)
978  {
979  case CS_CALLEE_INIT:
980  GNUNET_break (0);
981  break;
982  case CS_CALLEE_RINGING:
983  GNUNET_break (0);
984  break;
985  case CS_CALLEE_CONNECTED:
987  break;
988  case CS_CALLEE_SHUTDOWN:
989  return;
990  case CS_CALLER_CALLING:
991  GNUNET_break (0);
992  break;
993  case CS_CALLER_CONNECTED:
995  break;
996  case CS_CALLER_SHUTDOWN:
997  return;
998  }
999  env = GNUNET_MQ_msg (resume,
1001  resume->cid = ch->cid;
1002  GNUNET_MQ_send (line->mq,
1003  env);
1004 }
uint32_t cid
CID, internal caller ID to identify which active call we are talking about.
Definition: conversation.h:146
enum ChannelStatus status
Current status of this line.
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
#define GNUNET_NO
Definition: gnunet_common.h:81
struct GNUNET_CADET_Channel * channel
Handle for the channel.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
We&#39;re in shutdown, sending hangup messages before cleaning up.
We are waiting for the phone to be picked up.
struct Line * line
Line associated with the channel.
static char * line
Desired phone line (string to be converted to a hash).
We just got the connection, but no introduction yet.
Our phone is ringing, waiting for the client to pick up.
static void destroy_line_cadet_channels(struct Channel *ch)
Destroy a channel.
A struct Line connects a local client with cadet channels.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME
Client <-> Server message to resume connection.
struct GNUNET_MQ_Handle * mq
Message queue for client.
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
Service <-> Client message for phone was resumed.
Definition: conversation.h:135
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:973
#define GNUNET_log(kind,...)
#define GNUNET_YES
Definition: gnunet_common.h:80
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:353
We&#39;re in shutdown, sending hangup messages before cleaning up.
int8_t suspended_remote
GNUNET_YES if the channel was suspended by the other peer.
uint32_t cid
Channel identifier we use for this call with the client.
Here is the call graph for this function:

◆ check_cadet_audio_message()

static int check_cadet_audio_message ( void *  cls,
const struct CadetAudioMessage msg 
)
static

Function to check an audio message incoming over cadet.

Parameters
clsclosure, our struct Channel *
msgthe incoming message
Returns
GNUNET_OK (always)

Definition at line 1015 of file gnunet-service-conversation.c.

References GNUNET_OK.

1017 {
1018  (void) cls;
1019  (void) msg;
1020  return GNUNET_OK; /* any payload is fine */
1021 }
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78

◆ handle_cadet_audio_message()

static void handle_cadet_audio_message ( void *  cls,
const struct CadetAudioMessage msg 
)
static

Function to handle an audio message incoming over cadet.

Parameters
clsclosure, our struct Channel *
msgthe incoming message

Definition at line 1031 of file gnunet-service-conversation.c.

References ch, Channel::channel, Channel::cid, ClientAudioMessage::cid, Channel::env, GNUNET_CADET_receive_done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_YES, CadetAudioMessage::header, Channel::line, Line::mq, GNUNET_MessageHeader::size, Channel::suspended_local, and Channel::suspended_remote.

1033 {
1034  struct Channel *ch = cls;
1035  size_t msize = ntohs (msg->header.size) - sizeof (struct CadetAudioMessage);
1036  struct GNUNET_MQ_Envelope *env;
1037  struct ClientAudioMessage *cam;
1038 
1040  if ( (GNUNET_YES == ch->suspended_local) ||
1041  (GNUNET_YES == ch->suspended_remote) )
1042  {
1044  "Received %u bytes of AUDIO data on suspended channel CID %u; dropping\n",
1045  (unsigned int) msize,
1046  ch->cid);
1047  return;
1048  }
1050  "Forwarding %u bytes of AUDIO data to client CID %u\n",
1051  (unsigned int) msize,
1052  ch->cid);
1053  env = GNUNET_MQ_msg_extra (cam,
1054  msize,
1056  cam->cid = ch->cid;
1057  GNUNET_memcpy (&cam[1],
1058  &msg[1],
1059  msize);
1060  GNUNET_MQ_send (ch->line->mq,
1061  env);
1062 }
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO.
Definition: conversation.h:386
struct GNUNET_CADET_Channel * channel
Handle for the channel.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO
Client <-> Server message to send audio data.
int8_t suspended_local
GNUNET_YES if the channel was suspended by the local client.
#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:52
#define GNUNET_memcpy(dst, src, n)
struct Line * line
Line associated with the channel.
struct GNUNET_MQ_Handle * mq
Message queue for client.
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
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:973
#define GNUNET_log(kind,...)
Message Client <-> Service to transmit the audio.
Definition: conversation.h:193
#define GNUNET_YES
Definition: gnunet_common.h:80
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:353
int8_t suspended_remote
GNUNET_YES if the channel was suspended by the other peer.
Cadet message to transmit the audio.
Definition: conversation.h:381
uint32_t cid
Channel identifier we use for this call with the client.
uint32_t cid
CID, internal caller ID to identify which active call we are sending data to.
Definition: conversation.h:204
Here is the call graph for this function:

◆ inbound_end()

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

Function called whenever an inbound channel is destroyed.

Should clean up any associated state.

Parameters
clsclosure (set from GNUNET_CADET_connect)
channelconnection to the other end (henceforth invalid)

Definition at line 1073 of file gnunet-service-conversation.c.

References ch, Channel::channel, clean_up_channel(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, and Channel::status.

Referenced by handle_client_call_message(), and handle_client_register_message().

1075 {
1076  struct Channel *ch = cls;
1077 
1078  GNUNET_assert (channel == ch->channel);
1079  ch->channel = NULL;
1081  "Channel destroyed by CADET in state %d\n",
1082  ch->status);
1083  clean_up_channel (ch);
1084 }
enum ChannelStatus status
Current status of this line.
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
struct GNUNET_CADET_Channel * channel
Handle for the channel.
static void clean_up_channel(struct Channel *ch)
Channel went down, notify client and free data structure.
#define GNUNET_log(kind,...)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_client_call_message()

static void handle_client_call_message ( void *  cls,
const struct ClientCallMessage msg 
)
static

Function to handle call request from the client.

Parameters
clsthe struct Line the message is about
msgthe message from the client

Definition at line 1094 of file gnunet-service-conversation.c.

References ClientCallMessage::caller_id, CadetPhoneRingMessage::caller_id, ch, Channel::channel, Line::channel_head, Line::channel_tail, Line::client, CS_CALLER_CALLING, e, CadetPhoneRingInfoPS::expiration_time, CadetPhoneRingMessage::expiration_time, GNUNET_assert, GNUNET_CADET_channel_create(), GNUNET_CADET_get_mq(), GNUNET_CADET_OPTION_RELIABLE, GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_ecdsa_key_get_public(), GNUNET_CRYPTO_ecdsa_sign(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_hd_var_size, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_new, GNUNET_OK, GNUNET_SERVICE_client_continue(), GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING, GNUNET_TIME_absolute_hton(), GNUNET_TIME_relative_to_absolute(), inbound_end(), Channel::line, Line::line_port, ClientCallMessage::line_port, CadetPhoneRingInfoPS::line_port, Channel::mq, GNUNET_CRYPTO_EccSignaturePurpose::purpose, CadetPhoneRingInfoPS::purpose, RING_TIMEOUT, CadetPhoneRingMessage::signature, GNUNET_CRYPTO_EccSignaturePurpose::size, Channel::status, ClientCallMessage::target, and CadetPhoneRingInfoPS::target_peer.

1096 {
1097  struct Line *line = cls;
1098  struct Channel *ch = GNUNET_new (struct Channel);
1099  struct GNUNET_MQ_MessageHandler cadet_handlers[] = {
1100  GNUNET_MQ_hd_fixed_size (cadet_hangup_message,
1102  struct CadetPhoneHangupMessage,
1103  ch),
1104  GNUNET_MQ_hd_fixed_size (cadet_pickup_message,
1106  struct CadetPhonePickupMessage,
1107  ch),
1108  GNUNET_MQ_hd_fixed_size (cadet_suspend_message,
1110  struct CadetPhoneSuspendMessage,
1111  ch),
1112  GNUNET_MQ_hd_fixed_size (cadet_resume_message,
1114  struct CadetPhoneResumeMessage,
1115  ch),
1116  GNUNET_MQ_hd_var_size (cadet_audio_message,
1118  struct CadetAudioMessage,
1119  ch),
1121  };
1122  struct GNUNET_MQ_Envelope *e;
1123  struct CadetPhoneRingMessage *ring;
1124  struct CadetPhoneRingInfoPS rs;
1125 
1126  line->line_port = msg->line_port;
1127  rs.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING);
1128  rs.purpose.size = htonl (sizeof (struct CadetPhoneRingInfoPS));
1129  rs.line_port = line->line_port;
1130  rs.target_peer = msg->target;
1131  rs.expiration_time
1133  ch->line = line;
1135  line->channel_tail,
1136  ch);
1137  ch->status = CS_CALLER_CALLING;
1139  ch,
1140  &msg->target,
1141  &msg->line_port,
1143  NULL,
1144  &inbound_end,
1145  cadet_handlers);
1146  ch->mq = GNUNET_CADET_get_mq (ch->channel);
1147  e = GNUNET_MQ_msg (ring,
1150  &ring->caller_id);
1151  ring->expiration_time = rs.expiration_time;
1154  &rs.purpose,
1155  &ring->signature));
1157  "Sending RING message via CADET\n");
1158  GNUNET_MQ_send (ch->mq,
1159  e);
1161 }
static void inbound_end(void *cls, const struct GNUNET_CADET_Channel *channel)
Function called whenever an inbound channel is destroyed.
static struct GNUNET_CADET_Handle * cadet
Handle for cadet.
enum ChannelStatus status
Current status of this line.
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
Cadet message to make a phone ring.
Definition: conversation.h:296
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
#define RING_TIMEOUT
How long is our signature on a call valid? Needs to be long enough for time zone differences and netw...
struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute(struct GNUNET_TIME_Relative rel)
Convert relative time to an absolute time in the future.
Definition: time.c:245
#define GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING
Signature of a conversation ring.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
Information signed in a struct CadetPhoneRingMessage whereby the caller self-identifies to the receiv...
Definition: conversation.h:267
Enable channel reliability, lost messages will be retransmitted.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO
Cadet: audio data.
struct GNUNET_PeerIdentity target
Which peer is hosting the line?
Definition: conversation.h:229
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND
Cadet: phone suspended.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:67
static struct Experiment * e
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
#define GNUNET_new(type)
Allocate a struct or union of the given type.
struct GNUNET_CADET_Channel * channel
Handle for the channel.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP
Cadet: hang up / refuse call.
struct Channel * channel_tail
This is a DLL.
struct GNUNET_CRYPTO_EcdsaPrivateKey caller_id
Identity of the caller.
Definition: conversation.h:239
struct GNUNET_CRYPTO_EcdsaSignature signature
Signature over a struct CadetPhoneRingInfoPS
Definition: conversation.h:321
We are waiting for the phone to be picked up.
int GNUNET_CRYPTO_ecdsa_sign(const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, struct GNUNET_CRYPTO_EcdsaSignature *sig)
ECDSA Sign a given block.
Definition: crypto_ecc.c:931
struct Line * line
Line associated with the channel.
static char * line
Desired phone line (string to be converted to a hash).
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP
Cadet: pick up phone (establish audio channel)
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME
Cadet: phone resumed.
Message handler for a specific message type.
A struct Line connects a local client with cadet channels.
void GNUNET_CRYPTO_ecdsa_key_get_public(const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Extract the public key for the given private key.
Definition: crypto_ecc.c:241
Cadet message for phone suspended.
Definition: conversation.h:355
struct GNUNET_HashCode line_port
Port number we are listening on (to verify signatures).
struct GNUNET_SERVICE_Client * client
Handle to the line client.
struct GNUNET_HashCode line_port
Which phone line to call at the peer?
Definition: conversation.h:234
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING
Cadet: call initiation.
Cadet message for phone resumed.
Definition: conversation.h:368
struct Channel * channel_head
This is a DLL.
#define GNUNET_log(kind,...)
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:353
Cadet message for hanging up.
Definition: conversation.h:329
struct GNUNET_MQ_Handle * mq
Message queue for control messages.
Cadet message for picking up.
Definition: conversation.h:342
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
Definition: time.c:654
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
Definition: service.c:2533
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
struct GNUNET_TIME_AbsoluteNBO expiration_time
When does the signature expire?
Definition: conversation.h:316
Cadet message to transmit the audio.
Definition: conversation.h:381
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, enum GNUNET_CADET_ChannelOption options, 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:1088
struct GNUNET_CRYPTO_EcdsaPublicKey caller_id
Who is calling us? (also who is signing).
Definition: conversation.h:311
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:1142
Here is the call graph for this function:

◆ inbound_channel()

static void* inbound_channel ( 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.

Parameters
clsthe struct Line receiving a connection
channelnew handle to the channel
initiatorpeer that started the channel
Returns
initial channel context for the channel

Definition at line 1174 of file gnunet-service-conversation.c.

References ch, Channel::channel, Line::channel_head, Line::channel_tail, Channel::cid, Line::cid_gen, CS_CALLEE_INIT, GNUNET_CADET_get_mq(), GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_new, Channel::line, Channel::mq, and Channel::status.

Referenced by handle_client_register_message().

1177 {
1178  struct Line *line = cls;
1179  struct Channel *ch;
1180 
1181  (void) initiator;
1183  "Received incoming cadet channel on line %p\n",
1184  line);
1185  ch = GNUNET_new (struct Channel);
1186  ch->status = CS_CALLEE_INIT;
1187  ch->line = line;
1188  ch->channel = channel;
1189  ch->mq = GNUNET_CADET_get_mq (ch->channel);
1190  ch->cid = line->cid_gen++;
1192  line->channel_tail,
1193  ch);
1194  return ch;
1195 }
enum ChannelStatus status
Current status of this line.
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
#define GNUNET_new(type)
Allocate a struct or union of the given type.
struct GNUNET_CADET_Channel * channel
Handle for the channel.
uint32_t cid_gen
Generator for channel IDs.
struct Channel * channel_tail
This is a DLL.
struct Line * line
Line associated with the channel.
static char * line
Desired phone line (string to be converted to a hash).
We just got the connection, but no introduction yet.
A struct Line connects a local client with cadet channels.
struct Channel * channel_head
This is a DLL.
#define GNUNET_log(kind,...)
struct GNUNET_MQ_Handle * mq
Message queue for control messages.
uint32_t cid
Channel identifier we use for this call with the client.
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:1142
Here is the call graph for this function:
Here is the caller graph for this function:

◆ client_connect_cb()

static void* client_connect_cb ( void *  cls,
struct GNUNET_SERVICE_Client client,
struct GNUNET_MQ_Handle mq 
)
static

A client connected.

Initialize the struct Line data structure.

Parameters
clsclosure, NULL
clientidentification of the client
mqmessage queue for client
Returns
the struct Line for the client

Definition at line 1207 of file gnunet-service-conversation.c.

References Line::client, GNUNET_new, Channel::line, Channel::mq, and Line::mq.

Referenced by run().

1210 {
1211  struct Line *line;
1212 
1213  (void) cls;
1214  line = GNUNET_new (struct Line);
1215  line->client = client;
1216  line->mq = mq;
1217  return line;
1218 }
#define GNUNET_new(type)
Allocate a struct or union of the given type.
static char * line
Desired phone line (string to be converted to a hash).
A struct Line connects a local client with cadet channels.
struct GNUNET_MQ_Handle * mq
Message queue for client.
struct GNUNET_SERVICE_Client * client
Handle to the line client.
struct GNUNET_MQ_Handle * mq
Definition: 003.c:5
Here is the caller graph for this function:

◆ client_disconnect_cb()

static void client_disconnect_cb ( void *  cls,
struct GNUNET_SERVICE_Client client,
void *  app_ctx 
)
static

A client disconnected.

Remove all of its data structure entries.

Parameters
clsclosure, NULL
clientidentification of the client
app_ctxour struct Line * for client

Definition at line 1229 of file gnunet-service-conversation.c.

References ch, Line::channel_head, destroy_line_cadet_channels(), GNUNET_CADET_close_port(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, Channel::line, and Line::port.

Referenced by run().

1232 {
1233  struct Line *line = app_ctx;
1234  struct Channel *chn;
1235 
1236  (void) cls;
1237  (void) client;
1239  "Client disconnected, closing line\n");
1240  if (NULL != line->port)
1241  {
1242  GNUNET_CADET_close_port (line->port);
1243  line->port = NULL;
1244  }
1245  for (struct Channel *ch = line->channel_head; NULL != ch; ch = chn)
1246  {
1247  chn = ch->next;
1248  ch->line = NULL;
1250  }
1251  GNUNET_free (line);
1252 }
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
A struct Channel represents a cadet channel, which is a P2P connection to another conversation servic...
struct GNUNET_CADET_Port * port
Our open port.
static char * line
Desired phone line (string to be converted to a hash).
static void destroy_line_cadet_channels(struct Channel *ch)
Destroy a channel.
A struct Line connects a local client with cadet channels.
struct Channel * channel_head
This is a DLL.
#define GNUNET_log(kind,...)
void GNUNET_CADET_close_port(struct GNUNET_CADET_Port *p)
Close a port opened with GNUNET_CADET_open_port().
Definition: cadet_api.c:882
#define GNUNET_free(ptr)
Wrapper around free.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_client_register_message()

static void handle_client_register_message ( void *  cls,
const struct ClientPhoneRegisterMessage msg 
)
static

Function to register a phone.

Parameters
clsthe struct Line of the client from which the message is
msgthe message from the client

Definition at line 1262 of file gnunet-service-conversation.c.

References _, Line::client, GNUNET_CADET_open_port(), GNUNET_ERROR_TYPE_WARNING, GNUNET_h2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_hd_var_size, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), inbound_channel(), inbound_end(), Channel::line, ClientPhoneRegisterMessage::line_port, Line::line_port, and Line::port.

1264 {
1265  struct Line *line = cls;
1266  struct GNUNET_MQ_MessageHandler cadet_handlers[] = {
1267  GNUNET_MQ_hd_fixed_size (cadet_ring_message,
1269  struct CadetPhoneRingMessage,
1270  NULL),
1271  GNUNET_MQ_hd_fixed_size (cadet_hangup_message,
1273  struct CadetPhoneHangupMessage,
1274  NULL),
1275  GNUNET_MQ_hd_fixed_size (cadet_pickup_message,
1277  struct CadetPhonePickupMessage,
1278  NULL),
1279  GNUNET_MQ_hd_fixed_size (cadet_suspend_message,
1281  struct CadetPhoneSuspendMessage,
1282  NULL),
1283  GNUNET_MQ_hd_fixed_size (cadet_resume_message,
1285  struct CadetPhoneResumeMessage,
1286  NULL),
1287  GNUNET_MQ_hd_var_size (cadet_audio_message,
1289  struct CadetAudioMessage,
1290  NULL),
1292  };
1293 
1294  line->line_port = msg->line_port;
1296  &msg->line_port,
1297  &inbound_channel,
1298  line,
1299  NULL,
1300  &inbound_end,
1301  cadet_handlers);
1302  if (NULL == line->port)
1303  {
1305  _("Could not open line, port %s already in use!\n"),
1306  GNUNET_h2s (&msg->line_port));
1308  return;
1309  }
1311 }
static void inbound_end(void *cls, const struct GNUNET_CADET_Channel *channel)
Function called whenever an inbound channel is destroyed.
static struct GNUNET_CADET_Handle * cadet
Handle for cadet.
Cadet message to make a phone ring.
Definition: conversation.h:296
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO
Cadet: audio data.
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND
Cadet: phone suspended.
struct GNUNET_CADET_Port * port
Our open port.
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP
Cadet: hang up / refuse call.
#define _(String)
GNU gettext support macro.
Definition: platform.h:208
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 incomming MQ-based channels.
Definition: cadet_api.c:1029
static char * line
Desired phone line (string to be converted to a hash).
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP
Cadet: pick up phone (establish audio channel)
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME
Cadet: phone resumed.
void GNUNET_SERVICE_client_drop(struct GNUNET_SERVICE_Client *c)
Ask the server to disconnect from the given client.
Definition: service.c:2618
Message handler for a specific message type.
A struct Line connects a local client with cadet channels.
Cadet message for phone suspended.
Definition: conversation.h:355
struct GNUNET_HashCode line_port
Phone line / CADET port to register.
Definition: conversation.h:85
struct GNUNET_HashCode line_port
Port number we are listening on (to verify signatures).
struct GNUNET_SERVICE_Client * client
Handle to the line client.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING
Cadet: call initiation.
Cadet message for phone resumed.
Definition: conversation.h:368
#define GNUNET_log(kind,...)
static void * inbound_channel(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.
Cadet message for hanging up.
Definition: conversation.h:329
Cadet message for picking up.
Definition: conversation.h:342
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
Definition: service.c:2533
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
Cadet message to transmit the audio.
Definition: conversation.h:381
Here is the call graph for this function:

◆ do_shutdown()

static void do_shutdown ( void *  cls)
static

Shutdown nicely.

Parameters
clsclosure, NULL

Definition at line 1320 of file gnunet-service-conversation.c.

References GNUNET_CADET_disconnect().

Referenced by run().

1321 {
1322  (void) cls;
1323  if (NULL != cadet)
1324  {
1326  cadet = NULL;
1327  }
1328 }
static struct GNUNET_CADET_Handle * cadet
Handle for cadet.
void GNUNET_CADET_disconnect(struct GNUNET_CADET_Handle *handle)
Disconnect from the cadet service.
Definition: cadet_api.c:849
void * cls
Closure for mv and cb.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ run()

static void run ( void *  cls,
const struct GNUNET_CONFIGURATION_Handle c,
struct GNUNET_SERVICE_Handle service 
)
static

Main function that will be run by the scheduler.

Parameters
clsclosure
cconfiguration
serviceservice handle

Definition at line 1339 of file gnunet-service-conversation.c.

References client_connect_cb(), client_disconnect_cb(), do_shutdown(), GNUNET_assert, GNUNET_break, GNUNET_CADET_connect(), GNUNET_CRYPTO_get_peer_identity(), GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME, GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_hd_var_size, GNUNET_OK, GNUNET_SCHEDULER_add_shutdown(), GNUNET_SCHEDULER_shutdown(), GNUNET_SERVICE_MAIN(), GNUNET_SERVICE_OPTION_NONE, and my_identity.

1342 {
1343  (void) cls;
1344  (void) service;
1345  cfg = c;
1348  &my_identity));
1350  if (NULL == cadet)
1351  {
1352  GNUNET_break (0);
1354  return;
1355  }
1357  NULL);
1358 }
static struct GNUNET_CADET_Handle * cadet
Handle for cadet.
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, or when GNUNET_SCHEDULER_shutdown() is being invoked.
Definition: scheduler.c:1293
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
static struct GNUNET_PeerIdentity my_identity
Identity of this peer.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:524
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
struct GNUNET_CADET_Handle * GNUNET_CADET_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the MQ-based cadet service.
Definition: cadet_api.c:995
void * cls
Closure for mv and cb.
static void do_shutdown(void *cls)
Shutdown nicely.
int GNUNET_CRYPTO_get_peer_identity(const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_PeerIdentity *dst)
Retrieve the identity of the host&#39;s peer.
static const struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Here is the call graph for this function:

◆ GNUNET_SERVICE_MAIN()

Define "main" method using service macro.

Referenced by run().

Here is the caller graph for this function:

Variable Documentation

◆ cfg

const struct GNUNET_CONFIGURATION_Handle* cfg
static

Our configuration.

Definition at line 204 of file gnunet-service-conversation.c.

◆ cadet

struct GNUNET_CADET_Handle* cadet
static

Handle for cadet.

Definition at line 209 of file gnunet-service-conversation.c.

Referenced by cadet_disconnect_adapter(), start_test(), and warmup().

◆ my_identity

struct GNUNET_PeerIdentity my_identity
static

Identity of this peer.

Definition at line 214 of file gnunet-service-conversation.c.

Referenced by core_init(), core_startup_cb(), handle_cadet_ring_message(), occ_cache_get_handle_core_cb(), and run().