2 This file is part of GNUnet
3 Copyright (C) 2012-2013 GNUnet e.V.
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.
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.
16 * @file peerstore/peerstore.h
18 * @author Omar Tarabai
24 #include "gnunet_peerstore_service.h"
27 GNUNET_NETWORK_STRUCT_BEGIN
29 * Message carrying a PEERSTORE record message
31 struct StoreRecordMessage
35 * GNUnet message header
37 struct GNUNET_MessageHeader header;
40 * #GNUNET_YES if peer id value set, #GNUNET_NO otherwise
42 uint16_t peer_set GNUNET_PACKED;
45 * Size of the sub_system string
46 * Allocated at position 0 after this struct
48 uint16_t sub_system_size GNUNET_PACKED;
53 struct GNUNET_PeerIdentity peer;
56 * Expiry time of entry
58 struct GNUNET_TIME_AbsoluteNBO expiry;
61 * Size of the key string
62 * Allocated at position 1 after this struct
64 uint16_t key_size GNUNET_PACKED;
68 * Allocated at position 2 after this struct
70 uint16_t value_size GNUNET_PACKED;
73 * Options, needed only in case of a
76 uint32_t /* enum GNUNET_PEERSTORE_StoreOption */ options GNUNET_PACKED;
78 /* Followed by key and value */
84 * Message carrying record key hash
86 struct StoreKeyHashMessage
90 * GNUnet message header
92 struct GNUNET_MessageHeader header;
95 * Always 0, for alignment.
97 uint32_t reserved GNUNET_PACKED;
100 * Hash of a record key
102 struct GNUNET_HashCode keyhash;
106 GNUNET_NETWORK_STRUCT_END