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 | |
Eric Dumazet | b1cadc1 | 2016-06-18 21:52:02 -0700 | [diff] [blame] | 17 | typedef void ip6_icmp_send_t(struct sk_buff *skb, u8 type, u8 code, __u32 info, |
| 18 | const struct in6_addr *force_saddr); |
Pravin B Shelar | 5f5624c | 2013-04-25 11:08:30 +0000 | [diff] [blame] | 19 | extern int inet6_register_icmp_sender(ip6_icmp_send_t *fn); |
| 20 | extern int inet6_unregister_icmp_sender(ip6_icmp_send_t *fn); |
Eric Dumazet | 20e1954 | 2016-06-18 21:52:06 -0700 | [diff] [blame] | 21 | int ip6_err_gen_icmpv6_unreach(struct sk_buff *skb, int nhs, int type, |
| 22 | unsigned int data_len); |
Pravin B Shelar | 5f5624c | 2013-04-25 11:08:30 +0000 | [diff] [blame] | 23 | |
| 24 | #else |
| 25 | |
| 26 | static inline void icmpv6_send(struct sk_buff *skb, |
| 27 | u8 type, u8 code, __u32 info) |
| 28 | { |
| 29 | |
| 30 | } |
| 31 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | |
Denis V. Lunev | 9b0f976 | 2008-02-29 11:13:15 -0800 | [diff] [blame] | 33 | extern int icmpv6_init(void); |
Brian Haley | d5fdd6b | 2009-06-23 04:31:07 -0700 | [diff] [blame] | 34 | extern int icmpv6_err_convert(u8 type, u8 code, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | int *err); |
| 36 | extern void icmpv6_cleanup(void); |
| 37 | extern void icmpv6_param_prob(struct sk_buff *skb, |
Brian Haley | d5fdd6b | 2009-06-23 04:31:07 -0700 | [diff] [blame] | 38 | u8 code, int pos); |
YOSHIFUJI Hideaki | 95e41e9 | 2007-12-06 15:43:30 -0800 | [diff] [blame] | 39 | |
David S. Miller | 4c9483b | 2011-03-12 16:22:43 -0500 | [diff] [blame] | 40 | struct flowi6; |
David S. Miller | f59d438 | 2008-03-05 20:58:10 -0800 | [diff] [blame] | 41 | struct in6_addr; |
YOSHIFUJI Hideaki | 95e41e9 | 2007-12-06 15:43:30 -0800 | [diff] [blame] | 42 | extern void icmpv6_flow_init(struct sock *sk, |
David S. Miller | 4c9483b | 2011-03-12 16:22:43 -0500 | [diff] [blame] | 43 | struct flowi6 *fl6, |
YOSHIFUJI Hideaki | 95e41e9 | 2007-12-06 15:43:30 -0800 | [diff] [blame] | 44 | u8 type, |
| 45 | const struct in6_addr *saddr, |
| 46 | const struct in6_addr *daddr, |
| 47 | int oif); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | #endif |