\doxysection{mw\+\_\+channel.\+h File Reference}
\hypertarget{mw__channel_8h}{}\label{mw__channel_8h}\index{mw\_channel.h@{mw\_channel.h}}


Life-\/cycle of an outgoing channel\+:  


{\ttfamily \#include $<$time.\+h$>$}\newline
{\ttfamily \#include "{}mw\+\_\+common.\+h"{}}\newline
\doxysubsubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \mbox{\hyperlink{mw__channel_8h_a1a2154c83a846c017653a2ee8c1aaa35}{MW\+\_\+\+MASTER\+\_\+\+CHANNEL\+\_\+\+ID}}~0x00000000
\begin{DoxyCompactList}\small\item\em special ID indicating the master channel \end{DoxyCompactList}\item 
\#define \mbox{\hyperlink{mw__channel_8h_a74bd8e3a8a90d421b1a9a7e4b7acec89}{mw\+Channel\+\_\+id\+Is\+Incoming}}(id)
\begin{DoxyCompactList}\small\item\em non-\/zero if a channel id appears to be that of an incoming channel \end{DoxyCompactList}\item 
\#define \mbox{\hyperlink{mw__channel_8h_a1c4fa767a8f09e32aaa8b180c1b836f5}{mw\+Channel\+\_\+id\+Is\+Outgoing}}(id)
\begin{DoxyCompactList}\small\item\em non-\/zero if a channel id appears to be that of an outgoing channel \end{DoxyCompactList}\item 
\#define \mbox{\hyperlink{mw__channel_8h_aea68737cfe6d90e09b13ba1b95b9c633}{mw\+Channel\+\_\+is\+Incoming}}(chan)
\begin{DoxyCompactList}\small\item\em non-\/zero if a channel appears to be an incoming channel \end{DoxyCompactList}\item 
\#define \mbox{\hyperlink{mw__channel_8h_af8dd8d1088786774775243383f8f8f28}{mw\+Channel\+\_\+is\+Outgoing}}(chan)
\begin{DoxyCompactList}\small\item\em non-\/zero if a channel appears to be an outgoing channel \end{DoxyCompactList}\item 
\#define \mbox{\hyperlink{mw__channel_8h_acb79280fcff820ba79c7f2a9b9dbe0e0}{mw\+Channel\+\_\+is\+State}}(chan,  state)
\end{DoxyCompactItemize}
\doxysubsubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \mbox{\hyperlink{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11}{mw\+Channel\+State}} \{ \newline
\mbox{\hyperlink{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a0015e6ab100dcc9072046d4fbccf1c5c}{mw\+Channel\+\_\+\+NEW}}
, \newline
\mbox{\hyperlink{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a81856c37ab30b5c5dc918230e74b41be}{mw\+Channel\+\_\+\+INIT}}
, \newline
\mbox{\hyperlink{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11acc17dbc14dcca5f07db0e1086b1787d7}{mw\+Channel\+\_\+\+WAIT}}
, \newline
\mbox{\hyperlink{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a9b079efae54c7ce19a75cc72bb4bdf1d}{mw\+Channel\+\_\+\+OPEN}}
, \newline
\mbox{\hyperlink{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a4dbdbd31d9ff0fb6b973a665ab28a640}{mw\+Channel\+\_\+\+DESTROY}}
, \newline
\mbox{\hyperlink{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a13307644c3c44174b3374e165e4bd609}{mw\+Channel\+\_\+\+ERROR}}
, \newline
\mbox{\hyperlink{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a037260bf612b5b449b9dfc25f14d863c}{mw\+Channel\+\_\+\+UNKNOWN}}
 \}
\begin{DoxyCompactList}\small\item\em channel status \end{DoxyCompactList}\item 
enum \mbox{\hyperlink{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365e}{mw\+Channel\+Stat\+Field}} \{ \newline
\mbox{\hyperlink{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea2fb930374933a4ae3bcbb59c38100453}{mw\+Channel\+Stat\+\_\+\+MSG\+\_\+\+SENT}}
, \newline
\mbox{\hyperlink{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea0b9cd0c35eae32dde00d1757863c0c72}{mw\+Channel\+Stat\+\_\+\+MSG\+\_\+\+RECV}}
, \newline
\mbox{\hyperlink{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea5cb8465381680632b7f9f12c35e36b36}{mw\+Channel\+Stat\+\_\+\+U\+\_\+\+BYTES\+\_\+\+SENT}}
, \newline
\mbox{\hyperlink{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea76fcf9b81600e77219e91476087127ca}{mw\+Channel\+Stat\+\_\+\+U\+\_\+\+BYTES\+\_\+\+RECV}}
, \newline
\mbox{\hyperlink{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea89b26adcb1a6ecb4cf7f871856c597ce}{mw\+Channel\+Stat\+\_\+\+OPENED\+\_\+\+AT}}
, \newline
\mbox{\hyperlink{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea5eef1f4cfa0960802e63d5c98c1fc987}{mw\+Channel\+Stat\+\_\+\+CLOSED\+\_\+\+AT}}
 \}
\begin{DoxyCompactList}\small\item\em channel statistic fields. \end{DoxyCompactList}\item 
enum \mbox{\hyperlink{mw__channel_8h_af1a96846496c5953b72b8002821778dd}{mw\+Encrypt\+Policy}} \{ \newline
\mbox{\hyperlink{mw__channel_8h_af1a96846496c5953b72b8002821778dda8fb49fce96dafa93f4574079bcefefcd}{mw\+Encrypt\+\_\+\+NONE}} = 0x0000
, \newline
\mbox{\hyperlink{mw__channel_8h_af1a96846496c5953b72b8002821778dda23970e8fbf808d49e753b76edd2f7dac}{mw\+Encrypt\+\_\+\+WHATEVER}} = 0x0001
, \newline
\mbox{\hyperlink{mw__channel_8h_af1a96846496c5953b72b8002821778dda751e7884abd7fff5bf60df3be83acb49}{mw\+Encrypt\+\_\+\+ALL}} = 0x0002
, \newline
\mbox{\hyperlink{mw__channel_8h_af1a96846496c5953b72b8002821778ddab501a631c7ce9cf2afb4c3ae80a5f228}{mw\+Encrypt\+\_\+\+RC2\+\_\+40}} = 0x1000
, \newline
\mbox{\hyperlink{mw__channel_8h_af1a96846496c5953b72b8002821778dda24d43c164f072dfdb19b9b3b739b5e2c}{mw\+Encrypt\+\_\+\+RC2\+\_\+128}} = 0x2000
 \}
\begin{DoxyCompactList}\small\item\em Policy for a channel, dictating what sort of encryption should be used, if any, and when. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \mbox{\hyperlink{mw__channel_8h_a8c72269dfed1ad1a32a2f44501c3961a}{mw\+Channel\+\_\+accept}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan)
\begin{DoxyCompactList}\small\item\em Formally accept an incoming channel. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__channel_8h_a7c85be3b885f7bb2119707e78c9f1c1d}{mw\+Channel\+\_\+add\+Supported\+Cipher\+Instance}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan, struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}ci)
\begin{DoxyCompactList}\small\item\em add a cipher instance to a channel\textquotesingle{}s list of supported ciphers. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{mw__channel_8h_ac0b5dba71d6c2ac2780b094bae9bda13}{mw\+Channel\+\_\+create}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan)
\begin{DoxyCompactList}\small\item\em Formally open a channel. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{mw__channel_8h_acbfd68a6393902b1e396c19086cb8703}{mw\+Channel\+\_\+destroy}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan, guint32 reason, struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}data)
\begin{DoxyCompactList}\small\item\em Destroy a channel. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__channel_8h_accd0917f5d49b3b91fee3f272e469706}{mw\+Channel\+\_\+find}} (struct \mbox{\hyperlink{structmwChannelSet}{mw\+Channel\+Set}} \texorpdfstring{$\ast$}{*}cs, guint32 chan)
\begin{DoxyCompactList}\small\item\em Obtain a reference to a channel by its id. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__channel_8h_a51c461a61dc56f0e5d9fba6e68f71432}{mw\+Channel\+\_\+get\+Addtl\+Accept}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*})
\begin{DoxyCompactList}\small\item\em direct reference to the accept addtl information for a channel \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__channel_8h_afb3ceee2e20559e68b1d535778fd42d7}{mw\+Channel\+\_\+get\+Addtl\+Create}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*})
\begin{DoxyCompactList}\small\item\em direct reference to the create addtl information for a channel \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__channel_8h_a3b01207d264a361b890945aa737dadc9}{mw\+Channel\+\_\+get\+Cipher\+Instance}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan)
\item 
guint16 \mbox{\hyperlink{mw__channel_8h_a9eeee87028d25ba9addea3efa02409a4}{mw\+Channel\+\_\+get\+Encrypt\+Policy}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan)
\begin{DoxyCompactList}\small\item\em Channel encryption policy. \end{DoxyCompactList}\item 
guint32 \mbox{\hyperlink{mw__channel_8h_a205fb45f4f128840da446802a5b8858f}{mw\+Channel\+\_\+get\+Id}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*})
\begin{DoxyCompactList}\small\item\em get the ID for a channel. \end{DoxyCompactList}\item 
guint32 \mbox{\hyperlink{mw__channel_8h_a6cc4dc53011417c27ad7d34b814ee74d}{mw\+Channel\+\_\+get\+Options}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan)
\item 
guint32 \mbox{\hyperlink{mw__channel_8h_ac2d6c9be2a7183b7db1548b737725fa0}{mw\+Channel\+\_\+get\+Proto\+Type}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan)
\item 
guint32 \mbox{\hyperlink{mw__channel_8h_aa59d3438ea8d7ddaa4aa66e7f96e0d25}{mw\+Channel\+\_\+get\+Proto\+Ver}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan)
\item 
struct \mbox{\hyperlink{structmwService}{mw\+Service}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__channel_8h_a104afd04a9a9a03d14eebe0f28f49a14}{mw\+Channel\+\_\+get\+Service}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*})
\begin{DoxyCompactList}\small\item\em get the service for a channel. \end{DoxyCompactList}\item 
gpointer \mbox{\hyperlink{mw__channel_8h_a9edb54daf4ae35b0eb5d622b2b0a2332}{mw\+Channel\+\_\+get\+Service\+Data}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan)
\begin{DoxyCompactList}\small\item\em get service-\/specific data. \end{DoxyCompactList}\item 
guint32 \mbox{\hyperlink{mw__channel_8h_a852573bda2f2153ea7bdc3ce4e44ecba}{mw\+Channel\+\_\+get\+Service\+Id}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*})
\begin{DoxyCompactList}\small\item\em get the ID of the service for a channel. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structmwSession}{mw\+Session}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__channel_8h_ac31210a6efc8244b2cd645bec3d01256}{mw\+Channel\+\_\+get\+Session}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*})
\begin{DoxyCompactList}\small\item\em get the session for a channel. \end{DoxyCompactList}\item 
enum \mbox{\hyperlink{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11}{mw\+Channel\+State}} \mbox{\hyperlink{mw__channel_8h_a7bcf55392672ce5cc803019884f0cf82}{mw\+Channel\+\_\+get\+State}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*})
\begin{DoxyCompactList}\small\item\em get the state of a channel \end{DoxyCompactList}\item 
gpointer \mbox{\hyperlink{mw__channel_8h_a5d3eb44fd65ec67e7e04c01ea49bdf2c}{mw\+Channel\+\_\+get\+Statistic}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan, enum \mbox{\hyperlink{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365e}{mw\+Channel\+Stat\+Field}} stat)
\begin{DoxyCompactList}\small\item\em obtain the value for a statistic field as a gpointer \end{DoxyCompactList}\item 
GList \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__channel_8h_abd68d7186e200c3835f27bc81ce159a6}{mw\+Channel\+\_\+get\+Supported\+Cipher\+Instances}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan)
\begin{DoxyCompactList}\small\item\em the list of supported ciphers for a channel. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structmwLoginInfo}{mw\+Login\+Info}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__channel_8h_a67959d972c206f8c6cbf93ee1a28b863}{mw\+Channel\+\_\+get\+User}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan)
\begin{DoxyCompactList}\small\item\em User at the other end of the channel. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__channel_8h_a20a64cca961fa3e135f7265d6807f5bb}{mw\+Channel\+\_\+new\+Incoming}} (struct \mbox{\hyperlink{structmwChannelSet}{mw\+Channel\+Set}} \texorpdfstring{$\ast$}{*}, guint32 id)
\begin{DoxyCompactList}\small\item\em Create an incoming channel with the given channel id. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__channel_8h_af45e012befc2978424dd8051a07bed95}{mw\+Channel\+\_\+new\+Outgoing}} (struct \mbox{\hyperlink{structmwChannelSet}{mw\+Channel\+Set}} \texorpdfstring{$\ast$}{*})
\begin{DoxyCompactList}\small\item\em Create an outgoing channel. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__channel_8h_ad140721caa97992d7e64cd6504965946}{mw\+Channel\+\_\+populate\+Supported\+Cipher\+Instances}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan)
\begin{DoxyCompactList}\small\item\em automatically adds instances of all ciphers in the session to the list of supported ciphers for a channel \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__channel_8h_a45bfb6bb37d6db073c593bbfcc48af92}{mw\+Channel\+\_\+recv}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan, struct \mbox{\hyperlink{structmwMsgChannelSend}{mw\+Msg\+Channel\+Send}} \texorpdfstring{$\ast$}{*}msg)
\begin{DoxyCompactList}\small\item\em Feed data into a channel. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__channel_8h_acdcc28872711d7b7cb17f403472448e5}{mw\+Channel\+\_\+recv\+Accept}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan, struct \mbox{\hyperlink{structmwMsgChannelAccept}{mw\+Msg\+Channel\+Accept}} \texorpdfstring{$\ast$}{*}msg)
\begin{DoxyCompactList}\small\item\em pass an accept message to a channel for handling \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__channel_8h_a1172755c4bb709e9150691848ba4070f}{mw\+Channel\+\_\+recv\+Create}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan, struct \mbox{\hyperlink{structmwMsgChannelCreate}{mw\+Msg\+Channel\+Create}} \texorpdfstring{$\ast$}{*}msg)
\begin{DoxyCompactList}\small\item\em pass a create message to a channel for handling \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__channel_8h_a0e66613f64ea68bebfae4c3e2fe1a50b}{mw\+Channel\+\_\+recv\+Destroy}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan, struct \mbox{\hyperlink{structmwMsgChannelDestroy}{mw\+Msg\+Channel\+Destroy}} \texorpdfstring{$\ast$}{*}msg)
\begin{DoxyCompactList}\small\item\em pass a destroy message to a channel for handling \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__channel_8h_a288a0fc9ee0e2efbe16d6905a2bf158e}{mw\+Channel\+\_\+remove\+Service\+Data}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan)
\item 
void \mbox{\hyperlink{mw__channel_8h_aae6d4fb911cd040fb277d8caccf21d13}{mw\+Channel\+\_\+select\+Cipher\+Instance}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan, struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}ci)
\begin{DoxyCompactList}\small\item\em select a cipher instance for a channel. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{mw__channel_8h_a3c5c8c8fc12b5931e97e1456fac726cf}{mw\+Channel\+\_\+send}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan, guint32 msg\+\_\+type, struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}msg)
\begin{DoxyCompactList}\small\item\em Compose a send-\/on-\/channel message, encrypt it as per the channel\textquotesingle{}s specification, and send it. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{mw__channel_8h_a9680f1baac754a86449e2f416fa2ac27}{mw\+Channel\+\_\+send\+Encrypted}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan, guint32 msg\+\_\+type, struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}msg, gboolean encrypt)
\begin{DoxyCompactList}\small\item\em Compose a send-\/on-\/channel message, and if encrypt is TRUE, encrypt it as per the channel\textquotesingle{}s specification, and send it. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__channel_8h_adf361ad42cbffec92a393bc3e059c38e}{mw\+Channel\+\_\+set\+Options}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan, guint32 options)
\item 
void \mbox{\hyperlink{mw__channel_8h_adc7007d3b03fed371cd1f2a51321f04e}{mw\+Channel\+\_\+set\+Proto\+Type}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan, guint32 proto\+\_\+type)
\item 
void \mbox{\hyperlink{mw__channel_8h_a7f43ceb7857fadd26d24ad1294ba4d8b}{mw\+Channel\+\_\+set\+Proto\+Ver}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan, guint32 proto\+\_\+ver)
\item 
void \mbox{\hyperlink{mw__channel_8h_a730aaae4bae3fdfe485cf4e62510bdd7}{mw\+Channel\+\_\+set\+Service}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan, struct \mbox{\hyperlink{structmwService}{mw\+Service}} \texorpdfstring{$\ast$}{*}srvc)
\begin{DoxyCompactList}\small\item\em associate a channel with an owning service \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__channel_8h_ae424543ba6d270f04d4819a7b77b5d47}{mw\+Channel\+\_\+set\+Service\+Data}} (struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan, gpointer data, GDestroy\+Notify clean)
\begin{DoxyCompactList}\small\item\em set service-\/specific data. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__channel_8h_a36ca1279d6e68a1e86a9f0126bc545cc}{mw\+Channel\+Set\+\_\+free}} (struct \mbox{\hyperlink{structmwChannelSet}{mw\+Channel\+Set}} \texorpdfstring{$\ast$}{*})
\begin{DoxyCompactList}\small\item\em Clear and deallocate a channel set. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structmwChannelSet}{mw\+Channel\+Set}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__channel_8h_a42ae0e73f34b0900c89e5c620ada4a71}{mw\+Channel\+Set\+\_\+new}} (struct \mbox{\hyperlink{structmwSession}{mw\+Session}} \texorpdfstring{$\ast$}{*})
\begin{DoxyCompactList}\small\item\em Allocate and initialize a channel set for a session. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Life-\/cycle of an outgoing channel\+: 

