aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/cadet.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet/cadet.h')
-rw-r--r--src/cadet/cadet.h87
1 files changed, 86 insertions, 1 deletions
diff --git a/src/cadet/cadet.h b/src/cadet/cadet.h
index 29400e39f..d17eab1d6 100644
--- a/src/cadet/cadet.h
+++ b/src/cadet/cadet.h
@@ -95,7 +95,6 @@ extern "C" {
95 95
96GNUNET_NETWORK_STRUCT_BEGIN 96GNUNET_NETWORK_STRUCT_BEGIN
97 97
98
99/** 98/**
100 * Number uniquely identifying a channel of a client. 99 * Number uniquely identifying a channel of a client.
101 */ 100 */
@@ -111,6 +110,70 @@ struct GNUNET_CADET_ClientChannelNumber
111 uint32_t channel_of_client GNUNET_PACKED; 110 uint32_t channel_of_client GNUNET_PACKED;
112}; 111};
113 112
113/**
114 * Opaque handle to a channel.
115 */
116struct GNUNET_CADET_Channel
117{
118
119 /**
120 * Other end of the channel.
121 */
122 struct GNUNET_PeerIdentity peer;
123
124 /**
125 * Handle to the cadet this channel belongs to
126 */
127 struct GNUNET_CADET_Handle *cadet;
128
129 /**
130 * Channel's port, if incoming.
131 */
132 struct GNUNET_CADET_Port *incoming_port;
133
134 /**
135 * Any data the caller wants to put in here, used for the
136 * various callbacks (@e disconnects, @e window_changes, handlers).
137 */
138 void *ctx;
139
140 /**
141 * Message Queue for the channel (which we are implementing).
142 */
143 struct GNUNET_MQ_Handle *mq;
144
145 /**
146 * Task to allow mq to send more traffic.
147 */
148 struct GNUNET_SCHEDULER_Task *mq_cont;
149
150 /**
151 * Pending envelope with a message to be transmitted to the
152 * service as soon as we are allowed to. Should only be
153 * non-NULL if @e allow_send is 0.
154 */
155 struct GNUNET_MQ_Envelope *pending_env;
156
157 /**
158 * Window change handler.
159 */
160 GNUNET_CADET_WindowSizeEventHandler window_changes;
161
162 /**
163 * Disconnect handler.
164 */
165 GNUNET_CADET_DisconnectEventHandler disconnects;
166
167 /**
168 * Local ID of the channel, #GNUNET_CADET_LOCAL_CHANNEL_ID_CLI bit is set if outbound.
169 */
170 struct GNUNET_CADET_ClientChannelNumber ccn;
171
172 /**
173 * How many messages are we allowed to send to the service right now?
174 */
175 unsigned int allow_send;
176};
114 177
115/** 178/**
116 * Message for a client to create and destroy channels. 179 * Message for a client to create and destroy channels.
@@ -252,7 +315,29 @@ struct GNUNET_CADET_LocalInfo
252 struct GNUNET_PeerIdentity peer; 315 struct GNUNET_PeerIdentity peer;
253}; 316};
254 317
318/**
319 * Message to drop another message of specific type. Used in test context
320 */
321struct GNUNET_CADET_RequestDropCadetMessage
322{
255 323
324 /**
325 * Type: #GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE
326 */
327 struct GNUNET_MessageHeader header;
328
329 /**
330 * Type of the message this handler covers, in host byte order.
331 */
332 uint16_t type;
333
334 /**
335 * ID of the channel we want to drop a message for.
336 */
337 struct GNUNET_CADET_ClientChannelNumber ccn;
338
339};
340
256/** 341/**
257 * Message to inform the client about channels in the service. 342 * Message to inform the client about channels in the service.
258 */ 343 */