Go to the documentation of this file.
110 #define MW_MASTER_CHANNEL_ID 0x00000000
114 #define mwChannel_idIsOutgoing(id) \
115 (! (0x80000000 & (id)))
118 #define mwChannel_idIsIncoming(id) \
119 (! mwChannel_idIsOutgoing(id))
122 #define mwChannel_isOutgoing(chan) \
123 mwChannel_idIsOutgoing(mwChannel_getId(chan))
126 #define mwChannel_isIncoming(chan) \
127 mwChannel_idIsIncoming(mwChannel_getId(chan))
142 #define mwChannel_isState(chan, state) \
143 (mwChannel_getState(chan) == (state))
229 gpointer data, GDestroyNotify clean);
351 guint32 msg_type,
struct mwOpaque *msg,
@ mwEncrypt_ALL
encrypt all, any cipher
Definition: mw_channel.h:166
gpointer mwChannel_getStatistic(struct mwChannel *chan, enum mwChannelStatField stat)
obtain the value for a statistic field as a gpointer
struct mwChannel * mwChannel_find(struct mwChannelSet *cs, guint32 chan)
Obtain a reference to a channel by its id.
@ mwChannel_INIT
channel is being prepared, out of the pool
Definition: mw_channel.h:133
@ mwEncrypt_NONE
encrypt none
Definition: mw_channel.h:164
@ mwChannelStat_OPENED_AT
time when channel was opened
Definition: mw_channel.h:153
@ mwEncrypt_RC2_40
encrypt all, RC2/40 cipher
Definition: mw_channel.h:167
struct mwOpaque * mwChannel_getAddtlCreate(struct mwChannel *)
direct reference to the create addtl information for a channel
Definition: mw_common.h:123
void mwChannelSet_free(struct mwChannelSet *)
Clear and deallocate a channel set.
Definition: mw_message.h:183
enum mwChannelState mwChannel_getState(struct mwChannel *)
get the state of a channel
struct mwChannel * mwChannel_newOutgoing(struct mwChannelSet *)
Create an outgoing channel.
struct mwCipherInstance * mwChannel_getCipherInstance(struct mwChannel *chan)
mwEncryptPolicy
Definition: mw_channel.h:163
void mwChannel_setProtoVer(struct mwChannel *chan, guint32 proto_ver)
int mwChannel_create(struct mwChannel *chan)
Formally open a channel.
void mwChannel_selectCipherInstance(struct mwChannel *chan, struct mwCipherInstance *ci)
select a cipher instance for a channel.
guint32 mwChannel_getProtoVer(struct mwChannel *chan)
@ mwEncrypt_RC2_128
encrypt all, RC2/128 cipher
Definition: mw_channel.h:168
struct mwService * mwChannel_getService(struct mwChannel *)
get the service for a channel.
guint32 mwChannel_getProtoType(struct mwChannel *chan)
int mwChannel_send(struct mwChannel *chan, guint32 msg_type, struct mwOpaque *msg)
Compose a send-on-channel message, encrypt it as per the channel's specification, and send it.
struct mwOpaque * mwChannel_getAddtlAccept(struct mwChannel *)
direct reference to the accept addtl information for a channel
void mwChannel_removeServiceData(struct mwChannel *chan)
void mwChannel_recvCreate(struct mwChannel *chan, struct mwMsgChannelCreate *msg)
pass a create message to a channel for handling
Definition: mw_channel.h:101
void mwChannel_populateSupportedCipherInstances(struct mwChannel *chan)
automatically adds instances of all ciphers in the session to the list of supported ciphers for a cha...
gpointer mwChannel_getServiceData(struct mwChannel *chan)
get service-specific data.
void mwChannel_setOptions(struct mwChannel *chan, guint32 options)
Definition: mw_message.h:224
void mwChannel_recvAccept(struct mwChannel *chan, struct mwMsgChannelAccept *msg)
pass an accept message to a channel for handling
Definition: mw_message.h:210
@ mwChannel_UNKNOWN
unknown state, or error determining state
Definition: mw_channel.h:138
struct mwSession * mwChannel_getSession(struct mwChannel *)
get the session for a channel.
@ mwChannel_WAIT
channel is waiting for accept
Definition: mw_channel.h:134
Definition: mw_channel.h:95
guint32 mwChannel_getOptions(struct mwChannel *chan)
@ mwChannel_OPEN
channel is accepted and open
Definition: mw_channel.h:135
mwChannelStatField
channel statistic fields.
Definition: mw_channel.h:148
@ mwChannelStat_U_BYTES_RECV
total bytes received, post-decryption
Definition: mw_channel.h:152
mwChannelState
channel status
Definition: mw_channel.h:131
Definition: mw_message.h:238
An instance of a cipher.
Definition: mw_cipher.h:105
GList * mwChannel_getSupportedCipherInstances(struct mwChannel *chan)
the list of supported ciphers for a channel.
struct mwChannelSet * mwChannelSet_new(struct mwSession *)
Allocate and initialize a channel set for a session.
void mwChannel_setServiceData(struct mwChannel *chan, gpointer data, GDestroyNotify clean)
set service-specific data.
void mwChannel_setService(struct mwChannel *chan, struct mwService *srvc)
associate a channel with an owning service
@ mwChannelStat_CLOSED_AT
time when channel was closed
Definition: mw_channel.h:154
A service is the recipient of sendOnCnl messages sent over channels marked with the corresponding ser...
Definition: mw_service.h:123
int mwChannel_accept(struct mwChannel *chan)
Formally accept an incoming channel.
@ mwChannelStat_U_BYTES_SENT
total bytes sent, pre-encryption
Definition: mw_channel.h:151
void mwChannel_setProtoType(struct mwChannel *chan, guint32 proto_type)
guint32 mwChannel_getId(struct mwChannel *)
get the ID for a channel.
int mwChannel_destroy(struct mwChannel *chan, guint32 reason, struct mwOpaque *data)
Destroy a channel.
@ mwChannel_ERROR
channel is being destroyed due to error
Definition: mw_channel.h:137
void mwChannel_addSupportedCipherInstance(struct mwChannel *chan, struct mwCipherInstance *ci)
add a cipher instance to a channel's list of supported ciphers.
void mwChannel_recv(struct mwChannel *chan, struct mwMsgChannelSend *msg)
Feed data into a channel.
@ mwChannelStat_MSG_SENT
total send-on-chan messages sent
Definition: mw_channel.h:149
@ mwChannel_DESTROY
channel is being destroyed
Definition: mw_channel.h:136
A length of binary data, not null-terminated.
Definition: mw_common.h:79
void mwChannel_recvDestroy(struct mwChannel *chan, struct mwMsgChannelDestroy *msg)
pass a destroy message to a channel for handling
int mwChannel_sendEncrypted(struct mwChannel *chan, guint32 msg_type, struct mwOpaque *msg, gboolean encrypt)
Compose a send-on-channel message, and if encrypt is TRUE, encrypt it as per the channel's specificat...
@ mwChannel_NEW
channel is newly allocated, in the pool
Definition: mw_channel.h:132
struct mwLoginInfo * mwChannel_getUser(struct mwChannel *chan)
User at the other end of the channel.
guint16 mwChannel_getEncryptPolicy(struct mwChannel *chan)
Channel encryption policy.
@ mwEncrypt_WHATEVER
encrypt whatever you want
Definition: mw_channel.h:165
guint32 mwChannel_getServiceId(struct mwChannel *)
get the ID of the service for a channel.
struct mwChannel * mwChannel_newIncoming(struct mwChannelSet *, guint32 id)
Create an incoming channel with the given channel id.
@ mwChannelStat_MSG_RECV
total send-on-chan messages received
Definition: mw_channel.h:150