#include <sys/sockfilter.h> int sof_register(int version, const char *name, const sof_ops_t *ops, int flags);
int sof_unregister(const char *name);
the socket filter version; should always be set to SOF_VERSION.
a name that uniquely identifies this filter, and must match the name (not module name) used when configuring the filter via soconfig(1M).
a pointer to an instance of the sof_ops(9S) structure.
unused; should always be 0.
The sof_register() function, typically called from a module's _init(9E) entry point, is used to register a module with the socket filter framework.
The sof_unregister() function is used to unregister a module from the socket filter framework. If sof_unregister() is called from a module's _fini (9E) entry point, then the module must return EBUSY if sof_unregister() fails.
The sof_register() and sof_unregister() functions return 0 on success, and a non-zero error, as described in Intro(2), on failure.
See attributes(5) for descriptions of the following attributes: