glitch in the license text detected by hyazinthe, thank you!
[oweals/gnunet.git] / src / peerinfo / peerinfo.h
1 /*
2      This file is part of GNUnet.
3      Copyright (C) 2009, 2010 GNUnet e.V.
4
5      GNUnet is free software: you can redistribute it and/or modify it
6      under the terms of the GNU Affero General Public License as published
7      by the Free Software Foundation, either version 3 of the License,
8      or (at your 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      Affero General Public License for more details.
14 */
15
16 /**
17  * @file peerinfo/peerinfo.h
18  * @brief common internal definitions for peerinfo service
19  * @author Christian Grothoff
20  */
21
22 #ifndef PEERINFO_H
23 #define PEERINFO_H
24
25 #include "gnunet_crypto_lib.h"
26 #include "gnunet_time_lib.h"
27 #include "gnunet_peerinfo_service.h"
28
29
30
31 GNUNET_NETWORK_STRUCT_BEGIN
32
33 /**
34  * Message requesting a listing of peers,
35  * 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    * Include friend only HELLOs and peers in callbacks
47    */
48   uint32_t include_friend_only GNUNET_PACKED;
49
50   /**
51    * Restrict to peers with this identity (optional
52    * field, check header.size!).
53    */
54   struct GNUNET_PeerIdentity peer;
55
56 };
57
58 /**
59  * Message requesting a listing of all peers,
60  * restricted to the specified peer identity.
61  */
62 struct ListAllPeersMessage
63 {
64   /**
65    * Type will be GNUNET_MESSAGE_TYPE_PEERINFO_GET_ALL
66    */
67   struct GNUNET_MessageHeader header;
68
69   /**
70    * Include friend only HELLOs and peers in callbacks
71    */
72   uint32_t include_friend_only GNUNET_PACKED;
73
74 };
75
76
77 /**
78  * Header for all communications.
79  */
80 struct NotifyMessage
81 {
82   /**
83    * Type will be GNUNET_MESSAGE_TYPE_PEERINFO_NOTIFY
84    */
85   struct GNUNET_MessageHeader header;
86
87   /**
88    * Include friend only HELLOs and peers in callbacks
89    */
90   uint32_t include_friend_only GNUNET_PACKED;
91
92 };
93
94
95 /**
96  * Message used to inform the client about
97  * a particular peer; this message is optionally followed
98  * by a HELLO message for the respective peer (if available).
99  * Check the header.size field to see if a HELLO is
100  * present.
101  */
102 struct InfoMessage
103 {
104
105   /**
106    * Type will be GNUNET_MESSAGE_TYPE_PEERINFO_INFO
107    */
108   struct GNUNET_MessageHeader header;
109
110   /**
111    * Always zero.
112    */
113   uint32_t reserved GNUNET_PACKED;
114
115   /**
116    * About which peer are we talking here?
117    */
118   struct GNUNET_PeerIdentity peer;
119
120 };
121 GNUNET_NETWORK_STRUCT_END
122
123 /*#ifndef PEERINFO_H*/
124 #endif
125 /* end of peerinfo.h */