Mac Developer Library

Developer

init.h Reference

Options
Deployment Target:

On This Page

init.h Reference

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Not Applicable

Objective-C

@import Kernel;

This header defines an API to register a function that will be called when the network stack is being initialized. This gives a kernel extensions an opportunity to install filters before sockets are created and network operations occur.

Included Headers

  • <sys/kernel_types.h>

Functions

  • Declaration

    Objective-C

    errno_t net_init_add ( net_init_func_ptr init_func );

    Parameters

    init_func

    A pointer to a function to be called when the stack is initialized.

    Return Value

    EINVAL - the init_func value was NULL. EALREADY - the network has already been initialized ENOMEM - there was not enough memory to perform this operation 0 - success

    Discussion

    Add a function to be called during network initialization. Your kext must not unload until the function you register is called if net_init_add returns success.

    Import Statement

    Objective-C

    #include <init.h>;

    Availability

    Available in OS X v10.4 and later.

Callbacks

  • Declaration

    Objective-C

    typedef void ( * net_init_func_ptr )( void);

    Discussion

    net_init_func_ptr will be called once the networking stack initialized and before network operations occur.

    Import Statement

    Objective-C

    #include <init.h>;

    Availability

    Available in OS X v10.4 and later.