peerinfo.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. This file is part of GNUnet.
  3. Copyright (C) 2009, 2010 GNUnet e.V.
  4. GNUnet is free software: you can redistribute it and/or modify it
  5. under the terms of the GNU Affero General Public License as published
  6. by the Free Software Foundation, either version 3 of the License,
  7. or (at your 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. Affero General Public License for more details.
  12. You should have received a copy of the GNU Affero General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. SPDX-License-Identifier: AGPL3.0-or-later
  15. */
  16. /**
  17. * @file peerinfo/peerinfo.h
  18. * @brief common internal definitions for peerinfo service
  19. * @author Christian Grothoff
  20. */
  21. #ifndef PEERINFO_H
  22. #define PEERINFO_H
  23. #include "gnunet_crypto_lib.h"
  24. #include "gnunet_time_lib.h"
  25. #include "gnunet_peerinfo_service.h"
  26. GNUNET_NETWORK_STRUCT_BEGIN
  27. /**
  28. * Message requesting a listing of peers,
  29. * restricted to the specified peer identity.
  30. */
  31. struct ListPeerMessage
  32. {
  33. /**
  34. * Type will be GNUNET_MESSAGE_TYPE_PEERINFO_GET
  35. */
  36. struct GNUNET_MessageHeader header;
  37. /**
  38. * Include friend only HELLOs and peers in callbacks
  39. */
  40. uint32_t include_friend_only GNUNET_PACKED;
  41. /**
  42. * Restrict to peers with this identity (optional
  43. * field, check header.size!).
  44. */
  45. struct GNUNET_PeerIdentity peer;
  46. };
  47. /**
  48. * Message requesting a listing of all peers,
  49. * restricted to the specified peer identity.
  50. */
  51. struct ListAllPeersMessage
  52. {
  53. /**
  54. * Type will be GNUNET_MESSAGE_TYPE_PEERINFO_GET_ALL
  55. */
  56. struct GNUNET_MessageHeader header;
  57. /**
  58. * Include friend only HELLOs and peers in callbacks
  59. */
  60. uint32_t include_friend_only GNUNET_PACKED;
  61. };
  62. /**
  63. * Header for all communications.
  64. */
  65. struct NotifyMessage
  66. {
  67. /**
  68. * Type will be GNUNET_MESSAGE_TYPE_PEERINFO_NOTIFY
  69. */
  70. struct GNUNET_MessageHeader header;
  71. /**
  72. * Include friend only HELLOs and peers in callbacks
  73. */
  74. uint32_t include_friend_only GNUNET_PACKED;
  75. };
  76. /**
  77. * Message used to inform the client about
  78. * a particular peer; this message is optionally followed
  79. * by a HELLO message for the respective peer (if available).
  80. * Check the header.size field to see if a HELLO is
  81. * present.
  82. */
  83. struct InfoMessage
  84. {
  85. /**
  86. * Type will be GNUNET_MESSAGE_TYPE_PEERINFO_INFO
  87. */
  88. struct GNUNET_MessageHeader header;
  89. /**
  90. * Always zero.
  91. */
  92. uint32_t reserved GNUNET_PACKED;
  93. /**
  94. * About which peer are we talking here?
  95. */
  96. struct GNUNET_PeerIdentity peer;
  97. };
  98. GNUNET_NETWORK_STRUCT_END
  99. /*#ifndef PEERINFO_H*/
  100. #endif
  101. /* end of peerinfo.h */