icmpv6.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef _LINUX_ICMPV6_H
  2. #define _LINUX_ICMPV6_H
  3. #include <linux/skbuff.h>
  4. #include <uapi/linux/icmpv6.h>
  5. static inline struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb)
  6. {
  7. return (struct icmp6hdr *)skb_transport_header(skb);
  8. }
  9. #include <linux/netdevice.h>
  10. #if IS_ENABLED(CONFIG_IPV6)
  11. extern void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info);
  12. typedef void ip6_icmp_send_t(struct sk_buff *skb, u8 type, u8 code, __u32 info,
  13. const struct in6_addr *force_saddr);
  14. extern int inet6_register_icmp_sender(ip6_icmp_send_t *fn);
  15. extern int inet6_unregister_icmp_sender(ip6_icmp_send_t *fn);
  16. int ip6_err_gen_icmpv6_unreach(struct sk_buff *skb, int nhs, int type,
  17. unsigned int data_len);
  18. #else
  19. static inline void icmpv6_send(struct sk_buff *skb,
  20. u8 type, u8 code, __u32 info)
  21. {
  22. }
  23. #endif
  24. extern int icmpv6_init(void);
  25. extern int icmpv6_err_convert(u8 type, u8 code,
  26. int *err);
  27. extern void icmpv6_cleanup(void);
  28. extern void icmpv6_param_prob(struct sk_buff *skb,
  29. u8 code, int pos);
  30. struct flowi6;
  31. struct in6_addr;
  32. extern void icmpv6_flow_init(struct sock *sk,
  33. struct flowi6 *fl6,
  34. u8 type,
  35. const struct in6_addr *saddr,
  36. const struct in6_addr *daddr,
  37. int oif);
  38. #endif