switch to IP that is in 192.0.2.0/24 range which is specifically reserved to be never...
[oweals/gnunet.git] / src / peerinfo / peerinfo.h
1 /*
2      This file is part of GNUnet.
3      (C) 2009 Christian Grothoff (and other contributing authors)
4
5      GNUnet is free software; you can redistribute it and/or modify
6      it under the terms of the GNU General Public License as published
7      by the Free Software Foundation; either version 3, or (at your
8      option) any later version.
9
10      GNUnet is distributed in the hope that it will be useful, but
11      WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13      General Public License for more details.
14
15      You should have received a copy of the GNU General Public License
16      along with GNUnet; see the file COPYING.  If not, write to the
17      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18      Boston, MA 02111-1307, USA.
19 */
20
21 /**
22  * @file peerinfo/peerinfo.h
23  * @brief common internal definitions for peerinfo service
24  * @author Christian Grothoff
25  */
26 #include "gnunet_crypto_lib.h"
27 #include "gnunet_time_lib.h"
28 #include "gnunet_peerinfo_service.h"
29
30 #define DEBUG_PEERINFO GNUNET_NO
31
32 /**
33  * Message requesting a listing of all known peers,
34  * possibly modified by the specified trust value
35  * and restricted to the specified peer identity.
36  */
37 struct ListPeerMessage
38 {
39
40   /**
41    * Type will be GNUNET_MESSAGE_TYPE_PEERINFO_GET
42    */
43   struct GNUNET_MessageHeader header;
44
45   /**
46    * How much to change the trust in each returned peer,
47    * in network byte order.
48    */
49   int32_t trust_change GNUNET_PACKED;
50
51   /**
52    * Restrict to peers with this identity (optional
53    * field, check header.size!).
54    */
55   struct GNUNET_PeerIdentity peer;
56
57 };
58
59
60 /**
61  * Message requesting a listing of all known peers,
62  * possibly modified by the specified trust value
63  * and restricted to the specified peer identity.
64  */
65 struct ListAllPeersMessage
66 {
67
68   /**
69    * Type will be GNUNET_MESSAGE_TYPE_PEERINFO_GET
70    */
71   struct GNUNET_MessageHeader header;
72
73   /**
74    * How much to change the trust in each returned peer,
75    * in network byte order.
76    */
77   int32_t trust_change GNUNET_PACKED;
78
79 };
80
81
82 /**
83  * Message used to inform the client about
84  * a particular peer; this message is optionally followed
85  * by a HELLO message for the respective peer (if available).
86  * Check the header.size field to see if a HELLO is
87  * present.
88  */
89 struct InfoMessage
90 {
91
92   /**
93    * Type will be GNUNET_MESSAGE_TYPE_PEERINFO_INFO
94    */
95   struct GNUNET_MessageHeader header;
96
97   /**
98    * Amount of trust we now have in the peer,
99    * in network byte order.
100    */
101   uint32_t trust GNUNET_PACKED;
102
103   /**
104    * About which peer are we talking here?
105    */
106   struct GNUNET_PeerIdentity peer;
107
108 };
109
110
111 /* end of peerinfo.h */