1\+: mw\+Channel\+\_\+new is called. If there is a channel in the outgoing collection in state NEW, then it is returned. Otherwise, a channel is allocated, assigned a unique outgoing id, marked as NEW, and returned.

2\+: channel is set to INIT status (effectively earmarking it as in-\/ use). fields on the channel can then be set as necessary to prepare it for creation.

3\+: mw\+Channel\+\_\+create is called. The channel is marked to WAIT status and a message is sent to the server. The channel is also marked as inactive as of that moment.

4\+: the channel is accepted (step 5) or rejected (step 7)

5\+: an accept message is received from the server, and the channel is marked as OPEN, and the inactive mark is removed. And messages in the in or out queues for that channel are processed. The channel is now ready to be used.

6\+: data is sent and received over the channel

7\+: the channel is closed either by receipt of a close message or by local action. If by local action, then a close message is sent to the server. The channel is cleaned up, its queues dumped, and it is set to NEW status to await re-\/use.

Life-\/cycle of an incoming channel\+:

1\+: a channel create message is received. A channel is allocated and given an id matching the message. It is placed in status WAIT, and marked as inactive as of that moment. The service matching that channel is alerted of the incoming creation request.

2\+: the service can either accept (step 3) or reject (step 5) the channel

3\+: mw\+Channel\+\_\+accept is called. The channel is marked as OPEN, and an accept message is sent to the server. And messages in the in or out queues for that channel are processed. The channel is now ready to be used.

