icmpv6.h 1.26 KB
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1 2 3
#ifndef _LINUX_ICMPV6_H
#define _LINUX_ICMPV6_H

4
#include <linux/skbuff.h>
5
#include <uapi/linux/icmpv6.h>
6 7 8

static inline struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb)
{
9
	return (struct icmp6hdr *)skb_transport_header(skb);
10
}
Linus Torvalds's avatar
Linus Torvalds committed
11 12 13

#include <linux/netdevice.h>

14 15 16
#if IS_ENABLED(CONFIG_IPV6)
extern void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info);

17 18
typedef void ip6_icmp_send_t(struct sk_buff *skb, u8 type, u8 code, __u32 info,
			     const struct in6_addr *force_saddr);
19 20
extern int inet6_register_icmp_sender(ip6_icmp_send_t *fn);
extern int inet6_unregister_icmp_sender(ip6_icmp_send_t *fn);
21 22
int ip6_err_gen_icmpv6_unreach(struct sk_buff *skb, int nhs, int type,
			       unsigned int data_len);
23 24 25 26 27 28 29 30 31

#else

static inline void icmpv6_send(struct sk_buff *skb,
			       u8 type, u8 code, __u32 info)
{

}
#endif
Linus Torvalds's avatar
Linus Torvalds committed
32

33
extern int				icmpv6_init(void);
34
extern int				icmpv6_err_convert(u8 type, u8 code,
Linus Torvalds's avatar
Linus Torvalds committed
35 36 37
							   int *err);
extern void				icmpv6_cleanup(void);
extern void				icmpv6_param_prob(struct sk_buff *skb,
38
							  u8 code, int pos);
39

40
struct flowi6;
41
struct in6_addr;
42
extern void				icmpv6_flow_init(struct sock *sk,
43
							 struct flowi6 *fl6,
44 45 46 47
							 u8 type,
							 const struct in6_addr *saddr,
							 const struct in6_addr *daddr,
							 int oif);
Linus Torvalds's avatar
Linus Torvalds committed
48
#endif