Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _LINUX_ICMPV6_H |
| 2 | #define _LINUX_ICMPV6_H |
| 3 | |
Arnaldo Carvalho de Melo | cc70ab2 | 2007-03-13 14:03:22 -0300 | [diff] [blame] | 4 | #include <linux/skbuff.h> |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 5 | #include <uapi/linux/icmpv6.h> |
Arnaldo Carvalho de Melo | cc70ab2 | 2007-03-13 14:03:22 -0300 | [diff] [blame] | 6 | |
| 7 | static inline struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb) |
| 8 | { |
Arnaldo Carvalho de Melo | 9c70220 | 2007-04-25 18:04:18 -0700 | [diff] [blame] | 9 | return (struct icmp6hdr *)skb_transport_header(skb); |
Arnaldo Carvalho de Melo | cc70ab2 | 2007-03-13 14:03:22 -0300 | [diff] [blame] | 10 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | |
| 12 | #include <linux/netdevice.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | |
Pravin B Shelar | 5f5624c | 2013-04-25 11:08:30 +0000 | [diff] [blame] | 14 | #if IS_ENABLED(CONFIG_IPV6) |
| 15 | extern void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info); |
| 16 | |
| 17 | typedef void ip6_icmp_send_t(struct sk_buff *skb, u8 type, u8 code, __u32 info); |
| 18 | extern int inet6_register_icmp_sender(ip6_icmp_send_t *fn); |
| 19 | extern int inet6_unregister_icmp_sender(ip6_icmp_send_t *fn); |
| 20 | |
| 21 | #else |
| 22 | |
| 23 | static inline void icmpv6_send(struct sk_buff *skb, |
| 24 | u8 type, u8 code, __u32 info) |
| 25 | { |
| 26 | |
| 27 | } |
| 28 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | |
Denis V. Lunev | 9b0f976 | 2008-02-29 11:13:15 -0800 | [diff] [blame] | 30 | extern int icmpv6_init(void); |
Brian Haley | d5fdd6b | 2009-06-23 04:31:07 -0700 | [diff] [blame] | 31 | extern int icmpv6_err_convert(u8 type, u8 code, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | int *err); |
| 33 | extern void icmpv6_cleanup(void); |
| 34 | extern void icmpv6_param_prob(struct sk_buff *skb, |
Brian Haley | d5fdd6b | 2009-06-23 04:31:07 -0700 | [diff] [blame] | 35 | u8 code, int pos); |
YOSHIFUJI Hideaki | 95e41e9 | 2007-12-06 15:43:30 -0800 | [diff] [blame] | 36 | |
David S. Miller | 4c9483b | 2011-03-12 16:22:43 -0500 | [diff] [blame] | 37 | struct flowi6; |
David S. Miller | f59d438 | 2008-03-05 20:58:10 -0800 | [diff] [blame] | 38 | struct in6_addr; |
YOSHIFUJI Hideaki | 95e41e9 | 2007-12-06 15:43:30 -0800 | [diff] [blame] | 39 | extern void icmpv6_flow_init(struct sock *sk, |
David S. Miller | 4c9483b | 2011-03-12 16:22:43 -0500 | [diff] [blame] | 40 | struct flowi6 *fl6, |
YOSHIFUJI Hideaki | 95e41e9 | 2007-12-06 15:43:30 -0800 | [diff] [blame] | 41 | u8 type, |
| 42 | const struct in6_addr *saddr, |
| 43 | const struct in6_addr *daddr, |
| 44 | int oif); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | #endif |