45 sssize = strlen (sub_system) + 1;
47 ksize = strlen (
key) + 1;
48 totalsize = sssize + psize + ksize;
63 const char *sub_system,
80 ss_size = strlen (sub_system) + 1;
84 key_size = strlen (
key) + 1;
85 msg_size = ss_size + key_size + value_size;
91 srm->
rid = htons (rid);
115 req_size = ntohs (srm->
header.
size) -
sizeof(*srm);
119 if (ss_size + key_size +
value_size != req_size)
127 dummy = (
char *) &srm[1];
158 if (NULL !=
record->sub_system)
162 if (NULL !=
record->value)
struct GNUNET_GETOPT_CommandLineOption options[]
static int ret
Final status code.
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.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
#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_PEERSTORE_Record * PEERSTORE_parse_record_message(const struct PeerstoreRecordMessage *srm)
Parses a message carrying a record.
struct GNUNET_MQ_Envelope * PEERSTORE_create_record_mq_envelope(uint32_t rid, 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.
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.
uint16_t value_size
Size of value blob Allocated at position 2 after this struct.
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.
uint32_t options
Options, needed only in case of a store operation.
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.