#include <sys/sockfilter.h> void sof_flowctrl_data_in(sof_handle_t hdl, boolean_t on);
void sof_flowctrl_data_out(sof_handle_t hdl, boolean_t on);
per-socket filter handle
set to B_TRUE or B_FALSE to assert or clear flow control, respectively
The sof_flowctrl_data_in() and sof_flowctrl_data_out() functions are used to enforce flow control on the transmit and receive paths, respectively. Unlike send side flow control, which is enforced by the socket layer, the behavior on the receive side is dependent on the transport protocol. Asserting flow control for a protocol that supports it at the protocol level, such TCP, will cause the peer to stop transmitting data. Other protocols, like UDP, will start dropping packets as they are received.
Neither sof_flowctrl_data_in() nor sof_flowctrl_data_out() can be used to clear a flow control condition that was not asserted by the filter. For example, a socket may be flow controlled as a result of an application not consuming data, and clearing the filter's flow control condition will not change the socket's state.
Flow control may not take effect right away, and during this transient period both the socket and protocol may generate data that will call the data entry points. It is also possible that another filter inject data while the socket is flow controlled.
The sof_flowctrl_data_in() and sof_flowctrl_data_out() functions can be called from any context
See attributes(5) for descriptions of the following attributes: