Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6/mini2440.git] / include / net / ndisc.h
blobf85d6e4b74426b97f75b472403c6e5c82ca9cdb2
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_MAX
28 #define MAX_RTR_SOLICITATION_DELAY HZ
30 #define ND_REACHABLE_TIME (30*HZ)
31 #define ND_RETRANS_TIMER HZ
33 #define ND_MIN_RANDOM_FACTOR (1/2)
34 #define ND_MAX_RANDOM_FACTOR (3/2)
36 #ifdef __KERNEL__
38 #include <linux/skbuff.h>
39 #include <linux/netdevice.h>
40 #include <linux/icmpv6.h>
41 #include <net/neighbour.h>
42 #include <asm/atomic.h>
44 extern struct neigh_table nd_tbl;
46 struct nd_msg {
47 struct icmp6hdr icmph;
48 struct in6_addr target;
49 __u8 opt[0];
52 struct rs_msg {
53 struct icmp6hdr icmph;
54 __u8 opt[0];
57 struct ra_msg {
58 struct icmp6hdr icmph;
59 __u32 reachable_time;
60 __u32 retrans_timer;
63 struct nd_opt_hdr {
64 __u8 nd_opt_type;
65 __u8 nd_opt_len;
66 } __attribute__((__packed__));
69 extern int ndisc_init(struct net_proto_family *ops);
71 extern void ndisc_cleanup(void);
73 extern int ndisc_rcv(struct sk_buff *skb);
75 extern void ndisc_send_ns(struct net_device *dev,
76 struct neighbour *neigh,
77 struct in6_addr *solicit,
78 struct in6_addr *daddr,
79 struct in6_addr *saddr);
81 extern void ndisc_send_rs(struct net_device *dev,
82 struct in6_addr *saddr,
83 struct in6_addr *daddr);
85 extern void ndisc_forwarding_on(void);
86 extern void ndisc_forwarding_off(void);
88 extern void ndisc_send_redirect(struct sk_buff *skb,
89 struct neighbour *neigh,
90 struct in6_addr *target);
92 extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir);
95 struct rt6_info * dflt_rt_lookup(void);
98 * IGMP
100 extern int igmp6_init(struct net_proto_family *ops);
102 extern void igmp6_cleanup(void);
104 extern int igmp6_event_query(struct sk_buff *skb);
106 extern int igmp6_event_report(struct sk_buff *skb);
108 extern void igmp6_cleanup(void);
110 #ifdef CONFIG_SYSCTL
111 extern int ndisc_ifinfo_sysctl_change(ctl_table *ctl,
112 int write,
113 struct file * filp,
114 void __user *buffer,
115 size_t *lenp,
116 loff_t *ppos);
117 #endif
119 extern void inet6_ifinfo_notify(int event,
120 struct inet6_dev *idev);
122 static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, struct in6_addr *addr)
125 if (dev)
126 return __neigh_lookup(&nd_tbl, addr, dev, 1);
128 return NULL;
132 #endif /* __KERNEL__ */
135 #endif