Changes

252 bytes added ,  16:57, 9 March 2018
Merge NSD and sockets
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 72: Line 72:     
== 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 115:     
== 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 171: Line 168:     
== GetAddrInfo ==
 
== GetAddrInfo ==
   
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 217: Line 212:  
Takes no arguments, doesn't return anything, never fails.
 
Takes no arguments, doesn't return anything, never fails.
   −
= nsd:u / nsd:a =
+
= nsd:u, nsd:a =
 
This is "nn::nsd::detail::IManager".
 
This is "nn::nsd::detail::IManager".
   Line 226: Line 221:  
| 10 || GetSettingName
 
| 10 || GetSettingName
 
|-
 
|-
| 11 || GetEnvironmentIdentifier
+
| 11 || [[#GetEnvironmentIdentifier]]
 
|-
 
|-
 
| 12 || GetDeviceId
 
| 12 || GetDeviceId
Line 258: Line 253:  
| 62 || [[#DeleteSaveDataOfFsForTest]]
 
| 62 || [[#DeleteSaveDataOfFsForTest]]
 
|}
 
|}
 +
 +
== 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 275:     
Deletes the system save data for bsdsockets.
 
Deletes the system save data for bsdsockets.
 +
 +
[[Category:Services]]