Protocols/OSCAR/SNAC/ICBM CHANNEL MSG TO CLIENT

From NINA Wiki
Jump to navigation Jump to search
OSCAR Protocol
IntroductionTermsClients
Basic
DatatypesFLAPSNACTLV
UUIDsErrorsTool IDs
Host Interaction
Rate LimitsMigrationMessages
Other Services
ADMINADVERTALERT
BARTBOSBUCPCHAT
CHAT_NAV
Tutorials
Sign OnBARTRendezvous
ICBMLocateBuddies
Foodgroups
OSERVICE (0x0001)
LOCATE (0x0002)
BUDDY (0x0003)
ICBM (0x0004)
ADVERT (0x0005)
INVITE (0x0006)
ADMIN (0x0007)
POPUP (0x0008)
PD (0x0009)
USER_LOOKUP (0x000A)
STATS (0x000B)
TRANSLATE (0x000C)
CHAT_NAV (0x000D)
CHAT (0x000E)
ODIR (0x000F)
BART (0x0010)
FEEDBAG (0x0013)
ICQ (0x0015)
BUCP (0x0017)
ALERT (0x0018)
PLUGIN (0x0022)
UNNAMED_FG_24 (0x0024)
MDIR (0x0025)
ARS (0x044A)
ID Origin Name Foodgroup Service Status Version
0x0004, 0x0007 Host ICBM__CHANNEL_MSG_TOCLIENT Unspecified BOS Active 1.25

This is the ICBM__CHANNEL_MSG_TOHOST after it has been reformatted by the host and sent to the destination client.

SNAC Header

Foodgroup uint16 (word) 00 04
Subgroup uint16 (word) 00 07
Flags uint16 (word) 00 00
Request ID uint32 (dword) 00 00 00 00

SNAC Data

Name Type Notes
cookie ICBM Cookie Opaque data generated by conversation initiator and used to link up the conversation and errors
channel uint16 (word) [Class: ICBM__CHANNELS] Channel the message is on
info OSERVICE__USERINFO Information about the sender of the message
icbmTlvs TLV [Class: ICBM__TAGS] Actual message

From Aleksandr Shutko: SNAC(04,07) message for client from server

SNAC(04,07)  ICBM__CHANNEL_MSG_TOCLIENT 


You'll receive this snac when another client send you a message thru server. Within the ICBM (Inter-Client Basic Message) types, a channel is defined. Each channel represents a different kind of message.

Channel 1 is used for simple plain text messages. Channel 2 is used for complex messages (rtf, utf8) and negotiating "rendezvous". These transactions end in something more complex happening, such as a chat invitation, or a file transfer. Channel 4 is used for various ICQ messages. Examples are normal messages, URLs, and old-style authorization.

This snac contain one fixed part (sender uin, channel, msg-id cookie, sender info) and channel-dependend tlv-chain with message data. See also additional information about online userinfo block.

 00 04   word   SNAC family
 00 07   word   SNAC subtype
 00 00   word   SNAC flags
 xx xx xx xx   dword   SNAC request-id
 xx xx xx xx
 xx xx xx xx
  qword   msg-id cookie
 xx xx   word   message channel (see table below)
 xx   byte   screenname string length
 xx ..   string   screenname string
 xx xx   word   sender warning level
 00 04   word   number of TLVs in fixed part
 00 01   word   TLV.Type(0x01) - user class
 00 02   word   TLV.Length
 xx xx   word   User class
 00 06   word   TLV.Type(0x06) - user status
 00 04   word   TLV.Length
 xx xx xx xx   dword   User status
 00 0F   word   TLV.Type(0x0F) - online time
 00 04   word   TLV.Length
 xx xx xx xx   dword   client online time
 00 03   word   TLV.Type(0x03) - account creation time
 00 04   word   TLV.Length
 xx xx xx xx   dword   user account creation time

 xx xx   word   TLV.Type(0xXX) - icbm data
 xx xx   word   TLV.Length
 ....   ....   ....


  ....  .... ....
 xx xx   word   TLV.Type(0xXX) - icbm data
 xx xx   word   TLV.Length
 ....   ....   ....



 Channel 1    Channel 1 message format (plain-text messages)
 Channel 2    Channel 2 message format (rtf messages, rendezvous)
 Channel 4    Channel 4 message format (typed old-style messages)



Examples

Channel 1 Example

From Aleksandr Shutko: SNAC(04,07)/CH1 channel1 message from server for client

SNAC(04,07)/CH1  ICBM__CHANNEL_MSG_TOCLIENT/CH1 

