blob: 630f45335c73f8ad2a4e7f082fb0abc947e1405e [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _LINUX_ICMPV6_H
2#define _LINUX_ICMPV6_H
3
Arnaldo Carvalho de Melocc70ab22007-03-13 14:03:22 -03004#include <linux/skbuff.h>
David Howells607ca462012-10-13 10:46:48 +01005#include <uapi/linux/icmpv6.h>
Arnaldo Carvalho de Melocc70ab22007-03-13 14:03:22 -03006
7static inline struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb)
8{
Arnaldo Carvalho de Melo9c702202007-04-25 18:04:18 -07009 return (struct icmp6hdr *)skb_transport_header(skb);
Arnaldo Carvalho de Melocc70ab22007-03-13 14:03:22 -030010}
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
12#include <linux/netdevice.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
Pravin B Shelar5f5624c2013-04-25 11:08:30 +000014#if IS_ENABLED(CONFIG_IPV6)
15extern void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info);
16
17typedef void ip6_icmp_send_t(struct sk_buff *skb, u8 type, u8 code, __u32 info);
18extern int inet6_register_icmp_sender(ip6_icmp_send_t *fn);
19extern int inet6_unregister_icmp_sender(ip6_icmp_send_t *fn);
20
21#else
22
23static inline void icmpv6_send(struct sk_buff *skb,
24 u8 type, u8 code, __u32 info)
25{
26
27}
28#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
Denis V. Lunev9b0f9762008-02-29 11:13:15 -080030extern int icmpv6_init(void);
Brian Haleyd5fdd6b2009-06-23 04:31:07 -070031extern int icmpv6_err_convert(u8 type, u8 code,
Linus Torvalds1da177e2005-04-16 15:20:36 -070032 int *err);
33extern void icmpv6_cleanup(void);
34extern void icmpv6_param_prob(struct sk_buff *skb,
Brian Haleyd5fdd6b2009-06-23 04:31:07 -070035 u8 code, int pos);
YOSHIFUJI Hideaki95e41e92007-12-06 15:43:30 -080036
David S. Miller4c9483b2011-03-12 16:22:43 -050037struct flowi6;
David S. Millerf59d4382008-03-05 20:58:10 -080038struct in6_addr;
YOSHIFUJI Hideaki95e41e92007-12-06 15:43:30 -080039extern void icmpv6_flow_init(struct sock *sk,
David S. Miller4c9483b2011-03-12 16:22:43 -050040 struct flowi6 *fl6,
YOSHIFUJI Hideaki95e41e92007-12-06 15:43:30 -080041 u8 type,
42 const struct in6_addr *saddr,
43 const struct in6_addr *daddr,
44 int oif);
Linus Torvalds1da177e2005-04-16 15:20:36 -070045#endif