diff options
author | Philipp Tölke <toelke@in.tum.de> | 2011-07-27 07:28:18 +0000 |
---|---|---|
committer | Philipp Tölke <toelke@in.tum.de> | 2011-07-27 07:28:18 +0000 |
commit | e8fac5ff0ff5dece01bdfd51a57a2af7b4117d52 (patch) | |
tree | 19a68ad459c01ef59dd77c9dc28cdc2bd371d65c /src/mesh/mesh_api.c | |
parent | 98760f1bfe7a96e87f762c6948825f12ab9bb736 (diff) | |
download | gnunet-e8fac5ff0ff5dece01bdfd51a57a2af7b4117d52.tar.gz gnunet-e8fac5ff0ff5dece01bdfd51a57a2af7b4117d52.zip |
queue transmits to tunnels
Diffstat (limited to 'src/mesh/mesh_api.c')
-rw-r--r-- | src/mesh/mesh_api.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c index fc22cbeb4..445c74388 100644 --- a/src/mesh/mesh_api.c +++ b/src/mesh/mesh_api.c | |||
@@ -77,6 +77,13 @@ struct GNUNET_MESH_Tunnel | |||
77 | 77 | ||
78 | /* The context of the receive-function. */ | 78 | /* The context of the receive-function. */ |
79 | void *ctx; | 79 | void *ctx; |
80 | |||
81 | /* A list, usable by application-code (for queues) */ | ||
82 | void* app_head; | ||
83 | void* app_tail; | ||
84 | |||
85 | /* A pointer, usable by application-code */ | ||
86 | void* app_data; | ||
80 | }; | 87 | }; |
81 | 88 | ||
82 | struct tunnel_list_element | 89 | struct tunnel_list_element |
@@ -699,6 +706,43 @@ GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle | |||
699 | *) th); | 706 | *) th); |
700 | } | 707 | } |
701 | 708 | ||
709 | void | ||
710 | GNUNET_MESH_tunnel_set_head (struct GNUNET_MESH_Tunnel *tunnel, void *head) | ||
711 | { | ||
712 | tunnel->app_head = head; | ||
713 | } | ||
714 | |||
715 | void | ||
716 | GNUNET_MESH_tunnel_set_tail (struct GNUNET_MESH_Tunnel *tunnel, void *tail) | ||
717 | { | ||
718 | tunnel->app_tail = tail; | ||
719 | } | ||
720 | |||
721 | void * | ||
722 | GNUNET_MESH_tunnel_get_head (struct GNUNET_MESH_Tunnel *tunnel) | ||
723 | { | ||
724 | return tunnel->app_head; | ||
725 | } | ||
726 | |||
727 | void * | ||
728 | GNUNET_MESH_tunnel_get_tail (struct GNUNET_MESH_Tunnel *tunnel) | ||
729 | { | ||
730 | return tunnel->app_head; | ||
731 | } | ||
732 | |||
733 | void | ||
734 | GNUNET_MESH_tunnel_set_data (struct GNUNET_MESH_Tunnel *tunnel, void *data) | ||
735 | { | ||
736 | tunnel->app_data = data; | ||
737 | } | ||
738 | |||
739 | void * | ||
740 | GNUNET_MESH_tunnel_get_data (struct GNUNET_MESH_Tunnel *tunnel) | ||
741 | { | ||
742 | return tunnel->app_data; | ||
743 | } | ||
744 | |||
745 | |||
702 | void build_hello_message(struct GNUNET_MESH_Handle* handle, | 746 | void build_hello_message(struct GNUNET_MESH_Handle* handle, |
703 | const GNUNET_MESH_ApplicationType *stypes) | 747 | const GNUNET_MESH_ApplicationType *stypes) |
704 | { | 748 | { |