^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) #ifndef __NET_FIB_NOTIFIER_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #define __NET_FIB_NOTIFIER_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <linux/notifier.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #include <net/net_namespace.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) struct module;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) struct fib_notifier_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) int family;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) struct netlink_ext_ack *extack;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) enum fib_event_type {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) FIB_EVENT_ENTRY_REPLACE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) FIB_EVENT_ENTRY_APPEND,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) FIB_EVENT_ENTRY_ADD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) FIB_EVENT_ENTRY_DEL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) FIB_EVENT_RULE_ADD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) FIB_EVENT_RULE_DEL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) FIB_EVENT_NH_ADD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) FIB_EVENT_NH_DEL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) FIB_EVENT_VIF_ADD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) FIB_EVENT_VIF_DEL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) struct fib_notifier_ops {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) int family;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) struct list_head list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) unsigned int (*fib_seq_read)(struct net *net);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) int (*fib_dump)(struct net *net, struct notifier_block *nb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) struct netlink_ext_ack *extack);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) struct module *owner;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) struct rcu_head rcu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) int call_fib_notifier(struct notifier_block *nb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) enum fib_event_type event_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) struct fib_notifier_info *info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) int call_fib_notifiers(struct net *net, enum fib_event_type event_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) struct fib_notifier_info *info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) int register_fib_notifier(struct net *net, struct notifier_block *nb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) void (*cb)(struct notifier_block *nb),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) struct netlink_ext_ack *extack);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) int unregister_fib_notifier(struct net *net, struct notifier_block *nb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) struct fib_notifier_ops *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) fib_notifier_ops_register(const struct fib_notifier_ops *tmpl, struct net *net);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) void fib_notifier_ops_unregister(struct fib_notifier_ops *ops);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) #endif