4\+: data is sent and received over the channel

5\+: The channel is closed either by receipt of a close message or by local action. If by local action, then a close message is sent to the server. The channel is cleaned up, its queues dumped, and it is deallocated. 

\label{doc-define-members}
\Hypertarget{mw__channel_8h_doc-define-members}
\doxysubsection{Macro Definition Documentation}
\Hypertarget{mw__channel_8h_a1a2154c83a846c017653a2ee8c1aaa35}\index{mw\_channel.h@{mw\_channel.h}!MW\_MASTER\_CHANNEL\_ID@{MW\_MASTER\_CHANNEL\_ID}}
\index{MW\_MASTER\_CHANNEL\_ID@{MW\_MASTER\_CHANNEL\_ID}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{MW\_MASTER\_CHANNEL\_ID}{MW\_MASTER\_CHANNEL\_ID}}
{\footnotesize\ttfamily \label{mw__channel_8h_a1a2154c83a846c017653a2ee8c1aaa35} 
\#define MW\+\_\+\+MASTER\+\_\+\+CHANNEL\+\_\+\+ID~0x00000000}



special ID indicating the master channel 

\Hypertarget{mw__channel_8h_a74bd8e3a8a90d421b1a9a7e4b7acec89}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_idIsIncoming@{mwChannel\_idIsIncoming}}
\index{mwChannel\_idIsIncoming@{mwChannel\_idIsIncoming}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_idIsIncoming}{mwChannel\_idIsIncoming}}
{\footnotesize\ttfamily \label{mw__channel_8h_a74bd8e3a8a90d421b1a9a7e4b7acec89} 
\#define mw\+Channel\+\_\+id\+Is\+Incoming(\begin{DoxyParamCaption}\item[{}]{id}{}\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \ (!\ \mbox{\hyperlink{mw__channel_8h_a1c4fa767a8f09e32aaa8b180c1b836f5}{mwChannel\_idIsOutgoing}}(\textcolor{keywordtype}{id}))}

\end{DoxyCode}


non-\/zero if a channel id appears to be that of an incoming channel 

\Hypertarget{mw__channel_8h_a1c4fa767a8f09e32aaa8b180c1b836f5}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_idIsOutgoing@{mwChannel\_idIsOutgoing}}
\index{mwChannel\_idIsOutgoing@{mwChannel\_idIsOutgoing}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_idIsOutgoing}{mwChannel\_idIsOutgoing}}
{\footnotesize\ttfamily \label{mw__channel_8h_a1c4fa767a8f09e32aaa8b180c1b836f5} 
\#define mw\+Channel\+\_\+id\+Is\+Outgoing(\begin{DoxyParamCaption}\item[{}]{id}{}\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \ (!\ (0x80000000\ \&\ (id)))}

\end{DoxyCode}


non-\/zero if a channel id appears to be that of an outgoing channel 

\Hypertarget{mw__channel_8h_aea68737cfe6d90e09b13ba1b95b9c633}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_isIncoming@{mwChannel\_isIncoming}}
\index{mwChannel\_isIncoming@{mwChannel\_isIncoming}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_isIncoming}{mwChannel\_isIncoming}}
{\footnotesize\ttfamily \label{mw__channel_8h_aea68737cfe6d90e09b13ba1b95b9c633} 
\#define mw\+Channel\+\_\+is\+Incoming(\begin{DoxyParamCaption}\item[{}]{chan}{}\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \ \mbox{\hyperlink{mw__channel_8h_a74bd8e3a8a90d421b1a9a7e4b7acec89}{mwChannel\_idIsIncoming}}(\mbox{\hyperlink{mw__channel_8h_a205fb45f4f128840da446802a5b8858f}{mwChannel\_getId}}(chan))}

\end{DoxyCode}


non-\/zero if a channel appears to be an incoming channel 

\Hypertarget{mw__channel_8h_af8dd8d1088786774775243383f8f8f28}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_isOutgoing@{mwChannel\_isOutgoing}}
\index{mwChannel\_isOutgoing@{mwChannel\_isOutgoing}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_isOutgoing}{mwChannel\_isOutgoing}}
{\footnotesize\ttfamily \label{mw__channel_8h_af8dd8d1088786774775243383f8f8f28} 
\#define mw\+Channel\+\_\+is\+Outgoing(\begin{DoxyParamCaption}\item[{}]{chan}{}\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \ \mbox{\hyperlink{mw__channel_8h_a1c4fa767a8f09e32aaa8b180c1b836f5}{mwChannel\_idIsOutgoing}}(\mbox{\hyperlink{mw__channel_8h_a205fb45f4f128840da446802a5b8858f}{mwChannel\_getId}}(chan))}

\end{DoxyCode}


non-\/zero if a channel appears to be an outgoing channel 

\Hypertarget{mw__channel_8h_acb79280fcff820ba79c7f2a9b9dbe0e0}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_isState@{mwChannel\_isState}}
\index{mwChannel\_isState@{mwChannel\_isState}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_isState}{mwChannel\_isState}}
{\footnotesize\ttfamily \label{mw__channel_8h_acb79280fcff820ba79c7f2a9b9dbe0e0} 
\#define mw\+Channel\+\_\+is\+State(\begin{DoxyParamCaption}\item[{}]{chan}{, }\item[{}]{state}{}\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\ \ (\mbox{\hyperlink{mw__channel_8h_a7bcf55392672ce5cc803019884f0cf82}{mwChannel\_getState}}(chan)\ ==\ (state))}

\end{DoxyCode}


\label{doc-enum-members}
\Hypertarget{mw__channel_8h_doc-enum-members}
\doxysubsection{Enumeration Type Documentation}
\Hypertarget{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11}\index{mw\_channel.h@{mw\_channel.h}!mwChannelState@{mwChannelState}}
\index{mwChannelState@{mwChannelState}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannelState}{mwChannelState}}
{\footnotesize\ttfamily \label{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11} 
enum \mbox{\hyperlink{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11}{mw\+Channel\+State}}}



