46 sssize = strlen (sub_system) + 1;
48 ksize = strlen (
key) + 1;
49 totalsize = sssize + psize + ksize;
93 ss_size = strlen (sub_system) + 1;
97 key_size = strlen (
key) + 1;
98 msg_size = ss_size + key_size + value_size;
132 req_size = ntohs (srm->
header.
size) -
sizeof(*srm);
136 if (ss_size + key_size +
value_size != req_size)
147 dummy = (
char *) &srm[1];
178 if (NULL !=
record->sub_system)
182 if (NULL !=
record->value)
struct GNUNET_GETOPT_CommandLineOption options[]
static int ret
Return value of the commandline.
static void record(void *cls, size_t data_size, const void *data)
Process recorded audio data.
struct GNUNET_HashCode key
The key used in the DHT.
static struct in_addr dummy
Target "dummy" address of the packet we pretend to respond to.
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.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
GNUNET_PEERSTORE_StoreOption
Options for storing values in PEERSTORE.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
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_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.
struct GNUNET_PEERSTORE_Record * PEERSTORE_parse_record_message(const struct StoreRecordMessage *srm)
Parses a message carrying a record.
void PEERSTORE_destroy_record(struct GNUNET_PEERSTORE_Record *record)
Free any memory allocated for this record.
Helper peerstore functions.
size_t value_size
Size of value BLOB.
The identity of the host (wraps the signing key of the peer).
Time for absolute times used by GNUnet, in microseconds.
Message carrying a PEERSTORE record message.
uint32_t options
Options, needed only in case of a store operation.
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.
uint16_t value_size
Size of value blob Allocated at position 2 after this struct.
uint16_t peer_set
GNUNET_YES if peer id value set, GNUNET_NO otherwise
uint16_t sub_system_size
Size of the sub_system string Allocated at position 0 after this struct.
struct GNUNET_PeerIdentity peer
Peer Identity.
struct GNUNET_MessageHeader header
GNUnet message header.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.