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

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

Version: ~ [ linux-5.3 ] ~ [ linux-5.2.14 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.72 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.143 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.192 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.192 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.73 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef __LINUX_MROUTE6_H
  2 #define __LINUX_MROUTE6_H
  3 
  4 
  5 #include <linux/pim.h>
  6 #include <linux/skbuff.h>       /* for struct sk_buff_head */
  7 #include <net/net_namespace.h>
  8 #include <uapi/linux/mroute6.h>
  9 
 10 #ifdef CONFIG_IPV6_MROUTE
 11 static inline int ip6_mroute_opt(int opt)
 12 {
 13         return (opt >= MRT6_BASE) && (opt <= MRT6_MAX);
 14 }
 15 #else
 16 static inline int ip6_mroute_opt(int opt)
 17 {
 18         return 0;
 19 }
 20 #endif
 21 
 22 struct sock;
 23 
 24 #ifdef CONFIG_IPV6_MROUTE
 25 extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, unsigned int);
 26 extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *);
 27 extern int ip6_mr_input(struct sk_buff *skb);
 28 extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg);
 29 extern int ip6mr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg);
 30 extern int ip6_mr_init(void);
 31 extern void ip6_mr_cleanup(void);
 32 #else
 33 static inline
 34 int ip6_mroute_setsockopt(struct sock *sock,
 35                           int optname, char __user *optval, unsigned int optlen)
 36 {
 37         return -ENOPROTOOPT;
 38 }
 39 
 40 static inline
 41 int ip6_mroute_getsockopt(struct sock *sock,
 42                           int optname, char __user *optval, int __user *optlen)
 43 {
 44         return -ENOPROTOOPT;
 45 }
 46 
 47 static inline
 48 int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg)
 49 {
 50         return -ENOIOCTLCMD;
 51 }
 52 
 53 static inline int ip6_mr_init(void)
 54 {
 55         return 0;
 56 }
 57 
 58 static inline void ip6_mr_cleanup(void)
 59 {
 60         return;
 61 }
 62 #endif
 63 
 64 struct mif_device {
 65         struct net_device       *dev;                   /* Device we are using */
 66         unsigned long   bytes_in,bytes_out;
 67         unsigned long   pkt_in,pkt_out;         /* Statistics                   */
 68         unsigned long   rate_limit;             /* Traffic shaping (NI)         */
 69         unsigned char   threshold;              /* TTL threshold                */
 70         unsigned short  flags;                  /* Control flags                */
 71         int             link;                   /* Physical interface index     */
 72 };
 73 
 74 #define VIFF_STATIC 0x8000
 75 
 76 struct mfc6_cache {
 77         struct list_head list;
 78         struct in6_addr mf6c_mcastgrp;                  /* Group the entry belongs to   */
 79         struct in6_addr mf6c_origin;                    /* Source of packet             */
 80         mifi_t mf6c_parent;                     /* Source interface             */
 81         int mfc_flags;                          /* Flags on line                */
 82 
 83         union {
 84                 struct {
 85                         unsigned long expires;
 86                         struct sk_buff_head unresolved; /* Unresolved buffers           */
 87                 } unres;
 88                 struct {
 89                         unsigned long last_assert;
 90                         int minvif;
 91                         int maxvif;
 92                         unsigned long bytes;
 93                         unsigned long pkt;
 94                         unsigned long wrong_if;
 95                         unsigned char ttls[MAXMIFS];    /* TTL thresholds               */
 96                 } res;
 97         } mfc_un;
 98 };
 99 
100 #define MFC_STATIC              1
101 #define MFC_NOTIFY              2
102 
103 #define MFC6_LINES              64
104 
105 #define MFC6_HASH(a, g) (((__force u32)(a)->s6_addr32[0] ^ \
106                           (__force u32)(a)->s6_addr32[1] ^ \
107                           (__force u32)(a)->s6_addr32[2] ^ \
108                           (__force u32)(a)->s6_addr32[3] ^ \
109                           (__force u32)(g)->s6_addr32[0] ^ \
110                           (__force u32)(g)->s6_addr32[1] ^ \
111                           (__force u32)(g)->s6_addr32[2] ^ \
112                           (__force u32)(g)->s6_addr32[3]) % MFC6_LINES)
113 
114 #define MFC_ASSERT_THRESH (3*HZ)                /* Maximal freq. of asserts */
115 
116 struct rtmsg;
117 extern int ip6mr_get_route(struct net *net, struct sk_buff *skb,
118                            struct rtmsg *rtm, int nowait);
119 
120 #ifdef CONFIG_IPV6_MROUTE
121 extern struct sock *mroute6_socket(struct net *net, struct sk_buff *skb);
122 extern int ip6mr_sk_done(struct sock *sk);
123 #else
124 static inline struct sock *mroute6_socket(struct net *net, struct sk_buff *skb)
125 {
126         return NULL;
127 }
128 static inline int ip6mr_sk_done(struct sock *sk)
129 {
130         return 0;
131 }
132 #endif
133 #endif
134 

~ [ 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