This is the message from server that was sent by another client. It contain two parts: fixed part (sender uin, msg-id cookie, channel, sender info) and message data part. See also additional information about online userinfo block.

 00 04   word   SNAC family
 00 07   word   SNAC subtype
 00 00   word   SNAC flags
 xx xx xx xx   dword   SNAC request-id
 xx xx xx xx
 xx xx xx xx
  qword   msg-id cookie
 00 01   word   message channel
 xx   byte   screenname string length
 xx ..   string   screenname string
 xx xx   word   sender warning level
 00 04   word   number of TLVs in fixed part
 00 01   word   TLV.Type(0x01) - user class
 00 02   word   TLV.Length
 xx xx   word   User class
 00 06   word   TLV.Type(0x06) - user status
 00 04   word   TLV.Length
 xx xx xx xx   dword   User status
 00 0f   word   TLV.Type(0x0f) - user idle time
 00 04   word   TLV.Length
 xx xx xx xx   dword   client idle time
 00 03   word   TLV.Type(0x03) - account creation time
 00 04   word   TLV.Length
 xx xx xx xx   dword   user account creation time
 00 04   word   TLV.Type(0x04) - automated response flag
 00 00   word   TLV.Length
 empty (this TLV appears in automated responses like away messages)

 00 02   word   TLV.Type(0x02) - message data
 xx xx   word   TLV.Length
 05   byte   fragment identifier (array of required capabilities)
 01   byte   fragment version
 xx xx   word   TLV.Length
 xx ..   array   byte array of required capabilities (1 - text)
 01   byte   fragment identifier (message text)
 01   byte   fragment version
 xx xx   word   TLV.Length
 00 00   word   Message charset number
 ff ff   word   Message charset subset
 xx ..   string (ascii)   Message text string


Example SNAC dumps with flap header:


  2a 02 ae e3 00 66 00 04  00 07 00 00 9a b3 8d eb  *....f..........
  3e bc 91 9e 4a ba ef c9  00 01 07 31 30 30 30 30  >...J......10000
  30 30 00 00 00 04 00 01  00 02 00 50 00 06 00 04  00.........P....
  00 01 00 00 00 0f 00 04  00 00 04 66 00 03 00 04  ...........f....
  00 00 00 00 00 02 00 24  05 01 00 01 00 01 01 00  .......$........
  1b 00 00 00 00 74 65 73  74 20 70 6c 61 69 6e 2d  .....test plain-
  74 65 78 74 20 6d 65 73  73 61 67 65              text message


Channel 2 Example

From Aleksandr Shutko: SNAC(04,07)/CH2 channel 2 message from server for client

SNAC(04,07)/CH2  ICBM__CHANNEL_MSG_TOCLIENT/CH2 


This is the message from server that was sent by another client. It contain two parts: fixed part (sender uin, msg-id cookie, channel, sender info) and message data part. See also additional information about online userinfo block.

 00 04   word   SNAC family
 00 07   word   SNAC subtype
 00 00   word   SNAC flags
 xx xx xx xx   dword   SNAC request-id
 xx xx xx xx
 xx xx xx xx
  qword   msg-id cookie
 00 02   word   message channel
 xx   byte   screenname string length
 xx ..   string   screenname string
 xx xx   word   sender warning level
 xx xx   word   number of TLVs in fixed part
 00 01   word   TLV.Type(0x01) - user class
 00 02   word   TLV.Length
 xx xx   word   User class
 00 06   word   TLV.Type(0x06) - user status
 00 04   word   TLV.Length
 xx xx xx xx   dword   User status
 00 0F   word   TLV.Type(0x0F) - online time
 00 04   word   TLV.Length
 xx xx xx xx   dword   client online time
 00 03   word   TLV.Type(0x03) - account creation time
 00 04   word   TLV.Length
 xx xx xx xx   dword   user account creation time

 00 05   word   TLV.Type(0x05) - rendezvous message data
 xx xx   word   TLV.Length
 xx xx   word   message type (0 - request, 1 - cancel, 2 - accept)
 xx xx xx xx
 xx xx xx xx
  qword   msg-id cookie (same as above)
 xx .. xx   guid   capability (determines format of message data in "extention data" below)
 00 04   word   TLV.Type(0x04) - external ip
 xx xx   word   TLV.Length
 xx xx xx xx   dword   external ip
 00 05   word   TLV.Type(0x05) - listening port
 xx xx   word   TLV.Length
 xx xx   word   listening port
 00 0A   word   TLV.Type(0x0A) - unknown
 xx xx   word   TLV.Length
 xx xx   word   unknown (usually 1)
 00 0B   word   TLV.Type(0x0B) - unknown
 xx xx   word   TLV.Length
 xx xx   word   unknown
 00 0F   word   TLV.Type(0x0F) - unknown
 00 00   word   TLV.Length
 empty
 27 11   word   TLV.Type(0x2711) - extention data
 xx xx   word   TLV.Length
