aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-05-07 11:46:27 +0000
committerBart Polot <bart@net.in.tum.de>2013-05-07 11:46:27 +0000
commit0365741f83213f474346d732842a624c00621b8d (patch)
tree204f85823cc8a22e5358bc167124db43fdaaa9cb /src
parentce1f13b0c623d222a080e9745093bd74b98c7b70 (diff)
downloadgnunet-0365741f83213f474346d732842a624c00621b8d.tar.gz
gnunet-0365741f83213f474346d732842a624c00621b8d.zip
- remove more unnecessary code
Diffstat (limited to 'src')
-rw-r--r--src/mesh/mesh2_api.c66
1 files changed, 4 insertions, 62 deletions
diff --git a/src/mesh/mesh2_api.c b/src/mesh/mesh2_api.c
index 2956fecf3..35b408552 100644
--- a/src/mesh/mesh2_api.c
+++ b/src/mesh/mesh2_api.c
@@ -1744,7 +1744,6 @@ GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle)
1744 GNUNET_SCHEDULER_cancel(handle->reconnect_task); 1744 GNUNET_SCHEDULER_cancel(handle->reconnect_task);
1745 handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 1745 handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
1746 } 1746 }
1747 GNUNET_free_non_null (handle->applications);
1748 GNUNET_free (handle); 1747 GNUNET_free (handle);
1749} 1748}
1750 1749
@@ -1798,21 +1797,11 @@ GNUNET_MESH_announce_regex (struct GNUNET_MESH_Handle *h,
1798 } while (len > offset); 1797 } while (len > offset);
1799} 1798}
1800 1799
1801/** 1800
1802 * Create a new tunnel (we're initiator and will be allowed to add/remove peers
1803 * and to broadcast).
1804 *
1805 * @param h mesh handle
1806 * @param tunnel_ctx client's tunnel context to associate with the tunnel
1807 * @param connect_handler function to call when peers are actually connected
1808 * @param disconnect_handler function to call when peers are disconnected
1809 * @param handler_cls closure for connect/disconnect handlers
1810 */
1811struct GNUNET_MESH_Tunnel * 1801struct GNUNET_MESH_Tunnel *
1812GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle *h, void *tunnel_ctx, 1802GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle *h,
1813 GNUNET_MESH_PeerConnectHandler connect_handler, 1803 void *tunnel_ctx,
1814 GNUNET_MESH_PeerDisconnectHandler disconnect_handler, 1804 const struct GNUNET_PeerIdentity *peer)
1815 void *handler_cls)
1816{ 1805{
1817 struct GNUNET_MESH_Tunnel *t; 1806 struct GNUNET_MESH_Tunnel *t;
1818 struct GNUNET_MESH_TunnelMessage msg; 1807 struct GNUNET_MESH_TunnelMessage msg;
@@ -1821,9 +1810,6 @@ GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle *h, void *tunnel_ctx,
1821 t = create_tunnel (h, 0); 1810 t = create_tunnel (h, 0);
1822 LOG (GNUNET_ERROR_TYPE_DEBUG, " at %p\n", t); 1811 LOG (GNUNET_ERROR_TYPE_DEBUG, " at %p\n", t);
1823 LOG (GNUNET_ERROR_TYPE_DEBUG, " number %X\n", t->tid); 1812 LOG (GNUNET_ERROR_TYPE_DEBUG, " number %X\n", t->tid);
1824 t->connect_handler = connect_handler;
1825 t->disconnect_handler = disconnect_handler;
1826 t->cls = handler_cls;
1827 t->ctx = tunnel_ctx; 1813 t->ctx = tunnel_ctx;
1828 msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_CREATE); 1814 msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_CREATE);
1829 msg.header.size = htons (sizeof (struct GNUNET_MESH_TunnelMessage)); 1815 msg.header.size = htons (sizeof (struct GNUNET_MESH_TunnelMessage));
@@ -1874,50 +1860,6 @@ GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tunnel)
1874 send_packet (h, &msg.header, NULL); 1860 send_packet (h, &msg.header, NULL);
1875} 1861}
1876 1862
1877/**
1878 * Request that the tunnel data rate is limited to the speed of the slowest
1879 * receiver.
1880 *
1881 * @param tunnel Tunnel affected.
1882 */
1883void
1884GNUNET_MESH_tunnel_speed_min (struct GNUNET_MESH_Tunnel *tunnel)
1885{
1886 struct GNUNET_MESH_TunnelMessage msg;
1887 struct GNUNET_MESH_Handle *h;
1888
1889 h = tunnel->mesh;
1890 tunnel->speed_min = GNUNET_YES;
1891
1892 msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_MIN);
1893 msg.header.size = htons (sizeof (struct GNUNET_MESH_TunnelMessage));
1894 msg.tunnel_id = htonl (tunnel->tid);
1895
1896 send_packet (h, &msg.header, NULL);
1897}
1898
1899
1900/**
1901 * Request that the tunnel data rate is limited to the speed of the fastest
1902 * receiver. This is the default behavior.
1903 *
1904 * @param tunnel Tunnel affected.
1905 */
1906void
1907GNUNET_MESH_tunnel_speed_max (struct GNUNET_MESH_Tunnel *tunnel)
1908{
1909 struct GNUNET_MESH_TunnelMessage msg;
1910 struct GNUNET_MESH_Handle *h;
1911
1912 h = tunnel->mesh;
1913 tunnel->speed_min = GNUNET_NO;
1914
1915 msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_MAX);
1916 msg.header.size = htons (sizeof (struct GNUNET_MESH_TunnelMessage));
1917 msg.tunnel_id = htonl (tunnel->tid);
1918
1919 send_packet (h, &msg.header, NULL);
1920}
1921 1863
1922/** 1864/**
1923 * Turn on/off the buffering status of the tunnel. 1865 * Turn on/off the buffering status of the tunnel.