NET_PROTOCOL_NOTIFY_REGISTER man page on SmartOS

Man page or keyword search:  
man Server   16655 pages
apropos Keyword Search (all sections)
Output format
SmartOS logo
[printable version]

NET_PROTOCOL_NOTIFY_REGISTER(9F)	      NET_PROTOCOL_NOTIFY_REGISTER(9F)

NAME
       net_protocol_notify_register,	 net_instance_protocol_unregister    -
       add/delete a function to be called for changes to a protocol

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

       int net_protocol_notify_register(net_handle_t family,
	    hook_notify_fn_t *callback, void *arg);

       int net_protocol_notify_unregister(net_handle_t family,
	    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
       family
		   value returned from net_protocol_lookup().

       callback
		   function to call when a change occurs.

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

DESCRIPTION
       The net_protocol_notify_register() function registers a function repre‐
       sented by the pointer callback to be called when there is a  change  to
       the  protocol  represented  by  family.	The types of changes for which
       notifications are available for is currently limited  to	 the  addition
       and removal of protocols.

       The  net_protocol_notify_unregister()  function	removes	 the  function
       specified by the pointer callback from the list of functions  to	 call.
       This call may fail if the specified function cannot be found.

       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 protocols.

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

       name1
		is the name of the protocol

       name2
		is NULL.

       name3
		is the name of the protocol 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 TYPE    │ ATTRIBUTE VALUE │
       ├────────────────────┼─────────────────┤
       │Interface Stability │ Committed	      │
       └────────────────────┴─────────────────┘

SEE ALSO
       attributes(5), net_protocol_lookup(9F)

				 Oct 30, 2008 NET_PROTOCOL_NOTIFY_REGISTER(9F)
[top]

List of man pages available for SmartOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net