meanwhile
1.0.2
Main Page
Related Pages
Data Structures
Files
File List
Globals
src
mw_channel.h
Go to the documentation of this file.
1
2
/*
3
Meanwhile - Unofficial Lotus Sametime Community Client Library
4
Copyright (C) 2004 Christopher (siege) O'Brien
5
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Library General Public
8
License as published by the Free Software Foundation; either
9
version 2 of the License, or (at your option) any later version.
10
11
This library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Library General Public License for more details.
15
16
You should have received a copy of the GNU Library General Public
17
License along with this library; if not, write to the Free
18
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
*/
20
21
#ifndef _MW_CHANNEL_H
22
#define _MW_CHANNEL_H
23
24
79
#include <time.h>
80
#include "
mw_common.h
"
81
82
83
#ifdef __cplusplus
84
extern
"C"
{
85
#endif
86
87
88
/* place-holders */
89
struct
mwCipherInstance
;
90
struct
mwMsgChannelAccept
;
91
struct
mwMsgChannelCreate
;
92
struct
mwMsgChannelDestroy
;
93
struct
mwMsgChannelSend
;
94
struct
mwService
;
95
struct
mwSession
;
96
97
98
101
struct
mwChannel
;
102
103
106
struct
mwChannelSet
;
107
108
110
#define MW_MASTER_CHANNEL_ID 0x00000000
111
112
114
#define mwChannel_idIsOutgoing(id) \
115
(! (0x80000000 & (id)))
116
118
#define mwChannel_idIsIncoming(id) \
119
(! mwChannel_idIsOutgoing(id))
120
122
#define mwChannel_isOutgoing(chan) \
123
mwChannel_idIsOutgoing(mwChannel_getId(chan))
124
126
#define mwChannel_isIncoming(chan) \
127
mwChannel_idIsIncoming(mwChannel_getId(chan))
128
129
131
enum
mwChannelState
{
132
mwChannel_NEW
,
133
mwChannel_INIT
,
134
mwChannel_WAIT
,
135
mwChannel_OPEN
,
136
mwChannel_DESTROY
,
137
mwChannel_ERROR
,
138
mwChannel_UNKNOWN
,
139
};
140
141
142
#define mwChannel_isState(chan, state) \
143
(mwChannel_getState(chan) == (state))
144
145
148
enum
mwChannelStatField
{
149
mwChannelStat_MSG_SENT
,
150
mwChannelStat_MSG_RECV
,
151
mwChannelStat_U_BYTES_SENT
,
152
mwChannelStat_U_BYTES_RECV
,
153
mwChannelStat_OPENED_AT
,
154
mwChannelStat_CLOSED_AT
,
155
};
156
157
163
enum
mwEncryptPolicy
{
164
mwEncrypt_NONE
= 0x0000,
165
mwEncrypt_WHATEVER
= 0x0001,
166
mwEncrypt_ALL
= 0x0002,
167
mwEncrypt_RC2_40
= 0x1000,
168
mwEncrypt_RC2_128
= 0x2000,
169
};
170
171
173
struct
mwChannelSet
*
mwChannelSet_new
(
struct
mwSession
*);
174
175
178
void
mwChannelSet_free
(
struct
mwChannelSet
*);
179
180
183
struct
mwChannel
*
mwChannel_newIncoming
(
struct
mwChannelSet
*, guint32
id
);
184
185
188
struct
mwChannel
*
mwChannel_newOutgoing
(
struct
mwChannelSet
*);
189
190
193
struct
mwChannel
*
mwChannel_find
(
struct
mwChannelSet
*cs, guint32 chan);
194
195
198
guint32
mwChannel_getId
(
struct
mwChannel
*);
199
200
202
struct
mwSession
*
mwChannel_getSession
(
struct
mwChannel
*);
203
204
207
guint32
mwChannel_getServiceId
(
struct
mwChannel
*);
208
209
212
struct
mwService
*
mwChannel_getService
(
struct
mwChannel
*);
213
214
216
void
mwChannel_setService
(
struct
mwChannel
*chan,
struct
mwService
*srvc);
217
218
222
gpointer
mwChannel_getServiceData
(
struct
mwChannel
*chan);
223
224
228
void
mwChannel_setServiceData
(
struct
mwChannel
*chan,
229
gpointer data, GDestroyNotify clean);
230
231
232
void
mwChannel_removeServiceData
(
struct
mwChannel
*chan);
233
234
235
guint32
mwChannel_getProtoType
(
struct
mwChannel
*chan);
236
237
238
void
mwChannel_setProtoType
(
struct
mwChannel
*chan, guint32 proto_type);
239
240
241
guint32
mwChannel_getProtoVer
(
struct
mwChannel
*chan);
242
243
244
void
mwChannel_setProtoVer
(
struct
mwChannel
*chan, guint32 proto_ver);
245
246
255
guint16
mwChannel_getEncryptPolicy
(
struct
mwChannel
*chan);
256
257
258
guint32
mwChannel_getOptions
(
struct
mwChannel
*chan);
259
260
261
void
mwChannel_setOptions
(
struct
mwChannel
*chan, guint32 options);
262
263
266
struct
mwLoginInfo
*
mwChannel_getUser
(
struct
mwChannel
*chan);
267
268
270
struct
mwOpaque
*
mwChannel_getAddtlCreate
(
struct
mwChannel
*);
271
272
274
struct
mwOpaque
*
mwChannel_getAddtlAccept
(
struct
mwChannel
*);
275
276
279
void
mwChannel_populateSupportedCipherInstances
(
struct
mwChannel
*chan);
280
281
284
void
mwChannel_addSupportedCipherInstance
(
struct
mwChannel
*chan,
285
struct
mwCipherInstance
*ci);
286
287
290
GList *
mwChannel_getSupportedCipherInstances
(
struct
mwChannel
*chan);
291
292
295
void
mwChannel_selectCipherInstance
(
struct
mwChannel
*chan,
296
struct
mwCipherInstance
*ci);
297
298
299
struct
mwCipherInstance
*
300
mwChannel_getCipherInstance
(
struct
mwChannel
*chan);
301
302
304
enum
mwChannelState
mwChannel_getState
(
struct
mwChannel
*);
305
306
308
gpointer
mwChannel_getStatistic
(
struct
mwChannel
*chan,
309
enum
mwChannelStatField
stat);
310
311
322
int
mwChannel_create
(
struct
mwChannel
*chan);
323
324
328
int
mwChannel_accept
(
struct
mwChannel
*chan);
329
330
338
int
mwChannel_destroy
(
struct
mwChannel
*chan, guint32 reason,
339
struct
mwOpaque
*data);
340
341
344
int
mwChannel_send
(
struct
mwChannel
*chan, guint32 msg_type,
345
struct
mwOpaque
*msg);
346
347
350
int
mwChannel_sendEncrypted
(
struct
mwChannel
*chan,
351
guint32 msg_type,
struct
mwOpaque
*msg,
352
gboolean encrypt);
353
354
356
void
mwChannel_recvCreate
(
struct
mwChannel
*chan,
357
struct
mwMsgChannelCreate
*msg);
358
359
361
void
mwChannel_recvAccept
(
struct
mwChannel
*chan,
362
struct
mwMsgChannelAccept
*msg);
363
364
366
void
mwChannel_recvDestroy
(
struct
mwChannel
*chan,
367
struct
mwMsgChannelDestroy
*msg);
368
369
371
void
mwChannel_recv
(
struct
mwChannel
*chan,
struct
mwMsgChannelSend
*msg);
372
373
374
#ifdef __cplusplus
375
}
376
#endif
377
378
379
#endif
/* _MW_CHANNEL_H */
380
Generated on Fri Oct 5 2012 11:39:00 for meanwhile by
1.8.1.2