x86: arch/x86/mm/init_32.c cleanup
[wrt350n-kernel.git] / include / net / ndisc.h
blob6684f7efbeeb84add2716337c8d8628fc6449bf8
1 #ifndef _NDISC_H
2 #define _NDISC_H
4 /*
5 * ICMP codes for neighbour discovery messages
6 */
8 #define NDISC_ROUTER_SOLICITATION 133
9 #define NDISC_ROUTER_ADVERTISEMENT 134
10 #define NDISC_NEIGHBOUR_SOLICITATION 135
11 #define NDISC_NEIGHBOUR_ADVERTISEMENT 136
12 #define NDISC_REDIRECT 137
15 * ndisc options
18 enum {
19 __ND_OPT_PREFIX_INFO_END = 0,
20 ND_OPT_SOURCE_LL_ADDR = 1, /* RFC2461 */
21 ND_OPT_TARGET_LL_ADDR = 2, /* RFC2461 */
22 ND_OPT_PREFIX_INFO = 3, /* RFC2461 */
23 ND_OPT_REDIRECT_HDR = 4, /* RFC2461 */
24 ND_OPT_MTU = 5, /* RFC2461 */
25 __ND_OPT_ARRAY_MAX,
26 ND_OPT_ROUTE_INFO = 24, /* RFC4191 */
27 ND_OPT_RDNSS = 25, /* RFC5006 */
28 __ND_OPT_MAX
31 #define MAX_RTR_SOLICITATION_DELAY HZ
33 #define ND_REACHABLE_TIME (30*HZ)
34 #define ND_RETRANS_TIMER HZ
36 #define ND_MIN_RANDOM_FACTOR (1/2)
37 #define ND_MAX_RANDOM_FACTOR (3/2)
39 #ifdef __KERNEL__
41 #include <linux/compiler.h>
42 #include <linux/icmpv6.h>
43 #include <linux/in6.h>
44 #include <linux/types.h>
46 #include <net/neighbour.h>
48 struct ctl_table;
49 struct file;
50 struct inet6_dev;
51 struct net_device;
52 struct net_proto_family;
53 struct sk_buff;
55 extern struct neigh_table nd_tbl;
57 struct nd_msg {
58 struct icmp6hdr icmph;
59 struct in6_addr target;
60 __u8 opt[0];
63 struct rs_msg {
64 struct icmp6hdr icmph;
65 __u8 opt[0];
68 struct ra_msg {
69 struct icmp6hdr icmph;
70 __be32 reachable_time;
71 __be32 retrans_timer;
74 struct nd_opt_hdr {
75 __u8 nd_opt_type;
76 __u8 nd_opt_len;
77 } __attribute__((__packed__));
80 extern int ndisc_init(struct net_proto_family *ops);
82 extern void ndisc_cleanup(void);
84 extern int ndisc_rcv(struct sk_buff *skb);
86 extern void ndisc_send_ns(struct net_device *dev,
87 struct neighbour *neigh,
88 struct in6_addr *solicit,
89 struct in6_addr *daddr,
90 struct in6_addr *saddr);
92 extern void ndisc_send_rs(struct net_device *dev,
93 struct in6_addr *saddr,
94 struct in6_addr *daddr);
96 extern void ndisc_forwarding_on(void);
97 extern void ndisc_forwarding_off(void);
99 extern void ndisc_send_redirect(struct sk_buff *skb,
100 struct neighbour *neigh,
101 struct in6_addr *target);
103 extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir);
106 struct rt6_info * dflt_rt_lookup(void);
109 * IGMP
111 extern int igmp6_init(struct net_proto_family *ops);
113 extern void igmp6_cleanup(void);
115 extern int igmp6_event_query(struct sk_buff *skb);
117 extern int igmp6_event_report(struct sk_buff *skb);
119 extern void igmp6_cleanup(void);
121 #ifdef CONFIG_SYSCTL
122 extern int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl,
123 int write,
124 struct file * filp,
125 void __user *buffer,
126 size_t *lenp,
127 loff_t *ppos);
128 #endif
130 extern void inet6_ifinfo_notify(int event,
131 struct inet6_dev *idev);
133 static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, struct in6_addr *addr)
136 if (dev)
137 return __neigh_lookup(&nd_tbl, addr, dev, 1);
139 return NULL;
143 #endif /* __KERNEL__ */
146 #endif