1 #ifndef __LINUX_MROUTE_H
2 #define __LINUX_MROUTE_H
7 #include <uapi/linux/mroute.h>
9 #ifdef CONFIG_IP_MROUTE
10 static inline int ip_mroute_opt(int opt
)
12 return (opt
>= MRT_BASE
) && (opt
<= MRT_MAX
);
15 static inline int ip_mroute_opt(int opt
)
21 #ifdef CONFIG_IP_MROUTE
22 extern int ip_mroute_setsockopt(struct sock
*, int, char __user
*, unsigned int);
23 extern int ip_mroute_getsockopt(struct sock
*, int, char __user
*, int __user
*);
24 extern int ipmr_ioctl(struct sock
*sk
, int cmd
, void __user
*arg
);
25 extern int ipmr_compat_ioctl(struct sock
*sk
, unsigned int cmd
, void __user
*arg
);
26 extern int ip_mr_init(void);
29 int ip_mroute_setsockopt(struct sock
*sock
,
30 int optname
, char __user
*optval
, unsigned int optlen
)
36 int ip_mroute_getsockopt(struct sock
*sock
,
37 int optname
, char __user
*optval
, int __user
*optlen
)
43 int ipmr_ioctl(struct sock
*sk
, int cmd
, void __user
*arg
)
48 static inline int ip_mr_init(void)
55 struct net_device
*dev
; /* Device we are using */
56 unsigned long bytes_in
,bytes_out
;
57 unsigned long pkt_in
,pkt_out
; /* Statistics */
58 unsigned long rate_limit
; /* Traffic shaping (NI) */
59 unsigned char threshold
; /* TTL threshold */
60 unsigned short flags
; /* Control flags */
61 __be32 local
,remote
; /* Addresses(remote for tunnels)*/
62 int link
; /* Physical interface index */
65 #define VIFF_STATIC 0x8000
68 struct list_head list
;
69 __be32 mfc_mcastgrp
; /* Group the entry belongs to */
70 __be32 mfc_origin
; /* Source of packet */
71 vifi_t mfc_parent
; /* Source interface */
72 int mfc_flags
; /* Flags on line */
76 unsigned long expires
;
77 struct sk_buff_head unresolved
; /* Unresolved buffers */
80 unsigned long last_assert
;
85 unsigned long wrong_if
;
86 unsigned char ttls
[MAXVIFS
]; /* TTL thresholds */
98 #define MFC_HASH(a,b) (((((__force u32)(__be32)a)>>24)^(((__force u32)(__be32)b)>>26))&(MFC_LINES-1))
100 #define MFC_HASH(a,b) ((((__force u32)(__be32)a)^(((__force u32)(__be32)b)>>2))&(MFC_LINES-1))
104 extern int ipmr_get_route(struct net
*net
, struct sk_buff
*skb
,
105 __be32 saddr
, __be32 daddr
,
106 struct rtmsg
*rtm
, int nowait
);