aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_local.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet/gnunet-service-cadet_local.c')
-rw-r--r--src/cadet/gnunet-service-cadet_local.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/cadet/gnunet-service-cadet_local.c b/src/cadet/gnunet-service-cadet_local.c
index 96596ce68..9a36aae86 100644
--- a/src/cadet/gnunet-service-cadet_local.c
+++ b/src/cadet/gnunet-service-cadet_local.c
@@ -216,9 +216,9 @@ channel_destroy_iterator (void *cls,
216 216
217 LOG (GNUNET_ERROR_TYPE_DEBUG, 217 LOG (GNUNET_ERROR_TYPE_DEBUG,
218 " Channel %s destroy, due to client %s shutdown.\n", 218 " Channel %s destroy, due to client %s shutdown.\n",
219 GMCH_2s (ch), GML_2s (c)); 219 GCCH_2s (ch), GML_2s (c));
220 220
221 GMCH_handle_local_destroy (ch, c, key < GNUNET_CADET_LOCAL_CHANNEL_ID_SERV); 221 GCCH_handle_local_destroy (ch, c, key < GNUNET_CADET_LOCAL_CHANNEL_ID_SERV);
222 return GNUNET_OK; 222 return GNUNET_OK;
223} 223}
224 224
@@ -383,7 +383,7 @@ handle_channel_create (void *cls, struct GNUNET_SERVER_Client *client,
383 } 383 }
384 384
385 if (GNUNET_OK != 385 if (GNUNET_OK !=
386 GMCH_handle_local_create (c, 386 GCCH_handle_local_create (c,
387 (struct GNUNET_CADET_ChannelMessage *) message)) 387 (struct GNUNET_CADET_ChannelMessage *) message))
388 { 388 {
389 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 389 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
@@ -446,7 +446,7 @@ handle_channel_destroy (void *cls, struct GNUNET_SERVER_Client *client,
446 return; 446 return;
447 } 447 }
448 448
449 GMCH_handle_local_destroy (ch, c, chid < GNUNET_CADET_LOCAL_CHANNEL_ID_SERV); 449 GCCH_handle_local_destroy (ch, c, chid < GNUNET_CADET_LOCAL_CHANNEL_ID_SERV);
450 450
451 GNUNET_SERVER_receive_done (client, GNUNET_OK); 451 GNUNET_SERVER_receive_done (client, GNUNET_OK);
452 return; 452 return;
@@ -508,7 +508,7 @@ handle_data (void *cls, struct GNUNET_SERVER_Client *client,
508 } 508 }
509 509
510 if (GNUNET_OK != 510 if (GNUNET_OK !=
511 GMCH_handle_local_data (ch, c, 511 GCCH_handle_local_data (ch, c,
512 (struct GNUNET_MessageHeader *)&msg[1], fwd)) 512 (struct GNUNET_MessageHeader *)&msg[1], fwd))
513 { 513 {
514 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 514 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
@@ -573,7 +573,7 @@ handle_ack (void *cls, struct GNUNET_SERVER_Client *client,
573 /* If client is dest, the ACK is going BCK, therefore this is "FWD ACK" */ 573 /* If client is dest, the ACK is going BCK, therefore this is "FWD ACK" */
574 fwd = chid >= GNUNET_CADET_LOCAL_CHANNEL_ID_SERV; 574 fwd = chid >= GNUNET_CADET_LOCAL_CHANNEL_ID_SERV;
575 575
576 GMCH_handle_local_ack (ch, fwd); 576 GCCH_handle_local_ack (ch, fwd);
577 GNUNET_SERVER_receive_done (client, GNUNET_OK); 577 GNUNET_SERVER_receive_done (client, GNUNET_OK);
578 578
579 return; 579 return;
@@ -602,8 +602,8 @@ get_all_peers_iterator (void *cls,
602 msg.header.size = htons (sizeof (msg)); 602 msg.header.size = htons (sizeof (msg));
603 msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS); 603 msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS);
604 msg.destination = *peer; 604 msg.destination = *peer;
605 msg.paths = htons (GMP_count_paths (p)); 605 msg.paths = htons (GCP_count_paths (p));
606 msg.tunnel = htons (NULL != GMP_get_tunnel (p)); 606 msg.tunnel = htons (NULL != GCP_get_tunnel (p));
607 607
608 LOG (GNUNET_ERROR_TYPE_DEBUG, "sending info about peer %s\n", 608 LOG (GNUNET_ERROR_TYPE_DEBUG, "sending info about peer %s\n",
609 GNUNET_i2s (peer)); 609 GNUNET_i2s (peer));
@@ -640,7 +640,7 @@ handle_get_peers (void *cls, struct GNUNET_SERVER_Client *client,
640 "Received get peers request from client %u (%p)\n", 640 "Received get peers request from client %u (%p)\n",
641 c->id, client); 641 c->id, client);
642 642
643 GMP_iterate_all (get_all_peers_iterator, client); 643 GCP_iterate_all (get_all_peers_iterator, client);
644 reply.size = htons (sizeof (reply)); 644 reply.size = htons (sizeof (reply));
645 reply.type = htons (GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS); 645 reply.type = htons (GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS);
646 GNUNET_SERVER_notification_context_unicast (nc, client, &reply, GNUNET_NO); 646 GNUNET_SERVER_notification_context_unicast (nc, client, &reply, GNUNET_NO);
@@ -672,10 +672,10 @@ get_all_tunnels_iterator (void *cls,
672 msg.header.size = htons (sizeof (msg)); 672 msg.header.size = htons (sizeof (msg));
673 msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNELS); 673 msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNELS);
674 msg.destination = *peer; 674 msg.destination = *peer;
675 msg.channels = htonl (GMT_count_channels (t)); 675 msg.channels = htonl (GCT_count_channels (t));
676 msg.connections = htonl (GMT_count_connections (t)); 676 msg.connections = htonl (GCT_count_connections (t));
677 msg.cstate = htons ((uint16_t) GMT_get_cstate (t)); 677 msg.cstate = htons ((uint16_t) GCT_get_cstate (t));
678 msg.estate = htons ((uint16_t) GMT_get_estate (t)); 678 msg.estate = htons ((uint16_t) GCT_get_estate (t));
679 679
680 LOG (GNUNET_ERROR_TYPE_DEBUG, "sending info about tunnel ->%s\n", 680 LOG (GNUNET_ERROR_TYPE_DEBUG, "sending info about tunnel ->%s\n",
681 GNUNET_i2s (peer)); 681 GNUNET_i2s (peer));
@@ -712,7 +712,7 @@ handle_get_tunnels (void *cls, struct GNUNET_SERVER_Client *client,
712 "Received get tunnels request from client %u (%p)\n", 712 "Received get tunnels request from client %u (%p)\n",
713 c->id, client); 713 c->id, client);
714 714
715 GMT_iterate_all (get_all_tunnels_iterator, client); 715 GCT_iterate_all (get_all_tunnels_iterator, client);
716 reply.size = htons (sizeof (reply)); 716 reply.size = htons (sizeof (reply));
717 reply.type = htons (GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNELS); 717 reply.type = htons (GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNELS);
718 GNUNET_SERVER_notification_context_unicast (nc, client, &reply, GNUNET_NO); 718 GNUNET_SERVER_notification_context_unicast (nc, client, &reply, GNUNET_NO);
@@ -729,7 +729,7 @@ iter_connection (void *cls, struct CadetConnection *c)
729 struct GNUNET_CADET_LocalInfoTunnel *msg = cls; 729 struct GNUNET_CADET_LocalInfoTunnel *msg = cls;
730 struct GNUNET_CADET_Hash *h = (struct GNUNET_CADET_Hash *) &msg[1]; 730 struct GNUNET_CADET_Hash *h = (struct GNUNET_CADET_Hash *) &msg[1];
731 731
732 h[msg->connections] = *(GMC_get_id (c)); 732 h[msg->connections] = *(GCC_get_id (c));
733 msg->connections++; 733 msg->connections++;
734} 734}
735 735
@@ -740,7 +740,7 @@ iter_channel (void *cls, struct CadetChannel *ch)
740 struct GNUNET_HashCode *h = (struct GNUNET_HashCode *) &msg[1]; 740 struct GNUNET_HashCode *h = (struct GNUNET_HashCode *) &msg[1];
741 CADET_ChannelNumber *chn = (CADET_ChannelNumber *) &h[msg->connections]; 741 CADET_ChannelNumber *chn = (CADET_ChannelNumber *) &h[msg->connections];
742 742
743 chn[msg->channels] = GMCH_get_id (ch); 743 chn[msg->channels] = GCCH_get_id (ch);
744 msg->channels++; 744 msg->channels++;
745} 745}
746 746
@@ -777,7 +777,7 @@ handle_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client,
777 "Received tunnel info request from client %u for tunnel %s\n", 777 "Received tunnel info request from client %u for tunnel %s\n",
778 c->id, GNUNET_i2s_full(&msg->peer)); 778 c->id, GNUNET_i2s_full(&msg->peer));
779 779
780 t = GMP_get_tunnel (GMP_get (&msg->peer)); 780 t = GCP_get_tunnel (GCP_get (&msg->peer));
781 if (NULL == t) 781 if (NULL == t)
782 { 782 {
783 /* We don't know the tunnel */ 783 /* We don't know the tunnel */
@@ -801,8 +801,8 @@ handle_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client,
801 } 801 }
802 802
803 /* Initialize context */ 803 /* Initialize context */
804 ch_n = GMT_count_channels (t); 804 ch_n = GCT_count_channels (t);
805 c_n = GMT_count_connections (t); 805 c_n = GCT_count_connections (t);
806 806
807 size = sizeof (struct GNUNET_CADET_LocalInfoTunnel); 807 size = sizeof (struct GNUNET_CADET_LocalInfoTunnel);
808 size += c_n * sizeof (struct GNUNET_CADET_Hash); 808 size += c_n * sizeof (struct GNUNET_CADET_Hash);
@@ -811,14 +811,14 @@ handle_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client,
811 resp = GNUNET_malloc (size); 811 resp = GNUNET_malloc (size);
812 resp->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNEL); 812 resp->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNEL);
813 resp->header.size = htons (size); 813 resp->header.size = htons (size);
814 GMT_iterate_connections (t, &iter_connection, resp); 814 GCT_iterate_connections (t, &iter_connection, resp);
815 GMT_iterate_channels (t, &iter_channel, resp); 815 GCT_iterate_channels (t, &iter_channel, resp);
816 /* Do not interleave with iterators, iter_channel needs conn in HBO */ 816 /* Do not interleave with iterators, iter_channel needs conn in HBO */
817 resp->destination = msg->peer; 817 resp->destination = msg->peer;
818 resp->connections = htonl (resp->connections); 818 resp->connections = htonl (resp->connections);
819 resp->channels = htonl (resp->channels); 819 resp->channels = htonl (resp->channels);
820 resp->cstate = htons (GMT_get_cstate (t)); 820 resp->cstate = htons (GCT_get_cstate (t));
821 resp->estate = htons (GMT_get_estate (t)); 821 resp->estate = htons (GCT_get_estate (t));
822 GNUNET_SERVER_notification_context_unicast (nc, c->handle, 822 GNUNET_SERVER_notification_context_unicast (nc, c->handle,
823 &resp->header, GNUNET_NO); 823 &resp->header, GNUNET_NO);
824 GNUNET_free (resp); 824 GNUNET_free (resp);