channel status 

\begin{DoxyEnumFields}[2]{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{mwChannel\_NEW@{mwChannel\_NEW}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_NEW@{mwChannel\_NEW}}}\Hypertarget{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a0015e6ab100dcc9072046d4fbccf1c5c}\label{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a0015e6ab100dcc9072046d4fbccf1c5c} 
mw\+Channel\+\_\+\+NEW&channel is newly allocated, in the pool \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{mwChannel\_INIT@{mwChannel\_INIT}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_INIT@{mwChannel\_INIT}}}\Hypertarget{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a81856c37ab30b5c5dc918230e74b41be}\label{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a81856c37ab30b5c5dc918230e74b41be} 
mw\+Channel\+\_\+\+INIT&channel is being prepared, out of the pool \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{mwChannel\_WAIT@{mwChannel\_WAIT}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_WAIT@{mwChannel\_WAIT}}}\Hypertarget{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11acc17dbc14dcca5f07db0e1086b1787d7}\label{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11acc17dbc14dcca5f07db0e1086b1787d7} 
mw\+Channel\+\_\+\+WAIT&channel is waiting for accept \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{mwChannel\_OPEN@{mwChannel\_OPEN}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_OPEN@{mwChannel\_OPEN}}}\Hypertarget{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a9b079efae54c7ce19a75cc72bb4bdf1d}\label{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a9b079efae54c7ce19a75cc72bb4bdf1d} 
mw\+Channel\+\_\+\+OPEN&channel is accepted and open \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{mwChannel\_DESTROY@{mwChannel\_DESTROY}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_DESTROY@{mwChannel\_DESTROY}}}\Hypertarget{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a4dbdbd31d9ff0fb6b973a665ab28a640}\label{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a4dbdbd31d9ff0fb6b973a665ab28a640} 
mw\+Channel\+\_\+\+DESTROY&channel is being destroyed \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{mwChannel\_ERROR@{mwChannel\_ERROR}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_ERROR@{mwChannel\_ERROR}}}\Hypertarget{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a13307644c3c44174b3374e165e4bd609}\label{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a13307644c3c44174b3374e165e4bd609} 
mw\+Channel\+\_\+\+ERROR&channel is being destroyed due to error \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{mwChannel\_UNKNOWN@{mwChannel\_UNKNOWN}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_UNKNOWN@{mwChannel\_UNKNOWN}}}\Hypertarget{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a037260bf612b5b449b9dfc25f14d863c}\label{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11a037260bf612b5b449b9dfc25f14d863c} 
mw\+Channel\+\_\+\+UNKNOWN&unknown state, or error determining state \\
\hline

\end{DoxyEnumFields}
\Hypertarget{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365e}\index{mw\_channel.h@{mw\_channel.h}!mwChannelStatField@{mwChannelStatField}}
\index{mwChannelStatField@{mwChannelStatField}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannelStatField}{mwChannelStatField}}
{\footnotesize\ttfamily \label{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365e} 
enum \mbox{\hyperlink{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365e}{mw\+Channel\+Stat\+Field}}}



channel statistic fields. 

\begin{DoxySeeAlso}{See also}
\doxylink{mw__channel_8h_a5d3eb44fd65ec67e7e04c01ea49bdf2c}{mw\+Channel\+\_\+get\+Statistic} 
\end{DoxySeeAlso}
\begin{DoxyEnumFields}[2]{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{mwChannelStat\_MSG\_SENT@{mwChannelStat\_MSG\_SENT}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwChannelStat\_MSG\_SENT@{mwChannelStat\_MSG\_SENT}}}\Hypertarget{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea2fb930374933a4ae3bcbb59c38100453}\label{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea2fb930374933a4ae3bcbb59c38100453} 
mw\+Channel\+Stat\+\_\+\+MSG\+\_\+\+SENT&total send-\/on-\/chan messages sent \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{mwChannelStat\_MSG\_RECV@{mwChannelStat\_MSG\_RECV}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwChannelStat\_MSG\_RECV@{mwChannelStat\_MSG\_RECV}}}\Hypertarget{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea0b9cd0c35eae32dde00d1757863c0c72}\label{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea0b9cd0c35eae32dde00d1757863c0c72} 
mw\+Channel\+Stat\+\_\+\+MSG\+\_\+\+RECV&total send-\/on-\/chan messages received \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{mwChannelStat\_U\_BYTES\_SENT@{mwChannelStat\_U\_BYTES\_SENT}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwChannelStat\_U\_BYTES\_SENT@{mwChannelStat\_U\_BYTES\_SENT}}}\Hypertarget{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea5cb8465381680632b7f9f12c35e36b36}\label{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea5cb8465381680632b7f9f12c35e36b36} 
mw\+Channel\+Stat\+\_\+\+U\+\_\+\+BYTES\+\_\+\+SENT&total bytes sent, pre-\/encryption \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{mwChannelStat\_U\_BYTES\_RECV@{mwChannelStat\_U\_BYTES\_RECV}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwChannelStat\_U\_BYTES\_RECV@{mwChannelStat\_U\_BYTES\_RECV}}}\Hypertarget{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea76fcf9b81600e77219e91476087127ca}\label{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea76fcf9b81600e77219e91476087127ca} 
mw\+Channel\+Stat\+\_\+\+U\+\_\+\+BYTES\+\_\+\+RECV&total bytes received, post-\/decryption \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{mwChannelStat\_OPENED\_AT@{mwChannelStat\_OPENED\_AT}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwChannelStat\_OPENED\_AT@{mwChannelStat\_OPENED\_AT}}}\Hypertarget{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea89b26adcb1a6ecb4cf7f871856c597ce}\label{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea89b26adcb1a6ecb4cf7f871856c597ce} 
mw\+Channel\+Stat\+\_\+\+OPENED\+\_\+\+AT&time when channel was opened \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{mwChannelStat\_CLOSED\_AT@{mwChannelStat\_CLOSED\_AT}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwChannelStat\_CLOSED\_AT@{mwChannelStat\_CLOSED\_AT}}}\Hypertarget{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea5eef1f4cfa0960802e63d5c98c1fc987}\label{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365ea5eef1f4cfa0960802e63d5c98c1fc987} 
mw\+Channel\+Stat\+\_\+\+CLOSED\+\_\+\+AT&time when channel was closed \\
\hline

