Programming Interfaces Guide

Packet Filtering Hooks Kernel Functions

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 functions will be correctly loaded by the kernel.

hook_alloc(9F)

Allocate a hook_t data structure.

hook_free(9F)

Free a hook_t structure that was originally allocated by hook_alloc().

net_event_notify_register(9F)

Register a function to be called when there is a change to a specified event.

net_event_notify_unregister(9F)

Indicate that there is no longer any desire to receive notification of changes to the specified event through calls to the specified callback function.

net_getifname(9F)

Retrieve the name given to the specified network interface.

net_getlifaddr(9F)

Retrieve the network address information for each specified logical interface.

net_getmtu(9F)

Retrieve information about the current MTU of the specified network interface.

net_getpmtuenabled(9F)

Indicate whether path MTU (PMTU) discovery is enabled for the specified network protocol.

net_hook_register(9F)

Add a hook that allows callbacks to be registered with events that belong to the specified network protocol.

net_hook_unregister(9F)

Disable callback hooks that were registered with net_hook_register().

net_inject(9F)

Deliver network layer packets either into the kernel or onto the network.

net_inject_alloc(9F)

Allocate a net_inject_t structure.

net_inject_free(9F)

Free a net_inject_t structure that was originally allocated by net_inject_alloc().

net_instance_alloc(9F)

Allocate a net_instance_t structure.

net_instance_free(9F)

Free a net_instance_t structure that was originally allocated by net_instance_alloc().

net_instance_notify_register(9F)

Register the specified function to be called when there is a new instance added to or removed from the specified network instance.

net_instance_notify_unregister(9F)

Indicate that there is no longer any desire to receive notification of changes to the specified instance through calls to the specified callback function.

net_instance_register(9F)

Record the set of functions to be called when an event related to IP instance maintenance occurs.

net_instance_unregister(9F)

Remove the set of instances that were previously registered with net_instance_register().

net_ispartialchecksum(9F)

Indicates whether the specified packet contains headers with only partial checksum values.

net_isvalidchecksum(9F)

Verify the layer 3 checksum and, in some cases, the layer 4 checksum in the specified packet.

net_kstat_create(9F)

Allocate and initialize a new kstat(9S) structure for the specified instance of IP.

net_kstat_delete(9F)

Remove a kstat for the specified instance of IP from the system.

net_lifgetnext(9F)

Search all of the logical interfaces that are associated with a physical network interface.

net_phygetnext(9F)

Search all of the network interfaces that a network protocol “owns.”

net_phylookup(9F)

Attempt to retrieve the specified interface name for a network protocol.

net_protocol_lookup(9F)

Locate an implementation of a network layer protocol.

net_protocol_notify_register(9F)

Register the specified function to be called when there is a change to the specified protocol.

net_protocol_notify_unregister(9F)

Remove the specified function from the list of functions to call.

net_protocol_release(9F)

Indicate that a reference to the specified network protocol is no longer required.

net_routeto(9F)

Indicate which network interface packets are sent.