Go to main content

man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: July 2017
 
 

sof_inject_data_in(9F)

Name

sof_inject_data_in, sof_inject_data_out - inject data

Synopsis

#include <sys/sockfilter.h>

int sof_inject_data_in(sof_handle_t hdl, mblk_t *mp, boolean_t *stop);
int sof_inject_data_out(sof_handle_t hdl, mblk_t *mp, boolean_t *stop);

Parameters

hdl

per-socket filter handle

mp

pointer to a msgb(9S) structure containing data to inject. Multiple mblk structures can be chained together via b_cont. The first mblk can contain address and/or control information, which can be constructed from a message header structure using sof_mblk_create(9F) .

stop

result parameter indicating whether the socket is flow controlled. The filter should stop injecting any more data if stop is B_TRUE, and only resume once the SOF_EV_FLOWCTRL_CLR (sofop_notify(9E)) event is observed.

Description

The sof_inject_data_in() function is used to enqueue data in socket's receive buffer, which can then be consumed using recv(3SOCKET).

The sof_inject_data_out() function is used to transmit data from the socket to its peer.

The framework takes ownership of the message chain on both successful and failed inject attempts.

The filter can check flow control state by calling sof_inject_data_in() and sof_inject_data_out() with a NULL message, which will update stop.

Return Values

The sof_inject_data_in() and sof_inject_data_out() functions returns 0 if data was successfully injected, and a non-zero error value, as described in Intro(2), on failure.

Context

The sof_inject_data_in() and sof_inject_data_out() functions can be called from user and kernel context

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/kernel
Interface Stability
Uncommitted

See Also

Intro(2), recv(3SOCKET), attributes(5), sofop_notify(9E), sof_flowctrl_data_in(9F), sof_mblk_create (9F), msgb(9S), sof_ops(9S)