45 sssize = strlen (sub_system) + 1;
47 ksize = strlen (key) + 1;
48 totalsize = sssize + psize + ksize;
92 ss_size = strlen (sub_system) + 1;
96 key_size = strlen (key) + 1;
97 msg_size = ss_size + key_size + value_size;
110 srm->
options = htonl (options);
137 req_size = ntohs (srm->
header.
size) -
sizeof(*srm);
141 if (ss_size + key_size + value_size != req_size)
152 dummy = (
char *) &srm[1];
185 if (NULL != record->
key)
187 if (NULL != record->
value)
struct GNUNET_MessageHeader header
GNUnet message header.
uint16_t sub_system_size
Size of the sub_system string Allocated at position 0 after this struct.
Helper peerstore functions.
struct GNUNET_PEERSTORE_Record * PEERSTORE_parse_record_message(const struct StoreRecordMessage *srm)
Parses a message carrying a record.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
struct GNUNET_PeerIdentity peer
Peer Identity.
struct GNUNET_GETOPT_CommandLineOption options[]
void PEERSTORE_destroy_record(struct GNUNET_PEERSTORE_Record *record)
Free any memory allocated for this record.
size_t value_size
Size of value BLOB.
struct GNUNET_PeerIdentity peer
Peer Identity.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
static int ret
Return value of the commandline.
uint16_t value_size
Size of value blob Allocated at position 2 after this struct.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
char * key
Record key string.
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
void * value
Record value BLOB.
static char * value
Value of the record to add/remove.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
uint16_t peer_set
GNUNET_YES if peer id value set, GNUNET_NO otherwise
uint16_t key_size
Size of the key string Allocated at position 1 after this struct.
struct GNUNET_TIME_AbsoluteNBO expiry
Expiry time of entry.
GNUNET_PEERSTORE_StoreOption
Options for storing values in PEERSTORE.
void PEERSTORE_hash_key(const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, struct GNUNET_HashCode *ret)
Creates a hash of the given key combination.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
struct GNUNET_HashCode key
The key used in the DHT.
struct GNUNET_MQ_Envelope * PEERSTORE_create_record_mq_envelope(const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, const void *value, size_t value_size, struct GNUNET_TIME_Absolute expiry, enum GNUNET_PEERSTORE_StoreOption options, uint16_t msg_type)
Creates a MQ envelope for a single record.
uint32_t options
Options, needed only in case of a store operation.
static struct in_addr dummy
Target "dummy" address of the packet we pretend to respond to.
The identity of the host (wraps the signing key of the peer).
struct GNUNET_TIME_Absolute expiry
Expiry time of entry.
char * sub_system
Responsible sub system string.
static void record(void *cls, size_t data_size, const void *data)
Process recorded audio data.
Message carrying a PEERSTORE record message.
Time for absolute times used by GNUnet, in microseconds.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.