\end{DoxyEnumFields}
\Hypertarget{mw__channel_8h_af1a96846496c5953b72b8002821778dd}\index{mw\_channel.h@{mw\_channel.h}!mwEncryptPolicy@{mwEncryptPolicy}}
\index{mwEncryptPolicy@{mwEncryptPolicy}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwEncryptPolicy}{mwEncryptPolicy}}
{\footnotesize\ttfamily \label{mw__channel_8h_af1a96846496c5953b72b8002821778dd} 
enum \mbox{\hyperlink{mw__channel_8h_af1a96846496c5953b72b8002821778dd}{mw\+Encrypt\+Policy}}}



Policy for a channel, dictating what sort of encryption should be used, if any, and when. 

\begin{DoxyEnumFields}[2]{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{mwEncrypt\_NONE@{mwEncrypt\_NONE}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwEncrypt\_NONE@{mwEncrypt\_NONE}}}\Hypertarget{mw__channel_8h_af1a96846496c5953b72b8002821778dda8fb49fce96dafa93f4574079bcefefcd}\label{mw__channel_8h_af1a96846496c5953b72b8002821778dda8fb49fce96dafa93f4574079bcefefcd} 
mw\+Encrypt\+\_\+\+NONE&encrypt none \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{mwEncrypt\_WHATEVER@{mwEncrypt\_WHATEVER}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwEncrypt\_WHATEVER@{mwEncrypt\_WHATEVER}}}\Hypertarget{mw__channel_8h_af1a96846496c5953b72b8002821778dda23970e8fbf808d49e753b76edd2f7dac}\label{mw__channel_8h_af1a96846496c5953b72b8002821778dda23970e8fbf808d49e753b76edd2f7dac} 
mw\+Encrypt\+\_\+\+WHATEVER&encrypt whatever you want \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{mwEncrypt\_ALL@{mwEncrypt\_ALL}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwEncrypt\_ALL@{mwEncrypt\_ALL}}}\Hypertarget{mw__channel_8h_af1a96846496c5953b72b8002821778dda751e7884abd7fff5bf60df3be83acb49}\label{mw__channel_8h_af1a96846496c5953b72b8002821778dda751e7884abd7fff5bf60df3be83acb49} 
mw\+Encrypt\+\_\+\+ALL&encrypt all, any cipher \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{mwEncrypt\_RC2\_40@{mwEncrypt\_RC2\_40}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwEncrypt\_RC2\_40@{mwEncrypt\_RC2\_40}}}\Hypertarget{mw__channel_8h_af1a96846496c5953b72b8002821778ddab501a631c7ce9cf2afb4c3ae80a5f228}\label{mw__channel_8h_af1a96846496c5953b72b8002821778ddab501a631c7ce9cf2afb4c3ae80a5f228} 
mw\+Encrypt\+\_\+\+RC2\+\_\+40&encrypt all, RC2/40 cipher \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{mwEncrypt\_RC2\_128@{mwEncrypt\_RC2\_128}!mw\_channel.h@{mw\_channel.h}}\index{mw\_channel.h@{mw\_channel.h}!mwEncrypt\_RC2\_128@{mwEncrypt\_RC2\_128}}}\Hypertarget{mw__channel_8h_af1a96846496c5953b72b8002821778dda24d43c164f072dfdb19b9b3b739b5e2c}\label{mw__channel_8h_af1a96846496c5953b72b8002821778dda24d43c164f072dfdb19b9b3b739b5e2c} 
mw\+Encrypt\+\_\+\+RC2\+\_\+128&encrypt all, RC2/128 cipher \\
\hline

\end{DoxyEnumFields}


\label{doc-func-members}
\Hypertarget{mw__channel_8h_doc-func-members}
\doxysubsection{Function Documentation}
\Hypertarget{mw__channel_8h_a8c72269dfed1ad1a32a2f44501c3961a}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_accept@{mwChannel\_accept}}
\index{mwChannel\_accept@{mwChannel\_accept}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_accept()}{mwChannel\_accept()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a8c72269dfed1ad1a32a2f44501c3961a} 
int mw\+Channel\+\_\+accept (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{}\end{DoxyParamCaption})}



Formally accept an incoming channel. 

Instructs the session to send a channel accept message to the server, and to mark the channel as being OPEN. \Hypertarget{mw__channel_8h_a7c85be3b885f7bb2119707e78c9f1c1d}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_addSupportedCipherInstance@{mwChannel\_addSupportedCipherInstance}}
\index{mwChannel\_addSupportedCipherInstance@{mwChannel\_addSupportedCipherInstance}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_addSupportedCipherInstance()}{mwChannel\_addSupportedCipherInstance()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a7c85be3b885f7bb2119707e78c9f1c1d} 
void mw\+Channel\+\_\+add\+Supported\+Cipher\+Instance (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{, }\item[{struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}}]{ci}{}\end{DoxyParamCaption})}



add a cipher instance to a channel\textquotesingle{}s list of supported ciphers. 

Channel must be NEW. \Hypertarget{mw__channel_8h_ac0b5dba71d6c2ac2780b094bae9bda13}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_create@{mwChannel\_create}}
\index{mwChannel\_create@{mwChannel\_create}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_create()}{mwChannel\_create()}}
{\footnotesize\ttfamily \label{mw__channel_8h_ac0b5dba71d6c2ac2780b094bae9bda13} 
int mw\+Channel\+\_\+create (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{}\end{DoxyParamCaption})}



Formally open a channel. 

For outgoing channels\+: instruct the session to send a channel create message to the server, and to mark the channel (which must be in INIT status) as being in WAIT status.

For incoming channels\+: configures the channel according to options in the channel create message. Marks the channel as being in WAIT status \Hypertarget{mw__channel_8h_acbfd68a6393902b1e396c19086cb8703}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_destroy@{mwChannel\_destroy}}
\index{mwChannel\_destroy@{mwChannel\_destroy}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_destroy()}{mwChannel\_destroy()}}
{\footnotesize\ttfamily \label{mw__channel_8h_acbfd68a6393902b1e396c19086cb8703} 
int mw\+Channel\+\_\+destroy (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{, }\item[{guint32}]{reason}{, }\item[{struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}}]{data}{}\end{DoxyParamCaption})}



Destroy a channel. 

Sends a channel-\/destroy message to the server, and perform cleanup to remove the channel.


