Content-type: text/html Man page of net_instance_notify_register

net_instance_notify_register

Section: Kernel Functions for Drivers (9F)
Updated: 30 Oct 2008
Index Return to Main Contents
 

NAME

net_instance_notify_register, net_instance_notify_unregister - add/delete a function to be called for changes to an instance  

SYNOPSIS

#include <sys/hook.h>
#include <sys/neti.h>

int net_instance_notify_register(net id_t net_id, 
     hook_notify_fn_t *callback, void *arg);

int net_instance_notify_unregister(net id_t net_id, 
     hook_notify_fn_t *callback);

typedef int (* hook_notify_fn_t)(hook_notify_cmd_t command,
     void *arg, const char *name1, const char *name2, const char 
     *name3);

 

INTERFACE LEVEL

Solaris DDI specific (Solaris DDI).  

PARAMETERS

netid

value from either callback registered with net_instance_register() or net_zoneidtonetid().

callback

function to call when a change occurs.

arg

pointer to pass into the callback() function when a change occurs.

 

DESCRIPTION

The net_instance_notify_register() function registers a function represented by the pointer callback to be called when there is a new instance added or removed from the given network instance (represented by netid.)

The net_instance_notify_unregister() function indicates that there is no longer any desire to receive notification of changes to the instance through function calls to the specified callback.

Multiple callback functions may be registered through this interface. The same set of parameters is passed to each callback function. The memory referenced through the pointers passed to the callback should be treated as pointing to read-only memory. Changing this data is strictly prohibited.

The function that is called must not block any other events.

The arguments passed through to the callback are as follows (the command is either HN_REGISTER or HN_UNREGISTER):

name1

is the netid represented as a string.

name2

is NULL.

name3

is the name of the instance being added/removed

 

RETURN VALUES

If these functions succeed, 0 is returned. Otherwise, the following error is returned:

EEXIST

the given callback function is already registered.

 

CONTEXT

These functions may be called from user or kernel context.  

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE

AvailabilitySUNWcsu

Interface Stability

 

SEE ALSO

attributes(5), net_instance_register(9F), net_instance_unregister(9F), net_zoneidtonetid(9F)


 

Index

NAME
SYNOPSIS
INTERFACE LEVEL
PARAMETERS
DESCRIPTION
RETURN VALUES
CONTEXT
ATTRIBUTES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 02:39:40 GMT, October 02, 2010