linux-bk/include/net/ndisc.h
<<
>>
Prefs
   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
  18#define ND_OPT_SOURCE_LL_ADDR           1
  19#define ND_OPT_TARGET_LL_ADDR           2
  20#define ND_OPT_PREFIX_INFO              3
  21#define ND_OPT_REDIRECT_HDR             4
  22#define ND_OPT_MTU                      5
  23
  24#define MAX_RTR_SOLICITATION_DELAY      HZ
  25
  26#define ND_REACHABLE_TIME               (30*HZ)
  27#define ND_RETRANS_TIMER                HZ
  28
  29#define ND_MIN_RANDOM_FACTOR            (1/2)
  30#define ND_MAX_RANDOM_FACTOR            (3/2)
  31
  32#ifdef __KERNEL__
  33
  34#include <linux/skbuff.h>
  35#include <linux/netdevice.h>
  36#include <linux/icmpv6.h>
  37#include <net/neighbour.h>
  38#include <asm/atomic.h>
  39
  40extern struct neigh_table nd_tbl;
  41
  42struct nd_msg {
  43        struct icmp6hdr icmph;
  44        struct in6_addr target;
  45        __u8            opt[0];
  46};
  47
  48struct ra_msg {
  49        struct icmp6hdr         icmph;
  50        __u32                   reachable_time;
  51        __u32                   retrans_timer;
  52};
  53
  54struct nd_opt_hdr {
  55        __u8            nd_opt_type;
  56        __u8            nd_opt_len;
  57} __attribute__((__packed__));
  58
  59
  60extern int                      ndisc_init(struct net_proto_family *ops);
  61
  62extern void                     ndisc_cleanup(void);
  63
  64extern int                      ndisc_rcv(struct sk_buff *skb);
  65
  66extern void                     ndisc_send_ns(struct net_device *dev,
  67                                              struct neighbour *neigh,
  68                                              struct in6_addr *solicit,
  69                                              struct in6_addr *daddr,
  70                                              struct in6_addr *saddr);
  71
  72extern void                     ndisc_send_rs(struct net_device *dev,
  73                                              struct in6_addr *saddr,
  74                                              struct in6_addr *daddr);
  75
  76extern void                     ndisc_forwarding_on(void);
  77extern void                     ndisc_forwarding_off(void);
  78
  79extern void                     ndisc_send_redirect(struct sk_buff *skb,
  80                                                    struct neighbour *neigh,
  81                                                    struct in6_addr *target);
  82
  83extern int                      ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir);
  84
  85
  86struct rt6_info *               dflt_rt_lookup(void);
  87
  88/*
  89 *      IGMP
  90 */
  91extern int                      igmp6_init(struct net_proto_family *ops);
  92
  93extern void                     igmp6_cleanup(void);
  94
  95extern int                      igmp6_event_query(struct sk_buff *skb);
  96
  97extern int                      igmp6_event_report(struct sk_buff *skb);
  98
  99extern void                     igmp6_cleanup(void);
 100
 101#ifdef CONFIG_SYSCTL
 102extern int                      ndisc_ifinfo_sysctl_change(ctl_table *ctl,
 103                                                           int write,
 104                                                           struct file * filp,
 105                                                           void __user *buffer,
 106                                                           size_t *lenp,
 107                                                           loff_t *ppos);
 108#endif
 109
 110extern void                     inet6_ifinfo_notify(int event,
 111                                                    struct inet6_dev *idev);
 112
 113static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, struct in6_addr *addr)
 114{
 115
 116        if (dev)
 117                return __neigh_lookup(&nd_tbl, addr, dev, 1);
 118
 119        return NULL;
 120}
 121
 122
 123#endif /* __KERNEL__ */
 124
 125
 126#endif
 127
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.