Difference between revisions of "Network Protocol/PARAM-STRING"
m (Krummers moved page MKWii Network Protocol/PARAM-STRING to Network Protocol/PARAM-STRING without leaving a redirect: Cleaning this article and all of its subarticles) |
|||
Line 1: | Line 1: | ||
− | This | + | == Overview == |
− | + | This article describes the record type '''PARAM-STRING''' of the [[Network Protocol]]. This record is a protocol that transfers named parameters and their values. The complete data is sent as an ASCII string using the format <code>\NAME1\VALUE1\NAME2\VALUE2\NAME3\VALUE3\...\FINAL\</code>. The PARAM-STRING itself is not null terminated, only the packet length defines the end of the string. The backslash character is used as a separator and cannot be used inside value names. After splitting the string at the backslash separator, it has an even number of substrings. Two substrings together are one '''PARAMETER''' with a '''NAME''' and a '''VALUE'''. The parameter '''LIST''' is always terminated by a final parameter with an empty value. A PARAM-STRING may contain one or more LISTS. If TCP is used for data transmission, the PSH flag is always set to push all buffered data to the receiving application and to avoid an unwanted data split. | |
− | |||
− | |||
− | |||
− | |||
− | The PARAM-STRING itself is not null terminated, only the packet length | ||
− | |||
− | If TCP is used for data transmission, the | ||
− | |||
− | |||
+ | === Naming Convention and Syntax === | ||
<pre> | <pre> | ||
PARAM_STRING := COMPLETE_LIST [ PARAM_STRING ] | PARAM_STRING := COMPLETE_LIST [ PARAM_STRING ] | ||
Line 23: | Line 15: | ||
</pre> | </pre> | ||
− | ''' | + | Notes: |
− | + | * '''any_but_not_backslash''' - Use any character (even an ASCII control character) except a backslash. | |
− | + | * '''...''' - A character or string. | |
− | + | * '''[...]''' - Optional parts. They are often used as self reference to define a list of the same element. | |
− | + | * '''|''' - An alternative element. Use exactly one of the alternatives. | |
− | + | * If there is a slash in the data that does not indicate a new sub section, it is escaped with "/1". A backslash in the data (not indicating a new parameter) is escaped with "/2". | |
− | |||
=== Display Scheme === | === Display Scheme === | ||
− | + | The following would be an example. | |
− | |||
\name1\\name2\VALUE2\name3\VALUE3\final\\name4\\name5\VALUE5\final\ | \name1\\name2\VALUE2\name3\VALUE3\final\\name4\\name5\VALUE5\final\ | ||
− | A more readable representation of the same string | + | A more readable representation of the same string is: |
<pre> | <pre> | ||
name1 = | name1 = | ||
Line 45: | Line 35: | ||
name5 = VALUE5 | name5 = VALUE5 | ||
final / | final / | ||
− | </pre> | + | </pre> |
− | === | + | === Sublists === |
− | + | Some values itself are a parameter list with a different separator character. Two examples are ''statstring'' and ''msg''. | |
− | Some values are | ||
statstring = /SCM/1/SCN/0/VER/90 | statstring = /SCM/1/SCN/0/VER/90 | ||
− | + | msg = |s|1|ss|/SCM/1/SCN/0/VER/90|ls||ip|633988064|p|0|qm|0 | |
Interesting is, that ''msg'' contains a ''statstring'' (abbreviated to ''ss'') third level sub list. | Interesting is, that ''msg'' contains a ''statstring'' (abbreviated to ''ss'') third level sub list. | ||
=== Special Packets === | === Special Packets === | ||
− | + | Sometime you can find packets with 0, 2 or 6 null bytes. These packets without content are used for TCP sync, finish, reset and acknowledge (see the TCP flags byte). | |
− | Sometime you can find packets with 0, 2 or 6 | ||
== Examples == | == Examples == | ||
− | |||
In the following example, the parameter ''statstring'' contains a parameter string with a slash as separator. | In the following example, the parameter ''statstring'' contains a parameter string with a slash as separator. | ||
<pre> | <pre> | ||
Line 75: | Line 62: | ||
</pre> | </pre> | ||
− | In the next example, the parameter ''msg '' contains a parameter string with a pipe as separator. | + | In the next example, the parameter ''msg'' contains a parameter string with a pipe as separator. |
<pre> | <pre> | ||
bm = 100 | bm = 100 | ||
Line 83: | Line 70: | ||
</pre> | </pre> | ||
− | + | {{Network Protocol}} | |
− | + | [[Category:Network Protocol|P]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | {{ | ||
− | [[ |
Latest revision as of 20:36, 29 April 2023
Overview
This article describes the record type PARAM-STRING of the Network Protocol. This record is a protocol that transfers named parameters and their values. The complete data is sent as an ASCII string using the format \NAME1\VALUE1\NAME2\VALUE2\NAME3\VALUE3\...\FINAL\
. The PARAM-STRING itself is not null terminated, only the packet length defines the end of the string. The backslash character is used as a separator and cannot be used inside value names. After splitting the string at the backslash separator, it has an even number of substrings. Two substrings together are one PARAMETER with a NAME and a VALUE. The parameter LIST is always terminated by a final parameter with an empty value. A PARAM-STRING may contain one or more LISTS. If TCP is used for data transmission, the PSH flag is always set to push all buffered data to the receiving application and to avoid an unwanted data split.
Naming Convention and Syntax
PARAM_STRING := COMPLETE_LIST [ PARAM_STRING ] COMPLETE_LIST := LIST FINAL_PARAM LIST := PARAMETER [ LIST ] PARAMETER := '\' NAME '\' VALUE NAME := NAME_CHAR [ NAME ] NAME_CHAR := 'a' | 'b' | ... | 'z' VALUE := VALUE_CHAR [ VALUE ] VALUE_CHAR := any_but_not_backslash FINAL_PARAMETER := '\final\'
Notes:
- any_but_not_backslash - Use any character (even an ASCII control character) except a backslash.
- ... - A character or string.
- [...] - Optional parts. They are often used as self reference to define a list of the same element.
- | - An alternative element. Use exactly one of the alternatives.
- If there is a slash in the data that does not indicate a new sub section, it is escaped with "/1". A backslash in the data (not indicating a new parameter) is escaped with "/2".
Display Scheme
The following would be an example.
\name1\\name2\VALUE2\name3\VALUE3\final\\name4\\name5\VALUE5\final\
A more readable representation of the same string is:
name1 = name2 = VALUE2 name3 = VALUE3 final / name4 = name5 = VALUE5 final /
Sublists
Some values itself are a parameter list with a different separator character. Two examples are statstring and msg.
statstring = /SCM/1/SCN/0/VER/90 msg = |s|1|ss|/SCM/1/SCN/0/VER/90|ls||ip|633988064|p|0|qm|0
Interesting is, that msg contains a statstring (abbreviated to ss) third level sub list.
Special Packets
Sometime you can find packets with 0, 2 or 6 null bytes. These packets without content are used for TCP sync, finish, reset and acknowledge (see the TCP flags byte).
Examples
In the following example, the parameter statstring contains a parameter string with a slash as separator.
status = 1 sesskey = 262611642 statstring = /SCM/1/SCN/0/VER/90 locstring = final / updatepro = sesskey = 262611642 firstname = Wii:4113862228885420@RMCE partnerid = 11 final /
In the next example, the parameter msg contains a parameter string with a pipe as separator.
bm = 100 f = 295941470 msg = |s|0|ss|Offline final /
Information:
Nintendo's Servers –
Friend Code –
Nick –
Dumping Network Traffic
Record Types:
HEADER –
ROOM –
SELECT –
USER
RACEHEADER_1 –
RACEHEADER_2 –
RACEDATA –
ITEM –
EVENT
NATNEG –
ANNOUNCE –
QUIT –
STATUS –
PARAM-STRING
Wiimmfi Extensions:
Online Status –
Connection Status –
Wiimmfi packets –
Server SV
Software:
Wiimms mkw-ana