Protocols/OSCAR/SNAC: Difference between revisions

From NINA Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 37: Line 37:


=== Datatype: SNAC__Header ===
=== Datatype: SNAC__Header ===
The FLAP Header will be immediately followed by the SNAC Header that describes what type of message it is for SNAC messages sent over FLAP. The SNAC Header is a simple 10 byte header that contains the foodgroup, type, any high level flags, and the requestId. The requestId is used to link up requests and replies and can also be used to determine the direction of traffic.
A client should never set the high bit of a requestId or use 0. The server will always set the high bit for its requestId unless it is a reply to a client query, in which case it will use the same requestId as the request. The flags field tells the client if for the same request there will be multiple replies and if there are any SNAC Header TLVs.
{| class="wikitable"
! Name
! Type
! Notes
|-
| id
| [[Protocols/OSCAR/SNAC#Datatype:_SNAC_ID|SNAC__ID]]
| Foodgroup and message type
|-
| flags
| uint16 (word)
| ''[Class: [[Protocols/OSCAR/SNAC#Class:_SNAC_HEADER_FLAGS|SNAC__HEADER_FLAGS]]]'' Flags
|-
| requestId
| uint32 (dword)
| Used to link requests and replies
|}


=== Datatype: SNAC__ID ===
=== Datatype: SNAC__ID ===
Describes the foodgroup and type this SNAC represents
{| class="wikitable"
! Name
! Type
! Notes
|-
| foodgroup
| uint16 (word)
| Numeric value that represents the foodgroup the SNAC is in
|-
| type
| uint16 (word)
| Numeric value that represent the SNAC type
|}


=== Class: SNAC__HEADER_FLAGS ===
=== Class: SNAC__HEADER_FLAGS ===


These are the flags that let the client know details about the SNAC being received.


{| class="wikitable"
! Name
! Value
! Notes
|-
| SNAC_HEADER_FLAGS_MORE_REPLIES_FOLLOW
| 0x0001
| More replies follow this message using the same requestId; the last reply is easily detectable because it will not have this flag set
|-
| SNAC_HEADER_FLAGS_CLIENT_SNAC
| 0x0002
| NOT CURRENTLY DOCUMENTED
|-
| SNAC_HEADER_FLAGS_OPT_TLV_PRESENT
| 0x8000
| A [[Protocols/OSCAR/TLV|tlvLBlock]] immediately follows the SNAC header before the rest of the fields
|}


[[Category:Stub]]
[[Category:Stub]]

Revision as of 19:03, 20 March 2020

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)

SNAC notes from another

SNACs (Simple Network Atomic Communication) are used to represent the protocol messages that are sent between the client and backend. The messages are separated into different categories, called foodgroups. Within each foodgroup there are different kinds of messages related to the category.

Datatype: SNAC__Header

The FLAP Header will be immediately followed by the SNAC Header that describes what type of message it is for SNAC messages sent over FLAP. The SNAC Header is a simple 10 byte header that contains the foodgroup, type, any high level flags, and the requestId. The requestId is used to link up requests and replies and can also be used to determine the direction of traffic.

A client should never set the high bit of a requestId or use 0. The server will always set the high bit for its requestId unless it is a reply to a client query, in which case it will use the same requestId as the request. The flags field tells the client if for the same request there will be multiple replies and if there are any SNAC Header TLVs.

Name Type Notes
id SNAC__ID Foodgroup and message type
flags uint16 (word) [Class: SNAC__HEADER_FLAGS] Flags
requestId uint32 (dword) Used to link requests and replies

Datatype: SNAC__ID

Describes the foodgroup and type this SNAC represents

Name Type Notes
foodgroup uint16 (word) Numeric value that represents the foodgroup the SNAC is in
type uint16 (word) Numeric value that represent the SNAC type

Class: SNAC__HEADER_FLAGS

These are the flags that let the client know details about the SNAC being received.

Name Value Notes
SNAC_HEADER_FLAGS_MORE_REPLIES_FOLLOW 0x0001 More replies follow this message using the same requestId; the last reply is easily detectable because it will not have this flag set
SNAC_HEADER_FLAGS_CLIENT_SNAC 0x0002 NOT CURRENTLY DOCUMENTED
SNAC_HEADER_FLAGS_OPT_TLV_PRESENT 0x8000 A tlvLBlock immediately follows the SNAC header before the rest of the fields