| Current File : //usr/share/man/man9f/sof_register.9f |
'\" te
.\" Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
.TH sof_register 9F "9 May 2012" "SunOS 5.11" "Kernel Functions for Drivers"
.SH NAME
sof_register, sof_unregister \- register or unregister a socket filter module
.SH SYNOPSIS
.LP
.nf
#include <sys/sockfilter.h>
int sof_register(int \fIversion\fR, const char *\fIname\fR,
const sof_ops_t *\fIops\fR, int \fIflags\fR);
.fi
.LP
.nf
int sof_unregister(const char *\fIname\fR);
.fi
.SH PARAMETERS
.sp
.ne 2
.mk
.na
\fB\fIversion\fR\fR
.ad
.RS 11n
.rt
the socket filter version; should always be set to \fBSOF_VERSION\fR.
.RE
.sp
.ne 2
.mk
.na
\fB\fIname\fR\fR
.ad
.RS 11n
.rt
a name that uniquely identifies this filter, and must match the name (not module name) used when configuring the filter via \fBsoconfig\fR(1M).
.RE
.sp
.ne 2
.mk
.na
\fB\fIops\fR\fR
.ad
.RS 11n
.rt
a pointer to an instance of the \fBsof_ops\fR(9S) structure.
.RE
.sp
.ne 2
.mk
.na
\fB\fIflags\fR\fR
.ad
.RS 11n
.rt
unused; should always be 0.
.RE
.SH DESCRIPTION
.sp
.LP
The \fBsof_register()\fR function, typically called from a module's \fB_init\fR(9E) entry point, is used to register a module with the socket filter framework.
.sp
.LP
The \fBsof_unregister()\fR function is used to unregister a module from the socket filter framework. If \fBsof_unregister()\fR is called from a module's \fB_fini\fR(9E) entry point, then the module must return \fBEBUSY\fR if \fBsof_unregister()\fR fails.
.SH RETURN VALUES
.sp
.LP
The \fBsof_register()\fR and \fBsof_unregister()\fR functions return 0 on success, and a non-zero error, as described in \fBIntro\fR(2), on failure.
.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), \fBIntro\fR(2), \fBattributes\fR(5), \fB_fini\fR(9E), \fB_init\fR(9E), \fBsof_ops\fR(9S)