mw_channel.h | mw_channel.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
Library General Public License for more details. | Library General Public License for more details. | |||
You should have received a copy of the GNU Library General Public | You should have received a copy of the GNU Library General Public | |||
License along with this library; if not, write to the Free | License along with this library; if not, write to the Free | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
*/ | */ | |||
#ifndef _MW_CHANNEL_H | #ifndef _MW_CHANNEL_H | |||
#define _MW_CHANNEL_H | #define _MW_CHANNEL_H | |||
#include <time.h> | ||||
#include "mw_common.h" | ||||
/** @file mw_channel.h | /** @file mw_channel.h | |||
Life-cycle of an outgoing channel: | Life-cycle of an outgoing channel: | |||
1: mwChannel_new is called. If there is a channel in the outgoing | 1: mwChannel_new is called. If there is a channel in the outgoing | |||
collection in state NEW, then it is returned. Otherwise, a channel | collection in state NEW, then it is returned. Otherwise, a channel | |||
is allocated, assigned a unique outgoing id, marked as NEW, and | is allocated, assigned a unique outgoing id, marked as NEW, and | |||
returned. | returned. | |||
2: channel is set to INIT status (effectively earmarking it as in- | 2: channel is set to INIT status (effectively earmarking it as in- | |||
skipping to change at line 80 | skipping to change at line 77 | |||
out queues for that channel are processed. The channel is now ready | out queues for that channel are processed. The channel is now ready | |||
to be used. | to be used. | |||
4: data is sent and received over the channel | 4: data is sent and received over the channel | |||
5: The channel is closed either by receipt of a close message or by | 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 | 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 | the server. The channel is cleaned up, its queues dumped, and it | |||
is deallocated. */ | is deallocated. */ | |||
#include <time.h> | ||||
#include "mw_common.h" | ||||
#ifdef _cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/* place-holders */ | /* place-holders */ | |||
struct mwCipherInstance; | struct mwCipherInstance; | |||
struct mwMsgChannelAccept; | struct mwMsgChannelAccept; | |||
struct mwMsgChannelCreate; | struct mwMsgChannelCreate; | |||
struct mwMsgChannelDestroy; | struct mwMsgChannelDestroy; | |||
struct mwMsgChannelSend; | struct mwMsgChannelSend; | |||
struct mwService; | struct mwService; | |||
struct mwSession; | struct mwSession; | |||
/** @struct mwChannel | /** @struct mwChannel | |||
skipping to change at line 254 | skipping to change at line 258 | |||
/** the list of supported ciphers for a channel. This list will be | /** the list of supported ciphers for a channel. This list will be | |||
empty once a cipher has been selected for the channel */ | empty once a cipher has been selected for the channel */ | |||
GList *mwChannel_getSupportedCipherInstances(struct mwChannel *chan); | GList *mwChannel_getSupportedCipherInstances(struct mwChannel *chan); | |||
/** select a cipher instance for a channel. A NULL instance indicates | /** select a cipher instance for a channel. A NULL instance indicates | |||
that no encryption should be used. */ | that no encryption should be used. */ | |||
void mwChannel_selectCipherInstance(struct mwChannel *chan, | void mwChannel_selectCipherInstance(struct mwChannel *chan, | |||
struct mwCipherInstance *ci); | struct mwCipherInstance *ci); | |||
struct mwCipherInstance * | ||||
mwChannel_getCipherInstance(struct mwChannel *chan); | ||||
/** get the state of a channel */ | /** get the state of a channel */ | |||
enum mwChannelState mwChannel_getState(struct mwChannel *); | enum mwChannelState mwChannel_getState(struct mwChannel *); | |||
/** obtain the value for a statistic field as a gpointer */ | /** obtain the value for a statistic field as a gpointer */ | |||
gpointer mwChannel_getStatistic(struct mwChannel *chan, | gpointer mwChannel_getStatistic(struct mwChannel *chan, | |||
enum mwChannelStatField stat); | enum mwChannelStatField stat); | |||
/** Formally open a channel. | /** Formally open a channel. | |||
For outgoing channels: instruct the session to send a channel | For outgoing channels: instruct the session to send a channel | |||
skipping to change at line 314 | skipping to change at line 321 | |||
void mwChannel_recvAccept(struct mwChannel *chan, | void mwChannel_recvAccept(struct mwChannel *chan, | |||
struct mwMsgChannelAccept *msg); | struct mwMsgChannelAccept *msg); | |||
/** pass a destroy message to a channel for handling */ | /** pass a destroy message to a channel for handling */ | |||
void mwChannel_recvDestroy(struct mwChannel *chan, | void mwChannel_recvDestroy(struct mwChannel *chan, | |||
struct mwMsgChannelDestroy *msg); | struct mwMsgChannelDestroy *msg); | |||
/** Feed data into a channel. */ | /** Feed data into a channel. */ | |||
void mwChannel_recv(struct mwChannel *chan, struct mwMsgChannelSend *msg); | void mwChannel_recv(struct mwChannel *chan, struct mwMsgChannelSend *msg); | |||
#ifdef _cplusplus | ||||
} | ||||
#endif | #endif | |||
#endif /* _MW_CHANNEL_H */ | ||||
End of changes. 5 change blocks. | ||||
3 lines changed or deleted | 12 lines changed or added | |||
mw_cipher.h | mw_cipher.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
License along with this library; if not, write to the Free | License along with this library; if not, write to the Free | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
*/ | */ | |||
#ifndef _MW_CIPHER_H | #ifndef _MW_CIPHER_H | |||
#define _MW_CIPHER_H | #define _MW_CIPHER_H | |||
#include <glib.h> | #include <glib.h> | |||
#include "mw_common.h" | #include "mw_common.h" | |||
#ifdef _cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/* place-holders */ | /* place-holders */ | |||
struct mwChannel; | struct mwChannel; | |||
struct mwSession; | struct mwSession; | |||
/** @enum mwCipherType | /** @enum mwCipherType | |||
Common cipher types */ | Common cipher types */ | |||
enum mwCipherType { | enum mwCipherType { | |||
mwCipher_RC2_40 = 0x0000, | mwCipher_RC2_40 = 0x0000, | |||
mwCipher_RC2_128 = 0x0001, | mwCipher_RC2_128 = 0x0001, | |||
}; | }; | |||
struct mwCipher; | struct mwCipher; | |||
struct mwCipherInstance; | struct mwCipherInstance; | |||
/** Obtain an instance of a given cipher, which can be used for the | /** Obtain an instance of a given cipher, which can be used for the | |||
processing of a single channel. */ | processing of a single channel. */ | |||
typedef struct mwCipherInstance *(*mwCipherInstantiator) | typedef struct mwCipherInstance *(*mwCipherInstantiator) | |||
(struct mwCipher *cipher, struct mwChannel *chan); | (struct mwCipher *cipher, struct mwChannel *chan); | |||
/** Generate a descriptor for use in a channel create message to | ||||
indicate the availability of this cipher | ||||
@todo remove for 1.0 | ||||
*/ | ||||
typedef struct mwEncryptItem *(*mwCipherDescriptor) | ||||
(struct mwCipherInstance *instance); | ||||
/** Process (encrypt or decrypt, depending) the given data. The passed | /** Process (encrypt or decrypt, depending) the given data. The passed | |||
buffer may be freed in processing and be replaced with a freshly | buffer may be freed in processing and be replaced with a freshly | |||
allocated buffer. The post-processed buffer must in turn be freed | allocated buffer. The post-processed buffer must in turn be freed | |||
after use */ | after use */ | |||
typedef int (*mwCipherProcessor) | typedef int (*mwCipherProcessor) | |||
(struct mwCipherInstance *ci, struct mwOpaque *data); | (struct mwCipherInstance *ci, struct mwOpaque *data); | |||
/** A cipher. Ciphers are primarily used to provide cipher instances | /** A cipher. Ciphers are primarily used to provide cipher instances | |||
for bi-directional encryption on channels, but some may be used | for bi-directional encryption on channels, but some may be used | |||
for other activities. Expand upon this structure to create a | for other activities. Expand upon this structure to create a | |||
skipping to change at line 80 | skipping to change at line 76 | |||
struct mwSession *session; | struct mwSession *session; | |||
guint16 type; /**< @see mwCipher_getType */ | guint16 type; /**< @see mwCipher_getType */ | |||
const char *(*get_name)(); /**< @see mwCipher_getName */ | const char *(*get_name)(); /**< @see mwCipher_getName */ | |||
const char *(*get_desc)(); /**< @see mwCipher_getDesc */ | const char *(*get_desc)(); /**< @see mwCipher_getDesc */ | |||
/** Generate a new Cipher Instance for use on a channel | /** Generate a new Cipher Instance for use on a channel | |||
@see mwCipher_newInstance */ | @see mwCipher_newInstance */ | |||
mwCipherInstantiator new_instance; | mwCipherInstantiator new_instance; | |||
/** @see mwCipher_newItem | ||||
@todo remove for 1.0 | ||||
*/ | ||||
mwCipherDescriptor new_item; | ||||
void (*offered)(struct mwCipherInstance *ci, struct mwEncryptItem *item); | void (*offered)(struct mwCipherInstance *ci, struct mwEncryptItem *item); | |||
struct mwEncryptItem *(*offer)(struct mwCipherInstance *ci); | struct mwEncryptItem *(*offer)(struct mwCipherInstance *ci); | |||
void (*accepted)(struct mwCipherInstance *ci, struct mwEncryptItem *item) ; | void (*accepted)(struct mwCipherInstance *ci, struct mwEncryptItem *item) ; | |||
struct mwEncryptItem *(*accept)(struct mwCipherInstance *ci); | struct mwEncryptItem *(*accept)(struct mwCipherInstance *ci); | |||
mwCipherProcessor encrypt; /**< @see mwCipherInstance_encrypt */ | mwCipherProcessor encrypt; /**< @see mwCipherInstance_encrypt */ | |||
mwCipherProcessor decrypt; /**< @see mwCipherInstance_decrypt */ | mwCipherProcessor decrypt; /**< @see mwCipherInstance_decrypt */ | |||
/** prepare this cipher for being free'd | /** prepare this cipher for being free'd | |||
@see mwCipher_free */ | @see mwCipher_free */ | |||
skipping to change at line 137 | skipping to change at line 128 | |||
struct mwCipherInstance *mwCipher_newInstance(struct mwCipher *cipher, | struct mwCipherInstance *mwCipher_newInstance(struct mwCipher *cipher, | |||
struct mwChannel *channel); | struct mwChannel *channel); | |||
/** destroy a cipher */ | /** destroy a cipher */ | |||
void mwCipher_free(struct mwCipher* cipher); | void mwCipher_free(struct mwCipher* cipher); | |||
/** reference the parent cipher of an instance */ | /** reference the parent cipher of an instance */ | |||
struct mwCipher *mwCipherInstance_getCipher(struct mwCipherInstance *ci); | struct mwCipher *mwCipherInstance_getCipher(struct mwCipherInstance *ci); | |||
/** | /** reference the channel a cipher instance is attached to */ | |||
Deprecated in favor of the methods mwCipherInstance_offer and | struct mwChannel *mwCipherInstance_getChannel(struct mwCipherInstance *ci); | |||
mwCipherInstance_accept | ||||
*/ | ||||
struct mwEncryptItem *mwCipherInstance_newItem(struct mwCipherInstance *ci) | ||||
; | ||||
/** Indicates a cipher has been offered to our channel */ | /** Indicates a cipher has been offered to our channel */ | |||
void mwCipherInstance_offered(struct mwCipherInstance *ci, | void mwCipherInstance_offered(struct mwCipherInstance *ci, | |||
struct mwEncryptItem *item); | struct mwEncryptItem *item); | |||
/** Offer a cipher */ | /** Offer a cipher */ | |||
struct mwEncryptItem * | struct mwEncryptItem * | |||
mwCipherInstance_offer(struct mwCipherInstance *ci); | mwCipherInstance_offer(struct mwCipherInstance *ci); | |||
/** Indicates an offered cipher has been accepted */ | /** Indicates an offered cipher has been accepted */ | |||
skipping to change at line 182 | skipping to change at line 170 | |||
These functions are reused where encryption is necessary outside of | These functions are reused where encryption is necessary outside of | |||
a channel (eg. session authentication) | a channel (eg. session authentication) | |||
*/ | */ | |||
/* @{ */ | /* @{ */ | |||
/** generate some pseudo-random bytes | /** generate some pseudo-random bytes | |||
@param keylen count of bytes to write into key | @param keylen count of bytes to write into key | |||
@param key buffer to write keys into | @param key buffer to write keys into | |||
*/ | */ | |||
void mwKeyRandom(char *key, gsize keylen); | void mwKeyRandom(guchar *key, gsize keylen); | |||
/** Setup an Initialization Vector. IV must be at least 8 bytes */ | /** Setup an Initialization Vector. IV must be at least 8 bytes */ | |||
void mwIV_init(char *iv); | void mwIV_init(guchar *iv); | |||
/** Expand a variable-length key into a 128-byte key (represented as | /** Expand a variable-length key into a 128-byte key (represented as | |||
an an array of 64 ints) */ | an an array of 64 ints) */ | |||
void mwKeyExpand(int *ekey, const char *key, gsize keylen); | void mwKeyExpand(int *ekey, const guchar *key, gsize keylen); | |||
/** Encrypt data using an already-expanded key */ | /** Encrypt data using an already-expanded key */ | |||
void mwEncryptExpanded(const int *ekey, char *iv, | void mwEncryptExpanded(const int *ekey, guchar *iv, | |||
struct mwOpaque *in, | struct mwOpaque *in, | |||
struct mwOpaque *out); | struct mwOpaque *out); | |||
/** Encrypt data using an expanded form of the given key */ | /** Encrypt data using an expanded form of the given key */ | |||
void mwEncrypt(const char *key, gsize keylen, char *iv, | void mwEncrypt(const guchar *key, gsize keylen, guchar *iv, | |||
struct mwOpaque *in, struct mwOpaque *out); | struct mwOpaque *in, struct mwOpaque *out); | |||
/** Decrypt data using an already expanded key */ | /** Decrypt data using an already expanded key */ | |||
void mwDecryptExpanded(const int *ekey, char *iv, | void mwDecryptExpanded(const int *ekey, guchar *iv, | |||
struct mwOpaque *in, | struct mwOpaque *in, | |||
struct mwOpaque *out); | struct mwOpaque *out); | |||
/** Decrypt data using an expanded form of the given key */ | /** Decrypt data using an expanded form of the given key */ | |||
void mwDecrypt(const char *key, gsize keylen, char *iv, | void mwDecrypt(const guchar *key, gsize keylen, guchar *iv, | |||
struct mwOpaque *in, struct mwOpaque *out); | struct mwOpaque *in, struct mwOpaque *out); | |||
/* @} */ | /* @} */ | |||
/** | /** | |||
@section Diffie-Hellman Functions | @section Diffie-Hellman Functions | |||
These functions are reused where DH Key negotiation is necessary | These functions are reused where DH Key negotiation is necessary | |||
outside of a channel (eg. session authentication). You'll need to | outside of a channel (eg. session authentication). These are | |||
include <gmp.h> in order to use these functions. | wrapping a full multiple-precision integer math library, but most of | |||
the functionality there-of is not exposed. Currently, the math is | ||||
provided by a copy of the public domain libmpi. | ||||
for more information on the used MPI Library, visit | ||||
http://www.cs.dartmouth.edu/~sting/mpi/ | ||||
*/ | */ | |||
/* @{ */ | /* @{ */ | |||
#ifdef __GMP_H__ | ||||
/** initialize and set a big integer to the Sametime Prime value */ | /** @struct mwMpi */ | |||
void mwInitDHPrime(mpz_t z); | struct mwMpi; | |||
/** initialize and set a big integer to the Sametime Base value */ | /** prepare a new mpi value */ | |||
void mwInitDHBase(mpz_t z); | struct mwMpi *mwMpi_new(); | |||
/** destroy an mpi value */ | ||||
void mwMpi_free(struct mwMpi *i); | ||||
/** Import a value from an opaque */ | ||||
void mwMpi_import(struct mwMpi *i, struct mwOpaque *o); | ||||
/** Export a value into an opaque */ | ||||
void mwMpi_export(struct mwMpi *i, struct mwOpaque *o); | ||||
/** set a big integer to the Sametime Prime value */ | ||||
void mwMpi_setDHPrime(struct mwMpi *i); | ||||
/** set a big integer to the Sametime Base value */ | ||||
void mwMpi_setDHBase(struct mwMpi *i); | ||||
/** sets private to a randomly generated value, and calculates public | /** sets private to a randomly generated value, and calculates public | |||
using the Sametime Prime and Base */ | using the Sametime Prime and Base */ | |||
void mwDHRandKeypair(mpz_t private, mpz_t public); | void mwMpi_randDHKeypair(struct mwMpi *private, struct mwMpi *public); | |||
/** sets the shared key value based on the remote and private keys, | /** sets the shared key value based on the remote and private keys, | |||
using the Sametime Prime and Base */ | using the Sametime Prime and Base */ | |||
void mwDHCalculateShared(mpz_t shared, mpz_t remote, mpz_t private); | void mwMpi_calculateDHShared(struct mwMpi *shared, struct mwMpi *remote, | |||
struct mwMpi *private); | ||||
/** Import a DH key from an opaque */ | ||||
void mwDHImportKey(mpz_t key, struct mwOpaque *o); | ||||
/** Export a DH key into an opaque */ | ||||
void mwDHExportKey(mpz_t key, struct mwOpaque *o); | ||||
#endif | ||||
/* @} */ | /* @} */ | |||
#ifdef _cplusplus | ||||
} | ||||
#endif | #endif | |||
#endif /* _MW_CIPHER_H */ | ||||
End of changes. 20 change blocks. | ||||
42 lines changed or deleted | 44 lines changed or added | |||
mw_common.h | mw_common.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
Library General Public License for more details. | Library General Public License for more details. | |||
You should have received a copy of the GNU Library General Public | You should have received a copy of the GNU Library General Public | |||
License along with this library; if not, write to the Free | License along with this library; if not, write to the Free | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
*/ | */ | |||
#ifndef _MW_COMMON_H | #ifndef _MW_COMMON_H | |||
#define _MW_COMMON_H | #define _MW_COMMON_H | |||
#include <glib.h> | ||||
/** @file mw_common.h | /** @file mw_common.h | |||
Common data types and functions for handling those types. | Common data types and functions for handling those types. | |||
Functions in this file all fit into similar naming conventions of | Functions in this file all fit into similar naming conventions of | |||
<code>TYPE_ACTION</code> as per the activity they perform. The | <code>TYPE_ACTION</code> as per the activity they perform. The | |||
following actions are available: | following actions are available: | |||
<code>void TYPE_put(struct mwPutBuffer *b, TYPE *val)</code> | <code>void TYPE_put(struct mwPutBuffer *b, TYPE *val)</code> | |||
- marshalls val onto the buffer b. The buffer will grow as necessary | - marshalls val onto the buffer b. The buffer will grow as necessary | |||
skipping to change at line 61 | skipping to change at line 59 | |||
<code>void TYPE_clone(TYPE *to, TYPE *from)</code> | <code>void TYPE_clone(TYPE *to, TYPE *from)</code> | |||
- copies/clones members of from into to. May result in memory | - copies/clones members of from into to. May result in memory | |||
allocation for some types. Note that to is not cleared | allocation for some types. Note that to is not cleared | |||
before-hand, it must already be in a pristine condition. | before-hand, it must already be in a pristine condition. | |||
<code>gboolean TYPE_equal(TYPE *y, TYPE *z)</code> | <code>gboolean TYPE_equal(TYPE *y, TYPE *z)</code> | |||
- simple equality test. | - simple equality test. | |||
*/ | */ | |||
#include <glib.h> | ||||
#ifdef _cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/** @struct mwPutBuffer | /** @struct mwPutBuffer | |||
buffer to be written to */ | buffer to be written to */ | |||
struct mwPutBuffer; | struct mwPutBuffer; | |||
/** @struct mwGetBuffer | /** @struct mwGetBuffer | |||
buffer to be read from */ | buffer to be read from */ | |||
struct mwGetBuffer; | struct mwGetBuffer; | |||
/** A length of binary data, not null-terminated. */ | /** A length of binary data, not null-terminated. */ | |||
struct mwOpaque { | struct mwOpaque { | |||
gsize len; /**< length of data. */ | gsize len; /**< length of data. */ | |||
char *data; /**< data, normally with no NULL termination */ | guchar *data; /**< data, normally with no NULL termination */ | |||
}; | }; | |||
/* 8.3.6 Login Types */ | /* 8.3.6 Login Types */ | |||
/** The type of login. Normally meaning the type of client code being | /** The type of login. Normally meaning the type of client code being | |||
used to login with. | used to login with. | |||
If you know of any additional client identifiers, please add them | If you know of any additional client identifiers, please add them | |||
below. | below or submit an RFE to the meanwhile tracker. | |||
If you are using Meanwhile in your client code and would like to | ||||
differentiate yourself, please email siege at preoccupied dot net | ||||
with all the relevant information you can think of and I'll add it | ||||
to the text mapping as well | ||||
@see mwLoginType_getName | ||||
*/ | */ | |||
enum mwLoginType { | enum mwLoginType { | |||
mwLogin_LIB = 0x1000, /**< official Lotus binary library */ | mwLogin_LIB = 0x1000, /**< official Lotus binary library */ | |||
mwLogin_JAVA_WEB = 0x1001, /**< official Lotus Java applet */ | mwLogin_JAVA_WEB = 0x1001, /**< official Lotus Java applet */ | |||
mwLogin_BINARY = 0x1002, /**< official Lotus binary application * / | mwLogin_BINARY = 0x1002, /**< official Lotus binary application * / | |||
mwLogin_JAVA_APP = 0x1003, /**< official Lotus Java application */ | mwLogin_JAVA_APP = 0x1003, /**< official Lotus Java application */ | |||
mwLogin_LINKS = 0x100a, /**< official Sametime Links toolkit */ | mwLogin_LINKS = 0x100a, /**< official Sametime Links toolkit */ | |||
/* now we're getting crazy */ | /* now we're getting crazy */ | |||
mwLogin_NOTES_6_5 = 0x1200, | mwLogin_NOTES_6_5 = 0x1200, | |||
mwLogin_NOTES_7_0 = 0x1210, | mwLogin_NOTES_6_5_3 = 0x1203, | |||
mwLogin_NOTES_7_0_beta = 0x1210, | ||||
mwLogin_NOTES_7_0 = 0x1214, | ||||
mwLogin_ICT = 0x1300, | mwLogin_ICT = 0x1300, | |||
mwLogin_ICT_1_7_8_2 = 0x1302, | mwLogin_ICT_1_7_8_2 = 0x1302, | |||
mwLogin_NOTESBUDDY = 0x1400, /**< 0xff00 mask? */ | mwLogin_ICT_SIP = 0x1303, | |||
mwLogin_NOTESBUDDY_4_14 = 0x1400, /**< 0xff00 mask? */ | ||||
mwLogin_NOTESBUDDY_4_15 = 0x1405, | mwLogin_NOTESBUDDY_4_15 = 0x1405, | |||
mwLogin_NOTESBUDDY_4_16 = 0x1406, | ||||
mwLogin_SANITY = 0x1600, | mwLogin_SANITY = 0x1600, | |||
mwLogin_ST_PERL = 0x1625, | mwLogin_ST_PERL = 0x1625, | |||
mwLogin_PMR_ALERT = 0x1650, | mwLogin_PMR_ALERT = 0x1650, | |||
mwLogin_TRILLIAN = 0x16aa, /**< http://sf.net/st-plugin/ */ | mwLogin_TRILLIAN = 0x16aa, /**< http://sf.net/st-plugin/ */ | |||
mwLogin_TRILLIAN_IBM = 0x16bb, | mwLogin_TRILLIAN_IBM = 0x16bb, | |||
mwLogin_MEANWHILE = 0x1700, /**< Meanwhile library */ | mwLogin_MEANWHILE = 0x1700, /**< Meanwhile library */ | |||
}; | }; | |||
/* 8.2 Common Structures */ | /* 8.2 Common Structures */ | |||
/* 8.2.1 Login Info block */ | /* 8.2.1 Login Info block */ | |||
skipping to change at line 257 | skipping to change at line 258 | |||
/** count of remaining available bytes */ | /** count of remaining available bytes */ | |||
gsize mwGetBuffer_remaining(struct mwGetBuffer *b); | gsize mwGetBuffer_remaining(struct mwGetBuffer *b); | |||
/** TRUE if an error occurred while reading a basic type from this | /** TRUE if an error occurred while reading a basic type from this | |||
buffer */ | buffer */ | |||
gboolean mwGetBuffer_error(struct mwGetBuffer *b); | gboolean mwGetBuffer_error(struct mwGetBuffer *b); | |||
/*@}*/ | /*@}*/ | |||
/** provides a textual name for a given login type. If the type is not | /** @name Basic Data Types | |||
known by name, returns NULL */ | The basic types are combined to construct the compound types. | |||
const char *mwLoginType_getName(enum mwLoginType type); | ||||
/** @name Basic Data Type Marshalling | ||||
The basic types are combined to construct the complex types. | ||||
*/ | */ | |||
/*@{*/ | /*@{*/ | |||
void guint16_put(struct mwPutBuffer *b, guint16 val); | void guint16_put(struct mwPutBuffer *b, guint16 val); | |||
void guint16_get(struct mwGetBuffer *b, guint16 *val); | void guint16_get(struct mwGetBuffer *b, guint16 *val); | |||
guint16 guint16_peek(struct mwGetBuffer *b); | guint16 guint16_peek(struct mwGetBuffer *b); | |||
void guint32_put(struct mwPutBuffer *b, guint32 val); | void guint32_put(struct mwPutBuffer *b, guint32 val); | |||
skipping to change at line 300 | skipping to change at line 297 | |||
void mwOpaque_get(struct mwGetBuffer *b, struct mwOpaque *o); | void mwOpaque_get(struct mwGetBuffer *b, struct mwOpaque *o); | |||
void mwOpaque_clear(struct mwOpaque *o); | void mwOpaque_clear(struct mwOpaque *o); | |||
void mwOpaque_free(struct mwOpaque *o); | void mwOpaque_free(struct mwOpaque *o); | |||
void mwOpaque_clone(struct mwOpaque *to, const struct mwOpaque *from); | void mwOpaque_clone(struct mwOpaque *to, const struct mwOpaque *from); | |||
/*@}*/ | /*@}*/ | |||
/** @name Complex Data Type Marshalling */ | /** @name Compound Data Types */ | |||
/*@{*/ | /*@{*/ | |||
void mwLoginInfo_put(struct mwPutBuffer *b, const struct mwLoginInfo *info) ; | void mwLoginInfo_put(struct mwPutBuffer *b, const struct mwLoginInfo *info) ; | |||
void mwLoginInfo_get(struct mwGetBuffer *b, struct mwLoginInfo *info); | void mwLoginInfo_get(struct mwGetBuffer *b, struct mwLoginInfo *info); | |||
void mwLoginInfo_clear(struct mwLoginInfo *info); | void mwLoginInfo_clear(struct mwLoginInfo *info); | |||
void mwLoginInfo_clone(struct mwLoginInfo *to, const struct mwLoginInfo *fr om); | void mwLoginInfo_clone(struct mwLoginInfo *to, const struct mwLoginInfo *fr om); | |||
skipping to change at line 387 | skipping to change at line 384 | |||
const struct mwEncryptItem *item); | const struct mwEncryptItem *item); | |||
void mwEncryptItem_get(struct mwGetBuffer *b, struct mwEncryptItem *item); | void mwEncryptItem_get(struct mwGetBuffer *b, struct mwEncryptItem *item); | |||
void mwEncryptItem_clear(struct mwEncryptItem *item); | void mwEncryptItem_clear(struct mwEncryptItem *item); | |||
void mwEncryptItem_free(struct mwEncryptItem *item); | void mwEncryptItem_free(struct mwEncryptItem *item); | |||
/*@}*/ | /*@}*/ | |||
#ifdef _cplusplus | ||||
} | ||||
#endif | #endif | |||
#endif /* _MW_COMMON_H */ | ||||
End of changes. 11 change blocks. | ||||
21 lines changed or deleted | 20 lines changed or added | |||
mw_error.h | mw_error.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
Library General Public License for more details. | Library General Public License for more details. | |||
You should have received a copy of the GNU Library General Public | You should have received a copy of the GNU Library General Public | |||
License along with this library; if not, write to the Free | License along with this library; if not, write to the Free | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
*/ | */ | |||
#ifndef _MW_ERROR_H | #ifndef _MW_ERROR_H | |||
#define _MW_ERROR_H | #define _MW_ERROR_H | |||
#include <glib.h> | ||||
/** @file mw_error.h | /** @file mw_error.h | |||
Common error code constants used by Meanwhile. | Common error code constants used by Meanwhile. | |||
Not all of these error codes (or even many, really) will ever | Not all of these error codes (or even many, really) will ever | |||
actually appear from Meanwhile. These are taken directly from the | actually appear from Meanwhile. These are taken directly from the | |||
houri draft, along with the minimal explanation for each. | houri draft, along with the minimal explanation for each. | |||
*/ | */ | |||
#include <glib.h> | ||||
#ifdef _cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/** reference to a new string appropriate for the given error code.*/ | /** reference to a new string appropriate for the given error code.*/ | |||
char* mwError(guint32 code); | char* mwError(guint32 code); | |||
/* 8.3 Constants */ | /* 8.3 Constants */ | |||
/* 8.3.1 Error Codes */ | /* 8.3.1 Error Codes */ | |||
/* 8.3.1.1 General error/success codes */ | /* 8.3.1.1 General error/success codes */ | |||
/** @enum ERR_GENERAL | /** @enum ERR_GENERAL | |||
general error codes */ | general error codes */ | |||
enum ERR_GENERAL { | enum ERR_GENERAL { | |||
skipping to change at line 156 | skipping to change at line 160 | |||
enum ERR_IM { | enum ERR_IM { | |||
ERR_IM_COULDNT_REGISTER = 0x80002003, | ERR_IM_COULDNT_REGISTER = 0x80002003, | |||
ERR_IM_ALREADY_REGISTERED = 0x80002004, | ERR_IM_ALREADY_REGISTERED = 0x80002004, | |||
/** apparently, this is used to mean that the requested feature (per | /** apparently, this is used to mean that the requested feature (per | |||
the channel create addtl data) is not supported by the client on | the channel create addtl data) is not supported by the client on | |||
the other end of the IM channel */ | the other end of the IM channel */ | |||
ERR_IM_NOT_REGISTERED = 0x80002005, | ERR_IM_NOT_REGISTERED = 0x80002005, | |||
}; | }; | |||
#ifdef _cplusplus | ||||
} | ||||
#endif | #endif | |||
#endif /* _MW_ERROR_H */ | ||||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 8 lines changed or added | |||
mw_message.h | mw_message.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
License along with this library; if not, write to the Free | License along with this library; if not, write to the Free | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
*/ | */ | |||
#ifndef _MW_MESSAGE_H | #ifndef _MW_MESSAGE_H | |||
#define _MW_MESSAGE_H | #define _MW_MESSAGE_H | |||
#include <glib/glist.h> | #include <glib/glist.h> | |||
#include "mw_common.h" | #include "mw_common.h" | |||
#ifdef _cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/** Cast a pointer to a message subtype (eg, mwMsgHandshake, | /** Cast a pointer to a message subtype (eg, mwMsgHandshake, | |||
mwMsgAdmin) into a pointer to a mwMessage */ | mwMsgAdmin) into a pointer to a mwMessage */ | |||
#define MW_MESSAGE(msg) (&msg->head) | #define MW_MESSAGE(msg) (&msg->head) | |||
/** Indicates the type of a message. */ | /** Indicates the type of a message. */ | |||
enum mwMessageType { | enum mwMessageType { | |||
mwMessage_HANDSHAKE = 0x0000, /**< mwMsgHandshake */ | mwMessage_HANDSHAKE = 0x0000, /**< mwMsgHandshake */ | |||
mwMessage_HANDSHAKE_ACK = 0x8000, /**< mwMsgHandshakeAck */ | mwMessage_HANDSHAKE_ACK = 0x8000, /**< mwMsgHandshakeAck */ | |||
mwMessage_LOGIN = 0x0001, /**< mwMsgLogin */ | mwMessage_LOGIN = 0x0001, /**< mwMsgLogin */ | |||
mwMessage_LOGIN_ACK = 0x8001, /**< mwMsgLoginAck */ | mwMessage_LOGIN_ACK = 0x8001, /**< mwMsgLoginAck */ | |||
skipping to change at line 264 | skipping to change at line 268 | |||
guint16 unknown_a; /**< unknown A. Usually 0x00 */ | guint16 unknown_a; /**< unknown A. Usually 0x00 */ | |||
gboolean may_reply; /**< replies allowed */ | gboolean may_reply; /**< replies allowed */ | |||
char *text; /**< text of message */ | char *text; /**< text of message */ | |||
/** list of (char *) indicating recipients. Recipient users are in | /** list of (char *) indicating recipients. Recipient users are in | |||
the format "@U username" and recipient NAB groups are in the | the format "@U username" and recipient NAB groups are in the | |||
format "@G groupname" */ | format "@G groupname" */ | |||
GList *recipients; | GList *recipients; | |||
}; | }; | |||
#ifdef _cplusplus | ||||
} | ||||
#endif | #endif | |||
#endif /* _MW_MESSAGE_H */ | ||||
End of changes. 3 change blocks. | ||||
0 lines changed or deleted | 6 lines changed or added | |||
mw_service.h | mw_service.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
You should have received a copy of the GNU Library General Public | You should have received a copy of the GNU Library General Public | |||
License along with this library; if not, write to the Free | License along with this library; if not, write to the Free | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
*/ | */ | |||
#ifndef _MW_SERVICE_H | #ifndef _MW_SERVICE_H | |||
#define _MW_SERVICE_H | #define _MW_SERVICE_H | |||
#include "mw_common.h" | #include "mw_common.h" | |||
#ifdef _cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/* place-holders */ | /* place-holders */ | |||
struct mwChannel; | struct mwChannel; | |||
struct mwService; | struct mwService; | |||
struct mwSession; | struct mwSession; | |||
struct mwMsgChannelCreate; | struct mwMsgChannelCreate; | |||
struct mwMsgChannelAccept; | struct mwMsgChannelAccept; | |||
struct mwMsgChannelDestroy; | struct mwMsgChannelDestroy; | |||
/** State-tracking for a service */ | /** State-tracking for a service */ | |||
enum mwServiceState { | enum mwServiceState { | |||
skipping to change at line 328 | skipping to change at line 332 | |||
/** Reference associated client data */ | /** Reference associated client data */ | |||
gpointer mwService_getClientData(struct mwService *service); | gpointer mwService_getClientData(struct mwService *service); | |||
/** Removes client data from service. If there is a cleanup function, | /** Removes client data from service. If there is a cleanup function, | |||
it will be called. */ | it will be called. */ | |||
void mwService_removeClientData(struct mwService *service); | void mwService_removeClientData(struct mwService *service); | |||
/*@}*/ | /*@}*/ | |||
#ifdef _cplusplus | ||||
} | ||||
#endif | #endif | |||
#endif /* _MW_SERVICE_H */ | ||||
End of changes. 3 change blocks. | ||||
0 lines changed or deleted | 6 lines changed or added | |||
mw_session.h | mw_session.h | |||
---|---|---|---|---|
skipping to change at line 47 | skipping to change at line 47 | |||
A session does not perform reads on a socket directly. Instead, it | A session does not perform reads on a socket directly. Instead, it | |||
must be fed from an outside source via the mwSession_recv | must be fed from an outside source via the mwSession_recv | |||
function. The session will buffer and merge data passed to this | function. The session will buffer and merge data passed to this | |||
function to build complete protocol messages, and will act upon | function to build complete protocol messages, and will act upon | |||
each complete message accordingly. | each complete message accordingly. | |||
*/ | */ | |||
#include "mw_common.h" | #include "mw_common.h" | |||
#ifdef __cplusplus | ||||
extern "C" { | ||||
#endif | ||||
struct mwChannelSet; | struct mwChannelSet; | |||
struct mwCipher; | struct mwCipher; | |||
struct mwMessage; | struct mwMessage; | |||
struct mwService; | struct mwService; | |||
/** default protocol major version */ | /** default protocol major version */ | |||
#define MW_PROTOCOL_VERSION_MAJOR 0x001e | #define MW_PROTOCOL_VERSION_MAJOR 0x001e | |||
/** default protocol minor version */ | /** default protocol minor version */ | |||
#define MW_PROTOCOL_VERSION_MINOR 0x001d | #define MW_PROTOCOL_VERSION_MINOR 0x001d | |||
skipping to change at line 143 | skipping to change at line 147 | |||
struct mwSession; | struct mwSession; | |||
/** @struct mwSessionHandler | /** @struct mwSessionHandler | |||
session handler. Structure which interfaces a session with client | session handler. Structure which interfaces a session with client | |||
code to provide I/O and event handling */ | code to provide I/O and event handling */ | |||
struct mwSessionHandler { | struct mwSessionHandler { | |||
/** write data to the server connection. Required. Should return | /** write data to the server connection. Required. Should return | |||
zero for success, non-zero for error */ | zero for success, non-zero for error */ | |||
int (*io_write)(struct mwSession *, const char *buf, gsize len); | int (*io_write)(struct mwSession *, const guchar *buf, gsize len); | |||
/** close the server connection. Required */ | /** close the server connection. Required */ | |||
void (*io_close)(struct mwSession *); | void (*io_close)(struct mwSession *); | |||
/** triggered by mwSession_free. Optional. Put cleanup code here */ | /** triggered by mwSession_free. Optional. Put cleanup code here */ | |||
void (*clear)(struct mwSession *); | void (*clear)(struct mwSession *); | |||
/** Called when the session has changed status. | /** Called when the session has changed status. | |||
@see mwSession_getStateInfo for uses of info field | @see mwSession_getStateInfo for uses of info field | |||
skipping to change at line 201 | skipping to change at line 205 | |||
/** instruct the session to begin. This will result in the initial | /** instruct the session to begin. This will result in the initial | |||
handshake message being sent. */ | handshake message being sent. */ | |||
void mwSession_start(struct mwSession *); | void mwSession_start(struct mwSession *); | |||
/** instruct the session to shut down with the following reason | /** instruct the session to shut down with the following reason | |||
code. */ | code. */ | |||
void mwSession_stop(struct mwSession *, guint32 reason); | void mwSession_stop(struct mwSession *, guint32 reason); | |||
/** Data is buffered, unpacked, and parsed into a message, then | /** Data is buffered, unpacked, and parsed into a message, then | |||
processed accordingly. */ | processed accordingly. */ | |||
void mwSession_recv(struct mwSession *, const char *, gsize); | void mwSession_recv(struct mwSession *, const guchar *, gsize); | |||
/** primarily used by services to have messages serialized and sent | /** primarily used by services to have messages serialized and sent | |||
@param s session to send message over | @param s session to send message over | |||
@param msg message to serialize and send | @param msg message to serialize and send | |||
@returns 0 for success */ | @returns 0 for success */ | |||
int mwSession_send(struct mwSession *s, struct mwMessage *msg); | int mwSession_send(struct mwSession *s, struct mwMessage *msg); | |||
/** sends the keepalive byte */ | /** sends the keepalive byte */ | |||
int mwSession_sendKeepalive(struct mwSession *s); | int mwSession_sendKeepalive(struct mwSession *s); | |||
skipping to change at line 342 | skipping to change at line 346 | |||
*/ | */ | |||
void mwSession_setClientData(struct mwSession *session, | void mwSession_setClientData(struct mwSession *session, | |||
gpointer data, GDestroyNotify clear); | gpointer data, GDestroyNotify clear); | |||
gpointer mwSession_getClientData(struct mwSession *session); | gpointer mwSession_getClientData(struct mwSession *session); | |||
/** remove client data, calling the optional GDestroyNotify function | /** remove client data, calling the optional GDestroyNotify function | |||
indicated in mwSession_setClientData if applicable */ | indicated in mwSession_setClientData if applicable */ | |||
void mwSession_removeClientData(struct mwSession *session); | void mwSession_removeClientData(struct mwSession *session); | |||
#ifdef __cplusplus | ||||
} | ||||
#endif | #endif | |||
#endif /* _MW_SESSION_H */ | ||||
End of changes. 5 change blocks. | ||||
2 lines changed or deleted | 8 lines changed or added | |||
mw_srvc_aware.h | mw_srvc_aware.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
Library General Public License for more details. | Library General Public License for more details. | |||
You should have received a copy of the GNU Library General Public | You should have received a copy of the GNU Library General Public | |||
License along with this library; if not, write to the Free | License along with this library; if not, write to the Free | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
*/ | */ | |||
#ifndef _MW_SRVC_AWARE_H | #ifndef _MW_SRVC_AWARE_H | |||
#define _MW_SRVC_AWARE_H | #define _MW_SRVC_AWARE_H | |||
#include "mw_common.h" | ||||
/** @file mw_srvc_aware.h | /** @file mw_srvc_aware.h | |||
The aware service... | The aware service... | |||
@todo remove the whole idea of an instantiated mwAwareList and | @todo remove the whole idea of an instantiated mwAwareList and | |||
instead use arbitrary pointers (including NULL) as keys to | instead use arbitrary pointers (including NULL) as keys to | |||
internally stored lists. This removes the problem of the service | internally stored lists. This removes the problem of the service | |||
free'ing its lists and invalidating mwAwareList references from | free'ing its lists and invalidating mwAwareList references from | |||
client code. | client code. | |||
*/ | */ | |||
#include "mw_common.h" | ||||
#ifdef _cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/** Type identifier for the aware service */ | /** Type identifier for the aware service */ | |||
#define mwService_AWARE 0x00000011 | #define mwService_AWARE 0x00000011 | |||
/** @struct mwServiceAware | /** @struct mwServiceAware | |||
Instance of an Aware Service. The members of this structure are | Instance of an Aware Service. The members of this structure are | |||
not made available. Accessing the parts of an aware service should | not made available. Accessing the parts of an aware service should | |||
be performed through the appropriate functions. Note that | be performed through the appropriate functions. Note that | |||
instances of this structure can be safely cast to a mwService. | instances of this structure can be safely cast to a mwService. | |||
*/ | */ | |||
skipping to change at line 226 | skipping to change at line 230 | |||
const char *mwServiceAware_getText(struct mwServiceAware *srvc, | const char *mwServiceAware_getText(struct mwServiceAware *srvc, | |||
struct mwAwareIdBlock *user); | struct mwAwareIdBlock *user); | |||
/** look up the last known copy of an attribute for a user by the | /** look up the last known copy of an attribute for a user by the | |||
attribute's key */ | attribute's key */ | |||
const struct mwAwareAttribute * | const struct mwAwareAttribute * | |||
mwServiceAware_getAttribute(struct mwServiceAware *srvc, | mwServiceAware_getAttribute(struct mwServiceAware *srvc, | |||
struct mwAwareIdBlock *user, | struct mwAwareIdBlock *user, | |||
guint32 key); | guint32 key); | |||
#ifdef _cplusplus | ||||
} | ||||
#endif | #endif | |||
#endif /* _MW_SRVC_AWARE_H */ | ||||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 8 lines changed or added | |||
mw_srvc_conf.h | mw_srvc_conf.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
License along with this library; if not, write to the Free | License along with this library; if not, write to the Free | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
*/ | */ | |||
#ifndef _MW_SRVC_CONF_H | #ifndef _MW_SRVC_CONF_H | |||
#define _MW_SRVC_CONF_H | #define _MW_SRVC_CONF_H | |||
#include <glib/glist.h> | #include <glib/glist.h> | |||
#include "mw_common.h" | #include "mw_common.h" | |||
#ifdef _cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/** Type identifier for the conference service */ | /** Type identifier for the conference service */ | |||
#define mwService_CONFERENCE 0x80000010 | #define mwService_CONFERENCE 0x80000010 | |||
enum mwConferenceState { | enum mwConferenceState { | |||
mwConference_NEW, /**< new outgoing conference */ | mwConference_NEW, /**< new outgoing conference */ | |||
mwConference_PENDING, /**< outgoing conference pending creation */ | mwConference_PENDING, /**< outgoing conference pending creation */ | |||
mwConference_INVITED, /**< invited to incoming conference */ | mwConference_INVITED, /**< invited to incoming conference */ | |||
mwConference_OPEN, /**< conference open and active */ | mwConference_OPEN, /**< conference open and active */ | |||
mwConference_CLOSING, /**< conference is closing */ | mwConference_CLOSING, /**< conference is closing */ | |||
mwConference_ERROR, /**< conference is closing due to error */ | mwConference_ERROR, /**< conference is closing due to error */ | |||
skipping to change at line 173 | skipping to change at line 177 | |||
void mwConference_setClientData(struct mwConference *conf, | void mwConference_setClientData(struct mwConference *conf, | |||
gpointer data, GDestroyNotify clear); | gpointer data, GDestroyNotify clear); | |||
/** reference associated client data */ | /** reference associated client data */ | |||
gpointer mwConference_getClientData(struct mwConference *conf); | gpointer mwConference_getClientData(struct mwConference *conf); | |||
/** remove associated client data if any, and call the cleanup | /** remove associated client data if any, and call the cleanup | |||
function on the data as necessary */ | function on the data as necessary */ | |||
void mwConference_removeClientData(struct mwConference *conf); | void mwConference_removeClientData(struct mwConference *conf); | |||
#ifdef _cplusplus | ||||
} | ||||
#endif | #endif | |||
#endif /* _MW_SRVC_CONF_H */ | ||||
End of changes. 3 change blocks. | ||||
0 lines changed or deleted | 6 lines changed or added | |||
mw_srvc_dir.h | mw_srvc_dir.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
License along with this library; if not, write to the Free | License along with this library; if not, write to the Free | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
*/ | */ | |||
#ifndef _MW_SRVC_DIR_H | #ifndef _MW_SRVC_DIR_H | |||
#define _MW_SERV_DIR_H | #define _MW_SERV_DIR_H | |||
#include <glib.h> | #include <glib.h> | |||
#include <glib/glist.h> | #include <glib/glist.h> | |||
#ifdef _cplusplus | ||||
extern "C" { | ||||
#endif | ||||
struct mwSession; | struct mwSession; | |||
#define SERVICE_DIRECTORY 0x0000001a | #define SERVICE_DIRECTORY 0x0000001a | |||
/** @struct mwServiceDirectory | /** @struct mwServiceDirectory | |||
the directory service. */ | the directory service. */ | |||
struct mwServiceDirectory; | struct mwServiceDirectory; | |||
/** @struct mwAddressBook | /** @struct mwAddressBook | |||
skipping to change at line 169 | skipping to change at line 173 | |||
/** continue a search into its previous results */ | /** continue a search into its previous results */ | |||
int mwDirectory_previous(struct mwDirectory *dir); | int mwDirectory_previous(struct mwDirectory *dir); | |||
/** initiate a search on an open directory */ | /** initiate a search on an open directory */ | |||
int mwDirectory_search(struct mwDirectory *dir, const char *query); | int mwDirectory_search(struct mwDirectory *dir, const char *query); | |||
/** close and free the directory, and unassociate it with its owning | /** close and free the directory, and unassociate it with its owning | |||
address book and service */ | address book and service */ | |||
int mwDirectory_destroy(struct mwDirectory *dir); | int mwDirectory_destroy(struct mwDirectory *dir); | |||
#ifdef _cplusplus | ||||
} | ||||
#endif | #endif | |||
#endif /* _MW_SRVC_DIR_H */ | ||||
End of changes. 3 change blocks. | ||||
0 lines changed or deleted | 6 lines changed or added | |||
mw_srvc_ft.h | mw_srvc_ft.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
Library General Public License for more details. | Library General Public License for more details. | |||
You should have received a copy of the GNU Library General Public | You should have received a copy of the GNU Library General Public | |||
License along with this library; if not, write to the Free | License along with this library; if not, write to the Free | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
*/ | */ | |||
#ifndef _MW_SRVC_FT_H | #ifndef _MW_SRVC_FT_H | |||
#define _MW_SRVC_FT_H | #define _MW_SRVC_FT_H | |||
#include "mw_common.h" | ||||
/** @file mw_srvc_ft.h | /** @file mw_srvc_ft.h | |||
A file transfer is a simple way to get large chunks of binary data | A file transfer is a simple way to get large chunks of binary data | |||
from one client to another. | from one client to another. | |||
*/ | */ | |||
#include "mw_common.h" | ||||
#ifdef _cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/** @struct mwServiceFileTransfer | /** @struct mwServiceFileTransfer | |||
File transfer service | File transfer service | |||
*/ | */ | |||
struct mwServiceFileTransfer; | struct mwServiceFileTransfer; | |||
/** @struct mwFileTransfer | /** @struct mwFileTransfer | |||
A single file trasfer session | A single file trasfer session | |||
*/ | */ | |||
struct mwFileTransfer; | struct mwFileTransfer; | |||
skipping to change at line 205 | skipping to change at line 209 | |||
*/ | */ | |||
int mwFileTransfer_ack(struct mwFileTransfer *ft); | int mwFileTransfer_ack(struct mwFileTransfer *ft); | |||
void mwFileTransfer_setClientData(struct mwFileTransfer *ft, | void mwFileTransfer_setClientData(struct mwFileTransfer *ft, | |||
gpointer data, GDestroyNotify clean); | gpointer data, GDestroyNotify clean); | |||
gpointer mwFileTransfer_getClientData(struct mwFileTransfer *ft); | gpointer mwFileTransfer_getClientData(struct mwFileTransfer *ft); | |||
void mwFileTransfer_removeClientData(struct mwFileTransfer *ft); | void mwFileTransfer_removeClientData(struct mwFileTransfer *ft); | |||
#ifdef _cplusplus | ||||
} | ||||
#endif | #endif | |||
#endif /* _MW_SRVC_FT_H */ | ||||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 8 lines changed or added | |||
mw_srvc_im.h | mw_srvc_im.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
Library General Public License for more details. | Library General Public License for more details. | |||
You should have received a copy of the GNU Library General Public | You should have received a copy of the GNU Library General Public | |||
License along with this library; if not, write to the Free | License along with this library; if not, write to the Free | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
*/ | */ | |||
#ifndef _MW_SRVC_IM_H | #ifndef _MW_SRVC_IM_H | |||
#define _MW_SRVC_IM_H | #define _MW_SRVC_IM_H | |||
#include <glib.h> | ||||
#include "mw_common.h" | ||||
/** @file mw_srvc_im.h | /** @file mw_srvc_im.h | |||
The IM service provides one-on-one communication between | The IM service provides one-on-one communication between | |||
users. Messages sent over conversations may relay different types | users. Messages sent over conversations may relay different types | |||
of information, in a variety of formats. The basic feature-set | of information, in a variety of formats. The basic feature-set | |||
provides plain-text chat with typing notification. More complex | provides plain-text chat with typing notification. More complex | |||
features may be negotiated transparently by setting the IM Client | features may be negotiated transparently by setting the IM Client | |||
Type for a conversation, or for the service as a whole. | Type for a conversation, or for the service as a whole. | |||
*/ | */ | |||
/** Type identifier for the IM service */ | #include <glib.h> | |||
#include "mw_common.h" | ||||
#ifdef _cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/* identifier for the IM service */ | ||||
#define mwService_IM 0x00001000 | #define mwService_IM 0x00001000 | |||
/** @struct mwServiceIm | /** @struct mwServiceIm | |||
An instance of the IM service. This service provides simple | An instance of the IM service. This service provides simple | |||
instant messaging functionality */ | instant messaging functionality */ | |||
struct mwServiceIm; | struct mwServiceIm; | |||
/** @struct mwConversation | /** @struct mwConversation | |||
skipping to change at line 78 | skipping to change at line 82 | |||
@see mwConversation_supports | @see mwConversation_supports | |||
@see mwConversation_send | @see mwConversation_send | |||
@see mwServiceImHandler::conversation_recv | @see mwServiceImHandler::conversation_recv | |||
*/ | */ | |||
enum mwImSendType { | enum mwImSendType { | |||
mwImSend_PLAIN, /**< char *, plain-text message */ | mwImSend_PLAIN, /**< char *, plain-text message */ | |||
mwImSend_TYPING, /**< gboolean, typing status */ | mwImSend_TYPING, /**< gboolean, typing status */ | |||
mwImSend_HTML, /**< char *, HTML formatted message (NOTESBUDDY) */ | mwImSend_HTML, /**< char *, HTML formatted message (NOTESBUDDY) */ | |||
mwImSend_SUBJECT, /**< char *, conversation subject (NOTESBUDDY) */ | mwImSend_SUBJECT, /**< char *, conversation subject (NOTESBUDDY) */ | |||
mwImSend_MIME, /**< char *, MIME-encoded message (NOTESBUDDY) */ | mwImSend_MIME, /**< char *, MIME-encoded message (NOTESBUDDY) */ | |||
mwImSend_TIMESTAMP, /**< char *, YYYY:MM:DD:HH:mm:SS format (NOTESBUDDY) */ | ||||
}; | }; | |||
/** @see mwConversation_getState */ | /** @see mwConversation_getState */ | |||
enum mwConversationState { | enum mwConversationState { | |||
mwConversation_CLOSED, /**< conversation is not open */ | mwConversation_CLOSED, /**< conversation is not open */ | |||
mwConversation_PENDING, /**< conversation is opening */ | mwConversation_PENDING, /**< conversation is opening */ | |||
mwConversation_OPEN, /**< conversation is open */ | mwConversation_OPEN, /**< conversation is open */ | |||
mwConversation_UNKNOWN, /**< unknown state */ | mwConversation_UNKNOWN, /**< unknown state */ | |||
}; | }; | |||
skipping to change at line 230 | skipping to change at line 235 | |||
@see mwConversation_setClientData | @see mwConversation_setClientData | |||
@see mwConversation_getClientData | @see mwConversation_getClientData | |||
*/ | */ | |||
void mwConversation_removeClientData(struct mwConversation *conv); | void mwConversation_removeClientData(struct mwConversation *conv); | |||
/** close and destroy the conversation and its backing channel, and | /** close and destroy the conversation and its backing channel, and | |||
call the optional client data cleanup function */ | call the optional client data cleanup function */ | |||
void mwConversation_free(struct mwConversation *conv); | void mwConversation_free(struct mwConversation *conv); | |||
#ifdef _cplusplus | ||||
} | ||||
#endif | #endif | |||
#endif /* _MW_SRVC_IM_H */ | ||||
End of changes. 6 change blocks. | ||||
5 lines changed or deleted | 12 lines changed or added | |||
mw_srvc_place.h | mw_srvc_place.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
License along with this library; if not, write to the Free | License along with this library; if not, write to the Free | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
*/ | */ | |||
#ifndef _MW_SRVC_PLACE_H | #ifndef _MW_SRVC_PLACE_H | |||
#define _MW_SRVC_PLACE_H | #define _MW_SRVC_PLACE_H | |||
#include <glib/glist.h> | #include <glib/glist.h> | |||
#include "mw_common.h" | #include "mw_common.h" | |||
#ifdef _cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/** Type identifier for the place service */ | /** Type identifier for the place service */ | |||
#define mwService_PLACE 0x80000022 | #define mwService_PLACE 0x80000022 | |||
/** @struct mwServicePlace */ | /** @struct mwServicePlace */ | |||
struct mwServicePlace; | struct mwServicePlace; | |||
/** @struct mwPlace */ | /** @struct mwPlace */ | |||
struct mwPlace; | struct mwPlace; | |||
struct mwPlaceHandler { | struct mwPlaceHandler { | |||
skipping to change at line 94 | skipping to change at line 98 | |||
int mwPlace_destroy(struct mwPlace *place, guint32 code); | int mwPlace_destroy(struct mwPlace *place, guint32 code); | |||
/** returns a GList* of struct mwIdBlock*. The GList will need to be | /** returns a GList* of struct mwIdBlock*. The GList will need to be | |||
freed after use, the mwIdBlock structures should not be modified | freed after use, the mwIdBlock structures should not be modified | |||
or freed */ | or freed */ | |||
GList *mwPlace_getMembers(struct mwPlace *place); | GList *mwPlace_getMembers(struct mwPlace *place); | |||
int mwPlace_sendText(struct mwPlace *place, const char *msg); | int mwPlace_sendText(struct mwPlace *place, const char *msg); | |||
/** send a legacy invitation for this place to a user. The user will | ||||
receive an apparent invitation from a Conference (rather than a | ||||
Place) */ | ||||
int mwPlace_legacyInvite(struct mwPlace *place, | ||||
struct mwIdBlock *idb, | ||||
const char *message); | ||||
int mwPlace_setAttribute(struct mwPlace *place, guint32 attrib, | int mwPlace_setAttribute(struct mwPlace *place, guint32 attrib, | |||
struct mwOpaque *data); | struct mwOpaque *data); | |||
int mwPlace_unsetAttribute(struct mwPlace *place, guint32 attrib); | int mwPlace_unsetAttribute(struct mwPlace *place, guint32 attrib); | |||
void mwPlace_setClientData(struct mwPlace *place, | void mwPlace_setClientData(struct mwPlace *place, | |||
gpointer data, GDestroyNotify clean); | gpointer data, GDestroyNotify clean); | |||
gpointer mwPlace_getClientData(struct mwPlace *place); | gpointer mwPlace_getClientData(struct mwPlace *place); | |||
void mwPlace_removeClientData(struct mwPlace *place); | void mwPlace_removeClientData(struct mwPlace *place); | |||
#ifdef _cplusplus | ||||
} | ||||
#endif | #endif | |||
#endif /* _MW_SRVC_PLACE_H */ | ||||
End of changes. 4 change blocks. | ||||
0 lines changed or deleted | 13 lines changed or added | |||
mw_srvc_resolve.h | mw_srvc_resolve.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
License along with this library; if not, write to the Free | License along with this library; if not, write to the Free | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
*/ | */ | |||
#ifndef _MW_SRVC_RESOLVE_H | #ifndef _MW_SRVC_RESOLVE_H | |||
#define _MW_SRVC_RESOLVE_H | #define _MW_SRVC_RESOLVE_H | |||
#include <glib.h> | #include <glib.h> | |||
#include <glib/glist.h> | #include <glib/glist.h> | |||
#ifdef _cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/** Type identifier for the conference service */ | /** Type identifier for the conference service */ | |||
#define mwService_RESOLVE 0x00000015 | #define mwService_RESOLVE 0x00000015 | |||
/** Return value of mwServiceResolve_search indicating an error */ | /** Return value of mwServiceResolve_search indicating an error */ | |||
#define SEARCH_ERROR 0x00 | #define SEARCH_ERROR 0x00 | |||
/** @struct mwServiceResolve | /** @struct mwServiceResolve | |||
User lookup service */ | User lookup service */ | |||
struct mwServiceResolve; | struct mwServiceResolve; | |||
skipping to change at line 126 | skipping to change at line 130 | |||
guint32 mwServiceResolve_resolve(struct mwServiceResolve *srvc, | guint32 mwServiceResolve_resolve(struct mwServiceResolve *srvc, | |||
GList *queries, enum mwResolveFlag flags, | GList *queries, enum mwResolveFlag flags, | |||
mwResolveHandler handler, | mwResolveHandler handler, | |||
gpointer data, GDestroyNotify cleanup); | gpointer data, GDestroyNotify cleanup); | |||
/** Cancel a resolve request by its generated ID. The handler function | /** Cancel a resolve request by its generated ID. The handler function | |||
will not be called, and the optional cleanup function will be | will not be called, and the optional cleanup function will be | |||
called upon the optional user data for the request */ | called upon the optional user data for the request */ | |||
void mwServiceResolve_cancelResolve(struct mwServiceResolve *, guint32); | void mwServiceResolve_cancelResolve(struct mwServiceResolve *, guint32); | |||
#ifdef _cplusplus | ||||
} | ||||
#endif | #endif | |||
#endif /* _MW_SRVC_RESOLVE_H */ | ||||
End of changes. 3 change blocks. | ||||
0 lines changed or deleted | 6 lines changed or added | |||
mw_srvc_store.h | mw_srvc_store.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
License along with this library; if not, write to the Free | License along with this library; if not, write to the Free | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
*/ | */ | |||
#ifndef _MW_SRVC_STORE_H | #ifndef _MW_SRVC_STORE_H | |||
#define _MW_SRVC_STORE_H | #define _MW_SRVC_STORE_H | |||
#include <glib.h> | #include <glib.h> | |||
#include "mw_common.h" | #include "mw_common.h" | |||
#ifdef _cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/** Type identifier for the storage service */ | /** Type identifier for the storage service */ | |||
#define mwService_STORAGE 0x00000018 | #define mwService_STORAGE 0x00000018 | |||
/** @struct mwServiceStorage | /** @struct mwServiceStorage | |||
@see mwServiceStorage_new | @see mwServiceStorage_new | |||
Instance of the storage service */ | Instance of the storage service */ | |||
struct mwServiceStorage; | struct mwServiceStorage; | |||
/** @struct mwStorage | /** @struct mwStorage | |||
skipping to change at line 163 | skipping to change at line 167 | |||
@param item storage unit to save | @param item storage unit to save | |||
@param cb callback function when the load call completes | @param cb callback function when the load call completes | |||
@param data optional user data for callback | @param data optional user data for callback | |||
@param data_free optional cleanup function for user data | @param data_free optional cleanup function for user data | |||
*/ | */ | |||
void mwServiceStorage_save(struct mwServiceStorage *srvc, | void mwServiceStorage_save(struct mwServiceStorage *srvc, | |||
struct mwStorageUnit *item, | struct mwStorageUnit *item, | |||
mwStorageCallback cb, | mwStorageCallback cb, | |||
gpointer data, GDestroyNotify data_free); | gpointer data, GDestroyNotify data_free); | |||
#ifdef _cplusplus | ||||
} | ||||
#endif | #endif | |||
#endif /* _MW_SRVC_STORE_H */ | ||||
End of changes. 3 change blocks. | ||||
0 lines changed or deleted | 6 lines changed or added | |||
mw_st_list.h | mw_st_list.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
Library General Public License for more details. | Library General Public License for more details. | |||
You should have received a copy of the GNU Library General Public | You should have received a copy of the GNU Library General Public | |||
License along with this library; if not, write to the Free | License along with this library; if not, write to the Free | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
*/ | */ | |||
#ifndef _MW_ST_LIST_H | #ifndef _MW_ST_LIST_H | |||
#define _MW_ST_LIST_H | #define _MW_ST_LIST_H | |||
/** @file mw_st_list.h | ||||
Parse and compose buddy lists in the format commonly used by Sametime | ||||
Connect clients. | ||||
*/ | ||||
#include <glib.h> | #include <glib.h> | |||
#include <glib/glist.h> | #include <glib/glist.h> | |||
#include "mw_common.h" | #include "mw_common.h" | |||
#ifdef _cplusplus | ||||
extern "C" { | ||||
#endif | ||||
#define ST_LIST_MAJOR 3 | #define ST_LIST_MAJOR 3 | |||
#define ST_LIST_MINOR 1 | #define ST_LIST_MINOR 1 | |||
#define ST_LIST_MICRO 3 | #define ST_LIST_MICRO 3 | |||
enum mwSametimeGroupType { | enum mwSametimeGroupType { | |||
mwSametimeGroup_NORMAL = 1, /**< a normal group of users */ | mwSametimeGroup_NORMAL = 1, /**< a normal group of users */ | |||
mwSametimeGroup_DYNAMIC = 2, /**< a server-side group */ | mwSametimeGroup_DYNAMIC = 2, /**< a server-side group */ | |||
mwSametimeGroup_UNKNOWN = 0, /**< error determining group type */ | mwSametimeGroup_UNKNOWN = 0, /**< error determining group type */ | |||
}; | }; | |||
skipping to change at line 157 | skipping to change at line 167 | |||
const char *mwSametimeUser_getCommunity(struct mwSametimeUser *u); | const char *mwSametimeUser_getCommunity(struct mwSametimeUser *u); | |||
void mwSametimeUser_setShortName(struct mwSametimeUser *u, const char *name ); | void mwSametimeUser_setShortName(struct mwSametimeUser *u, const char *name ); | |||
const char *mwSametimeUser_getShortName(struct mwSametimeUser *u); | const char *mwSametimeUser_getShortName(struct mwSametimeUser *u); | |||
void mwSametimeUser_setAlias(struct mwSametimeUser *u, const char *alias); | void mwSametimeUser_setAlias(struct mwSametimeUser *u, const char *alias); | |||
const char *mwSametimeUser_getAlias(struct mwSametimeUser *u); | const char *mwSametimeUser_getAlias(struct mwSametimeUser *u); | |||
#ifdef _cplusplus | ||||
} | ||||
#endif | #endif | |||
#endif /* _MW_ST_LIST_H */ | ||||
End of changes. 4 change blocks. | ||||
0 lines changed or deleted | 12 lines changed or added | |||