first batch of license fixes (boring)
[oweals/gnunet.git] / src / peerstore / peerstore.h
1 /*
2       This file is part of GNUnet
3       Copyright (C) 2012-2013 GNUnet e.V.
4
5       GNUnet is free software: you can redistribute it and/or modify it
6       under the terms of the GNU 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  * @file peerstore/peerstore.h
17  * @brief IPC messages
18  * @author Omar Tarabai
19  */
20
21 #ifndef PEERSTORE_H_
22 #define PEERSTORE_H_
23
24 #include "gnunet_peerstore_service.h"
25
26
27 GNUNET_NETWORK_STRUCT_BEGIN
28 /**
29  * Message carrying a PEERSTORE record message
30  */
31 struct StoreRecordMessage
32 {
33
34   /**
35    * GNUnet message header
36    */
37   struct GNUNET_MessageHeader header;
38
39   /**
40    * #GNUNET_YES if peer id value set, #GNUNET_NO otherwise
41    */
42   uint16_t peer_set GNUNET_PACKED;
43
44   /**
45    * Size of the sub_system string
46    * Allocated at position 0 after this struct
47    */
48   uint16_t sub_system_size GNUNET_PACKED;
49
50   /**
51    * Peer Identity
52    */
53   struct GNUNET_PeerIdentity peer;
54
55   /**
56    * Expiry time of entry
57    */
58   struct GNUNET_TIME_AbsoluteNBO expiry;
59
60   /**
61    * Size of the key string
62    * Allocated at position 1 after this struct
63    */
64   uint16_t key_size GNUNET_PACKED;
65
66   /**
67    * Size of value blob
68    * Allocated at position 2 after this struct
69    */
70   uint16_t value_size GNUNET_PACKED;
71
72   /**
73    * Options, needed only in case of a
74    * store operation
75    */
76   uint32_t /* enum GNUNET_PEERSTORE_StoreOption */ options GNUNET_PACKED;
77
78   /* Followed by key and value */
79
80 };
81
82
83 /**
84  * Message carrying record key hash
85  */
86 struct StoreKeyHashMessage
87 {
88
89   /**
90    * GNUnet message header
91    */
92   struct GNUNET_MessageHeader header;
93
94   /**
95    * Always 0, for alignment.
96    */
97   uint32_t reserved GNUNET_PACKED;
98
99   /**
100    * Hash of a record key
101    */
102   struct GNUNET_HashCode keyhash;
103
104 };
105
106 GNUNET_NETWORK_STRUCT_END
107 #endif