blob: 57086e9fc64c6ce05bf66f632727ceb32250ad92 [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
Eric Dumazetb1cadc12016-06-18 21:52:02 -070017typedef void ip6_icmp_send_t(struct sk_buff *skb, u8 type, u8 code, __u32 info,
18 const struct in6_addr *force_saddr);
Pravin B Shelar5f5624c2013-04-25 11:08:30 +000019extern int inet6_register_icmp_sender(ip6_icmp_send_t *fn);
20extern int inet6_unregister_icmp_sender(ip6_icmp_send_t *fn);
Eric Dumazet20e19542016-06-18 21:52:06 -070021int ip6_err_gen_icmpv6_unreach(struct sk_buff *skb, int nhs, int type,
22 unsigned int data_len);
Pravin B Shelar5f5624c2013-04-25 11:08:30 +000023
24#else
25
26static inline void icmpv6_send(struct sk_buff *skb,
27 u8 type, u8 code, __u32 info)
28{
29
30}
31#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
Denis V. Lunev9b0f9762008-02-29 11:13:15 -080033extern int icmpv6_init(void);
Brian Haleyd5fdd6b2009-06-23 04:31:07 -070034extern int icmpv6_err_convert(u8 type, u8 code,
Linus Torvalds1da177e2005-04-16 15:20:36 -070035 int *err);
36extern void icmpv6_cleanup(void);
37extern void icmpv6_param_prob(struct sk_buff *skb,
Brian Haleyd5fdd6b2009-06-23 04:31:07 -070038 u8 code, int pos);
YOSHIFUJI Hideaki95e41e92007-12-06 15:43:30 -080039
David S. Miller4c9483b2011-03-12 16:22:43 -050040struct flowi6;
David S. Millerf59d4382008-03-05 20:58:10 -080041struct in6_addr;
YOSHIFUJI Hideaki95e41e92007-12-06 15:43:30 -080042extern void icmpv6_flow_init(struct sock *sk,
David S. Miller4c9483b2011-03-12 16:22:43 -050043 struct flowi6 *fl6,
YOSHIFUJI Hideaki95e41e92007-12-06 15:43:30 -080044 u8 type,
45 const struct in6_addr *saddr,
46 const struct in6_addr *daddr,
47 int oif);
Linus Torvalds1da177e2005-04-16 15:20:36 -070048#endif