Changes

Jump to navigation Jump to search
2,346 bytes added ,  17:50, 10 September 2019
Line 1: Line 1: −
= bsd:u / bsd:s =
+
= bsd:u, bsd:s =
 
This is "nn::socket::sf::IClient".
 
This is "nn::socket::sf::IClient".
   Line 64: Line 64:  
| 27 || [[#DuplicateSocket]]
 
| 27 || [[#DuplicateSocket]]
 
|-
 
|-
| 28 || GetResourceStatistics
+
| 28 || [[#GetResourceStatistics]]
 
|-
 
|-
| 29 || [3.0.0+] RecvMMsg
+
| 29 || [3.0.0+] [[#RecvMMsg]]
 
|-
 
|-
| 30 || [3.0.0+] SendMMsg
+
| 30 || [3.0.0+] [[#SendMMsg]]
 +
|-
 +
| 31 || [7.0.0+] EventFd
 +
|-
 +
| 32 || [7.0.0+] RegisterResourceStatisticsName
 
|}
 
|}
    
== Initalize ==
 
== Initalize ==
   
Takes a [[#BsdBufferConfig]] (made-up name), the PID, the size of the transfer memory and a copy-handle of the latter.
 
Takes a [[#BsdBufferConfig]] (made-up name), the PID, the size of the transfer memory and a copy-handle of the latter.
    
=== BsdBufferConfig ===
 
=== BsdBufferConfig ===
   
  /// Configuration structure for bsdInitalize
 
  /// Configuration structure for bsdInitalize
 
  typedef struct  {
 
  typedef struct  {
Line 117: Line 119:     
== Sysctl ==
 
== Sysctl ==
   
FreeBSD's <code>sysctl</code> command. Privileged operations are reserved for <code>bsd:s</code>.
 
FreeBSD's <code>sysctl</code> command. Privileged operations are reserved for <code>bsd:s</code>.
 
<code>CTL_NET</code>, <code>CTL_VM</code>, <code>CTL_KERN</code> and <code>CTL_DEBUG</code> commands are implemented (?).
 
<code>CTL_NET</code>, <code>CTL_VM</code>, <code>CTL_KERN</code> and <code>CTL_DEBUG</code> commands are implemented (?).
Line 135: Line 136:  
== DuplicateSocket ==
 
== DuplicateSocket ==
 
Takes a socket file descriptor and an unused u64. Duplicates the socket (FreeBSD's <code>dup</code>). Reserved to <code>bsd:s</code>.
 
Takes a socket file descriptor and an unused u64. Duplicates the socket (FreeBSD's <code>dup</code>). Reserved to <code>bsd:s</code>.
 +
 +
== GetResourceStatistics ==
 +
Takes a total of 8-bytes of input, a PID, a type-0x22 output buffer, and returns a total of 8-bytes of output.
 +
 +
[4.0.0+] Now takes an additional 8-bytes of input.
 +
 +
[7.0.0+] Now takes an additional type-0x21 input buffer.
 +
 +
== RecvMMsg ==
 +
Takes a total of 0x20-bytes of input, a type-0x22 output buffer, and returns a total of 8-bytes of output.
 +
 +
[7.0.0+] The buffer was replaced with a type-0x6 output buffer.
 +
 +
== SendMMsg ==
 +
Takes a total of 0xC-bytes of input, two type-0x21 input buffers, and returns a total of 8-bytes of output.
 +
 +
[7.0.0+] The buffers were replaced with a type-0x6 output buffer.
 +
 +
= bsdcfg =
 +
This is "nn::bsdsocket::cfg::ServerInterface".
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0  || [[#SetIfUp]]
 +
|-
 +
| 1  || [[#SetIfUpWithEvent]]
 +
|-
 +
| 2  || CancelIf
 +
|-
 +
| 3  || SetIfDown
 +
|-
 +
| 4  || GetIfState
 +
|-
 +
| 5  || DhcpRenew
 +
|-
 +
| 6  || AddStaticArpEntry
 +
|-
 +
| 7  || RemoveArpEntry
 +
|-
 +
| 8  || LookupArpEntry
 +
|-
 +
| 9  || LookupArpEntry2
 +
|-
 +
| 10 || ClearArpEntries
 +
|-
 +
| 11 || ClearArpEntries2
 +
|-
 +
| 12 || PrintArpEntries
 +
|}
 +
 +
== SetIfUp ==
 +
Takes a total of 0x28-bytes of input and a type-0x5 input buffer, no output.
 +
 +
[3.0.0+] Takes an additional 4-bytes of input.
 +
 +
== SetIfUpWithEvent ==
 +
Takes a total of 0x28-bytes of input and a type-0x5 input buffer, returns an output handle.
 +
 +
[3.0.0+] Takes an additional 4-bytes of input.
 +
 +
= ethc:c =
 +
This is "nn::eth::sf::IEthInterface".
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0  || Initialize
 +
|-
 +
| 1  || Cancel
 +
|-
 +
| 2  || GetResult
 +
|-
 +
| 3  || GetMediaList
 +
|-
 +
| 4  || SetMediaType
 +
|-
 +
| 5  || GetMediaType
 +
|}
 +
 +
= ethc:i =
 +
This is "nn::eth::sf::IEthInterfaceGroup".
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0  || GetReadableHandle
 +
|-
 +
| 1  || Cancel
 +
|-
 +
| 2  || GetResult
 +
|-
 +
| 3  || GetInterfaceList
 +
|-
 +
| 4  || GetInterfaceCount
 +
|}
    
= sfdnsres =
 
= sfdnsres =
Line 145: Line 245:  
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || SetDnsAddressesPrivate (stubbed, returns 0x7FE03)
+
| 0 || SetDnsAddressesPrivateRequest (stubbed, returns 0x7FE03)
 
|-
 
|-
| 1 || GetDnsAddressPrivate (stubbed, returns 0x7FE03)
+
| 1 || GetDnsAddressPrivateRequest (stubbed, returns 0x7FE03)
 
|-
 
|-
| 2 || GetHostByName
+
| 2 || GetHostByNameRequest
 
|-
 
|-
| 3 || GetHostByAddr
+
| 3 || GetHostByAddrRequest
 
|-
 
|-
| 4 || GetHostStringError
+
| 4 || GetHostStringErrorRequest
 
|-
 
|-
| 5 || GetGaiStringError
+
| 5 || GetGaiStringErrorRequest
 
|-
 
|-
| 6 || [[#GetAddrInfo]]
+
| 6 || [[#GetAddrInfoRequest]]
 
|-
 
|-
| 7 || GetNameInfo
+
| 7 || GetNameInfoRequest
 
|-
 
|-
| 8 || RequestCancelHandle
+
| 8 || GetCancelHandleRequest
 
|-
 
|-
| 9 || CancelSocketCall
+
| 9 || CancelRequest
 
|-
 
|-
| 10 || ?
+
| 10 || [5.0.0+] GetHostByNameRequestWithOptions
 
|-
 
|-
| 11 || [[#ClearDnsIpServerAddressArray]] (made-up name)
+
| 11 || [5.0.0+] GetHostByAddrRequestWithOptions
 +
|-
 +
| 12 || [5.0.0+] GetAddrInfoRequestWithOptions
 +
|-
 +
| 13 || [5.0.0+] GetNameInfoRequestWithOptions
 +
|-
 +
| 14 || [5.0.0+] ResolverSetOptionRequest
 +
|-
 +
| 15 || [5.0.0+] ResolverGetOptionRequest
 
|}
 
|}
   −
== GetAddrInfo ==
+
== GetAddrInfoRequest ==
 
   
Takes three type 5 buffers (host, port, and hints), and a type 6 buffer (the output addrinfos). Also takes a u8 (padded to 4 bytes so the next raw parameter can align), a u32, and a u64. The u8 is a boolean for whether to enable "nsd resolve" (1) or not (0). Not sure what the u32 is. It seems to either come from a parameter to <tt>GetAddrInfo</tt> or be zero. The u64 is most likely a placeholder for the server to copy the PID into and should be zero. Both hints and the output buffer contain serialized addrinfo chains. The hints buffer is sized 0x400 bytes long by default, and the output buffer 0x1000 bytes.
 
Takes three type 5 buffers (host, port, and hints), and a type 6 buffer (the output addrinfos). Also takes a u8 (padded to 4 bytes so the next raw parameter can align), a u32, and a u64. The u8 is a boolean for whether to enable "nsd resolve" (1) or not (0). Not sure what the u32 is. It seems to either come from a parameter to <tt>GetAddrInfo</tt> or be zero. The u64 is most likely a placeholder for the server to copy the PID into and should be zero. Both hints and the output buffer contain serialized addrinfo chains. The hints buffer is sized 0x400 bytes long by default, and the output buffer 0x1000 bytes.
    
=== Addrinfo Serialization Format ===
 
=== Addrinfo Serialization Format ===
   
Each struct addrinfo in the linked list is serialized according to this format and then written to the buffer. All numbers are in network byte order.
 
Each struct addrinfo in the linked list is serialized according to this format and then written to the buffer. All numbers are in network byte order.
   Line 212: Line 318:  
The list should be terminated with a sentinel four-byte zero value.
 
The list should be terminated with a sentinel four-byte zero value.
   −
== ClearDnsIpServerAddressArray ==
+
= nsd:u, nsd:a =
This function clears <code>nn::socket::resolver::g_DnsIpServerAddressArray</code>, setting its length to 0 as well. The array initially contains IPs filled by <code>bsdconfig</code>, a privileged service handling DHCP and such.
  −
 
  −
Takes no arguments, doesn't return anything, never fails.
  −
 
  −
= nsd:u / nsd:a =
   
This is "nn::nsd::detail::IManager".
 
This is "nn::nsd::detail::IManager".
   Line 226: Line 327:  
| 10 || GetSettingName
 
| 10 || GetSettingName
 
|-
 
|-
| 11 || GetEnvironmentIdentifier
+
| 11 || [[#GetEnvironmentIdentifier]]
 
|-
 
|-
 
| 12 || GetDeviceId
 
| 12 || GetDeviceId
Line 233: Line 334:  
|-
 
|-
 
| 14 || ImportSettings
 
| 14 || ImportSettings
 +
|-
 +
| 15 || [4.0.0+] SetChangeEnvironmentIdentifierDisabled
 
|-
 
|-
 
| 20 || Resolve
 
| 20 || Resolve
Line 251: Line 354:  
|-
 
|-
 
| 50 || GetCurrentSetting
 
| 50 || GetCurrentSetting
 +
|-
 +
| 51 || [9.0.0+] WriteTestParameter
 +
|-
 +
| 52 || [9.0.0+] ReadTestParameter
 
|-
 
|-
 
| 60 || [[#ReadSaveDataFromFsForTest]]
 
| 60 || [[#ReadSaveDataFromFsForTest]]
Line 257: Line 364:  
|-
 
|-
 
| 62 || [[#DeleteSaveDataOfFsForTest]]
 
| 62 || [[#DeleteSaveDataOfFsForTest]]
 +
|-
 +
| 63 || [4.0.0+] IsChangeEnvironmentIdentifierDisabled
 
|}
 
|}
 +
 +
== GetEnvironmentIdentifier ==
 +
Takes a type-0x16 buffer with size 8. Returns a string.
 +
 +
The output string is used by [[NIM_services|NIM]] for the "eid:%s" in the User-Agent strings.
 +
 +
This is the "lp1" string also used in domains.
    
== ReadSaveDataFromFsForTest ==
 
== ReadSaveDataFromFsForTest ==
Line 273: Line 389:     
Deletes the system save data for bsdsockets.
 
Deletes the system save data for bsdsockets.
 +
 +
[[Category:Services]]

Navigation menu