\begin{DoxyParams}{Parameters}
{\em chan} & the channel to destroy \\
\hline
{\em reason} & the reason code for closing the channel \\
\hline
{\em data} & optional additional information \\
\hline
\end{DoxyParams}
\Hypertarget{mw__channel_8h_accd0917f5d49b3b91fee3f272e469706}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_find@{mwChannel\_find}}
\index{mwChannel\_find@{mwChannel\_find}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_find()}{mwChannel\_find()}}
{\footnotesize\ttfamily \label{mw__channel_8h_accd0917f5d49b3b91fee3f272e469706} 
struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*} mw\+Channel\+\_\+find (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannelSet}{mw\+Channel\+Set}} \texorpdfstring{$\ast$}{*}}]{cs}{, }\item[{guint32}]{chan}{}\end{DoxyParamCaption})}



Obtain a reference to a channel by its id. 

\begin{DoxyReturn}{Returns}
the channel matching chan, or NULL 
\end{DoxyReturn}
\Hypertarget{mw__channel_8h_a51c461a61dc56f0e5d9fba6e68f71432}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_getAddtlAccept@{mwChannel\_getAddtlAccept}}
\index{mwChannel\_getAddtlAccept@{mwChannel\_getAddtlAccept}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_getAddtlAccept()}{mwChannel\_getAddtlAccept()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a51c461a61dc56f0e5d9fba6e68f71432} 
struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*} mw\+Channel\+\_\+get\+Addtl\+Accept (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{}{}\end{DoxyParamCaption})}



direct reference to the accept addtl information for a channel 

\Hypertarget{mw__channel_8h_afb3ceee2e20559e68b1d535778fd42d7}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_getAddtlCreate@{mwChannel\_getAddtlCreate}}
\index{mwChannel\_getAddtlCreate@{mwChannel\_getAddtlCreate}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_getAddtlCreate()}{mwChannel\_getAddtlCreate()}}
{\footnotesize\ttfamily \label{mw__channel_8h_afb3ceee2e20559e68b1d535778fd42d7} 
struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*} mw\+Channel\+\_\+get\+Addtl\+Create (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{}{}\end{DoxyParamCaption})}



direct reference to the create addtl information for a channel 

\Hypertarget{mw__channel_8h_a3b01207d264a361b890945aa737dadc9}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_getCipherInstance@{mwChannel\_getCipherInstance}}
\index{mwChannel\_getCipherInstance@{mwChannel\_getCipherInstance}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_getCipherInstance()}{mwChannel\_getCipherInstance()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a3b01207d264a361b890945aa737dadc9} 
struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*} mw\+Channel\+\_\+get\+Cipher\+Instance (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{}\end{DoxyParamCaption})}

\Hypertarget{mw__channel_8h_a9eeee87028d25ba9addea3efa02409a4}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_getEncryptPolicy@{mwChannel\_getEncryptPolicy}}
\index{mwChannel\_getEncryptPolicy@{mwChannel\_getEncryptPolicy}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_getEncryptPolicy()}{mwChannel\_getEncryptPolicy()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a9eeee87028d25ba9addea3efa02409a4} 
guint16 mw\+Channel\+\_\+get\+Encrypt\+Policy (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{}\end{DoxyParamCaption})}



Channel encryption policy. 

Cannot currently be set, used internally to automatically negotiate ciphers. Future revisions may allow this to be specified in a new channel to dictate channel encryption.

\begin{DoxySeeAlso}{See also}
enum \doxylink{mw__channel_8h_af1a96846496c5953b72b8002821778dd}{mw\+Encrypt\+Policy} 
\end{DoxySeeAlso}
\Hypertarget{mw__channel_8h_a205fb45f4f128840da446802a5b8858f}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_getId@{mwChannel\_getId}}
\index{mwChannel\_getId@{mwChannel\_getId}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_getId()}{mwChannel\_getId()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a205fb45f4f128840da446802a5b8858f} 
guint32 mw\+Channel\+\_\+get\+Id (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{}{}\end{DoxyParamCaption})}



get the ID for a channel. 

0x00 indicates an error, as that is not a permissible value \Hypertarget{mw__channel_8h_a6cc4dc53011417c27ad7d34b814ee74d}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_getOptions@{mwChannel\_getOptions}}
\index{mwChannel\_getOptions@{mwChannel\_getOptions}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_getOptions()}{mwChannel\_getOptions()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a6cc4dc53011417c27ad7d34b814ee74d} 
guint32 mw\+Channel\+\_\+get\+Options (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{}\end{DoxyParamCaption})}

\Hypertarget{mw__channel_8h_ac2d6c9be2a7183b7db1548b737725fa0}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_getProtoType@{mwChannel\_getProtoType}}
\index{mwChannel\_getProtoType@{mwChannel\_getProtoType}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_getProtoType()}{mwChannel\_getProtoType()}}
{\footnotesize\ttfamily \label{mw__channel_8h_ac2d6c9be2a7183b7db1548b737725fa0} 
guint32 mw\+Channel\+\_\+get\+Proto\+Type (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{}\end{DoxyParamCaption})}

\Hypertarget{mw__channel_8h_aa59d3438ea8d7ddaa4aa66e7f96e0d25}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_getProtoVer@{mwChannel\_getProtoVer}}
\index{mwChannel\_getProtoVer@{mwChannel\_getProtoVer}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_getProtoVer()}{mwChannel\_getProtoVer()}}
{\footnotesize\ttfamily \label{mw__channel_8h_aa59d3438ea8d7ddaa4aa66e7f96e0d25} 
guint32 mw\+Channel\+\_\+get\+Proto\+Ver (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{}\end{DoxyParamCaption})}

\Hypertarget{mw__channel_8h_a104afd04a9a9a03d14eebe0f28f49a14}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_getService@{mwChannel\_getService}}
\index{mwChannel\_getService@{mwChannel\_getService}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_getService()}{mwChannel\_getService()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a104afd04a9a9a03d14eebe0f28f49a14} 
struct \mbox{\hyperlink{structmwService}{mw\+Service}} \texorpdfstring{$\ast$}{*} mw\+Channel\+\_\+get\+Service (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{}{}\end{DoxyParamCaption})}



get the service for a channel. 

This may be NULL for NEW channels \Hypertarget{mw__channel_8h_a9edb54daf4ae35b0eb5d622b2b0a2332}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_getServiceData@{mwChannel\_getServiceData}}
\index{mwChannel\_getServiceData@{mwChannel\_getServiceData}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_getServiceData()}{mwChannel\_getServiceData()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a9edb54daf4ae35b0eb5d622b2b0a2332} 
gpointer mw\+Channel\+\_\+get\+Service\+Data (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{}\end{DoxyParamCaption})}



get service-\/specific data. 

This is for use by service implementations to easily associate information with the channel \Hypertarget{mw__channel_8h_a852573bda2f2153ea7bdc3ce4e44ecba}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_getServiceId@{mwChannel\_getServiceId}}
\index{mwChannel\_getServiceId@{mwChannel\_getServiceId}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_getServiceId()}{mwChannel\_getServiceId()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a852573bda2f2153ea7bdc3ce4e44ecba} 
guint32 mw\+Channel\+\_\+get\+Service\+Id (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{}{}\end{DoxyParamCaption})}



get the ID of the service for a channel. 

This may be 0x00 for NEW channels \Hypertarget{mw__channel_8h_ac31210a6efc8244b2cd645bec3d01256}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_getSession@{mwChannel\_getSession}}
\index{mwChannel\_getSession@{mwChannel\_getSession}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_getSession()}{mwChannel\_getSession()}}
{\footnotesize\ttfamily \label{mw__channel_8h_ac31210a6efc8244b2cd645bec3d01256} 
struct \mbox{\hyperlink{structmwSession}{mw\+Session}} \texorpdfstring{$\ast$}{*} mw\+Channel\+\_\+get\+Session (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{}{}\end{DoxyParamCaption})}



