~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/net/core/netevent.c

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-or-later
  2 /*
  3  *      Network event notifiers
  4  *
  5  *      Authors:
  6  *      Tom Tucker             <tom@opengridcomputing.com>
  7  *      Steve Wise             <swise@opengridcomputing.com>
  8  *
  9  *      Fixes:
 10  */
 11 
 12 #include <linux/rtnetlink.h>
 13 #include <linux/notifier.h>
 14 #include <linux/export.h>
 15 #include <net/netevent.h>
 16 
 17 static ATOMIC_NOTIFIER_HEAD(netevent_notif_chain);
 18 
 19 /**
 20  *      register_netevent_notifier - register a netevent notifier block
 21  *      @nb: notifier
 22  *
 23  *      Register a notifier to be called when a netevent occurs.
 24  *      The notifier passed is linked into the kernel structures and must
 25  *      not be reused until it has been unregistered. A negative errno code
 26  *      is returned on a failure.
 27  */
 28 int register_netevent_notifier(struct notifier_block *nb)
 29 {
 30         return atomic_notifier_chain_register(&netevent_notif_chain, nb);
 31 }
 32 EXPORT_SYMBOL_GPL(register_netevent_notifier);
 33 
 34 /**
 35  *      unregister_netevent_notifier - unregister a netevent notifier block
 36  *      @nb: notifier
 37  *
 38  *      Unregister a notifier previously registered by
 39  *      register_neigh_notifier(). The notifier is unlinked into the
 40  *      kernel structures and may then be reused. A negative errno code
 41  *      is returned on a failure.
 42  */
 43 
 44 int unregister_netevent_notifier(struct notifier_block *nb)
 45 {
 46         return atomic_notifier_chain_unregister(&netevent_notif_chain, nb);
 47 }
 48 EXPORT_SYMBOL_GPL(unregister_netevent_notifier);
 49 
 50 /**
 51  *      call_netevent_notifiers - call all netevent notifier blocks
 52  *      @val: value passed unmodified to notifier function
 53  *      @v:   pointer passed unmodified to notifier function
 54  *
 55  *      Call all neighbour notifier blocks.  Parameters and return value
 56  *      are as for notifier_call_chain().
 57  */
 58 
 59 int call_netevent_notifiers(unsigned long val, void *v)
 60 {
 61         return atomic_notifier_call_chain(&netevent_notif_chain, val, v);
 62 }
 63 EXPORT_SYMBOL_GPL(call_netevent_notifiers);
 64 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php