-fix (C) notices
[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
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., 51 Franklin Street, Fifth Floor,
18      Boston, MA 02110-1301, USA.
19 */
20
21 /**
22  * @file peerinfo/peerinfo.h
23  * @brief common internal definitions for peerinfo service
24  * @author Christian Grothoff
25  */
26
27 #ifndef PEERINFO_H
28 #define PEERINFO_H
29
30 #include "gnunet_crypto_lib.h"
31 #include "gnunet_time_lib.h"
32 #include "gnunet_peerinfo_service.h"
33
34
35
36 GNUNET_NETWORK_STRUCT_BEGIN
37
38 /**
39  * Message requesting a listing of peers,
40  * restricted to the specified peer identity.
41  */
42 struct ListPeerMessage
43 {
44
45   /**
46    * Type will be GNUNET_MESSAGE_TYPE_PEERINFO_GET
47    */
48   struct GNUNET_MessageHeader header;
49
50   /**
51    * Include friend only HELLOs and peers in callbacks
52    */
53   uint32_t include_friend_only GNUNET_PACKED;
54
55   /**
56    * Restrict to peers with this identity (optional
57    * field, check header.size!).
58    */
59   struct GNUNET_PeerIdentity peer;
60
61 };
62
63 /**
64  * Message requesting a listing of all peers,
65  * restricted to the specified peer identity.
66  */
67 struct ListAllPeersMessage
68 {
69   /**
70    * Type will be GNUNET_MESSAGE_TYPE_PEERINFO_GET_ALL
71    */
72   struct GNUNET_MessageHeader header;
73
74   /**
75    * Include friend only HELLOs and peers in callbacks
76    */
77   uint32_t include_friend_only GNUNET_PACKED;
78
79 };
80
81
82 /**
83  * Header for all communications.
84  */
85 struct NotifyMessage
86 {
87   /**
88    * Type will be GNUNET_MESSAGE_TYPE_PEERINFO_NOTIFY
89    */
90   struct GNUNET_MessageHeader header;
91
92   /**
93    * Include friend only HELLOs and peers in callbacks
94    */
95   uint32_t include_friend_only GNUNET_PACKED;
96
97 };
98
99
100 /**
101  * Message used to inform the client about
102  * a particular peer; this message is optionally followed
103  * by a HELLO message for the respective peer (if available).
104  * Check the header.size field to see if a HELLO is
105  * present.
106  */
107 struct InfoMessage
108 {
109
110   /**
111    * Type will be GNUNET_MESSAGE_TYPE_PEERINFO_INFO
112    */
113   struct GNUNET_MessageHeader header;
114
115   /**
116    * Always zero.
117    */
118   uint32_t reserved GNUNET_PACKED;
119
120   /**
121    * About which peer are we talking here?
122    */
123   struct GNUNET_PeerIdentity peer;
124
125 };
126 GNUNET_NETWORK_STRUCT_END
127
128 /*#ifndef PEERINFO_H*/
129 #endif
130 /* end of peerinfo.h */