get the session for a channel. 

\Hypertarget{mw__channel_8h_a7bcf55392672ce5cc803019884f0cf82}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_getState@{mwChannel\_getState}}
\index{mwChannel\_getState@{mwChannel\_getState}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_getState()}{mwChannel\_getState()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a7bcf55392672ce5cc803019884f0cf82} 
enum \mbox{\hyperlink{mw__channel_8h_a2f9ff901fd7b6e0f92c4f651b209fd11}{mw\+Channel\+State}} mw\+Channel\+\_\+get\+State (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{}{}\end{DoxyParamCaption})}



get the state of a channel 

\Hypertarget{mw__channel_8h_a5d3eb44fd65ec67e7e04c01ea49bdf2c}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_getStatistic@{mwChannel\_getStatistic}}
\index{mwChannel\_getStatistic@{mwChannel\_getStatistic}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_getStatistic()}{mwChannel\_getStatistic()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a5d3eb44fd65ec67e7e04c01ea49bdf2c} 
gpointer mw\+Channel\+\_\+get\+Statistic (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{, }\item[{enum \mbox{\hyperlink{mw__channel_8h_ae48ef93585f681efb2f9e4eb702c365e}{mw\+Channel\+Stat\+Field}}}]{stat}{}\end{DoxyParamCaption})}



obtain the value for a statistic field as a gpointer 

\Hypertarget{mw__channel_8h_abd68d7186e200c3835f27bc81ce159a6}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_getSupportedCipherInstances@{mwChannel\_getSupportedCipherInstances}}
\index{mwChannel\_getSupportedCipherInstances@{mwChannel\_getSupportedCipherInstances}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_getSupportedCipherInstances()}{mwChannel\_getSupportedCipherInstances()}}
{\footnotesize\ttfamily \label{mw__channel_8h_abd68d7186e200c3835f27bc81ce159a6} 
GList \texorpdfstring{$\ast$}{*} mw\+Channel\+\_\+get\+Supported\+Cipher\+Instances (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{}\end{DoxyParamCaption})}



the list of supported ciphers for a channel. 

This list will be empty once a cipher has been selected for the channel \Hypertarget{mw__channel_8h_a67959d972c206f8c6cbf93ee1a28b863}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_getUser@{mwChannel\_getUser}}
\index{mwChannel\_getUser@{mwChannel\_getUser}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_getUser()}{mwChannel\_getUser()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a67959d972c206f8c6cbf93ee1a28b863} 
struct \mbox{\hyperlink{structmwLoginInfo}{mw\+Login\+Info}} \texorpdfstring{$\ast$}{*} mw\+Channel\+\_\+get\+User (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{}\end{DoxyParamCaption})}



User at the other end of the channel. 

The target user for outgoing channels, the creator for incoming channels \Hypertarget{mw__channel_8h_a20a64cca961fa3e135f7265d6807f5bb}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_newIncoming@{mwChannel\_newIncoming}}
\index{mwChannel\_newIncoming@{mwChannel\_newIncoming}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_newIncoming()}{mwChannel\_newIncoming()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a20a64cca961fa3e135f7265d6807f5bb} 
struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*} mw\+Channel\+\_\+new\+Incoming (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannelSet}{mw\+Channel\+Set}} \texorpdfstring{$\ast$}{*}}]{}{, }\item[{guint32}]{id}{}\end{DoxyParamCaption})}



Create an incoming channel with the given channel id. 

Channel\textquotesingle{}s state will be set to WAIT. Primarily for use in mw\+\_\+session \Hypertarget{mw__channel_8h_af45e012befc2978424dd8051a07bed95}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_newOutgoing@{mwChannel\_newOutgoing}}
\index{mwChannel\_newOutgoing@{mwChannel\_newOutgoing}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_newOutgoing()}{mwChannel\_newOutgoing()}}
{\footnotesize\ttfamily \label{mw__channel_8h_af45e012befc2978424dd8051a07bed95} 
struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*} mw\+Channel\+\_\+new\+Outgoing (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannelSet}{mw\+Channel\+Set}} \texorpdfstring{$\ast$}{*}}]{}{}\end{DoxyParamCaption})}



Create an outgoing channel. 

Its channel ID will be generated by the owning channel set. Channel\textquotesingle{}s state will be set to INIT \Hypertarget{mw__channel_8h_ad140721caa97992d7e64cd6504965946}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_populateSupportedCipherInstances@{mwChannel\_populateSupportedCipherInstances}}
\index{mwChannel\_populateSupportedCipherInstances@{mwChannel\_populateSupportedCipherInstances}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_populateSupportedCipherInstances()}{mwChannel\_populateSupportedCipherInstances()}}
{\footnotesize\ttfamily \label{mw__channel_8h_ad140721caa97992d7e64cd6504965946} 
void mw\+Channel\+\_\+populate\+Supported\+Cipher\+Instances (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{}\end{DoxyParamCaption})}



automatically adds instances of all ciphers in the session to the list of supported ciphers for a channel 

\Hypertarget{mw__channel_8h_a45bfb6bb37d6db073c593bbfcc48af92}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_recv@{mwChannel\_recv}}
\index{mwChannel\_recv@{mwChannel\_recv}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_recv()}{mwChannel\_recv()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a45bfb6bb37d6db073c593bbfcc48af92} 
void mw\+Channel\+\_\+recv (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{, }\item[{struct \mbox{\hyperlink{structmwMsgChannelSend}{mw\+Msg\+Channel\+Send}} \texorpdfstring{$\ast$}{*}}]{msg}{}\end{DoxyParamCaption})}



Feed data into a channel. 

\Hypertarget{mw__channel_8h_acdcc28872711d7b7cb17f403472448e5}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_recvAccept@{mwChannel\_recvAccept}}
\index{mwChannel\_recvAccept@{mwChannel\_recvAccept}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_recvAccept()}{mwChannel\_recvAccept()}}
{\footnotesize\ttfamily \label{mw__channel_8h_acdcc28872711d7b7cb17f403472448e5} 
void mw\+Channel\+\_\+recv\+Accept (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{, }\item[{struct \mbox{\hyperlink{structmwMsgChannelAccept}{mw\+Msg\+Channel\+Accept}} \texorpdfstring{$\ast$}{*}}]{msg}{}\end{DoxyParamCaption})}



pass an accept message to a channel for handling 

\Hypertarget{mw__channel_8h_a1172755c4bb709e9150691848ba4070f}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_recvCreate@{mwChannel\_recvCreate}}
\index{mwChannel\_recvCreate@{mwChannel\_recvCreate}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_recvCreate()}{mwChannel\_recvCreate()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a1172755c4bb709e9150691848ba4070f} 
void mw\+Channel\+\_\+recv\+Create (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{, }\item[{struct \mbox{\hyperlink{structmwMsgChannelCreate}{mw\+Msg\+Channel\+Create}} \texorpdfstring{$\ast$}{*}}]{msg}{}\end{DoxyParamCaption})}



pass a create message to a channel for handling 

\Hypertarget{mw__channel_8h_a0e66613f64ea68bebfae4c3e2fe1a50b}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_recvDestroy@{mwChannel\_recvDestroy}}
\index{mwChannel\_recvDestroy@{mwChannel\_recvDestroy}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_recvDestroy()}{mwChannel\_recvDestroy()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a0e66613f64ea68bebfae4c3e2fe1a50b} 
void mw\+Channel\+\_\+recv\+Destroy (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{, }\item[{struct \mbox{\hyperlink{structmwMsgChannelDestroy}{mw\+Msg\+Channel\+Destroy}} \texorpdfstring{$\ast$}{*}}]{msg}{}\end{DoxyParamCaption})}



