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

TOMOYO Linux Cross Reference
Linux/include/linux/mroute6.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ 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 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __LINUX_MROUTE6_H
  3 #define __LINUX_MROUTE6_H
  4 
  5 
  6 #include <linux/pim.h>
  7 #include <linux/skbuff.h>       /* for struct sk_buff_head */
  8 #include <net/net_namespace.h>
  9 #include <uapi/linux/mroute6.h>
 10 #include <linux/mroute_base.h>
 11 #include <linux/sockptr.h>
 12 #include <net/fib_rules.h>
 13 
 14 #ifdef CONFIG_IPV6_MROUTE
 15 static inline int ip6_mroute_opt(int opt)
 16 {
 17         return (opt >= MRT6_BASE) && (opt <= MRT6_MAX);
 18 }
 19 #else
 20 static inline int ip6_mroute_opt(int opt)
 21 {
 22         return 0;
 23 }
 24 #endif
 25 
 26 struct sock;
 27 
 28 #ifdef CONFIG_IPV6_MROUTE
 29 extern int ip6_mroute_setsockopt(struct sock *, int, sockptr_t, unsigned int);
 30 extern int ip6_mroute_getsockopt(struct sock *, int, sockptr_t, sockptr_t);
 31 extern int ip6_mr_input(struct sk_buff *skb);
 32 extern int ip6mr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg);
 33 extern int ip6_mr_init(void);
 34 extern void ip6_mr_cleanup(void);
 35 int ip6mr_ioctl(struct sock *sk, int cmd, void *arg);
 36 #else
 37 static inline int ip6_mroute_setsockopt(struct sock *sock, int optname,
 38                 sockptr_t optval, unsigned int optlen)
 39 {
 40         return -ENOPROTOOPT;
 41 }
 42 
 43 static inline
 44 int ip6_mroute_getsockopt(struct sock *sock,
 45                           int optname, sockptr_t optval, sockptr_t optlen)
 46 {
 47         return -ENOPROTOOPT;
 48 }
 49 
 50 static inline
 51 int ip6mr_ioctl(struct sock *sk, int cmd, void *arg)
 52 {
 53         return -ENOIOCTLCMD;
 54 }
 55 
 56 static inline int ip6_mr_init(void)
 57 {
 58         return 0;
 59 }
 60 
 61 static inline void ip6_mr_cleanup(void)
 62 {
 63         return;
 64 }
 65 #endif
 66 
 67 #ifdef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES
 68 bool ip6mr_rule_default(const struct fib_rule *rule);
 69 #else
 70 static inline bool ip6mr_rule_default(const struct fib_rule *rule)
 71 {
 72         return true;
 73 }
 74 #endif
 75 
 76 #define VIFF_STATIC 0x8000
 77 
 78 struct mfc6_cache_cmp_arg {
 79         struct in6_addr mf6c_mcastgrp;
 80         struct in6_addr mf6c_origin;
 81 };
 82 
 83 struct mfc6_cache {
 84         struct mr_mfc _c;
 85         union {
 86                 struct {
 87                         struct in6_addr mf6c_mcastgrp;
 88                         struct in6_addr mf6c_origin;
 89                 };
 90                 struct mfc6_cache_cmp_arg cmparg;
 91         };
 92 };
 93 
 94 #define MFC_ASSERT_THRESH (3*HZ)                /* Maximal freq. of asserts */
 95 
 96 struct rtmsg;
 97 extern int ip6mr_get_route(struct net *net, struct sk_buff *skb,
 98                            struct rtmsg *rtm, u32 portid);
 99 
100 #ifdef CONFIG_IPV6_MROUTE
101 bool mroute6_is_socket(struct net *net, struct sk_buff *skb);
102 extern int ip6mr_sk_done(struct sock *sk);
103 static inline int ip6mr_sk_ioctl(struct sock *sk, unsigned int cmd,
104                                  void __user *arg)
105 {
106         switch (cmd) {
107         /* These userspace buffers will be consumed by ip6mr_ioctl() */
108         case SIOCGETMIFCNT_IN6: {
109                 struct sioc_mif_req6 buffer;
110 
111                 return sock_ioctl_inout(sk, cmd, arg, &buffer,
112                                         sizeof(buffer));
113                 }
114         case SIOCGETSGCNT_IN6: {
115                 struct sioc_sg_req6 buffer;
116 
117                 return sock_ioctl_inout(sk, cmd, arg, &buffer,
118                                         sizeof(buffer));
119                 }
120         }
121 
122         return 1;
123 }
124 #else
125 static inline bool mroute6_is_socket(struct net *net, struct sk_buff *skb)
126 {
127         return false;
128 }
129 static inline int ip6mr_sk_done(struct sock *sk)
130 {
131         return 0;
132 }
133 
134 static inline int ip6mr_sk_ioctl(struct sock *sk, unsigned int cmd,
135                                  void __user *arg)
136 {
137         return 1;
138 }
139 #endif
140 #endif
141 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php