LDN services: Difference between revisions

No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 234: Line 234:


The array count must be at least 1. This is clamped to a maximum of 0x18.
The array count must be at least 1. This is clamped to a maximum of 0x18.
[18.0.0+] This now uses the same SecurityMode override as [[#CreateNetwork|CreateNetwork]].


=== ScanPrivate ===
=== ScanPrivate ===
Line 243: Line 241:


See [[#Scan]].
See [[#Scan]].
[18.0.0+] This now uses the same SecurityMode override as [[#CreateNetwork|CreateNetwork]].


=== SetWirelessControllerPolicy ===
=== SetWirelessControllerPolicy ===
Line 423: Line 419:
=== SendActionFrame ===
=== SendActionFrame ===
Takes a type-0x21 input buffer, two input [[#MacAddress]], two input s16s ('''Band''' and '''ChannelNumber''') and an input [[#MessageFlagSet]]. No output.
Takes a type-0x21 input buffer, two input [[#MacAddress]], two input s16s ('''Band''' and '''ChannelNumber''') and an input [[#MessageFlagSet]]. No output.
[20.0.0+] The input s16s were replaced with a single u16, which has the same format as [[#SetHomeChannel|SetHomeChannel]].
The first [[#MacAddress]] is the destination, the second [[#MacAddress]] is the Bssid.
The ChannelNumber must be non-zero.


[[#State|State]] must be 3-4 (AccessPointCreated/Station).
[[#State|State]] must be 3-4 (AccessPointCreated/Station).


On NX this sends a raw action frame with the input buffer as the data?
=== RecvActionFrame ===
Takes a type-0x22 output buffer and an input [[#MessageFlagSet]]. Returns two output [[#MacAddress]], two output s16s ('''Band''' and '''ChannelNumber'''), an output u32 '''Size''', and an output s32 '''LinkLevel'''.


=== RecvActionFrame ===
[20.0.0+] The output s16s were replaced with a single u16, which has the same format as [[#SetHomeChannel|SetHomeChannel]].
Takes a type-0x22 output buffer and an input [[#MessageFlagSet]]. Returns an output u32 '''Size''', two output [[#MacAddress]], two output s16s ('''Band''' and '''ChannelNumber''') and an output s32 '''LinkLevel'''.


[[#EnableActionFrame|EnableActionFrame]] must be used prior to this.
[[#EnableActionFrame|EnableActionFrame]] must be used prior to this.
Line 436: Line 438:
Takes two input s16s '''Band''' and '''ChannelNumber'''. No output.
Takes two input s16s '''Band''' and '''ChannelNumber'''. No output.


[20.0.0+] Now takes a total of 2-bytes of input instead of 4-bytes.
[20.0.0+] Now takes an input u16 instead of two s16s, merging the two params. Bitmask 0x3FF (low 10-bits) is the ChannelNumber, while the remaining upper 6-bits is the Band. The Band is used as an array index to load the actual Band for passing to a func. Only the following Band input is valid, others return 0x0/0xFFFF: 2 - > 2400, 5 -> 5000, 6 -> 6000.
 
On NX Band must be ([20.0.0+] converted Band from the above array) 50 ([20.0.0+] 5000) or 24 ([20.0.0+] 2400).
 
The ChannelNumber must be non-zero.
 
The [[#State|State]] must be Station.
 
sdknso uses the input channel to convert to the input needed by the cmd.


=== SetTxPower ===
=== SetTxPower ===
Takes an input s16 '''Power'''. No output.
Takes an input s16 '''Power'''. No output.
The input must be 0x0..0xFF.
A state field must be non-zero.
The [[#State|State]] must be 2-5 (AccessPoint*/Station*).


=== ResetTxPower ===
=== ResetTxPower ===
No input/output.
No input/output.
The same state field checked by [[#SetTxPower|SetTxPower]] must be non-zero. The [[#State|State]] check is also the same as [[#SetTxPower|SetTxPower]].


== IClientProcessMonitor ==
== IClientProcessMonitor ==
Line 1,421: Line 1,439:
|}
|}


SecurityMode must be 1-2. The same SecurityMode override functionality from elsewhere is used here.
SecurityMode must be 1-2. The same SecurityMode override functionality from elsewhere is used later with this.
 
The same LocalCommunicationId override/validation from elsewhere is used with the input as well.


= MessageFlagSet =
= MessageFlagSet =
Line 1,678: Line 1,698:
! Description
! Description
|-
|-
| 0x0 || 0x40 || Zeros. [6.0.0-?] Only included in the frame if it's enabled (+0x0 [[#AuthVersion]] >= 3). Unused by the Station.
| 0x0 || 0x1 ||
|-
| 0x1 || 0x3F || Zeros. [6.0.0-?] Only included in the frame if it's enabled (+0x0 [[#AuthVersion]] >= 3). Unused by the Station.
|-
|-
| 0x40 || 0x44 || [6.0.0-?] Only included in the frame if it's enabled (+0x0 [[#AuthVersion]] >= 3). Unused by the Station.
| 0x40 || 0x44 || [6.0.0-?] Only included in the frame if it's enabled (+0x0 [[#AuthVersion]] >= 3). Unused by the Station.
Line 1,751: Line 1,773:


When encryption is enabled, the encrypted data is at +0x28 (+0x38 with EncryptionType3) with size {remaining frame size}. The key is derived from the raw 0x20-bytes at +0x0. The CTR/IV is {raw Counter above without byte-swap}, with the rest cleared to zeros. The AAD for AES-128-GCM is at +0x0 size 0x28-bytes.
When encryption is enabled, the encrypted data is at +0x28 (+0x38 with EncryptionType3) with size {remaining frame size}. The key is derived from the raw 0x20-bytes at +0x0. The CTR/IV is {raw Counter above without byte-swap}, with the rest cleared to zeros. The AAD for AES-128-GCM is at +0x0 size 0x28-bytes.
Originally [[#Scan]]/[[#ScanPrivate]] used the EncryptionType field to determine encryption handling. With [18.0.0+] these now set an internal SecurityMode field to 0 (Any) initially, then later uses the same SecurityMode override as [[#CreateNetwork|CreateNetwork]]. The internal SecurityMode field is used to determine encryption handling: Any uses the EncryptionType field like before. With non-zero the encryption handling is determined as required by the SecurityMode.


The content data at +{above_header_size} follows, which has the size specified above (which must be >=0x500 with EncryptionType1-2), where all fields are big-endian. For EncryptionType1-2:
The content data at +{above_header_size} follows, which has the size specified above (which must be >=0x500 with EncryptionType1-2), where all fields are big-endian. For EncryptionType1-2:
Line 1,867: Line 1,891:


=== ActionFrame2 ===
=== ActionFrame2 ===
The Action frames used by [[#RecvActionFrame|RecvActionFrame]] have the following structure:
The Action frames used by [[#SendActionFrame|SendActionFrame]]/[[#RecvActionFrame|RecvActionFrame]] have the following structure:
* "Fixed parameters":
* "Fixed parameters":
** "Category code: Vendor Specific (127)"
** "Category code: Vendor Specific (127)"
Line 1,883: Line 1,907:
| 0x2 || 0x2 || Protocol ID, must match big-endian 0x0102.
| 0x2 || 0x2 || Protocol ID, must match big-endian 0x0102.
|-
|-
| 0x4 || 0x2 ||  
| 0x4 || 0x2 || 00 00
|-
|-
| 0x6 || 0x2 ||  
| 0x6 || 0x2 || 00 00
|}
|}