0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _ICMP_H
0015 #define _ICMP_H
0016
0017 #include <linux/icmp.h>
0018
0019 #include <net/inet_sock.h>
0020 #include <net/snmp.h>
0021 #include <net/ip.h>
0022
0023 struct icmp_err {
0024 int errno;
0025 unsigned int fatal:1;
0026 };
0027
0028 extern const struct icmp_err icmp_err_convert[];
0029 #define ICMP_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.icmp_statistics, field)
0030 #define __ICMP_INC_STATS(net, field) __SNMP_INC_STATS((net)->mib.icmp_statistics, field)
0031 #define ICMPMSGOUT_INC_STATS(net, field) SNMP_INC_STATS_ATOMIC_LONG((net)->mib.icmpmsg_statistics, field+256)
0032 #define ICMPMSGIN_INC_STATS(net, field) SNMP_INC_STATS_ATOMIC_LONG((net)->mib.icmpmsg_statistics, field)
0033
0034 struct dst_entry;
0035 struct net_proto_family;
0036 struct sk_buff;
0037 struct net;
0038
0039 void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info,
0040 const struct ip_options *opt);
0041 static inline void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
0042 {
0043 __icmp_send(skb_in, type, code, info, &IPCB(skb_in)->opt);
0044 }
0045
0046 #if IS_ENABLED(CONFIG_NF_NAT)
0047 void icmp_ndo_send(struct sk_buff *skb_in, int type, int code, __be32 info);
0048 #else
0049 static inline void icmp_ndo_send(struct sk_buff *skb_in, int type, int code, __be32 info)
0050 {
0051 struct ip_options opts = { 0 };
0052 __icmp_send(skb_in, type, code, info, &opts);
0053 }
0054 #endif
0055
0056 int icmp_rcv(struct sk_buff *skb);
0057 int icmp_err(struct sk_buff *skb, u32 info);
0058 int icmp_init(void);
0059 void icmp_out_count(struct net *net, unsigned char type);
0060 bool icmp_build_probe(struct sk_buff *skb, struct icmphdr *icmphdr);
0061
0062 #endif