General structure of a mig33 TCP packet. All packets from both client and server use this structure:
Table 1. Packet structure
Length | Content (if fixed) | Name | Description |
---|---|---|---|
1 byte | 02 | MAGIC | Identifies the packet as a mig33 packet. |
2 bytes | xx xx | COMMAND1 | High two bytes part of the command code for type of packet. |
2 bytes | xx xx | COMMAND2 | Low two bytes part of the command code for type of packet. |
4 bytes | xx xx xx xx | PACK_LEN | The length of the payload after this point. |
variable | PARAMS | Varable length data specific to a certain command. |
The PARAMS portion of the packet contains a list of block structures. The structure of each block is as follows:
Table 2. Block structure
Length | Name | Description |
---|---|---|
2 bytes | ID | The ID number of the block. |
4 bytes | LENGTH | The length of the block. |
variable | CONTENT | The contents of the block. |
The following commands are available for the client to send to the server:
Table 3. Client commands
High command bytes | Low command bytes | Name | Description |
---|---|---|---|
00 02 (2) | xx xx | KEEP_ALIVE | The keep alive packet. |
00 64 (100) | 00 02 (2) | REGISTER | The registration packet |
00 C8 (200) | 00 01 (1) | LOGIN_1 | The initial login packet |
00 CA (202) | 00 02 (2) | LOGIN_RESP | Login response to challenge packet sent by server. |
01 90 (400) | 00 03 (3) | GET_CLIST | Get contact list. |
01 F4 (500) | 00 06 (6) | SEND_MSG | Send a message to an entity (chat room or contact) |
03 8E (910) | 00 06 (6) | SEND_PIC_REQUEST | Tell the mig33 server that you wish to send a picture. |
Not yet described in detail
The following commands can be sent from the server to the client, either as a response to a client command, or to notify the client of some event.
Table 5. Server commands
High command bytes | Low command bytes | Name | Description |
---|---|---|---|
00 00 (0) | 00 00 (0) | ERROR_MESSAGE | A packet that notifies the client of an error. |
00 00 (0) | 00 01 (1) | LOGIN_NOTIFY | A packet that notifies the client that the server is down, or under going maintanence. |
00 00 (0) | 00 02 (2) | LOGIN_BAD_RESP | Login failure message when Client sends a bad LOGIN_RESP packet. |
00 01 (1) | 00 02 (2) | REGISTER_OK | The message that the server sends when registration (the REGISTER packet) is successful. |
00 03 (3) | xx xx | KEEP_ALIVE_RESP | The keep alive response packet. |
00 C9 (201) | 00 01 (1) | LOGIN_CHAL | Login challenge sent from server to client after receiving LOGIN_1 packet. |
00 CB (203) | 00 02 (2) | LOGIN_OK / MOTD | Login OK message with message of the day |
01 91 (401) | 00 03 (3) | CLIST_GROUPS | Packet sent with groups after requesting contact list. |
01 92 (402) | 00 03 (3) | CLIST_BUDDIES | Packet sent with buddies after requesting contact list. |
01 93 (403) | 00 03 (3) | CLIST_TERMINATOR | Packet sent to tell mig33 that the contact list is sent. |
01 94 (404) | 00 00 (0) | CLIST_STATUS_CHANGE | Packet sent to tell mig33 that the status of someone on your buddy list has changed. |
01 F4 (500) | 00 00 (0) | RECV_MSG | Receive a message from an entity. (Chatroom or contact) |
01 F6 (502) | 00 00 (0) | RECV_SYS_MSG | Receive a system message |