Packet filtering hooks interfaces include kernel functions and data type definitions.
The packet filtering hooks kernel functions are exported from the misc/neti and misc/hook kernel modules to support packet filtering. To use these functions, link your kernel modules with –Nmisc/neti and –Nmisc/hook so that the kernel load the functions.
The following kernel functions support packet filtering:
Allocate a hook_t data structure. For more information, see the hook_alloc(9F) man page.
Free a hook_t structure that was allocated by hook_alloc(). For more information, see the hook_free(9F) man page.
Register a function to be called when there is a change to a specified event. For more information, see the net_event_notify_register(9F) man page.
Stop receiving the notification of changes to the specified event through calls to the specified callback function. For more information, see the net_event_notify_unregister(9F) man page.
Retrieve the name given to the specified network interface. For more information, see the net_getifname(9F) man page.
Retrieve the network address information for each specified logical interface. For more information, see the net_getlifaddr(9F) man page.
Retrieve information about the current MTU of the specified network interface. For more information, see the net_getmtu(9F) man page.
Indicate whether path MTU (PMTU) discovery is enabled for the specified network protocol. For more information, see the net_getpmtuenabled(9F) man page.
Add a hook that allows callbacks to be registered with events that belong to the specified network protocol. For more information, see the net_hook_register(9F) man page.
Disable callback hooks that were registered with net_hook_register(). For more information, see the net_hook_register(9F) man page.
Deliver network layer packets either into the kernel or onto the network. For more information, see the net_inject(9F) man page.
Allocate a net_inject_t structure. For more information, see the net_inject_alloc(9F) man page.
Free a net_inject_t structure that was allocated by net_inject_alloc(). For more information, see the net_inject_free(9F) man page.
Allocate a net_instance_t structure. For more information, see the net_instance_alloc(9F) man page.
Free a net_instance_t structure that was allocated by net_instance_alloc(). For more information, see the net_instance_free(9F) man page.
Register the specified function to be called when there is a new instance added to or removed from the specified network instance. For more information, see the net_instance_notify_register(9F) man page.
Stop receiving the notification of changes to the specified instance through calls to the specified callback function. For more information, see the net_instance_notify_unregister(9F) man page.
Record the set of functions to be called when an event related to IP instance maintenance occurs. For more information, see the net_instance_register(9F) man page.
Remove the set of instances that were registered with net_instance_register(). For more information, see the net_instance_unregister(9F) man page.
Indicates whether the specified packet contains headers with only partial checksum values. For more information, see the net_ispartialchecksum(9F) man page.
Verify the layer 3 checksum and, in some cases, the layer 4 checksum in the specified packet. For more information, see the net_isvalidchecksum(9F) man page.
Allocate and initialize a new kstat(9S) structure for the specified instance of IP. For more information, see the net_kstat_create(9F) man page.
Remove a kstat for the specified instance of IP from the system. For more information, see the net_kstat_delete(9F) man page.
Search all of the logical interfaces that are associated with a physical network interface. For more information, see the net_lifgetnext(9F) man page.
Search all of the network interfaces that a network protocol owns. For more information, see the net_phygetnext(9F) man page.
Attempt to retrieve the specified interface name for a network protocol. For more information, see the net_phylookup(9F) man page.
Locate an implementation of a network layer protocol. For more information, see the net_protocol_lookup(9F) man page.
Register the specified function to be called when there is a change to the specified protocol. For more information, see the net_protocol_notify_register(9F) man page.
Indicate that a reference to the specified network protocol is no longer required. For more information, see the net_protocol_release(9F) man page.
Indicate which network interface packets are sent. For more information, see the net_routeto(9F) man page.
The following data types support the kernel functions.
A callback to be inserted into a networking event.
An event that has occurred and belongs to a network interface.
A packet event structure passed through the hooks.
Information about how to transmit a packet.
A collection of instances to be called when relevant events happen within IP.