nse.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. This file is part of GNUnet.
  3. (C) 2001-2011 Christian Grothoff (and other contributing authors)
  4. GNUnet is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published
  6. by the Free Software Foundation; either version 3, or (at your
  7. option) any later version.
  8. GNUnet is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNUnet; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  15. Boston, MA 02111-1307, USA.
  16. */
  17. /**
  18. * @author Nathan Evans
  19. * @file nse/nse.h
  20. *
  21. * @brief Common type definitions for the network size estimation
  22. * service and API.
  23. */
  24. #ifndef NSE_H
  25. #define NSE_H
  26. #include "gnunet_common.h"
  27. GNUNET_NETWORK_STRUCT_BEGIN
  28. /**
  29. * Network size estimate sent from the service
  30. * to clients. Contains the current size estimate
  31. * (or 0 if none has been calculated) and the
  32. * standard deviation of known estimates.
  33. *
  34. */
  35. struct GNUNET_NSE_ClientMessage
  36. {
  37. /**
  38. * Type: GNUNET_MESSAGE_TYPE_NSE_ESTIMATE
  39. */
  40. struct GNUNET_MessageHeader header;
  41. /**
  42. * For alignment.
  43. */
  44. uint32_t reserved GNUNET_PACKED;
  45. /**
  46. * Timestamp at which the server received the message.
  47. */
  48. struct GNUNET_TIME_AbsoluteNBO timestamp;
  49. /**
  50. * The current estimated network size.
  51. */
  52. double size_estimate GNUNET_PACKED;
  53. /**
  54. * The standard deviation (rounded down
  55. * to the nearest integer) of size
  56. * estimations.
  57. */
  58. double std_deviation GNUNET_PACKED;
  59. };
  60. GNUNET_NETWORK_STRUCT_END
  61. #endif