Following contents is capability-specific.
       Data format description for capability 
        {09461349-4C7F-11D1-8222-444553540000}
 xx xx   word (LE)   length of following data
 xx xx   word (LE)   protocol version
 xx .. xx   guid (LE)   plugin or zero bytes
 xx xx   word   unknown
 xx xx xx xx   dword (LE)   client capabilities flags
 xx   byte   unknown
 xx xx   word (LE)   seems to be a downcounter
 xx xx   word (LE)   length of following data
 xx xx   word (LE)   seems to be a downcounter as in first chunk above
 xx ..     unknown, usually zeros
if plugin field in first chunk above is zero,
here is
        message, overwise here is
        plugin-specific data.


Example SNAC dumps with flap header:


  2A 02 08 2C 01 9D 00 04 00 07 00 00 90 2F 30 11  *..,.???......???/0.
  70 95 A0 00 26 1F 00 00 00 02 07 31 32 33 34 35  p??????.&......12345
  36 37 00 00 00 04 00 01 00 02 00 50 00 06 00 04  67.........P....
  20 12 00 00 00 0F 00 04 00 00 06 F3 00 03 00 04   ..........???....
  40 5A 93 78 00 05 01 5B 00 00 70 95 A0 00 26 1F  @Z???x...[..p??????.&.
  00 00 09 46 13 49 4C 7F 11 D1 82 22 44 45 53 54  ...F.IL?.T???"DEST
  00 00 00 0A 00 02 00 01 00 0F 00 00 27 11 01 33  ............'..3
  1B 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00 00 00 00 00 00 03 00 00 00 00 E3 FF 0E 00 E3  ...........???..???
  FF 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00  ???...............
  00 21 00 CC 00 7B 5C 72 74 66 31 5C 61 6E 73 69  .!.???.{\rtf1\ansi
  5C 61 6E 73 69 63 70 67 31 32 35 31 5C 64 65 66  \ansicpg1251\def
  66 30 5C 64 65 66 6C 61 6E 67 31 30 34 39 7B 5C  f0\deflang1049{\
  66 6F 6E 74 74 62 6C 7B 5C 66 30 5C 66 6E 69 6C  fonttbl{\f0\fnil
  5C 66 63 68 61 72 73 65 74 32 30 34 7B 5C 2A 5C  \fcharset204{\*\
  66 6E 61 6D 65 20 4D 53 20 53 61 6E 73 20 53 65  fname MS Sans Se
  72 69 66 3B 7D 4D 53 20 53 68 65 6C 6C 20 44 6C  rif;}MS Shell Dl
  67 3B 7D 7D 0D 0A 7B 5C 63 6F 6C 6F 72 74 62 6C  g;}}..{\colortbl
  20 3B 5C 72 65 64 30 5C 67 72 65 65 6E 30 5C 62   ;\red0\green0\b
  6C 75 65 30 3B 7D 0D 0A 5C 76 69 65 77 6B 69 6E  lue0;}..\viewkin
  64 34 5C 75 63 31 5C 70 61 72 64 5C 63 66 31 5C  d4\uc1\pard\cf1\
  66 30 5C 66 73 32 30 3C 23 23 69 63 71 69 6D 61  f0\fs20<##icqima
  67 65 30 30 30 38 3E 5C 70 61 72 0D 0A 7D 0D 0A  ge0008>\par..}..
  00 00 00 00 00 FF FF FF 00 26 00 00 00 7B 39 37  .....?????????.&...{97
  42 31 32 37 35 31 2D 32 34 33 43 2D 34 33 33 34  B12751-243C-4334
  2D 41 44 32 32 2D 44 36 41 42 46 37 33 46 31 34  -AD22-D6ABF73F14
  39 32 7D                                         92}


Channel 4 Example

From Aleksandr Shutko: SNAC(04,07) message for client from server

SNAC(04,07)  ICBM__CHANNEL_MSG_TOCLIENT/CH4 


You'll receive this snac when another client send you a message on channel 4 thru server. ICQ clients use this snac to send messages to an old/offline/invisible clients if message type != 1 or message flags != 0 (for example plain-text multi-recipient message to an offline client) but this doesn't mean that you will never receive usual channel 4 plain-text message. See also additional information about online userinfo block.

 00 04   word   SNAC family
 00 07   word   SNAC subtype
 00 00   word   SNAC flags
 xx xx xx xx   dword   SNAC request-id
 xx xx xx xx
 xx xx xx xx
  qword   msg-id cookie
 xx xx   word   message channel (see table below)
 xx   byte   screenname string length
 xx ..   string   screenname string
 xx xx   word   sender warning level
 00 04   word   number of TLVs in fixed part
 00 01   word   TLV.Type(0x01) - user class
 00 02   word   TLV.Length
 xx xx   word   User class
 00 06   word   TLV.Type(0x06) - user status
 00 04   word   TLV.Length
 xx xx xx xx   dword   User status
 00 0f   word   TLV.Type(0x0f) - user idle time
 00 04   word   TLV.Length
 xx xx xx xx   dword   client idle time
 00 03   word   TLV.Type(0x03) - account creation time
 00 04   word   TLV.Length
 xx xx xx xx   dword   user account creation time

 00 05   word   TLV.Type(0x05) - message data
 xx xx   word   TLV.Length
 xx xx xx xx   dword (LE)   Sender uin
 xx   byte   Message type
 xx   byte   Message flags
 xx xx   word (LE)   Message string length
 xx .. 00   string (asciiz)   Message string


Example SNAC dumps with flap header:


  2a 02 ae e2 00 6a 00 04  00 07 00 00 9a b3 8d eb  *....j..........
  3e bc 8e 0a 59 65 b9 56  00 04 07 31 30 30 30 30  >...Ye.V...10000
  30 30 00 00 00 04 00 01  00 02 00 50 00 06 00 04  00.........P....
  00 01 00 00 00 0f 00 04  00 00 00 d2 00 03 00 04  ................
  00 00 00 00 00 05 00 28  40 42 0f 00 04 00 20 00  .......(@B.... .
  55 72 6c 20 64 65 73 63  72 69 70 74 69 6f 6e fe  Url description.
  68 74 74 70 3a 2f 2f 74  65 73 74 2e 75 72 6c 00  http://test.url.


ICBM SNACs

SNAC List
Subgroup Origin Name
0x0001 Any ICBM__ERR
This is the error SNAC for the ICBM foodgroup.
0x0002 Client ICBM__ADD_PARAMETERS
This SNAC is typically sent prior to sending the OSERVICE__CLIENT_ONLINE so that the host is properly initialized with the clients' preferences.
0x0003 Client ICBM__DEL_PARAMETERS
These are the delete all parameters for a given channel.
0x0004 Client ICBM__PARAMETER_QUERY
This SNAC requests ICBM parameters from the host.
0x0005 Host ICBM__PARAMETER_REPLY
This SNAC is sent by the host in response to a ICBM__PARAMETER_QUERY.
0x0006 Client ICBM__CHANNEL_MSG_TOHOST
This is the basic inter-client message after which the group was named (Inter-Client Basic Messages).
0x0007 Host ICBM__CHANNEL_MSG_TOCLIENT
This is the ICBM__CHANNEL_MSG_TOHOST after it has been reformatted by the host and sent to the destination client.
0x0008 Client ICBM__EVIL_REQUEST
This requests that the specified user is sent an EVIL notification.
0x0009 Host ICBM__EVIL_REPLY
The reply tells the requester, the sender of an ICBM__EVIL_REQUEST SNAC, how much EVIL, if any, was applied to the recipient.
0x000A Host ICBM__MISSED_CALLS
When the host is unable to send one or more messages to the client, the host sends this SNAC to the client to let it know that it missed some messages ("calls").
0x000B Any ICBM__CLIENT_ERR
This error notice is one of the few SNACs that can be sent to the host and received by a client.
0x000C Host ICBM__HOST_ACK
This SNAC is sent by the host upon receipt of any ICBM__CHANNEL_MSG_TOHOST which includes the optional ICBM__TLV_TAGS_REQUEST_HOST_ACK TLV.
0x000D NCD ICBM__SIN_STORED
This is not currently documented. Want to contribute?
0x000E NCD ICBM__SIN_LIST_QUERY
This is not currently documented. Want to contribute?
0x000F NCD ICBM__SIN_LIST_REPLY
This is not currently documented. Want to contribute?
0x0010 Client ICBM__SIN_RETRIEVE
This requests ICBM__CHANNEL_MSG_TOCLIENT messages be generated for each of the stored ICBMs. Any message retrieved is deleted.
0x0011 NCD ICBM__SIN_DELETE
This is not currently documented. Want to contribute?
0x0012 NCD ICBM__NOTIFY_REQUEST
This is not currently documented. Want to contribute?
0x0013 NCD ICBM__NOTIFY_REPLY
This is not currently documented. Want to contribute?
0x0014 Any ICBM__CLIENT_EVENT
This SNAC is sent as a control message, sent by a client to inform the recipient of an event, or by the host informing of an event.
0x0017 Host ICBM__SIN_REPLY
The host successfully processed the request to retrieve all the offline messages.