1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __LINUX_MROUTE_H
3 #define __LINUX_MROUTE_H
7 #include <net/fib_rules.h>
8 #include <net/fib_notifier.h>
9 #include <uapi/linux/mroute.h>
10 #include <linux/mroute_base.h>
11 #include <linux/sockptr.h>
13 #ifdef CONFIG_IP_MROUTE
14 static inline int ip_mroute_opt(int opt)
16 return opt >= MRT_BASE && opt <= MRT_MAX;
19 int ip_mroute_setsockopt(struct sock *, int, sockptr_t, unsigned int);
20 int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *);
21 int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg);
22 int ipmr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg);
24 bool ipmr_rule_default(const struct fib_rule *rule);
26 static inline int ip_mroute_setsockopt(struct sock *sock, int optname,
27 sockptr_t optval, unsigned int optlen)
32 static inline int ip_mroute_getsockopt(struct sock *sock, int optname,
33 char __user *optval, int __user *optlen)
38 static inline int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg)
43 static inline int ip_mr_init(void)
48 static inline int ip_mroute_opt(int opt)
53 static inline bool ipmr_rule_default(const struct fib_rule *rule)
59 #define VIFF_STATIC 0x8000
61 struct mfc_cache_cmp_arg {
67 * struct mfc_cache - multicast routing entries
68 * @_c: Common multicast routing information; has to be first [for casting]
69 * @mfc_mcastgrp: destination multicast group address
70 * @mfc_origin: source address
71 * @cmparg: used for rhashtable comparisons
80 struct mfc_cache_cmp_arg cmparg;
85 int ipmr_get_route(struct net *net, struct sk_buff *skb,
86 __be32 saddr, __be32 daddr,
87 struct rtmsg *rtm, u32 portid);