Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at cec2f0ca29fe99eec5e4012e5fb341fce64e578b 144 lines 3.0 kB view raw
1#ifndef _NDISC_H 2#define _NDISC_H 3 4/* 5 * ICMP codes for neighbour discovery messages 6 */ 7 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 13 14/* 15 * ndisc options 16 */ 17 18enum { 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 26}; 27 28#define MAX_RTR_SOLICITATION_DELAY HZ 29 30#define ND_REACHABLE_TIME (30*HZ) 31#define ND_RETRANS_TIMER HZ 32 33#define ND_MIN_RANDOM_FACTOR (1/2) 34#define ND_MAX_RANDOM_FACTOR (3/2) 35 36#ifdef __KERNEL__ 37 38#include <linux/config.h> 39#include <linux/compiler.h> 40#include <linux/icmpv6.h> 41#include <linux/in6.h> 42#include <linux/types.h> 43 44#include <net/neighbour.h> 45 46struct ctl_table; 47struct file; 48struct inet6_dev; 49struct net_device; 50struct net_proto_family; 51struct sk_buff; 52 53extern struct neigh_table nd_tbl; 54 55struct nd_msg { 56 struct icmp6hdr icmph; 57 struct in6_addr target; 58 __u8 opt[0]; 59}; 60 61struct rs_msg { 62 struct icmp6hdr icmph; 63 __u8 opt[0]; 64}; 65 66struct ra_msg { 67 struct icmp6hdr icmph; 68 __u32 reachable_time; 69 __u32 retrans_timer; 70}; 71 72struct nd_opt_hdr { 73 __u8 nd_opt_type; 74 __u8 nd_opt_len; 75} __attribute__((__packed__)); 76 77 78extern int ndisc_init(struct net_proto_family *ops); 79 80extern void ndisc_cleanup(void); 81 82extern int ndisc_rcv(struct sk_buff *skb); 83 84extern void ndisc_send_ns(struct net_device *dev, 85 struct neighbour *neigh, 86 struct in6_addr *solicit, 87 struct in6_addr *daddr, 88 struct in6_addr *saddr); 89 90extern void ndisc_send_rs(struct net_device *dev, 91 struct in6_addr *saddr, 92 struct in6_addr *daddr); 93 94extern void ndisc_forwarding_on(void); 95extern void ndisc_forwarding_off(void); 96 97extern void ndisc_send_redirect(struct sk_buff *skb, 98 struct neighbour *neigh, 99 struct in6_addr *target); 100 101extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir); 102 103 104struct rt6_info * dflt_rt_lookup(void); 105 106/* 107 * IGMP 108 */ 109extern int igmp6_init(struct net_proto_family *ops); 110 111extern void igmp6_cleanup(void); 112 113extern int igmp6_event_query(struct sk_buff *skb); 114 115extern int igmp6_event_report(struct sk_buff *skb); 116 117extern void igmp6_cleanup(void); 118 119#ifdef CONFIG_SYSCTL 120extern int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, 121 int write, 122 struct file * filp, 123 void __user *buffer, 124 size_t *lenp, 125 loff_t *ppos); 126#endif 127 128extern void inet6_ifinfo_notify(int event, 129 struct inet6_dev *idev); 130 131static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, struct in6_addr *addr) 132{ 133 134 if (dev) 135 return __neigh_lookup(&nd_tbl, addr, dev, 1); 136 137 return NULL; 138} 139 140 141#endif /* __KERNEL__ */ 142 143 144#endif