aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-07-13 11:50:31 +0000
committerBart Polot <bart@net.in.tum.de>2013-07-13 11:50:31 +0000
commit0e44af8a33393dec3ec7ca13b38bacfa953d5d93 (patch)
tree6a5f45306b460ff9b27f259701885c2614de2855 /src
parenta52ed8e9f53fde3dd97ebd989c20c5729cbba7e1 (diff)
downloadgnunet-0e44af8a33393dec3ec7ca13b38bacfa953d5d93.tar.gz
gnunet-0e44af8a33393dec3ec7ca13b38bacfa953d5d93.zip
- use one tunnelnotification struct
Diffstat (limited to 'src')
-rw-r--r--src/mesh/gnunet-service-mesh.c10
-rw-r--r--src/mesh/mesh.h2
-rw-r--r--src/mesh/mesh_api.c18
3 files changed, 15 insertions, 15 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c
index 936b81ca7..38e1a9dd7 100644
--- a/src/mesh/gnunet-service-mesh.c
+++ b/src/mesh/gnunet-service-mesh.c
@@ -1036,10 +1036,10 @@ send_client_tunnel_create (struct MeshTunnel *t)
1036 msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_CREATE); 1036 msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_CREATE);
1037 msg.tunnel_id = htonl (t->local_tid_dest); 1037 msg.tunnel_id = htonl (t->local_tid_dest);
1038 msg.port = htonl (t->port); 1038 msg.port = htonl (t->port);
1039 msg.options = 0; 1039 msg.opt = 0;
1040 msg.options |= GNUNET_YES == t->reliable ? GNUNET_MESH_OPTION_RELIABLE : 0; 1040 msg.opt |= GNUNET_YES == t->reliable ? GNUNET_MESH_OPTION_RELIABLE : 0;
1041 msg.options |= GNUNET_YES == t->nobuffer ? GNUNET_MESH_OPTION_NOBUFFER : 0; 1041 msg.opt |= GNUNET_YES == t->nobuffer ? GNUNET_MESH_OPTION_NOBUFFER : 0;
1042 msg.options = htonl (msg.options); 1042 msg.opt = htonl (msg.opt);
1043 GNUNET_PEER_resolve (t->id.oid, &msg.peer); 1043 GNUNET_PEER_resolve (t->id.oid, &msg.peer);
1044 GNUNET_SERVER_notification_context_unicast (nc, t->client->handle, 1044 GNUNET_SERVER_notification_context_unicast (nc, t->client->handle,
1045 &msg.header, GNUNET_NO); 1045 &msg.header, GNUNET_NO);
@@ -4836,7 +4836,7 @@ handle_local_tunnel_create (void *cls, struct GNUNET_SERVER_Client *client,
4836 return; 4836 return;
4837 } 4837 }
4838 t->port = ntohl (t_msg->port); 4838 t->port = ntohl (t_msg->port);
4839 tunnel_set_options (t, ntohl (t_msg->options)); 4839 tunnel_set_options (t, ntohl (t_msg->opt));
4840 if (GNUNET_YES == t->reliable) 4840 if (GNUNET_YES == t->reliable)
4841 { 4841 {
4842 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "!!! Reliable\n"); 4842 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "!!! Reliable\n");
diff --git a/src/mesh/mesh.h b/src/mesh/mesh.h
index 0443a9e0b..73bc04d27 100644
--- a/src/mesh/mesh.h
+++ b/src/mesh/mesh.h
@@ -174,7 +174,7 @@ struct GNUNET_MESH_TunnelMessage
174 /** 174 /**
175 * Options. 175 * Options.
176 */ 176 */
177 uint32_t options GNUNET_PACKED; 177 uint32_t opt GNUNET_PACKED;
178}; 178};
179 179
180 180
diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c
index 9085a7799..186961e6c 100644
--- a/src/mesh/mesh_api.c
+++ b/src/mesh/mesh_api.c
@@ -736,7 +736,7 @@ do_reconnect (struct GNUNET_MESH_Handle *h)
736 if (GNUNET_YES == t->reliable) 736 if (GNUNET_YES == t->reliable)
737 options |= GNUNET_MESH_OPTION_RELIABLE; 737 options |= GNUNET_MESH_OPTION_RELIABLE;
738 738
739 tmsg.options = htonl (options); 739 tmsg.opt = htonl (options);
740 send_packet (h, &tmsg.header, t); 740 send_packet (h, &tmsg.header, t);
741 } 741 }
742 return GNUNET_YES; 742 return GNUNET_YES;
@@ -791,7 +791,7 @@ reconnect (struct GNUNET_MESH_Handle *h)
791 */ 791 */
792static void 792static void
793process_tunnel_created (struct GNUNET_MESH_Handle *h, 793process_tunnel_created (struct GNUNET_MESH_Handle *h,
794 const struct GNUNET_MESH_TunnelNotification *msg) 794 const struct GNUNET_MESH_TunnelMessage *msg)
795{ 795{
796 struct GNUNET_MESH_Tunnel *t; 796 struct GNUNET_MESH_Tunnel *t;
797 MESH_TunnelNumber tid; 797 MESH_TunnelNumber tid;
@@ -834,7 +834,7 @@ process_tunnel_created (struct GNUNET_MESH_Handle *h,
834 d_msg.tunnel_id = msg->tunnel_id; 834 d_msg.tunnel_id = msg->tunnel_id;
835 memset (&d_msg.peer, 0, sizeof (struct GNUNET_PeerIdentity)); 835 memset (&d_msg.peer, 0, sizeof (struct GNUNET_PeerIdentity));
836 d_msg.port = 0; 836 d_msg.port = 0;
837 d_msg.options = 0; 837 d_msg.opt = 0;
838 838
839 send_packet (h, &d_msg.header, NULL); 839 send_packet (h, &d_msg.header, NULL);
840 } 840 }
@@ -1076,7 +1076,7 @@ msg_received (void *cls, const struct GNUNET_MessageHeader *msg)
1076 { 1076 {
1077 /* Notify of a new incoming tunnel */ 1077 /* Notify of a new incoming tunnel */
1078 case GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_CREATE: 1078 case GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_CREATE:
1079 process_tunnel_created (h, (struct GNUNET_MESH_TunnelNotification *) msg); 1079 process_tunnel_created (h, (struct GNUNET_MESH_TunnelMessage *) msg);
1080 break; 1080 break;
1081 /* Notify of a tunnel disconnection */ 1081 /* Notify of a tunnel disconnection */
1082 case GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_DESTROY: 1082 case GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_DESTROY:
@@ -1426,12 +1426,12 @@ GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle *h,
1426 msg.tunnel_id = htonl (t->tid); 1426 msg.tunnel_id = htonl (t->tid);
1427 msg.port = htonl (port); 1427 msg.port = htonl (port);
1428 msg.peer = *peer; 1428 msg.peer = *peer;
1429 msg.options = 0; 1429 msg.opt = 0;
1430 if (GNUNET_YES == reliable) 1430 if (GNUNET_YES == reliable)
1431 msg.options |= GNUNET_MESH_OPTION_RELIABLE; 1431 msg.opt |= GNUNET_MESH_OPTION_RELIABLE;
1432 if (GNUNET_NO == buffer) 1432 if (GNUNET_NO == buffer)
1433 msg.options |= GNUNET_MESH_OPTION_NOBUFFER; 1433 msg.opt |= GNUNET_MESH_OPTION_NOBUFFER;
1434 msg.options = htonl (msg.options); 1434 msg.opt = htonl (msg.opt);
1435 t->allow_send = 0; 1435 t->allow_send = 0;
1436 send_packet (h, &msg.header, t); 1436 send_packet (h, &msg.header, t);
1437 return t; 1437 return t;
@@ -1453,7 +1453,7 @@ GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tunnel)
1453 msg.tunnel_id = htonl (tunnel->tid); 1453 msg.tunnel_id = htonl (tunnel->tid);
1454 memset (&msg.peer, 0, sizeof (struct GNUNET_PeerIdentity)); 1454 memset (&msg.peer, 0, sizeof (struct GNUNET_PeerIdentity));
1455 msg.port = 0; 1455 msg.port = 0;
1456 msg.options = 0; 1456 msg.opt = 0;
1457 th = h->th_head; 1457 th = h->th_head;
1458 while (th != NULL) 1458 while (th != NULL)
1459 { 1459 {