Changes

963 bytes added ,  00:16, 24 January 2018
Document SocketExempt, sysctl, ioctl, fcntl + some refactoring
Line 12: Line 12:  
| 2  || Socket
 
| 2  || Socket
 
|-
 
|-
| 3  || SocketExempt
+
| 3  || [[#SocketExempt]]
 
|-
 
|-
| 4  || Open
+
| 4  || [[#Open]]
 
|-
 
|-
 
| 5  || Select
 
| 5  || Select
Line 20: Line 20:  
| 6  || Poll
 
| 6  || Poll
 
|-
 
|-
| 7  || Sysctl
+
| 7  || [[#Sysctl]]
 
|-
 
|-
 
| 8  || Recv
 
| 8  || Recv
Line 44: Line 44:  
| 18 || Listen
 
| 18 || Listen
 
|-
 
|-
| 19 || Ioctl
+
| 19 || [[#Ioctl]]
 
|-
 
|-
| 20 || Fcntl
+
| 20 || [[#Fcntl]]
 
|-
 
|-
 
| 21 || SetSockOpt
 
| 21 || SetSockOpt
Line 68: Line 68:  
| 30 || [3.0.0+] SendMMsg
 
| 30 || [3.0.0+] SendMMsg
 
|}
 
|}
  −
Open: can open <code>/dev/bpf</code> (and most likely only that file, given bsdservices' binary contents). This can be used, for example, to enable promiscuous mode, see FreeBSD's <code>/dev/bpf</code> for more details.
      
== Initalize ==
 
== Initalize ==
Line 95: Line 93:  
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.
   −
  static size_t _bsdGetTransferMemSizeForConfig(const BsdConfig *config)
+
  static size_t _bsdGetTransferMemSizeForBufferConfig(const BsdBufferConfig *config)
 
  {
 
  {
 
     u32 tcp_tx_buf_max_size = config->tcp_tx_buf_max_size != 0 ? config->tcp_tx_buf_max_size : config->tcp_tx_buf_size;
 
     u32 tcp_tx_buf_max_size = config->tcp_tx_buf_max_size != 0 ? config->tcp_tx_buf_max_size : config->tcp_tx_buf_size;
Line 104: Line 102:  
     return (size_t)(config->sb_efficiency * sum);
 
     return (size_t)(config->sb_efficiency * sum);
 
  }
 
  }
 +
 +
== SocketExempt ==
 +
This command is exclusive to <code>bsd:s</code> (FIXME: test whether this is actually the case).
 +
 +
Performs a FIONBIO <code>ioctl</code> on the socket, making it non-blocking. POSIX-compliant code should use <code>fcntl</code> instead.
 +
 +
== Open ==
 +
FreeBSD's <code>open</code> command, limited to opening <code>/dev/bpf</code>. This can be used, for example, to enable promiscuous mode, see FreeBSD's <code>/dev/bpf</code> for more details.
 +
 +
== Sysctl ==
 +
This command is exclusive to <code>bsd:s</code> (FIXME: test whether this is actually the case).
 +
 +
FreeBSD's <code>sysctl</code> command, restricted to <code>CTL_NET</code> (?).
 +
 +
== Ioctl ==
 +
FreeBSD's <code>ioctl</code> function. The following ioctls are implemented, refer to FreeBSD's headers for more details: SIOCATMARK, BIOCGBLEN, BIOCIMMEDIATE, BIOCSETIF, SIOCGETSGCNT, SIOCGIFMETRIC, SIOCSIFMETRIC SIOCDIFADDR, SIOCGIFINDEX, SIOCGIFADDR, SIOCGIFCONF, SIOCGIFNETMASK, SIOCGIFMTU, SIOCSIFMTU, SIOCGIFMEDIA, SIOCSIFLLADDR and SIOCGIFXMEDIA.
 +
 +
== Fcntl ==
 +
FreeBSD's <code>fcntl</code>, limited to <code>F_GETFL</code> and <code>F_SETFL</code> with <code>O_NONBLOCK</code>.
    
= sfdnsres =
 
= sfdnsres =
88

edits