Changes

Jump to navigation Jump to search
Line 1: Line 1: −
= bsd:u, bsd:s =
+
= bsd:u, bsd:s, bsd:a =
 
This is "nn::socket::sf::IClient".
 
This is "nn::socket::sf::IClient".
    
[15.0.0+] This is "nn::socket::sf::IClient_MC".
 
[15.0.0+] This is "nn::socket::sf::IClient_MC".
 +
 +
[18.0.0+] This is "nn::socket::sf::IClient".
    
All the services commands but the first two return -1 on failure and set errno when that happens. Although Nintendo has the FreeBSD kernel's to socket stack, '''the errno macro definitions being in use actually come from Linux (and not from FreeBSD as one would expect!)'''.
 
All the services commands but the first two return -1 on failure and set errno when that happens. Although Nintendo has the FreeBSD kernel's to socket stack, '''the errno macro definitions being in use actually come from Linux (and not from FreeBSD as one would expect!)'''.
 +
 +
[18.0.0+] bsd:a was added.
    
These services have max_sessions 0x40. There's 22 IPC handler threads for bsd:u, and 11 for bsd:s.
 
These services have max_sessions 0x40. There's 22 IPC handler threads for bsd:u, and 11 for bsd:s.
 +
 +
[16.0.0+] bsd:u has max_sessions 0x24 and bsd:s has max_sessions 0x7E.
 +
 +
[18.0.0+] bsd:u has max_sessions 0xF, bsd:s has max_sessions 0x7E and bsd:a has max_sessions 0x17.
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 12: Line 20:  
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0  || RegisterClient ([[#Initialize]])
+
| 0  || [[#RegisterClient]]
 
|-
 
|-
 
| 1  || StartMonitoring
 
| 1  || StartMonitoring
Line 76: Line 84:  
| 31 || [7.0.0+] EventFd
 
| 31 || [7.0.0+] EventFd
 
|-
 
|-
| 32 || [7.0.0+] [[#RegisterForStatistics]]
+
| 32 || [7.0.0+] [[#RegisterResourceStatisticsName]]
 
|-
 
|-
| 33 || [10.0.0+] [[#Initialize2]]
+
| 33 || [10.0.0+] [[#RegisterClientShared]]
 
|-
 
|-
 
| 34 || [15.0.0+] GetSocketStatistics
 
| 34 || [15.0.0+] GetSocketStatistics
 +
|-
 +
| 35 || [17.0.0+] NifIoctl
 
|-
 
|-
 
| 200 || [15.0.0+] SetThreadCoreMask
 
| 200 || [15.0.0+] SetThreadCoreMask
Line 87: Line 97:  
|}
 
|}
   −
== Initialize ==
+
== RegisterClient ==
Takes a [[#BsdBufferConfig]] (made-up name), the PID, the size of the transfer memory and a copy-handle of the latter.
+
Takes a [[#LibraryConfigData]], the PID, the size of the transfer memory and a copy-handle of the latter.
 
  −
=== BsdBufferConfig ===
  −
/// Configuration structure for bsdInitalize
  −
typedef struct  {
  −
    u32 version;                ///< Observed 1 on 2.0 LibAppletWeb, 2 on 3.0.
  −
  −
    u32 tcp_tx_buf_size;        ///< Size of the TCP transfer (send) buffer (initial or fixed).
  −
    u32 tcp_rx_buf_size;        ///< Size of the TCP recieve buffer (initial or fixed).
  −
    u32 tcp_tx_buf_max_size;    ///< Maximum size of the TCP transfer (send) buffer. If it is 0, the size of the buffer is fixed to its initial value.
  −
    u32 tcp_rx_buf_max_size;    ///< Maximum size of the TCP receive buffer. If it is 0, the size of the buffer is fixed to its initial value.
  −
  −
    u32 udp_tx_buf_size;        ///< Size of the UDP transfer (send) buffer (typically 0x2400 bytes).
  −
    u32 udp_rx_buf_size;        ///< Size of the UDP receive buffer (typically 0xA500 bytes).
  −
  −
    u32 sb_efficiency;          ///< Number of buffers for each socket (standard values range from 1 to 8).
  −
} BsdBufferConfig;
  −
 
      
The transfer memory must be larger than a the computed size below. Should the transfer memory be smaller than that, the BSD sockets service would only send ZeroWindow packets (for TCP), resulting in a transfer rate not exceeding 1 byte/s.
 
The transfer memory must be larger than a the computed size below. Should the transfer memory be smaller than that, the BSD sockets service would only send ZeroWindow packets (for TCP), resulting in a transfer rate not exceeding 1 byte/s.
Line 166: Line 159:  
[7.0.0+] The buffers were replaced with a type-0x6 output buffer.
 
[7.0.0+] The buffers were replaced with a type-0x6 output buffer.
   −
== RegisterForStatistics ==
+
== RegisterResourceStatisticsName ==
 
With [10.0.0+] this now takes an additional 8-bytes of input.
 
With [10.0.0+] this now takes an additional 8-bytes of input.
   −
== Initialize2 ==
+
== RegisterClientShared ==
Same input/output as [[#Initalize]] except this doesn't take an input handle.
+
Same input/output as [[#RegisterClient]] except this doesn't take an input handle.
    
The work-buffer (size is still specified with this cmd) is backed by memory in the sysmodule, instead of TransferMemory. The size (after alignment) must be >=0x1000 and <=0x13F000.
 
The work-buffer (size is still specified with this cmd) is backed by memory in the sysmodule, instead of TransferMemory. The size (after alignment) must be >=0x1000 and <=0x13F000.
   −
sdknso will only use this cmd when two flags in the input config are set: the first one being set indicates that the bsd:s service is used, while the second flag enables using this cmd. An error is thrown if the work-buffer size is <0x1000. Otherwise when these flags aren't set, [[#Initialize]] is used as usual.
+
sdknso will only use this cmd when two flags in the input config are set: the first one being set indicates that the bsd:s service is used, while the second flag enables using this cmd. An error is thrown if the work-buffer size is <0x1000. Otherwise when these flags aren't set, [[#RegisterClient]] is used as usual.
   −
= bsdcfg =
+
= bsdcfg, ifcfg =
 
This is "nn::bsdsocket::cfg::ServerInterface".
 
This is "nn::bsdsocket::cfg::ServerInterface".
   −
This has IPC max_sessions 4.
+
[17.0.0+] ifcfg was added.
 +
 
 +
This has max_sessions 4.
 +
 
 +
[18.0.0+] bsdcfg has max_sessions 1 and ifcfg has max_sessions 4.
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 216: Line 213:  
|-
 
|-
 
| 15 || [16.0.0+]
 
| 15 || [16.0.0+]
 +
|-
 +
| 16 || [17.0.0+]
 +
|-
 +
| 17 || [17.0.0+]
 +
|-
 +
| 18 || [17.0.0+]
 +
|-
 +
| 19 || [17.0.0+]
 +
|-
 +
| 20 || [17.0.0+]
 +
|-
 +
| 21 || [17.0.0+]
 +
|-
 +
| 22 || [17.0.0+]
 +
|-
 +
| 23 || [17.0.0+]
 +
|-
 +
| 50 || [17.0.0+]
 +
|-
 +
| 51 || [17.0.0+]
 +
|-
 +
| 52 || [17.0.0+]
 +
|-
 +
| 53 || [17.0.0+]
 +
|-
 +
| 54 || [17.0.0+]
 +
|-
 +
| 55 || [17.0.0+]
 +
|-
 +
| 56 || [17.0.0+]
 +
|-
 +
| 57 || [17.0.0+]
 +
|-
 +
| 58 || [17.0.0+]
 +
|-
 +
| 100 || [17.0.0+]
 
|}
 
|}
   Line 264: Line 297:  
| 5  || GetMediaType
 
| 5  || GetMediaType
 
|-
 
|-
| 6 || [11.0.0+]
+
| 6 || [11.0.0+] GetMacAddress
 
|}
 
|}
   Line 298: Line 331:  
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || SetDnsAddressesPrivateRequest (stubbed, returns 0x7FE03)
+
| 0 || SetDnsAddressesPrivateRequest
 
|-
 
|-
| 1 || GetDnsAddressPrivateRequest (stubbed, returns 0x7FE03)
+
| 1 || GetDnsAddressPrivateRequest
 
|-
 
|-
 
| 2 || GetHostByNameRequest
 
| 2 || GetHostByNameRequest
Line 372: Line 405:     
The list should be terminated with a sentinel four-byte zero value.
 
The list should be terminated with a sentinel four-byte zero value.
 +
 +
= dns:priv =
 +
This is "nn::socket::resolver::IPrivateResolver".
 +
 +
This was added with [18.0.0+].
 +
 +
This has max_sessions 1.
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 ||
 +
|-
 +
| 1 ||
 +
|-
 +
| 2 ||
 +
|}
    
= nsd:u, nsd:a =
 
= nsd:u, nsd:a =
 
This is "nn::nsd::detail::IManager".
 
This is "nn::nsd::detail::IManager".
   −
nsd:u has IPC max_sessions 20, nsd:a has IPC max_sessions 5. No retail system titles have access to nsd:a.
+
nsd:u has max_sessions 20, nsd:a has IPC max_sessions 5. No retail system titles have access to nsd:a.
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 561: Line 612:     
== GetApplicationServerEnvironmentType ==
 
== GetApplicationServerEnvironmentType ==
No input, returns an output u8 "[[Applet_Manager_services|nn::oe::ServerEnvironmentType]]".
+
No input. Returns an output [[Applet_Manager_services#ServerEnvironmentType|ServerEnvironmentType]].
    
This gets the type previously configured by [[#SetApplicationServerEnvironmentType]] if available, otherwise it determines the type via the current [[#EnvironmentIdentifier]].
 
This gets the type previously configured by [[#SetApplicationServerEnvironmentType]] if available, otherwise it determines the type via the current [[#EnvironmentIdentifier]].
    
== SetApplicationServerEnvironmentType ==
 
== SetApplicationServerEnvironmentType ==
Takes an input u8 "[[Applet_Manager_services|nn::oe::ServerEnvironmentType]]", no output.
+
Takes an input u8 [[Applet_Manager_services#ServerEnvironmentType|ServerEnvironmentType]], no output.
    
== DeleteApplicationServerEnvironmentType ==
 
== DeleteApplicationServerEnvironmentType ==
Line 584: Line 635:     
== CreateUserService ==
 
== CreateUserService ==
Unofficial name.
  −
   
No input. Returns an [[#ISfUserService]].
 
No input. Returns an [[#ISfUserService]].
   Line 597: Line 646:  
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || [[#CreateAssignedNetworkInterfaceService]]
+
| 0 || [[#Assign]]
 
|-
 
|-
| 128 ||  
+
| 128 || GetUserInfo
 
|-
 
|-
| 129 ||  
+
| 129 || GetStateChangedEvent
 
|}
 
|}
   −
=== CreateAssignedNetworkInterfaceService ===
+
=== Assign ===
Unofficial name.
  −
 
   
Takes an input handle. Returns an [[#ISfAssignedNetworkInterfaceService]].
 
Takes an input handle. Returns an [[#ISfAssignedNetworkInterfaceService]].
   Line 620: Line 667:  
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 ||  
+
| 0 || [[#AddSession]]
 
|}
 
|}
   −
==== Cmd0 ====
+
==== AddSession ====
 
Takes an input handle, no output.
 
Takes an input handle, no output.
    
The handle is the service-session handle for "nn::anif::detail::ISfNetworkInterfaceService".
 
The handle is the service-session handle for "nn::anif::detail::ISfNetworkInterfaceService".
 +
 +
= LibraryConfigData =
 +
This is "nn::socket::sf::LibraryConfigData".
 +
 +
/// Configuration structure for bsdInitalize
 +
typedef struct  {
 +
    u32 version;                ///< Observed 1 on 2.0 LibAppletWeb, 2 on 3.0.
 +
 +
    u32 tcp_tx_buf_size;        ///< Size of the TCP transfer (send) buffer (initial or fixed).
 +
    u32 tcp_rx_buf_size;        ///< Size of the TCP recieve buffer (initial or fixed).
 +
    u32 tcp_tx_buf_max_size;    ///< Maximum size of the TCP transfer (send) buffer. If it is 0, the size of the buffer is fixed to its initial value.
 +
    u32 tcp_rx_buf_max_size;    ///< Maximum size of the TCP receive buffer. If it is 0, the size of the buffer is fixed to its initial value.
 +
 +
    u32 udp_tx_buf_size;        ///< Size of the UDP transfer (send) buffer (typically 0x2400 bytes).
 +
    u32 udp_rx_buf_size;        ///< Size of the UDP receive buffer (typically 0xA500 bytes).
 +
 +
    u32 sb_efficiency;          ///< Number of buffers for each socket (standard values range from 1 to 8).
 +
} LibraryConfigData;
 +
 +
Versions:
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! System version
 +
! Version
 +
|-
 +
| [1.0.0-2.3.0] || 0x1
 +
|-
 +
| [3.0.0-3.0.2] || 0x2
 +
|-
 +
| [4.0.0-4.1.0] || 0x3
 +
|-
 +
| [5.0.0-5.1.0] || 0x4
 +
|-
 +
| [6.0.0-7.0.1] || 0x5
 +
|-
 +
| [8.0.0-8.1.1] || 0x6
 +
|-
 +
| [9.0.0-12.1.0] || 0x7
 +
|-
 +
| [13.0.0-15.0.1] || 0x8
 +
|-
 +
| [16.0.0+] || 0x9
 +
|}
    
= DeleteMode =
 
= DeleteMode =
This is s32 enum "nn::nsd::DeleteMode".
+
This is "nn::nsd::DeleteMode".
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 642: Line 733:     
= ImportMode =
 
= ImportMode =
This is s32 enum "nn::nsd::ImportMode".
+
This is "nn::nsd::ImportMode".
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"

Navigation menu