Main function that will be run.
56{
63 size_t msize;
64 uint64_t data_num = 23;
65 uint8_t *block_data = (uint8_t*) &data_num;
66 size_t block_len = 8;
67 unsigned int put_path_len = 0;
68 size_t putlen;
75 bool truncated = false;
77
79 {
84 peers_hash[i]);
85 printf ("Peer %d sk:\n", i);
87 printf ("\nPeer %d pk:\n", i);
89 printf ("\nPeer %d SHA512(pk):\n", i);
91 printf ("\n");
92 }
93
94 peer_bf
99 {
102 block_data, block_len, pp, put_path_len, &put_path_len,
103 NULL, &trunc_peer_out, &truncated);
105 {
106
107 uint8_t buf[msize];
111 &peers_hash[i]);
114 &peers_sk[i], &
peers[i + 1],
115 &peers_hash[i + 1],
119 block_data, 10,
120 pp, put_path_len, i, 7, NULL);
121 printf ("Peer %d sends to peer %d PUT Message:\n", i, i + 1);
127 pp[putlen].pred =
peers[i];
128 pp[putlen].sig = *last_sig;
129 put_path_len++;
130 printf ("\n");
131
132
133 }
134 }
135}
#define DHT_BLOOM_SIZE
Size of the bloom filter the DHT uses to filter peers.
void GDS_helper_make_put_message(struct PeerPutMessage *ppm, size_t msize, const struct GNUNET_CRYPTO_EddsaPrivateKey *sk, const struct GNUNET_PeerIdentity *target, const struct GNUNET_HashCode *target_hash, const struct GNUNET_CONTAINER_BloomFilter *bf, const struct GNUNET_HashCode *block_key, enum GNUNET_DHT_RouteOption ro, enum GNUNET_BLOCK_Type block_type, struct GNUNET_TIME_Absolute block_expiration_time, const uint8_t *block_data, size_t block_data_len, const struct GNUNET_DHT_PathElement *put_path, unsigned int put_path_len, size_t hop_count, uint32_t desired_replication_level, const struct GNUNET_PeerIdentity *trunc_peer)
enum GNUNET_GenericReturnValue GDS_helper_put_message_get_size(size_t *msize_out, const struct GNUNET_PeerIdentity *my_identity, enum GNUNET_DHT_RouteOption ro_in, enum GNUNET_DHT_RouteOption *ro_out, struct GNUNET_TIME_Absolute block_expiration_time, const uint8_t *block_data, size_t block_data_len, const struct GNUNET_DHT_PathElement *put_path_in, unsigned int put_path_len_in, unsigned int *put_path_len_out, const struct GNUNET_PeerIdentity *trunc_peer, struct GNUNET_PeerIdentity *trunc_peer_out, bool *truncated)
static int ret
Final status code.
struct GNUNET_HashCode key
The key used in the DHT.
static const char * peers_str[]
struct GNUNET_CONTAINER_MultiPeerMap * peers
Map from PIDs to struct CadetPeer entries.
@ GNUNET_BLOCK_TYPE_TEST
Block for testing.
struct GNUNET_CONTAINER_BloomFilter * GNUNET_CONTAINER_bloomfilter_init(const char *data, size_t size, unsigned int k)
Create a Bloom filter from raw bits.
void GNUNET_CONTAINER_bloomfilter_add(struct GNUNET_CONTAINER_BloomFilter *bf, const struct GNUNET_HashCode *e)
Add an element to the filter.
#define GNUNET_CONSTANTS_BLOOMFILTER_K
K-value that must be used for the bloom filters in 'GET' queries.
void GNUNET_CRYPTO_eddsa_key_get_public(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Extract the public key for the given private key.
GNUNET_DHT_RouteOption
Options for routing.
@ GNUNET_DHT_RO_RECORD_ROUTE
We should keep track of the route that the message took in the P2P network.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
GNUNET_GenericReturnValue
Named constants for return values.
void GNUNET_print_bytes(const void *buf, size_t buf_len, int fold, int in_be)
Print a byte string in hexadecimal ascii notation.
size_t GNUNET_hex2b(const char *src, void *dst, size_t dstlen, int invert)
Parse an ascii-encoded hexadecimal string into the buffer.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_TIME_UNIT_FOREVER_ABS
Constant used to specify "forever".
Private ECC key encoded for transmission.
an ECC signature using EdDSA.
A (signed) path tracking a block's flow through the DHT is represented by an array of path elements,...
The identity of the host (wraps the signing key of the peer).
struct GNUNET_CRYPTO_EddsaPublicKey public_key
uint16_t put_path_length
Length of the PUT path that follows (if tracked).