LDN services: Difference between revisions
No edit summary |
No edit summary |
||
Line 320: | Line 320: | ||
=== AddAcceptFilterEntry === | === AddAcceptFilterEntry === | ||
Takes an input [[# | Takes an input [[#MacAddress|MacAddress]], no output. | ||
There are two sdknso funcs implementing this: one which takes a [[# | There are two sdknso funcs implementing this: one which takes a [[#MacAddress|MacAddress]] directly, the other loads the [[#MacAddress|MacAddress]] from the input [[#NodeInfo|NodeInfo]]. | ||
[[#GetState|State]] must be 2-3. | [[#GetState|State]] must be 2-3. | ||
Line 875: | Line 875: | ||
| 0x10 || 0x10 || Last 0x10-bytes of [[#SecurityParameter]]. NetworkId which is used to generate/overwrite the [[#Ssid]]. With [[#Scan]]/[[#ScanPrivate]], this is only done after filtering when +0x4B is value 0x2. The converted Ssid is a 0x20-byte lowercase hex string version of the input NetworkId. | | 0x10 || 0x10 || Last 0x10-bytes of [[#SecurityParameter]]. NetworkId which is used to generate/overwrite the [[#Ssid]]. With [[#Scan]]/[[#ScanPrivate]], this is only done after filtering when +0x4B is value 0x2. The converted Ssid is a 0x20-byte lowercase hex string version of the input NetworkId. | ||
|- | |- | ||
| 0x20 || 0x6 || [[# | | 0x20 || 0x6 || [[#MacAddress|MacAddress]] | ||
|- | |- | ||
| 0x26 || 0x22 || [[#Ssid]] | | 0x26 || 0x22 || [[#Ssid]] | ||
Line 897: | Line 897: | ||
| 0x64 || 0x2 || Padding | | 0x64 || 0x2 || Padding | ||
|- | |- | ||
| 0x66 || 0x1 || Maximum participants, for the [[# | | 0x66 || 0x1 || Maximum participants, for the [[#NodeInfo|NodeInfo]] array. | ||
|- | |- | ||
| 0x67 || 0x1 || ParticipantNum, number of set entries in the [[# | | 0x67 || 0x1 || ParticipantNum, number of set entries in the [[#NodeInfo|NodeInfo]] array. If +0x4B is not 0x2, ParticipantNum should be handled as if it's 0. | ||
|- | |- | ||
| 0x68 || 0x200(0x40*8) || Array of [[# | | 0x68 || 0x200(0x40*8) || Array of [[#NodeInfo|NodeInfo]] with 8 entries, starting with the AccessPoint node. | ||
|- | |- | ||
| 0x268 || 0x2 || Reserved | | 0x268 || 0x2 || Reserved | ||
Line 937: | Line 937: | ||
| 0x20 || 0x4 || When enabled, must be <=0x3, and during filtering must match u8 [[#NetworkInfo]]+0x4B. | | 0x20 || 0x4 || When enabled, must be <=0x3, and during filtering must match u8 [[#NetworkInfo]]+0x4B. | ||
|- | |- | ||
| 0x24 || 0x6 || [[# | | 0x24 || 0x6 || [[#MacAddress|MacAddress]]. Only copied with [[#ScanPrivate]]. During filtering if enabled, this must match [[#NetworkInfo]]+0x20. | ||
|- | |- | ||
| 0x2A || 0x22 || [[#Ssid]]. During filtering if enabled, this must match [[#NetworkInfo]]+0x26 (the [[#Ssid]] there must be valid for this as well). The strings are compared, without verifying the length field in [[#Ssid]] matches. | | 0x2A || 0x22 || [[#Ssid]]. During filtering if enabled, this must match [[#NetworkInfo]]+0x26 (the [[#Ssid]] there must be valid for this as well). The strings are compared, without verifying the length field in [[#Ssid]] matches. | ||
Line 959: | Line 959: | ||
| 2 || When set, enables using ScanFilter+0x20. | | 2 || When set, enables using ScanFilter+0x20. | ||
|- | |- | ||
| 3 || When set, enables using the ScanFilter [[# | | 3 || When set, enables using the ScanFilter [[#MacAddress|MacAddress]]. | ||
|- | |- | ||
| 4 || When set, enables using the ScanFilter [[#Ssid]]. | | 4 || When set, enables using the ScanFilter [[#Ssid]]. | ||
Line 991: | Line 991: | ||
| 0x13 || 0x1 || Cleared to zero during the copy. | | 0x13 || 0x1 || Cleared to zero during the copy. | ||
|- | |- | ||
| 0x14 || 0x2 || Same as [[#NetworkInfo]]+0x96 (LocalCommunicationVersion from the first [[# | | 0x14 || 0x2 || Same as [[#NetworkInfo]]+0x96 (LocalCommunicationVersion from the first [[#NodeInfo|NodeInfo]]). Must not be negative. [[#Connect]]/[[#ConnectPrivate]]: This must match the value for the AccessPoint LocalCommunicationVersion. | ||
|- | |- | ||
| 0x16 || 0xA || Cleared to zero during the copy. | | 0x16 || 0xA || Cleared to zero during the copy. | ||
Line 1,089: | Line 1,089: | ||
| 0x0 || 0x4 || [[#Ipv4Address]] | | 0x0 || 0x4 || [[#Ipv4Address]] | ||
|- | |- | ||
| 0x4 || 0x6 || [[# | | 0x4 || 0x6 || [[#MacAddress|MacAddress]] | ||
|- | |- | ||
| 0xA || 0x2 || Padding | | 0xA || 0x2 || Padding | ||
Line 1,127: | Line 1,127: | ||
| 0x0 || 0x4 || [[#Ipv4Address]] | | 0x0 || 0x4 || [[#Ipv4Address]] | ||
|- | |- | ||
| 0x4 || 0x6 || [[# | | 0x4 || 0x6 || [[#MacAddress|MacAddress]] | ||
|- | |- | ||
| 0xA || 0x1 || s8 ID / index | | 0xA || 0x1 || s8 ID / index | ||
Line 1,169: | Line 1,169: | ||
= MacAddress = | = MacAddress = | ||
This is "nn::lp2p::MacAddress". Same as [[# | This is "nn::lp2p::MacAddress". Same as [[#MacAddress|MacAddress]]. | ||
= GroupId = | = GroupId = | ||
Line 1,240: | Line 1,240: | ||
Then the Station scans for an [[#ActionFrame]] for loading the [[#NetworkInfo]]. | Then the Station scans for an [[#ActionFrame]] for loading the [[#NetworkInfo]]. | ||
Once connected, the AccessPoint sends Epigram-vendor Action frame(s) (same data) to the Station, the Station doesn't require these frames: <code>dd1afeedfacedeadbeef010000000a00000000000000000000000000</code>. Then the Station must Authenticate with the AccessPoint, this is custom. The Station sends a frame (a maximum of 3 times in some cases if errors occur, with the same data), and the AccessPoint sends a response. Once Authenticated, the node is added to the [[# | Once connected, the AccessPoint sends Epigram-vendor Action frame(s) (same data) to the Station, the Station doesn't require these frames: <code>dd1afeedfacedeadbeef010000000a00000000000000000000000000</code>. Then the Station must Authenticate with the AccessPoint, this is custom. The Station sends a frame (a maximum of 3 times in some cases if errors occur, with the same data), and the AccessPoint sends a response. Once Authenticated, the node is added to the [[#NodeInfo|NodeInfo]] array in [[#NetworkInfo]]. If the Station does not successfully Authenticate X-seconds after connecting, the AccessPoint disconnects the Station. If the Station fails to Authenticate, the Station itself will disconnect as well. | ||
After Authentication the Station will scan for another [[#ActionFrame]], with frame-comparision enabled with the above frame (frame must have been updated since the previous scan). The Station locates the index for a [[# | After Authentication the Station will scan for another [[#ActionFrame]], with frame-comparision enabled with the above frame (frame must have been updated since the previous scan). The Station locates the index for a [[#MacAddress|MacAddress]] matching itself in the [[#NetworkInfo]] [[#NodeInfo|NodeInfo]] array (the entry for the AccessPoint is skipped), throwing an error if not found. After validating the LocalCommunicationVersion, it proceeds to handle ARP setup below. | ||
This does not use DHCP, each node on the network has to manually setup ARP (without sending ARP network requests) with the [[# | This does not use DHCP, each node on the network has to manually setup ARP (without sending ARP network requests) with the [[#NodeInfo|NodeInfo]] array in [[#NetworkInfo]]. | ||
At this point standard sockets can be used over Data frames. | At this point standard sockets can be used over Data frames. | ||
Line 1,430: | Line 1,430: | ||
The data here is copied into [[#NetworkInfo]]. | The data here is copied into [[#NetworkInfo]]. | ||
Node data used in the above array (all fields big-endian), which are copied into the [[#NetworkInfo]] [[# | Node data used in the above array (all fields big-endian), which are copied into the [[#NetworkInfo]] [[#NodeInfo|NodeInfo]] array: | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 1,440: | Line 1,440: | ||
| 0x0 || 0x4 || [[#Ipv4Address]] | | 0x0 || 0x4 || [[#Ipv4Address]] | ||
|- | |- | ||
| 0x4 || 0x6 || [[# | | 0x4 || 0x6 || [[#MacAddress|MacAddress]] | ||
|- | |- | ||
| 0xA || 0x1 || bool IsConnected | | 0xA || 0x1 || bool IsConnected |