'\" te .\" Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. .TH sof_ops 9S "9 May 2012" "SunOS 5.11" "Data Structures for Drivers" .SH NAME sof_ops \- socket filter entry points structure .SH SYNOPSIS .LP .nf #include .fi .SH DESCRIPTION .sp .LP The \fBsof_ops\fR structure defines a set of function entry points that a socket filter module exports to the socket filter framework. None of the entry points are required, and unused entry points should be set to \fINULL\fR. .sp .LP Filter instance are created and attached to sockets that match the requirements that were established when the filter was configured with \fBsoconfig\fR(1M). A filter module can only have a single filter instance attached to a socket, but there may be multiple filter instance attached to a socket as a result of multiple filter modules being configured on the system. .sp .LP The presence of multiple filter instance on a socket create a filter stack, which together with the source of the event determine the entry point execution order. Socket operations, such as \fBconnect\fR(3SOCKET), traverse the stack top to bottom, while protocol events, such as incoming data, move bottom-up. .sp .LP The order in which a filter is attached to a socket is undefined unless the filter specifies a placement hint when it is configured by \fBsoconfig\fR. .sp .LP The framework makes the following guarantees: .RS +4 .TP .ie t \(bu .el o \fBsofop_attach_active\fR(9E) or \fBsofop_attach_passive\fR(9E) is always called before any other entry point .RE .RS +4 .TP .ie t \(bu .el o \fBsofop_detach\fR(9E) is always the final entry point to be called .RE .RS +4 .TP .ie t \(bu .el o while a filter module is executing \fBsofop_attach_active()\fR, \fBsofop_attach_passive()\fR, or \fBsofop_detach()\fR for a socket, no other filter entry point will be called for the same socket. .RE .sp .LP In certain circumstances , a socket must be moved to legacy STREAMS mode to satisfy a STREAMS operation (\fBstreamio\fR(7I)) issued by an application. Socket filters are incompatible with sockets operating in STREAMS mode, and a socket that has an active socket filter attached can not fall back to legacy mode, causing the STREAMS operation to fail. Therefore, the impact of enabling a socket filter should always be evaluated before it is deployed. A socket filter can minimize this impact by always marking itself inactive (using \fBsof_bypass\fR(9F)) if it is determined that it will not be used by a particular socket. .sp .LP Socket filters are currently not supported by either AF_UNIX or SCTP sockets. .SH STRUCTURE MEMBERS .sp .in +2 .nf sof_attach_active_fn_t sofop_attach_active; sof_attach_passive_fn_t sofop_attach_passive; sof_detach_fn_t sofop_detach; sof_data_in_fn_t sofop_data_in; sof_data_in_proc_fn_t sofop_data_in_proc; sof_data_out_fn_t sofop_data_out; sof_bind_fn_t sofop_bind; sof_listen_fn_t sofop_listen; sof_connect_fn_t sofop_connect; sof_accepted_fn_t sofop_accepted; sof_shutdown_fn_t sofop_shutdown; sof_getsockname_fn_t sofop_getsockname; sof_getpeername_fn_t sofop_getpeername; sof_setsockopt_fn_t sofop_setsockopt; sof_getsockopt_fn_t sofop_getsockopt; sof_notify_fn_t sofop_notify; .fi .in -2 .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Availabilitysystem/kernel _ Interface StabilityUncommitted .TE .SH SEE ALSO .sp .LP \fBsoconfig\fR(1M), \fBconnect\fR(3SOCKET), \fBattributes\fR(5), \fBstreamio\fR(7I), \fBsofop_attach_active\fR(9E), \fBsofop_attach_passive\fR(9E), \fBsofop_bind\fR(9E), \fBsofop_data_in\fR(9E), \fBsofop_detach\fR(9E), \fBsofop_notify\fR(9E), \fBsof_bypass\fR(9F), \fBsof_register\fR(9F)