aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/cadet_api_get_channel.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-01-26 21:18:06 +0100
committerChristian Grothoff <christian@grothoff.org>2019-01-26 21:18:06 +0100
commit8f884f001a70fee622fff0c0ac8c38a0634df789 (patch)
treecd8b0c45ab3209d73db6396dc2956cf569625b54 /src/cadet/cadet_api_get_channel.c
parent7fc78674a6d3f2edb41e32cea59200908d0b344b (diff)
downloadgnunet-8f884f001a70fee622fff0c0ac8c38a0634df789.tar.gz
gnunet-8f884f001a70fee622fff0c0ac8c38a0634df789.zip
more work on 5385
Diffstat (limited to 'src/cadet/cadet_api_get_channel.c')
-rw-r--r--src/cadet/cadet_api_get_channel.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/src/cadet/cadet_api_get_channel.c b/src/cadet/cadet_api_get_channel.c
index c36766a3f..cd90f5b78 100644
--- a/src/cadet/cadet_api_get_channel.c
+++ b/src/cadet/cadet_api_get_channel.c
@@ -48,28 +48,40 @@ struct GNUNET_CADET_ChannelMonitor
48 */ 48 */
49 void *channel_cb_cls; 49 void *channel_cb_cls;
50 50
51 const struct GNUNET_CONFIGURATION_Handle *cfg;
52
53 struct GNUNET_MQ_Handle *mq;
54
55 struct GNUNET_PeerIdentity peer;
56
57 uint32_t /* UGH */ channel_number;
58
51}; 59};
52 60
53 61
54/** 62
55 * Send message of @a type to CADET service of @a h
56 *
57 * @param h handle to CADET service
58 * @param type message type of trivial information request to send
59 */
60static void 63static void
61send_info_request (struct GNUNET_CADET_Handle *h, 64reconnect (void *cls)
62 uint16_t type)
63{ 65{
66 struct GNUNET_CADET_ChannelMonitor *cm = cls;
67 struct GNUNET_MQ_MessageHandler *handlers[] = {
68 }
64 struct GNUNET_MessageHeader *msg; 69 struct GNUNET_MessageHeader *msg;
65 struct GNUNET_MQ_Envelope *env; 70 struct GNUNET_MQ_Envelope *env;
66 71
72 cm->mq = GNUNET_CLIENT_connect (cm->cfg,
73 "cadet",
74 handlers,
75 &error_handler,
76 cm);
77
67 env = GNUNET_MQ_msg (msg, 78 env = GNUNET_MQ_msg (msg,
68 type); 79 type);
69 GNUNET_MQ_send (h->mq, 80 GNUNET_MQ_send (cm->mq,
70 env); 81 env);
71} 82}
72 83
84
73/** 85/**
74 * Request information about a specific channel of the running cadet peer. 86 * Request information about a specific channel of the running cadet peer.
75 * 87 *
@@ -82,7 +94,7 @@ send_info_request (struct GNUNET_CADET_Handle *h,
82 * @param callback_cls Closure for @c callback. 94 * @param callback_cls Closure for @c callback.
83 */ 95 */
84struct GNUNET_CADET_ChannelMonitor * 96struct GNUNET_CADET_ChannelMonitor *
85GNUNET_CADET_get_channel (struct GNUNET_CADET_Handle *h, 97GNUNET_CADET_get_channel (const struct GNUNET_CONFIGURATION_Handle *cfg,
86 struct GNUNET_PeerIdentity *peer, 98 struct GNUNET_PeerIdentity *peer,
87 uint32_t /* UGH */ channel_number, 99 uint32_t /* UGH */ channel_number,
88 GNUNET_CADET_ChannelCB callback, 100 GNUNET_CADET_ChannelCB callback,
@@ -92,5 +104,6 @@ GNUNET_CADET_get_channel (struct GNUNET_CADET_Handle *h,
92 104
93 105
94void * 106void *
95GNUNET_CADET_get_channel_cancel (struct GNUNET_CADET_ChannelMonitor *cm); 107GNUNET_CADET_get_channel_cancel (struct GNUNET_CADET_ChannelMonitor *cm)
96 108{
109}