Main function that will be run.
56{
63 size_t msize;
64 uint64_t i = 23;
65 uint8_t *block_data = (uint8_t*) &i;
66 size_t block_len = 8;
67 unsigned int put_path_len = 0;
68 size_t putlen;
73
75 {
78 &
peers[i].public_key);
80 peers_hash[i]);
81 printf ("Peer %d sk:\n", i);
83 printf ("\nPeer %d pk:\n", i);
85 printf ("\nPeer %d SHA512(pk):\n", i);
87 printf ("\n");
88 }
91
92 peer_bf
97 {
100 block_data, block_len, pp, put_path_len, &put_path_len,
101 NULL);
103 {
104
105 uint8_t buf[msize];
109 &peers_hash[i]);
112 &peers_sk[i], &
peers[i + 1],
113 &peers_hash[i + 1],
117 block_data, 10,
118 pp, put_path_len, i, 7, NULL);
119 printf ("Peer %d sends to peer %d PUT Message:\n", i, i + 1);
125 pp[putlen].pred =
peers[i];
126 pp[putlen].sig = *last_sig;
127 put_path_len++;
128 printf ("\n");
129
130
131 }
132 }
133}
#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)
static int ret
Final status code.
struct GNUNET_HashCode key
The key used in the DHT.
static char * peers_str[]
struct GNUNET_CONTAINER_MultiPeerMap * peers
Map from PIDs to struct CadetPeer entries.
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.
size_t GNUNET_hex2b(char *src, void *dst, size_t dstlen, int invert)
Parse an ascii-encoded hexadecimal string into the buffer.
void GNUNET_print_bytes(const void *buf, size_t buf_len, int fold, int in_be)
Print a byte string in hexadecimal ascii notation.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_TIME_UNIT_FOREVER_ABS
Constant used to specify "forever".
@ GNUNET_BLOCK_TYPE_TEST
Block for testing.
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).
uint16_t put_path_length
Length of the PUT path that follows (if tracked).