diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-08-02 00:01:05 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-08-02 00:01:05 +0000 |
commit | 8aa5b2e7fe52ea6bf1682b49a4aeeb58d1d8eb5b (patch) | |
tree | a9a2d60834a326288e86413eb221d72501480b04 /src | |
parent | 54a720ebc76b0b59caca896fd8a7e859f61ded0b (diff) | |
download | gnunet-8aa5b2e7fe52ea6bf1682b49a4aeeb58d1d8eb5b.tar.gz gnunet-8aa5b2e7fe52ea6bf1682b49a4aeeb58d1d8eb5b.zip |
- new channel message types
Diffstat (limited to 'src')
-rw-r--r-- | src/mesh/mesh_api_enc.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mesh/mesh_api_enc.c b/src/mesh/mesh_api_enc.c index e1990c2ee..3401f5d33 100644 --- a/src/mesh/mesh_api_enc.c +++ b/src/mesh/mesh_api_enc.c | |||
@@ -684,10 +684,9 @@ do_reconnect (struct GNUNET_MESH_Handle *h) | |||
684 | GNUNET_TIME_relative_min (GNUNET_TIME_UNIT_SECONDS, | 684 | GNUNET_TIME_relative_min (GNUNET_TIME_UNIT_SECONDS, |
685 | GNUNET_TIME_relative_multiply | 685 | GNUNET_TIME_relative_multiply |
686 | (h->reconnect_time, 2)); | 686 | (h->reconnect_time, 2)); |
687 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 687 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Next retry in %s\n", |
688 | "Next retry in %s\n", | ||
689 | GNUNET_STRINGS_relative_time_to_string (h->reconnect_time, | 688 | GNUNET_STRINGS_relative_time_to_string (h->reconnect_time, |
690 | GNUNET_NO)); | 689 | GNUNET_NO)); |
691 | GNUNET_break (0); | 690 | GNUNET_break (0); |
692 | return GNUNET_NO; | 691 | return GNUNET_NO; |
693 | } | 692 | } |
@@ -710,8 +709,8 @@ do_reconnect (struct GNUNET_MESH_Handle *h) | |||
710 | */ | 709 | */ |
711 | continue; | 710 | continue; |
712 | } | 711 | } |
713 | ch->allow_send = GNUNET_NO; | 712 | ch->allow_send = GNUNET_NO; |
714 | tmsg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_CHANNEL_CREATE); | 713 | tmsg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_CHANNEL_CREATE); |
715 | tmsg.header.size = htons (sizeof (struct GNUNET_MESH_ChannelMessage)); | 714 | tmsg.header.size = htons (sizeof (struct GNUNET_MESH_ChannelMessage)); |
716 | tmsg.channel_id = htonl (ch->chid); | 715 | tmsg.channel_id = htonl (ch->chid); |
717 | tmsg.port = htonl (ch->port); | 716 | tmsg.port = htonl (ch->port); |
@@ -827,7 +826,7 @@ process_channel_created (struct GNUNET_MESH_Handle *h, | |||
827 | 826 | ||
828 | LOG (GNUNET_ERROR_TYPE_DEBUG, "No handler for incoming channels\n"); | 827 | LOG (GNUNET_ERROR_TYPE_DEBUG, "No handler for incoming channels\n"); |
829 | 828 | ||
830 | d_msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_CHANNEL_DESTROY); | 829 | d_msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_CHANNEL_DESTROY); |
831 | d_msg.header.size = htons (sizeof (struct GNUNET_MESH_ChannelMessage)); | 830 | d_msg.header.size = htons (sizeof (struct GNUNET_MESH_ChannelMessage)); |
832 | d_msg.channel_id = msg->channel_id; | 831 | d_msg.channel_id = msg->channel_id; |
833 | memset (&d_msg.peer, 0, sizeof (struct GNUNET_PeerIdentity)); | 832 | memset (&d_msg.peer, 0, sizeof (struct GNUNET_PeerIdentity)); |
@@ -1075,11 +1074,11 @@ msg_received (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1075 | switch (type) | 1074 | switch (type) |
1076 | { | 1075 | { |
1077 | /* Notify of a new incoming channel */ | 1076 | /* Notify of a new incoming channel */ |
1078 | case GNUNET_MESSAGE_TYPE_MESH_LOCAL_CHANNEL_CREATE: | 1077 | case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_CREATE: |
1079 | process_channel_created (h, (struct GNUNET_MESH_ChannelMessage *) msg); | 1078 | process_channel_created (h, (struct GNUNET_MESH_ChannelMessage *) msg); |
1080 | break; | 1079 | break; |
1081 | /* Notify of a channel disconnection */ | 1080 | /* Notify of a channel disconnection */ |
1082 | case GNUNET_MESSAGE_TYPE_MESH_LOCAL_CHANNEL_DESTROY: | 1081 | case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_DESTROY: |
1083 | process_channel_destroy (h, (struct GNUNET_MESH_ChannelMessage *) msg); | 1082 | process_channel_destroy (h, (struct GNUNET_MESH_ChannelMessage *) msg); |
1084 | break; | 1083 | break; |
1085 | /* Notify of a new data packet in the channel */ | 1084 | /* Notify of a new data packet in the channel */ |
@@ -1370,7 +1369,8 @@ GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle) | |||
1370 | switch (ntohs(msg->type)) | 1369 | switch (ntohs(msg->type)) |
1371 | { | 1370 | { |
1372 | case GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT: | 1371 | case GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT: |
1373 | case GNUNET_MESSAGE_TYPE_MESH_LOCAL_CHANNEL_DESTROY: | 1372 | case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_CREATE: |
1373 | case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_DESTROY: | ||
1374 | case GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_CHANNELS: | 1374 | case GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_CHANNELS: |
1375 | case GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_CHANNEL: | 1375 | case GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_CHANNEL: |
1376 | break; | 1376 | break; |
@@ -1435,7 +1435,7 @@ GNUNET_MESH_channel_create (struct GNUNET_MESH_Handle *h, | |||
1435 | LOG (GNUNET_ERROR_TYPE_DEBUG, " number %X\n", ch->chid); | 1435 | LOG (GNUNET_ERROR_TYPE_DEBUG, " number %X\n", ch->chid); |
1436 | ch->ctx = channel_ctx; | 1436 | ch->ctx = channel_ctx; |
1437 | ch->peer = GNUNET_PEER_intern (peer); | 1437 | ch->peer = GNUNET_PEER_intern (peer); |
1438 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_CHANNEL_CREATE); | 1438 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_CHANNEL_CREATE); |
1439 | msg.header.size = htons (sizeof (struct GNUNET_MESH_ChannelMessage)); | 1439 | msg.header.size = htons (sizeof (struct GNUNET_MESH_ChannelMessage)); |
1440 | msg.channel_id = htonl (ch->chid); | 1440 | msg.channel_id = htonl (ch->chid); |
1441 | msg.port = htonl (port); | 1441 | msg.port = htonl (port); |
@@ -1462,7 +1462,7 @@ GNUNET_MESH_channel_destroy (struct GNUNET_MESH_Channel *channel) | |||
1462 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Destroying channel\n"); | 1462 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Destroying channel\n"); |
1463 | h = channel->mesh; | 1463 | h = channel->mesh; |
1464 | 1464 | ||
1465 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_CHANNEL_DESTROY); | 1465 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_CHANNEL_DESTROY); |
1466 | msg.header.size = htons (sizeof (struct GNUNET_MESH_ChannelMessage)); | 1466 | msg.header.size = htons (sizeof (struct GNUNET_MESH_ChannelMessage)); |
1467 | msg.channel_id = htonl (channel->chid); | 1467 | msg.channel_id = htonl (channel->chid); |
1468 | memset (&msg.peer, 0, sizeof (struct GNUNET_PeerIdentity)); | 1468 | memset (&msg.peer, 0, sizeof (struct GNUNET_PeerIdentity)); |