ping.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #include <net/netns/hash.h>
  16. /* PING_HTABLE_SIZE must be power of 2 */
  17. #define PING_HTABLE_SIZE 64
  18. #define PING_HTABLE_MASK (PING_HTABLE_SIZE-1)
  19. #define ping_portaddr_for_each_entry(__sk, node, list) \
  20. hlist_nulls_for_each_entry(__sk, node, list, sk_nulls_node)
  21. /*
  22. * gid_t is either uint or ushort. We want to pass it to
  23. * proc_dointvec_minmax(), so it must not be larger than MAX_INT
  24. */
  25. #define GID_T_MAX (((gid_t)~0U) >> 1)
  26. struct ping_table {
  27. struct hlist_nulls_head hash[PING_HTABLE_SIZE];
  28. rwlock_t lock;
  29. };
  30. struct ping_iter_state {
  31. struct seq_net_private p;
  32. int bucket;
  33. };
  34. extern struct proto ping_prot;
  35. extern void ping_rcv(struct sk_buff *);
  36. extern void ping_err(struct sk_buff *, u32 info);
  37. #ifdef CONFIG_PROC_FS
  38. extern int __init ping_proc_init(void);
  39. extern void ping_proc_exit(void);
  40. #endif
  41. void __init ping_init(void);
  42. #endif /* _PING_H */