* add p cc
[mascara-docs.git] / i386 / linux / linux-2.3.21 / include / net / ip6_route.h
blobcd6097d4598dba02b3e9bd196f6d78cc8b7e54b9
1 #ifndef _NET_IP6_ROUTE_H
2 #define _NET_IP6_ROUTE_H
4 #define IP6_RT_PRIO_FW 16
5 #define IP6_RT_PRIO_USER 1024
6 #define IP6_RT_PRIO_ADDRCONF 256
7 #define IP6_RT_PRIO_KERN 512
8 #define IP6_RT_FLOW_MASK 0x00ff
10 #ifdef __KERNEL__
12 #include <net/flow.h>
13 #include <net/ip6_fib.h>
15 struct pol_chain {
16 int type;
17 int priority;
18 struct fib6_node *rules;
19 struct pol_chain *next;
22 extern struct rt6_info ip6_null_entry;
24 extern int ip6_rt_max_size;
25 extern int ip6_rt_gc_min;
26 extern int ip6_rt_gc_timeout;
27 extern int ip6_rt_gc_interval;
29 extern void ip6_route_input(struct sk_buff *skb);
31 extern struct dst_entry * ip6_route_output(struct sock *sk,
32 struct flowi *fl);
34 extern void ip6_route_init(void);
35 extern void ip6_route_cleanup(void);
37 extern int ipv6_route_ioctl(unsigned int cmd, void *arg);
39 extern int ip6_route_add(struct in6_rtmsg *rtmsg);
40 extern int ip6_del_rt(struct rt6_info *);
42 extern int ip6_rt_addr_add(struct in6_addr *addr,
43 struct net_device *dev);
45 extern int ip6_rt_addr_del(struct in6_addr *addr,
46 struct net_device *dev);
48 extern void rt6_sndmsg(int type, struct in6_addr *dst,
49 struct in6_addr *src,
50 struct in6_addr *gw,
51 struct net_device *dev,
52 int dstlen, int srclen,
53 int metric, __u32 flags);
55 extern struct rt6_info *rt6_lookup(struct in6_addr *daddr,
56 struct in6_addr *saddr,
57 int oif, int flags);
60 * support functions for ND
63 extern struct rt6_info * rt6_get_dflt_router(struct in6_addr *addr,
64 struct net_device *dev);
65 extern struct rt6_info * rt6_add_dflt_router(struct in6_addr *gwaddr,
66 struct net_device *dev);
68 extern void rt6_purge_dflt_routers(int lst_resort);
70 extern void rt6_redirect(struct in6_addr *dest,
71 struct in6_addr *saddr,
72 struct neighbour *neigh,
73 int on_link);
75 extern void rt6_pmtu_discovery(struct in6_addr *daddr,
76 struct in6_addr *saddr,
77 struct net_device *dev,
78 u32 pmtu);
80 struct nlmsghdr;
81 struct netlink_callback;
82 extern int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb);
83 extern int inet6_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg);
84 extern int inet6_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg);
85 extern int inet6_rtm_getroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg);
87 extern void rt6_ifdown(struct net_device *dev);
88 extern void rt6_mtu_change(struct net_device *dev, unsigned mtu);
90 extern rwlock_t rt6_lock;
93 * Store a destination cache entry in a socket
94 * For UDP/RAW sockets this is done on udp_connect.
97 extern __inline__ void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
98 struct in6_addr *daddr)
100 struct ipv6_pinfo *np = &sk->net_pinfo.af_inet6;
101 struct rt6_info *rt = (struct rt6_info *) dst;
103 write_lock(&sk->dst_lock);
104 __sk_dst_set(sk, dst);
105 np->daddr_cache = daddr;
106 np->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0;
107 write_unlock(&sk->dst_lock);
110 #endif
111 #endif