pass a destroy message to a channel for handling 

\Hypertarget{mw__channel_8h_a288a0fc9ee0e2efbe16d6905a2bf158e}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_removeServiceData@{mwChannel\_removeServiceData}}
\index{mwChannel\_removeServiceData@{mwChannel\_removeServiceData}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_removeServiceData()}{mwChannel\_removeServiceData()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a288a0fc9ee0e2efbe16d6905a2bf158e} 
void mw\+Channel\+\_\+remove\+Service\+Data (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{}\end{DoxyParamCaption})}

\Hypertarget{mw__channel_8h_aae6d4fb911cd040fb277d8caccf21d13}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_selectCipherInstance@{mwChannel\_selectCipherInstance}}
\index{mwChannel\_selectCipherInstance@{mwChannel\_selectCipherInstance}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_selectCipherInstance()}{mwChannel\_selectCipherInstance()}}
{\footnotesize\ttfamily \label{mw__channel_8h_aae6d4fb911cd040fb277d8caccf21d13} 
void mw\+Channel\+\_\+select\+Cipher\+Instance (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{, }\item[{struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}}]{ci}{}\end{DoxyParamCaption})}



select a cipher instance for a channel. 

A NULL instance indicates that no encryption should be used. \Hypertarget{mw__channel_8h_a3c5c8c8fc12b5931e97e1456fac726cf}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_send@{mwChannel\_send}}
\index{mwChannel\_send@{mwChannel\_send}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_send()}{mwChannel\_send()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a3c5c8c8fc12b5931e97e1456fac726cf} 
int mw\+Channel\+\_\+send (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{, }\item[{guint32}]{msg\+\_\+type}{, }\item[{struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}}]{msg}{}\end{DoxyParamCaption})}



Compose a send-\/on-\/channel message, encrypt it as per the channel\textquotesingle{}s specification, and send it. 

\Hypertarget{mw__channel_8h_a9680f1baac754a86449e2f416fa2ac27}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_sendEncrypted@{mwChannel\_sendEncrypted}}
\index{mwChannel\_sendEncrypted@{mwChannel\_sendEncrypted}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_sendEncrypted()}{mwChannel\_sendEncrypted()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a9680f1baac754a86449e2f416fa2ac27} 
int mw\+Channel\+\_\+send\+Encrypted (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{, }\item[{guint32}]{msg\+\_\+type}{, }\item[{struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}}]{msg}{, }\item[{gboolean}]{encrypt}{}\end{DoxyParamCaption})}



Compose a send-\/on-\/channel message, and if encrypt is TRUE, encrypt it as per the channel\textquotesingle{}s specification, and send it. 

\Hypertarget{mw__channel_8h_adf361ad42cbffec92a393bc3e059c38e}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_setOptions@{mwChannel\_setOptions}}
\index{mwChannel\_setOptions@{mwChannel\_setOptions}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_setOptions()}{mwChannel\_setOptions()}}
{\footnotesize\ttfamily \label{mw__channel_8h_adf361ad42cbffec92a393bc3e059c38e} 
void mw\+Channel\+\_\+set\+Options (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{, }\item[{guint32}]{options}{}\end{DoxyParamCaption})}

\Hypertarget{mw__channel_8h_adc7007d3b03fed371cd1f2a51321f04e}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_setProtoType@{mwChannel\_setProtoType}}
\index{mwChannel\_setProtoType@{mwChannel\_setProtoType}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_setProtoType()}{mwChannel\_setProtoType()}}
{\footnotesize\ttfamily \label{mw__channel_8h_adc7007d3b03fed371cd1f2a51321f04e} 
void mw\+Channel\+\_\+set\+Proto\+Type (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{, }\item[{guint32}]{proto\+\_\+type}{}\end{DoxyParamCaption})}

\Hypertarget{mw__channel_8h_a7f43ceb7857fadd26d24ad1294ba4d8b}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_setProtoVer@{mwChannel\_setProtoVer}}
\index{mwChannel\_setProtoVer@{mwChannel\_setProtoVer}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_setProtoVer()}{mwChannel\_setProtoVer()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a7f43ceb7857fadd26d24ad1294ba4d8b} 
void mw\+Channel\+\_\+set\+Proto\+Ver (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{, }\item[{guint32}]{proto\+\_\+ver}{}\end{DoxyParamCaption})}

\Hypertarget{mw__channel_8h_a730aaae4bae3fdfe485cf4e62510bdd7}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_setService@{mwChannel\_setService}}
\index{mwChannel\_setService@{mwChannel\_setService}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_setService()}{mwChannel\_setService()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a730aaae4bae3fdfe485cf4e62510bdd7} 
void mw\+Channel\+\_\+set\+Service (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{, }\item[{struct \mbox{\hyperlink{structmwService}{mw\+Service}} \texorpdfstring{$\ast$}{*}}]{srvc}{}\end{DoxyParamCaption})}



associate a channel with an owning service 

\Hypertarget{mw__channel_8h_ae424543ba6d270f04d4819a7b77b5d47}\index{mw\_channel.h@{mw\_channel.h}!mwChannel\_setServiceData@{mwChannel\_setServiceData}}
\index{mwChannel\_setServiceData@{mwChannel\_setServiceData}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannel\_setServiceData()}{mwChannel\_setServiceData()}}
{\footnotesize\ttfamily \label{mw__channel_8h_ae424543ba6d270f04d4819a7b77b5d47} 
void mw\+Channel\+\_\+set\+Service\+Data (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{chan}{, }\item[{gpointer}]{data}{, }\item[{GDestroy\+Notify}]{clean}{}\end{DoxyParamCaption})}



set service-\/specific data. 

This is for use by service implementations to easily associate information with the channel \Hypertarget{mw__channel_8h_a36ca1279d6e68a1e86a9f0126bc545cc}\index{mw\_channel.h@{mw\_channel.h}!mwChannelSet\_free@{mwChannelSet\_free}}
\index{mwChannelSet\_free@{mwChannelSet\_free}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannelSet\_free()}{mwChannelSet\_free()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a36ca1279d6e68a1e86a9f0126bc545cc} 
void mw\+Channel\+Set\+\_\+free (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwChannelSet}{mw\+Channel\+Set}} \texorpdfstring{$\ast$}{*}}]{}{}\end{DoxyParamCaption})}



Clear and deallocate a channel set. 

Closes, clears, and frees all contained channels. \Hypertarget{mw__channel_8h_a42ae0e73f34b0900c89e5c620ada4a71}\index{mw\_channel.h@{mw\_channel.h}!mwChannelSet\_new@{mwChannelSet\_new}}
\index{mwChannelSet\_new@{mwChannelSet\_new}!mw\_channel.h@{mw\_channel.h}}
\doxysubsubsection{\texorpdfstring{mwChannelSet\_new()}{mwChannelSet\_new()}}
{\footnotesize\ttfamily \label{mw__channel_8h_a42ae0e73f34b0900c89e5c620ada4a71} 
struct \mbox{\hyperlink{structmwChannelSet}{mw\+Channel\+Set}} \texorpdfstring{$\ast$}{*} mw\+Channel\+Set\+\_\+new (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwSession}{mw\+Session}} \texorpdfstring{$\ast$}{*}}]{}{}\end{DoxyParamCaption})}



Allocate and initialize a channel set for a session. 

