diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-08-03 01:35:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-08-03 01:35:26 -0400 |
commit | 46f5960fdbf359f0c75989854bbaebc1de7a1eb4 (patch) | |
tree | 132d8d0eba110342bb88fcce2519c441ac771162 /net/core/netevent.c | |
parent | 90eb29efd0ca9301d80d03ea13662d32436f060e (diff) | |
parent | 29bbd72d6ee1dbf2d9f00d022f8e999aa528fb3a (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (32 commits)
[NET]: Fix more per-cpu typos
[SECURITY]: Fix build with CONFIG_SECURITY disabled.
[I/OAT]: Remove CPU hotplug lock from net_dma_rebalance
[DECNET]: Fix for routing bug
[AF_UNIX]: Kernel memory leak fix for af_unix datagram getpeersec patch
[NET]: skb_queue_lock_key() is no longer used.
[NET]: Remove lockdep_set_class() call from skb_queue_head_init().
[IPV6]: SNMPv2 "ipv6IfStatsOutFragCreates" counter error
[IPV6]: SNMPv2 "ipv6IfStatsInHdrErrors" counter error
[NET]: Kill the WARN_ON() calls for checksum fixups.
[NETFILTER]: xt_hashlimit/xt_string: missing string validation
[NETFILTER]: SIP helper: expect RTP streams in both directions
[E1000]: Convert to netdev_alloc_skb
[TG3]: Convert to netdev_alloc_skb
[NET]: Add netdev_alloc_skb().
[TCP]: Process linger2 timeout consistently.
[SECURITY] secmark: nul-terminate secdata
[NET] infiniband: Cleanup ib_addr module to use the netevents
[NET]: Core net changes to generate netevents
[NET]: Network Event Notifier Mechanism.
...
Diffstat (limited to 'net/core/netevent.c')
-rw-r--r-- | net/core/netevent.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/net/core/netevent.c b/net/core/netevent.c new file mode 100644 index 00000000000..35d02c38554 --- /dev/null +++ b/net/core/netevent.c | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | * Network event notifiers | ||
3 | * | ||
4 | * Authors: | ||
5 | * Tom Tucker <tom@opengridcomputing.com> | ||
6 | * Steve Wise <swise@opengridcomputing.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | * | ||
13 | * Fixes: | ||
14 | */ | ||
15 | |||
16 | #include <linux/rtnetlink.h> | ||
17 | #include <linux/notifier.h> | ||
18 | |||
19 | static ATOMIC_NOTIFIER_HEAD(netevent_notif_chain); | ||
20 | |||
21 | /** | ||
22 | * register_netevent_notifier - register a netevent notifier block | ||
23 | * @nb: notifier | ||
24 | * | ||
25 | * Register a notifier to be called when a netevent occurs. | ||
26 | * The notifier passed is linked into the kernel structures and must | ||
27 | * not be reused until it has been unregistered. A negative errno code | ||
28 | * is returned on a failure. | ||
29 | */ | ||
30 | int register_netevent_notifier(struct notifier_block *nb) | ||
31 | { | ||
32 | int err; | ||
33 | |||
34 | err = atomic_notifier_chain_register(&netevent_notif_chain, nb); | ||
35 | return err; | ||
36 | } | ||
37 | |||
38 | /** | ||
39 | * netevent_unregister_notifier - unregister a netevent notifier block | ||
40 | * @nb: notifier | ||
41 | * | ||
42 | * Unregister a notifier previously registered by | ||
43 | * register_neigh_notifier(). The notifier is unlinked into the | ||
44 | * kernel structures and may then be reused. A negative errno code | ||
45 | * is returned on a failure. | ||
46 | */ | ||
47 | |||
48 | int unregister_netevent_notifier(struct notifier_block *nb) | ||
49 | { | ||
50 | return atomic_notifier_chain_unregister(&netevent_notif_chain, nb); | ||
51 | } | ||
52 | |||
53 | /** | ||
54 | * call_netevent_notifiers - call all netevent notifier blocks | ||
55 | * @val: value passed unmodified to notifier function | ||
56 | * @v: pointer passed unmodified to notifier function | ||
57 | * | ||
58 | * Call all neighbour notifier blocks. Parameters and return value | ||
59 | * are as for notifier_call_chain(). | ||
60 | */ | ||
61 | |||
62 | int call_netevent_notifiers(unsigned long val, void *v) | ||
63 | { | ||
64 | return atomic_notifier_call_chain(&netevent_notif_chain, val, v); | ||
65 | } | ||
66 | |||
67 | EXPORT_SYMBOL_GPL(register_netevent_notifier); | ||
68 | EXPORT_SYMBOL_GPL(unregister_netevent_notifier); | ||
69 | EXPORT_SYMBOL_GPL(call_netevent_notifiers); | ||