xref: /linux/include/net/icmp.h (revision e60ab84d)
11da177e4SLinus Torvalds /*
21da177e4SLinus Torvalds  * INET		An implementation of the TCP/IP protocol suite for the LINUX
31da177e4SLinus Torvalds  *		operating system.  INET is implemented using the  BSD Socket
41da177e4SLinus Torvalds  *		interface as the means of communication with the user level.
51da177e4SLinus Torvalds  *
61da177e4SLinus Torvalds  *		Definitions for the ICMP module.
71da177e4SLinus Torvalds  *
81da177e4SLinus Torvalds  * Version:	@(#)icmp.h	1.0.4	05/13/93
91da177e4SLinus Torvalds  *
1002c30a84SJesper Juhl  * Authors:	Ross Biro
111da177e4SLinus Torvalds  *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
121da177e4SLinus Torvalds  *
131da177e4SLinus Torvalds  *		This program is free software; you can redistribute it and/or
141da177e4SLinus Torvalds  *		modify it under the terms of the GNU General Public License
151da177e4SLinus Torvalds  *		as published by the Free Software Foundation; either version
161da177e4SLinus Torvalds  *		2 of the License, or (at your option) any later version.
171da177e4SLinus Torvalds  */
181da177e4SLinus Torvalds #ifndef _ICMP_H
191da177e4SLinus Torvalds #define	_ICMP_H
201da177e4SLinus Torvalds 
211da177e4SLinus Torvalds #include <linux/icmp.h>
221da177e4SLinus Torvalds 
2314c85021SArnaldo Carvalho de Melo #include <net/inet_sock.h>
241da177e4SLinus Torvalds #include <net/snmp.h>
251da177e4SLinus Torvalds 
261da177e4SLinus Torvalds struct icmp_err {
271da177e4SLinus Torvalds   int		errno;
2895c96174SEric Dumazet   unsigned int	fatal:1;
291da177e4SLinus Torvalds };
301da177e4SLinus Torvalds 
31e754834eSAlexey Dobriyan extern const struct icmp_err icmp_err_convert[];
32b60538a0SPavel Emelyanov #define ICMP_INC_STATS(net, field)	SNMP_INC_STATS((net)->mib.icmp_statistics, field)
33b60538a0SPavel Emelyanov #define ICMP_INC_STATS_BH(net, field)	SNMP_INC_STATS_BH((net)->mib.icmp_statistics, field)
34acb32ba3SEric Dumazet #define ICMPMSGOUT_INC_STATS(net, field)	SNMP_INC_STATS_ATOMIC_LONG((net)->mib.icmpmsg_statistics, field+256)
35acb32ba3SEric Dumazet #define ICMPMSGIN_INC_STATS_BH(net, field)	SNMP_INC_STATS_ATOMIC_LONG((net)->mib.icmpmsg_statistics, field)
361da177e4SLinus Torvalds 
3714c85021SArnaldo Carvalho de Melo struct dst_entry;
3814c85021SArnaldo Carvalho de Melo struct net_proto_family;
3914c85021SArnaldo Carvalho de Melo struct sk_buff;
400388b004SPavel Emelyanov struct net;
4114c85021SArnaldo Carvalho de Melo 
42*e60ab84dSJoe Perches void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info);
43*e60ab84dSJoe Perches int icmp_rcv(struct sk_buff *skb);
44*e60ab84dSJoe Perches void icmp_err(struct sk_buff *skb, u32 info);
45*e60ab84dSJoe Perches int icmp_init(void);
46*e60ab84dSJoe Perches void icmp_out_count(struct net *net, unsigned char type);
471da177e4SLinus Torvalds 
481da177e4SLinus Torvalds #endif	/* _ICMP_H */
49