1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Definitions for the "ping" module. 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License 10 * as published by the Free Software Foundation; either version 11 * 2 of the License, or (at your option) any later version. 12 */ 13#ifndef _PING_H 14#define _PING_H 15 16#include <net/netns/hash.h> 17 18/* PING_HTABLE_SIZE must be power of 2 */ 19#define PING_HTABLE_SIZE 64 20#define PING_HTABLE_MASK (PING_HTABLE_SIZE-1) 21 22#define ping_portaddr_for_each_entry(__sk, node, list) \ 23 hlist_nulls_for_each_entry(__sk, node, list, sk_nulls_node) 24 25/* 26 * gid_t is either uint or ushort. We want to pass it to 27 * proc_dointvec_minmax(), so it must not be larger than MAX_INT 28 */ 29#define GID_T_MAX (((gid_t)~0U) >> 1) 30 31struct ping_table { 32 struct hlist_nulls_head hash[PING_HTABLE_SIZE]; 33 rwlock_t lock; 34}; 35 36struct ping_iter_state { 37 struct seq_net_private p; 38 int bucket; 39}; 40 41extern struct proto ping_prot; 42 43 44extern void ping_rcv(struct sk_buff *); 45extern void ping_err(struct sk_buff *, u32 info); 46 47#ifdef CONFIG_PROC_FS 48extern int __init ping_proc_init(void); 49extern void ping_proc_exit(void); 50#endif 51 52void __init ping_init(void); 53 54 55#endif /* _PING_H */ 56