mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
![Paul Gortmaker](/assets/img/avatar_default.png)
Ideally, header files under include/linux shouldn't be adding includes of other headers, in anticipation of their consumers, but just the headers needed for the header itself to pass parsing with CPP. The module.h is particularly bad in this sense, as it itself does include a whole bunch of other headers, due to the complexity of module support. Since fib_notifier.h is not going into a module struct looking for specific fields, we can just let it know that module is a struct, just like about 60 other include/linux headers already do. Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
50 lines
1.3 KiB
C
50 lines
1.3 KiB
C
#ifndef __NET_FIB_NOTIFIER_H
|
|
#define __NET_FIB_NOTIFIER_H
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/notifier.h>
|
|
#include <net/net_namespace.h>
|
|
|
|
struct module;
|
|
|
|
struct fib_notifier_info {
|
|
struct net *net;
|
|
int family;
|
|
struct netlink_ext_ack *extack;
|
|
};
|
|
|
|
enum fib_event_type {
|
|
FIB_EVENT_ENTRY_REPLACE,
|
|
FIB_EVENT_ENTRY_APPEND,
|
|
FIB_EVENT_ENTRY_ADD,
|
|
FIB_EVENT_ENTRY_DEL,
|
|
FIB_EVENT_RULE_ADD,
|
|
FIB_EVENT_RULE_DEL,
|
|
FIB_EVENT_NH_ADD,
|
|
FIB_EVENT_NH_DEL,
|
|
FIB_EVENT_VIF_ADD,
|
|
FIB_EVENT_VIF_DEL,
|
|
};
|
|
|
|
struct fib_notifier_ops {
|
|
int family;
|
|
struct list_head list;
|
|
unsigned int (*fib_seq_read)(struct net *net);
|
|
int (*fib_dump)(struct net *net, struct notifier_block *nb);
|
|
struct module *owner;
|
|
struct rcu_head rcu;
|
|
};
|
|
|
|
int call_fib_notifier(struct notifier_block *nb, struct net *net,
|
|
enum fib_event_type event_type,
|
|
struct fib_notifier_info *info);
|
|
int call_fib_notifiers(struct net *net, enum fib_event_type event_type,
|
|
struct fib_notifier_info *info);
|
|
int register_fib_notifier(struct notifier_block *nb,
|
|
void (*cb)(struct notifier_block *nb));
|
|
int unregister_fib_notifier(struct notifier_block *nb);
|
|
struct fib_notifier_ops *
|
|
fib_notifier_ops_register(const struct fib_notifier_ops *tmpl, struct net *net);
|
|
void fib_notifier_ops_unregister(struct fib_notifier_ops *ops);
|
|
|
|
#endif
|