binder: Use wake up hint for synchronous transactions.
[linux-2.6/btrfs-unstable.git] / include / linux / mroute6.h
blobce44e3e96d2763cf766058c88680a15215a37084
1 #ifndef __LINUX_MROUTE6_H
2 #define __LINUX_MROUTE6_H
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>
10 #ifdef CONFIG_IPV6_MROUTE
11 static inline int ip6_mroute_opt(int opt)
13 return (opt >= MRT6_BASE) && (opt <= MRT6_MAX);
15 #else
16 static inline int ip6_mroute_opt(int opt)
18 return 0;
20 #endif
22 struct sock;
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)
37 return -ENOPROTOOPT;
40 static inline
41 int ip6_mroute_getsockopt(struct sock *sock,
42 int optname, char __user *optval, int __user *optlen)
44 return -ENOPROTOOPT;
47 static inline
48 int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg)
50 return -ENOIOCTLCMD;
53 static inline int ip6_mr_init(void)
55 return 0;
58 static inline void ip6_mr_cleanup(void)
60 return;
62 #endif
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 */
74 #define VIFF_STATIC 0x8000
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 */
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 long lastuse;
96 unsigned char ttls[MAXMIFS]; /* TTL thresholds */
97 } res;
98 } mfc_un;
101 #define MFC_STATIC 1
102 #define MFC_NOTIFY 2
104 #define MFC6_LINES 64
106 #define MFC6_HASH(a, g) (((__force u32)(a)->s6_addr32[0] ^ \
107 (__force u32)(a)->s6_addr32[1] ^ \
108 (__force u32)(a)->s6_addr32[2] ^ \
109 (__force u32)(a)->s6_addr32[3] ^ \
110 (__force u32)(g)->s6_addr32[0] ^ \
111 (__force u32)(g)->s6_addr32[1] ^ \
112 (__force u32)(g)->s6_addr32[2] ^ \
113 (__force u32)(g)->s6_addr32[3]) % MFC6_LINES)
115 #define MFC_ASSERT_THRESH (3*HZ) /* Maximal freq. of asserts */
117 struct rtmsg;
118 extern int ip6mr_get_route(struct net *net, struct sk_buff *skb,
119 struct rtmsg *rtm, u32 portid);
121 #ifdef CONFIG_IPV6_MROUTE
122 extern struct sock *mroute6_socket(struct net *net, struct sk_buff *skb);
123 extern int ip6mr_sk_done(struct sock *sk);
124 #else
125 static inline struct sock *mroute6_socket(struct net *net, struct sk_buff *skb)
127 return NULL;
129 static inline int ip6mr_sk_done(struct sock *sk)
131 return 0;
133 #endif
134 #endif