/**
* Message for a client to create channels.
*/
-struct GNUNET_CADET_TunnelCreateMessage
+struct GNUNET_CADET_LocalChannelCreateMessage
{
/**
- * Type: #GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_CREATE
+ * Type: #GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE
*
* Size: sizeof(struct GNUNET_CADET_ChannelOpenMessageMessage)
*/
/**
* Message for or to a client to destroy tunnel.
*/
-struct GNUNET_CADET_TunnelDestroyMessage
+struct GNUNET_CADET_LocalChannelDestroyMessage
{
/**
- * Type: #GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_DESTROY
+ * Type: #GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY
*/
struct GNUNET_MessageHeader header;
*/
static void
handle_channel_created (void *cls,
- const struct GNUNET_CADET_TunnelCreateMessage *msg)
+ const struct GNUNET_CADET_LocalChannelCreateMessage *msg)
{
struct GNUNET_CADET_Handle *h = cls;
struct GNUNET_CADET_Channel *ch;
}
else
{
- struct GNUNET_CADET_TunnelDestroyMessage *d_msg;
+ struct GNUNET_CADET_LocalChannelDestroyMessage *d_msg;
struct GNUNET_MQ_Envelope *env;
LOG (GNUNET_ERROR_TYPE_DEBUG, "No handler for incoming channels\n");
env = GNUNET_MQ_msg (d_msg,
- GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_DESTROY);
+ GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY);
d_msg->channel_id = msg->channel_id;
GNUNET_MQ_send (h->mq, env);
}
*/
static void
handle_channel_destroy (void *cls,
- const struct GNUNET_CADET_TunnelDestroyMessage *msg)
+ const struct GNUNET_CADET_LocalChannelDestroyMessage *msg)
{
struct GNUNET_CADET_Handle *h = cls;
struct GNUNET_CADET_Channel *ch;
{
struct GNUNET_MQ_MessageHandler handlers[] = {
GNUNET_MQ_hd_fixed_size (channel_created,
- GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_CREATE,
- struct GNUNET_CADET_TunnelCreateMessage,
+ GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE,
+ struct GNUNET_CADET_LocalChannelCreateMessage,
h),
GNUNET_MQ_hd_fixed_size (channel_destroy,
- GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_DESTROY,
- struct GNUNET_CADET_TunnelDestroyMessage,
+ GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY,
+ struct GNUNET_CADET_LocalChannelDestroyMessage,
h),
GNUNET_MQ_hd_var_size (local_data,
GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA,
const struct GNUNET_HashCode *port,
enum GNUNET_CADET_ChannelOption options)
{
- struct GNUNET_CADET_TunnelCreateMessage *msg;
+ struct GNUNET_CADET_LocalChannelCreateMessage *msg;
struct GNUNET_MQ_Envelope *env;
struct GNUNET_CADET_Channel *ch;
struct GNUNET_CADET_ClientChannelNumber chid;
ch->ctx = channel_ctx;
ch->peer = GNUNET_PEER_intern (peer);
- env = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_CREATE);
+ env = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE);
msg->channel_id = ch->chid;
msg->port = *port;
msg->peer = *peer;
GNUNET_CADET_channel_destroy (struct GNUNET_CADET_Channel *channel)
{
struct GNUNET_CADET_Handle *h;
- struct GNUNET_CADET_TunnelDestroyMessage *msg;
+ struct GNUNET_CADET_LocalChannelDestroyMessage *msg;
struct GNUNET_MQ_Envelope *env;
struct GNUNET_CADET_TransmitHandle *th;
struct GNUNET_CADET_TransmitHandle *next;
}
env = GNUNET_MQ_msg (msg,
- GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_DESTROY);
+ GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY);
msg->channel_id = channel->chid;
GNUNET_MQ_send (h->mq, env);
uint32_t options)
{
struct GNUNET_MQ_Envelope *env;
- struct GNUNET_CADET_TunnelCreateMessage *msg;
+ struct GNUNET_CADET_LocalChannelCreateMessage *msg;
struct GNUNET_CADET_ClientChannelNumber lid;
lid = client_get_next_lid (c);
/* notify local client about incoming connection! */
env = GNUNET_MQ_msg (msg,
- GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_CREATE);
+ GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE);
msg->channel_id = lid;
msg->port = *port;
msg->opt = htonl (options);
*/
static void
handle_tunnel_create (void *cls,
- const struct GNUNET_CADET_TunnelCreateMessage *tcm)
+ const struct GNUNET_CADET_LocalChannelCreateMessage *tcm)
{
struct CadetClient *c = cls;
struct CadetChannel *ch;
*/
static void
handle_tunnel_destroy (void *cls,
- const struct GNUNET_CADET_TunnelDestroyMessage *msg)
+ const struct GNUNET_CADET_LocalChannelDestroyMessage *msg)
{
struct CadetClient *c = cls;
struct GNUNET_CADET_ClientChannelNumber chid;
struct GNUNET_CADET_PortMessage,
NULL),
GNUNET_MQ_hd_fixed_size (tunnel_create,
- GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_CREATE,
- struct GNUNET_CADET_TunnelCreateMessage,
+ GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE,
+ struct GNUNET_CADET_LocalChannelCreateMessage,
NULL),
GNUNET_MQ_hd_fixed_size (tunnel_destroy,
- GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_DESTROY,
- struct GNUNET_CADET_TunnelDestroyMessage,
+ GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY,
+ struct GNUNET_CADET_LocalChannelDestroyMessage,
NULL),
GNUNET_MQ_hd_var_size (data,
GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA,
struct CadetClient *c)
{
struct GNUNET_MQ_Envelope *env;
- struct GNUNET_CADET_TunnelCreateMessage *tcm;
+ struct GNUNET_CADET_LocalChannelCreateMessage *tcm;
uint32_t options;
if (NULL != ch->retry_task)
ch);
/* give client it's initial supply of ACKs */
env = GNUNET_MQ_msg (tcm,
- GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_CREATE);
+ GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE);
tcm->channel_id = ch->lid;
tcm->peer = *GCP_get_id (GCT_get_destination (ch->t));
tcm->port = ch->port;
GCCH_handle_remote_destroy (struct CadetChannel *ch)
{
struct GNUNET_MQ_Envelope *env;
- struct GNUNET_CADET_TunnelDestroyMessage *tdm;
+ struct GNUNET_CADET_LocalChannelDestroyMessage *tdm;
ch->destroy = GNUNET_YES;
env = GNUNET_MQ_msg (tdm,
- GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_DESTROY);
+ GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY);
tdm->channel_id = ch->lid;
GSC_send_to_client ((NULL != ch->owner) ? ch->owner : ch->dest,
env);
*/
int
GCCH_handle_local_create (struct CadetClient *c,
- struct GNUNET_CADET_TunnelCreateMessage *msg)
+ struct GNUNET_CADET_LocalChannelCreateMessage *msg)
{
struct CadetChannel *ch;
struct CadetTunnel *t;
*/
int
GCCH_handle_local_create (struct CadetClient *c,
- struct GNUNET_CADET_TunnelCreateMessage *msg);
+ struct GNUNET_CADET_LocalChannelCreateMessage *msg);
/**
* Handler for cadet network payload traffic.
LOG (GNUNET_ERROR_TYPE_DEBUG, " by client %u\n", c->id);
/* Message size sanity check */
- if (sizeof (struct GNUNET_CADET_TunnelCreateMessage)
+ if (sizeof (struct GNUNET_CADET_LocalChannelCreateMessage)
!= ntohs (message->size))
{
GNUNET_break (0);
if (GNUNET_OK !=
GCCH_handle_local_create (c,
- (struct GNUNET_CADET_TunnelCreateMessage *)
+ (struct GNUNET_CADET_LocalChannelCreateMessage *)
message))
{
GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
handle_channel_destroy (void *cls, struct GNUNET_SERVER_Client *client,
const struct GNUNET_MessageHeader *message)
{
- const struct GNUNET_CADET_TunnelDestroyMessage *msg;
+ const struct GNUNET_CADET_LocalChannelDestroyMessage *msg;
struct CadetClient *c;
struct CadetChannel *ch;
struct GNUNET_CADET_ClientChannelNumber chid;
LOG (GNUNET_ERROR_TYPE_DEBUG, " by client %u\n", c->id);
/* Message sanity check */
- if (sizeof (struct GNUNET_CADET_TunnelDestroyMessage)
+ if (sizeof (struct GNUNET_CADET_LocalChannelDestroyMessage)
!= ntohs (message->size))
{
GNUNET_break (0);
return;
}
- msg = (const struct GNUNET_CADET_TunnelDestroyMessage *) message;
+ msg = (const struct GNUNET_CADET_LocalChannelDestroyMessage *) message;
/* Retrieve tunnel */
chid = msg->channel_id;
sizeof (struct GNUNET_CADET_PortMessage)},
{&handle_port_close, NULL, GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE,
sizeof (struct GNUNET_CADET_PortMessage)},
- {&handle_channel_create, NULL, GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_CREATE,
- sizeof (struct GNUNET_CADET_TunnelCreateMessage)},
- {&handle_channel_destroy, NULL, GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_DESTROY,
- sizeof (struct GNUNET_CADET_TunnelDestroyMessage)},
+ {&handle_channel_create, NULL, GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE,
+ sizeof (struct GNUNET_CADET_LocalChannelCreateMessage)},
+ {&handle_channel_destroy, NULL, GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY,
+ sizeof (struct GNUNET_CADET_LocalChannelDestroyMessage)},
{&handle_data, NULL, GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA, 0},
{&handle_ack, NULL, GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK,
sizeof (struct GNUNET_CADET_LocalAck)},
uint32_t opt,
const struct GNUNET_PeerIdentity *peer)
{
- struct GNUNET_CADET_TunnelCreateMessage msg;
+ struct GNUNET_CADET_LocalChannelCreateMessage msg;
msg.header.size = htons (sizeof (msg));
- msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_CREATE);
+ msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE);
msg.channel_id = id;
msg.port = *port;
msg.opt = htonl (opt);
GML_send_channel_destroy (struct CadetClient *c,
struct GNUNET_CADET_ClientChannelNumber id)
{
- struct GNUNET_CADET_TunnelDestroyMessage msg;
+ struct GNUNET_CADET_LocalChannelDestroyMessage msg;
if (NULL == c)
{
if (GNUNET_YES == c->shutting_down)
return;
msg.header.size = htons (sizeof (msg));
- msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_DESTROY);
+ msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY);
msg.channel_id = id;
GNUNET_SERVER_notification_context_unicast (nc, c->handle,
&msg.header, GNUNET_NO);
/**
* Ask the cadet service to create a new channel.
*/
-#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_CREATE 1024
+#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE 1024
/**
* Tell client that a channel was destroyed.
*/
-#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_DESTROY 1025
+#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY 1025
/********************************** Monitor *********************************/