meanwhile  1.0.2
Data Structures | Macros | Enumerations | Functions
mw_message.h File Reference
#include <glib.h>
#include "mw_common.h"

Go to the source code of this file.

Data Structures

struct  mwEncryptAccept
 a selected encryption item from those offered More...
 
struct  mwEncryptOffer
 an offer of encryption items More...
 
struct  mwMessage
 
struct  mwMsgAdmin
 An administrative broadcast message. More...
 
struct  mwMsgAnnounce
 An announcement between users. More...
 
struct  mwMsgChannelAccept
 
struct  mwMsgChannelCreate
 
struct  mwMsgChannelDestroy
 
struct  mwMsgChannelSend
 
struct  mwMsgHandshake
 
struct  mwMsgHandshakeAck
 
struct  mwMsgLogin
 
struct  mwMsgLoginAck
 
struct  mwMsgLoginContinue
 
struct  mwMsgLoginRedirect
 
struct  mwMsgSenseService
 Sent to the server to request the presense of a service by its ID. More...
 
struct  mwMsgSetPrivacyList
 
struct  mwMsgSetUserStatus
 

Macros

#define MW_MESSAGE(msg)   (&msg->head)
 Cast a pointer to a message subtype (eg, mwMsgHandshake, mwMsgAdmin) into a pointer to a mwMessage. More...
 
#define MW_MESSAGE_HAS_OPTION(msg, opt)   ((msg)->options & (opt))
 

Enumerations

enum  mwAuthType {
  mwAuthType_PLAIN = 0x0000,
  mwAuthType_TOKEN = 0x0001,
  mwAuthType_ENCRYPT = 0x0002,
  mwAuthType_RC2_40 = 0x0002,
  mwAuthType_RC2_128 = 0x0004
}
 
enum  mwMessageOption {
  mwMessageOption_ENCRYPT = 0x4000,
  mwMessageOption_HAS_ATTRIBS = 0x8000
}
 
enum  mwMessageType {
  mwMessage_HANDSHAKE = 0x0000,
  mwMessage_HANDSHAKE_ACK = 0x8000,
  mwMessage_LOGIN = 0x0001,
  mwMessage_LOGIN_ACK = 0x8001,
  mwMessage_LOGIN_REDIRECT = 0x0018,
  mwMessage_LOGIN_CONTINUE = 0x0016,
  mwMessage_CHANNEL_CREATE = 0x0002,
  mwMessage_CHANNEL_DESTROY = 0x0003,
  mwMessage_CHANNEL_SEND = 0x0004,
  mwMessage_CHANNEL_ACCEPT = 0x0006,
  mwMessage_SET_USER_STATUS = 0x0009,
  mwMessage_SET_PRIVACY_LIST = 0x000b,
  mwMessage_SENSE_SERVICE = 0x0011,
  mwMessage_ADMIN = 0x0019,
  mwMessage_ANNOUNCE = 0x0022
}
 Indicates the type of a message. More...
 

Functions

void mwMessage_free (struct mwMessage *msg)
 
struct mwMessagemwMessage_get (struct mwGetBuffer *b)
 build a message from its representation More...
 
struct mwMessagemwMessage_new (enum mwMessageType type)
 Allocate and initialize a new message of the specified type. More...
 
void mwMessage_put (struct mwPutBuffer *b, struct mwMessage *msg)
 

Macro Definition Documentation

◆ MW_MESSAGE

#define MW_MESSAGE (   msg)    (&msg->head)

Cast a pointer to a message subtype (eg, mwMsgHandshake, mwMsgAdmin) into a pointer to a mwMessage.

◆ MW_MESSAGE_HAS_OPTION

#define MW_MESSAGE_HAS_OPTION (   msg,
  opt 
)    ((msg)->options & (opt))
See also
mwMessageOption

Enumeration Type Documentation

◆ mwAuthType

enum mwAuthType
Enumerator
mwAuthType_PLAIN 
mwAuthType_TOKEN 
mwAuthType_ENCRYPT 
Todo:
remove for 1.0
mwAuthType_RC2_40 
mwAuthType_RC2_128 

◆ mwMessageOption

Enumerator
mwMessageOption_ENCRYPT 

message data is encrypted

mwMessageOption_HAS_ATTRIBS 

message has attributes

◆ mwMessageType

Indicates the type of a message.

Enumerator
mwMessage_HANDSHAKE 

mwMsgHandshake

mwMessage_HANDSHAKE_ACK 

mwMsgHandshakeAck

mwMessage_LOGIN 

mwMsgLogin

mwMessage_LOGIN_ACK 

mwMsgLoginAck

mwMessage_LOGIN_REDIRECT 

mwMsgLoginRedirect

mwMessage_LOGIN_CONTINUE 

mwMsgLoginContinue

mwMessage_CHANNEL_CREATE 

mwMsgChannelCreate

mwMessage_CHANNEL_DESTROY 

mwMsgChannelDestroy

mwMessage_CHANNEL_SEND 

mwMsgChannelSend

mwMessage_CHANNEL_ACCEPT 

mwMsgChannelAccept

mwMessage_SET_USER_STATUS 

mwMsgSetUserStatus

mwMessage_SET_PRIVACY_LIST 

mwMsgSetPrivacyList

mwMessage_SENSE_SERVICE 

mwMsgSenseService

mwMessage_ADMIN 

mwMsgAdmin

mwMessage_ANNOUNCE 

mwMsgAnnounce

Function Documentation

◆ mwMessage_free()

void mwMessage_free ( struct mwMessage msg)

◆ mwMessage_get()

struct mwMessage* mwMessage_get ( struct mwGetBuffer b)

build a message from its representation

◆ mwMessage_new()

struct mwMessage* mwMessage_new ( enum mwMessageType  type)

Allocate and initialize a new message of the specified type.

◆ mwMessage_put()

void mwMessage_put ( struct mwPutBuffer b,
struct mwMessage msg 
)