62 #define MW_PROTOCOL_VERSION_MAJOR 0x001e
66 #define MW_PROTOCOL_VERSION_MINOR 0x001d
75 #define mwSession_AUTH_USER_ID "session.auth.user"
78 #define mwSession_AUTH_PASSWORD "session.auth.password"
81 #define mwSession_AUTH_TOKEN "session.auth.token"
84 #define mwSession_CLIENT_HOST "client.host"
87 #define mwSession_CLIENT_IP "client.ip"
90 #define mwSession_CLIENT_VER_MAJOR "client.version.major"
93 #define mwSession_CLIENT_VER_MINOR "client.version.minor"
96 #define mwSession_CLIENT_TYPE_ID "client.id"
99 #define mwSession_SERVER_VER_MAJOR "server.version.major"
102 #define mwSession_SERVER_VER_MINOR "server.version.minor"
122 #define mwSession_isState(session, state) \
123 (mwSession_getState((session)) == (state))
125 #define mwSession_isStarting(s) \
126 (mwSession_isState((s), mwSession_STARTING) || \
127 mwSession_isState((s), mwSession_HANDSHAKE) || \
128 mwSession_isState((s), mwSession_HANDSHAKE_ACK) || \
129 mwSession_isState((s), mwSession_LOGIN) || \
130 mwSession_isState((s), mwSession_LOGIN_ACK) || \
131 mwSession_isState((s), mwSession_LOGIN_REDIR) || \
132 mwSession_isState((s), mwSession_LOGIN_CONT))
134 #define mwSession_isStarted(s) \
135 (mwSession_isState((s), mwSession_STARTED))
137 #define mwSession_isStopping(s) \
138 (mwSession_isState((s), mwSession_STOPPING))
140 #define mwSession_isStopped(s) \
141 (mwSession_isState((s), mwSession_STOPPED))
192 gboolean may_reply,
const char *text);
252 const char *text,
const GList *recipients);
359 gpointer val, GDestroyNotify
clear);
380 gpointer data, GDestroyNotify
clear);
mwService_funcClear clear
The service's cleanup handler.
Definition: mw_service.h:195
Definition: mw_common.h:123
session is stopped
Definition: mw_session.h:116
void mwSession_setProperty(struct mwSession *, const char *key, gpointer val, GDestroyNotify clear)
associate a key:value pair with the session.
struct mwCipher * mwSession_getCipher(struct mwSession *, guint16 type)
find a cipher by its type identifier
void(* on_setPrivacyInfo)(struct mwSession *)
called when privacy information has been sent or received
Definition: mw_session.h:180
indicates an error determining state
Definition: mw_session.h:117
session is starting
Definition: mw_session.h:108
void mwSession_start(struct mwSession *)
instruct the session to begin.
void mwSession_removeClientData(struct mwSession *session)
remove client data, calling the optional GDestroyNotify function indicated in mwSession_setClientData...
void mwSession_setClientData(struct mwSession *session, gpointer data, GDestroyNotify clear)
associate arbitrary data with the session for use by the client code.
session has received login ack
Definition: mw_session.h:113
struct mwCipher * mwSession_removeCipher(struct mwSession *, guint16 type)
remove a cipher from the session
void mwSession_recv(struct mwSession *, const guchar *, gsize)
Data is buffered, unpacked, and parsed into a message, then processed accordingly.
session is shutting down
Definition: mw_session.h:115
void(* clear)(struct mwSession *)
triggered by mwSession_free.
Definition: mw_session.h:164
gpointer mwSession_getStateInfo(struct mwSession *)
additional status-specific information.
struct mwSession * mwSession_new(struct mwSessionHandler *)
allocate a new session
void mwSession_removeProperty(struct mwSession *, const char *key)
remove a property, calling the optional GDestroyNotify function indicated in mwSession_setProperty if...
Collection of channels.
Definition: mw_channel.h:101
GList * mwSession_getCiphers(struct mwSession *)
a GList of ciphers in this session.
gboolean mwSession_addService(struct mwSession *, struct mwService *)
adds a service to the session.
guint32 type
the unique identifier by which this service is registered.
Definition: mw_service.h:128
GList * mwSession_getServices(struct mwSession *)
a GList of services in this session.
int mwSession_setPrivacyInfo(struct mwSession *, struct mwPrivacyInfo *)
set the internal privacy information, and inform the server as necessary.
gpointer mwSession_getProperty(struct mwSession *, const char *key)
obtain the value of a previously set property, or NULL
session is active
Definition: mw_session.h:114
int mwSession_setUserStatus(struct mwSession *, struct mwUserStatus *)
set the internal user status state, and inform the server as necessary.
Represents a Sametime client session.
A cipher.
Definition: mw_cipher.h:70
void(* on_admin)(struct mwSession *, const char *text)
called when an admin messages has been received
Definition: mw_session.h:188
void(* on_announce)(struct mwSession *, struct mwLoginInfo *from, gboolean may_reply, const char *text)
called when an announcement arrives
Definition: mw_session.h:191
struct mwService * mwSession_getService(struct mwSession *, guint32 type)
find a service by its type identifier
gboolean mwSession_addCipher(struct mwSession *, struct mwCipher *)
adds a cipher to the session.
Common data types and functions for handling those types.
void mwSession_senseService(struct mwSession *s, guint32 type)
instruct a STARTED session to check the server for the presense of a given service.
struct mwLoginInfo * mwSession_getLoginInfo(struct mwSession *)
reference the login information for the session
struct mwSession * session
session this service is attached to.
Definition: mw_service.h:139
session has sent handshake
Definition: mw_session.h:109
A service is the recipient of sendOnCnl messages sent over channels marked with the corresponding ser...
Definition: mw_service.h:123
session has sent login
Definition: mw_session.h:111
void mwSession_free(struct mwSession *)
stop, clear, free a session.
struct mwPrivacyInfo * mwSession_getPrivacyInfo(struct mwSession *)
direct reference to the session's internal privacy structure
struct mwSessionHandler * mwSession_getHandler(struct mwSession *)
obtain a reference to the session's handler
session handler.
Definition: mw_session.h:154
void(* on_stateChange)(struct mwSession *s, enum mwSessionState state, gpointer info)
Called when the session has changed status.
Definition: mw_session.h:173
void mwSession_stop(struct mwSession *, guint32 reason)
instruct the session to shut down with the following reason code.
session has been redirected
Definition: mw_session.h:112
void(* io_close)(struct mwSession *)
close the server connection.
Definition: mw_session.h:161
Definition: mw_common.h:169
guint16 type
Definition: mw_cipher.h:76
gpointer mwSession_getClientData(struct mwSession *session)
int mwSession_sendKeepalive(struct mwSession *s)
sends the keepalive byte
Definition: mw_common.h:146
mwSessionState
Definition: mw_session.h:107
struct mwUserStatus * mwSession_getUserStatus(struct mwSession *)
int(* io_write)(struct mwSession *, const guchar *buf, gsize len)
write data to the server connection.
Definition: mw_session.h:158
struct mwService * mwSession_removeService(struct mwSession *, guint32 type)
removes a service from the session.
session has sent a login continue
Definition: mw_session.h:118
session has received handshake ack
Definition: mw_session.h:110
int mwSession_sendAnnounce(struct mwSession *s, gboolean may_reply, const char *text, const GList *recipients)
send an announcement to a list of users/groups.
enum mwSessionState mwSession_getState(struct mwSession *)
current status of the session
void(* on_setUserStatus)(struct mwSession *)
called when user status has changed
Definition: mw_session.h:185
int mwSession_forceLogin(struct mwSession *s)
respond to a login redirect message by forcing the login sequence to continue through the immediate s...
struct mwChannelSet * mwSession_getChannels(struct mwSession *)
Definition: mw_message.h:72
int mwSession_send(struct mwSession *s, struct mwMessage *msg)
primarily used by services to have messages serialized and sent