2017-08-03 11:28:11 +00:00
|
|
|
#ifndef __NET_FIB_NOTIFIER_H
|
|
|
|
#define __NET_FIB_NOTIFIER_H
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/notifier.h>
|
|
|
|
#include <net/net_namespace.h>
|
|
|
|
|
2019-04-21 03:29:44 +00:00
|
|
|
struct module;
|
|
|
|
|
2017-08-03 11:28:11 +00:00
|
|
|
struct fib_notifier_info {
|
|
|
|
int family;
|
2017-10-28 00:37:13 +00:00
|
|
|
struct netlink_ext_ack *extack;
|
2017-08-03 11:28:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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,
|
2017-09-27 06:23:11 +00:00
|
|
|
FIB_EVENT_VIF_ADD,
|
|
|
|
FIB_EVENT_VIF_DEL,
|
2017-08-03 11:28:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct fib_notifier_ops {
|
|
|
|
int family;
|
|
|
|
struct list_head list;
|
|
|
|
unsigned int (*fib_seq_read)(struct net *net);
|
2019-10-03 09:49:30 +00:00
|
|
|
int (*fib_dump)(struct net *net, struct notifier_block *nb,
|
|
|
|
struct netlink_ext_ack *extack);
|
2017-09-01 09:15:17 +00:00
|
|
|
struct module *owner;
|
2017-08-03 11:28:11 +00:00
|
|
|
struct rcu_head rcu;
|
|
|
|
};
|
|
|
|
|
2019-10-03 09:49:27 +00:00
|
|
|
int call_fib_notifier(struct notifier_block *nb,
|
2017-08-03 11:28:11 +00:00
|
|
|
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);
|
2019-10-03 09:49:27 +00:00
|
|
|
int register_fib_notifier(struct net *net, struct notifier_block *nb,
|
2019-10-03 09:49:30 +00:00
|
|
|
void (*cb)(struct notifier_block *nb),
|
|
|
|
struct netlink_ext_ack *extack);
|
2019-10-03 09:49:27 +00:00
|
|
|
int unregister_fib_notifier(struct net *net, struct notifier_block *nb);
|
2017-08-03 11:28:11 +00:00
|
|
|
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
|