Protocols/OSCAR/Datatypes: Difference between revisions

From NINA Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Protocols/OSCAR}}
The protocol is built on top of some common base types described below; these are the building blocks for all the other datatypes and SNACs. When encoding or decoding these types, make sure to use network byte order.
The protocol is built on top of some common base types described below; these are the building blocks for all the other datatypes and SNACs. When encoding or decoding these types, make sure to use network byte order.


Line 8: Line 9:
! Notes
! Notes
|-
|-
| u08
| uint8
| 1 byte
| byte
| Unsigned byte
| Unsigned byte
|-
|-
| u16
| uint16
| 2 bytes
| word (2 bytes)
| Unsigned two byte short
| Unsigned two byte short
|-
|-
| u32
| uint32
| 4 bytes
| dword (4 bytes)
| Unsigned four byte int
| Unsigned four byte int
|-
|-
Line 25: Line 26:
|-
|-
| t70
| t70
| 4 bytes
| dword (4 bytes)
| Unsigned four byte timestamp, from UNIX EPOCH
| Unsigned four byte timestamp, from UNIX EPOCH
|-
|-
| UUID
| UUID
| 16 bytes
| 16 bytes
|
| Sixteen bytes that represent a [[Protocols/OSCAR/UUIDs|UUID]] also known as a GUID
Sixteen bytes that represent a [[Protocols/OSCAR/UUID|UUID]] also known as a GUID
|-
|-
| blob
| blob
| length bytes
| length bytes
|
| Used in a [[Protocols/OSCAR/TLV|TLV]], data type and size is defined by external values
Used in a [[Protocols/OSCAR/TLV|TLV]], data type and size is defined by external values
|-
|-
| empty
| empty
| 0 bytes
| 0 bytes
|
| Used in a [[Protocols/OSCAR/TLV|TLV]], existence of tag causes behavior, the data is ignored
Used in a [[Protocols/OSCAR/TLV|TLV]], existence of tag causes behavior, the data is ignored
|}
|}


=== String Types ===
=== Strings ===


In general strings are not NULL terminated and are encoded using UTF8. A string is said to be ''compressed'' if all white spaces are removed and all upper case characters are converted to lower case.
In general strings are not NULL terminated and are encoded using UTF8. A string is said to be ''compressed'' if all white spaces are removed and all upper case characters are converted to lower case.
Line 55: Line 53:
| string
| string
| data
| data
|
| Inside of [[Protocols/OSCAR/TLV|TLVs]] a string inherits its length from the TLV length
Inside of [[Protocols/OSCAR/TLV|TLVs]] a string inherits its length from the TLV length
|-
|-
| string08
| string08
| u08 + data
| u08 (byte) + data
| One byte length followed by that many bytes of data
| One byte length followed by that many bytes of data
|-
|-
| string16
| string16
| u16 + data
| u16 (word) + data
| Two byte length followed by that many bytes of data
| Two byte length followed by that many bytes of data
|}
|}
[[Category:OSCAR]]

Latest revision as of 03:57, 17 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)

The protocol is built on top of some common base types described below; these are the building blocks for all the other datatypes and SNACs. When encoding or decoding these types, make sure to use network byte order.

Base Types

Name Size Notes
uint8 byte Unsigned byte
uint16 word (2 bytes) Unsigned two byte short
uint32 dword (4 bytes) Unsigned four byte int
f32 4 bytes Four byte float
t70 dword (4 bytes) Unsigned four byte timestamp, from UNIX EPOCH
UUID 16 bytes Sixteen bytes that represent a UUID also known as a GUID
blob length bytes Used in a TLV, data type and size is defined by external values
empty 0 bytes Used in a TLV, existence of tag causes behavior, the data is ignored

Strings

In general strings are not NULL terminated and are encoded using UTF8. A string is said to be compressed if all white spaces are removed and all upper case characters are converted to lower case.

Name Size Notes
string data Inside of TLVs a string inherits its length from the TLV length
string08 u08 (byte) + data One byte length followed by that many bytes of data
string16 u16 (word) + data Two byte length followed by that many bytes of data