0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef _LINUX_ICMP_H
0014 #define _LINUX_ICMP_H
0015
0016 #include <linux/skbuff.h>
0017 #include <uapi/linux/icmp.h>
0018 #include <uapi/linux/errqueue.h>
0019
0020 static inline struct icmphdr *icmp_hdr(const struct sk_buff *skb)
0021 {
0022 return (struct icmphdr *)skb_transport_header(skb);
0023 }
0024
0025 static inline bool icmp_is_err(int type)
0026 {
0027 switch (type) {
0028 case ICMP_DEST_UNREACH:
0029 case ICMP_SOURCE_QUENCH:
0030 case ICMP_REDIRECT:
0031 case ICMP_TIME_EXCEEDED:
0032 case ICMP_PARAMETERPROB:
0033 return true;
0034 }
0035
0036 return false;
0037 }
0038
0039 void ip_icmp_error_rfc4884(const struct sk_buff *skb,
0040 struct sock_ee_data_rfc4884 *out,
0041 int thlen, int off);
0042
0043 #endif