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

TOMOYO Linux Cross Reference
Linux/net/ipv6/fib6_notifier.c

Version: ~ [ linux-6.4-rc3 ] ~ [ linux-6.3.4 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.30 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.113 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.180 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.243 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.283 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.315 ] ~ [ 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 #include <linux/notifier.h>
  2 #include <linux/socket.h>
  3 #include <linux/kernel.h>
  4 #include <linux/export.h>
  5 #include <net/net_namespace.h>
  6 #include <net/fib_notifier.h>
  7 #include <net/netns/ipv6.h>
  8 #include <net/ip6_fib.h>
  9 
 10 int call_fib6_notifier(struct notifier_block *nb, struct net *net,
 11                        enum fib_event_type event_type,
 12                        struct fib_notifier_info *info)
 13 {
 14         info->family = AF_INET6;
 15         return call_fib_notifier(nb, net, event_type, info);
 16 }
 17 
 18 int call_fib6_notifiers(struct net *net, enum fib_event_type event_type,
 19                         struct fib_notifier_info *info)
 20 {
 21         info->family = AF_INET6;
 22         return call_fib_notifiers(net, event_type, info);
 23 }
 24 
 25 static unsigned int fib6_seq_read(struct net *net)
 26 {
 27         return fib6_tables_seq_read(net) + fib6_rules_seq_read(net);
 28 }
 29 
 30 static int fib6_dump(struct net *net, struct notifier_block *nb)
 31 {
 32         int err;
 33 
 34         err = fib6_rules_dump(net, nb);
 35         if (err)
 36                 return err;
 37 
 38         return fib6_tables_dump(net, nb);
 39 }
 40 
 41 static const struct fib_notifier_ops fib6_notifier_ops_template = {
 42         .family         = AF_INET6,
 43         .fib_seq_read   = fib6_seq_read,
 44         .fib_dump       = fib6_dump,
 45         .owner          = THIS_MODULE,
 46 };
 47 
 48 int __net_init fib6_notifier_init(struct net *net)
 49 {
 50         struct fib_notifier_ops *ops;
 51 
 52         ops = fib_notifier_ops_register(&fib6_notifier_ops_template, net);
 53         if (IS_ERR(ops))
 54                 return PTR_ERR(ops);
 55         net->ipv6.notifier_ops = ops;
 56 
 57         return 0;
 58 }
 59 
 60 void __net_exit fib6_notifier_exit(struct net *net)
 61 {
 62         fib_notifier_ops_unregister(net->ipv6.notifier_ops);
 63 }
 64 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp