diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-04-07 12:00:28 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-04-07 12:00:28 +0000 |
commit | 22f59cade743d9209cf212946a42b859bbb51b87 (patch) | |
tree | 7dbb95ac1d6cf64477510c67c365c6c04182b1d2 /src | |
parent | 864a6bfe96db3c0eae0dc188708dcac0ac4ce9cd (diff) |
- rename 256 bit mesh hash type
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_mesh_service.h | 2 | ||||
-rw-r--r-- | src/mesh/gnunet-mesh.c | 2 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh_connection.c | 14 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh_connection.h | 4 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh_local.c | 4 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh_tunnel.c | 6 | ||||
-rw-r--r-- | src/mesh/mesh.h | 4 | ||||
-rw-r--r-- | src/mesh/mesh_api.c | 12 | ||||
-rw-r--r-- | src/mesh/mesh_common.c | 4 | ||||
-rw-r--r-- | src/mesh/mesh_protocol.h | 18 |
10 files changed, 35 insertions, 35 deletions
diff --git a/src/include/gnunet_mesh_service.h b/src/include/gnunet_mesh_service.h index 241a3d54e9..45aecf1276 100644 --- a/src/include/gnunet_mesh_service.h +++ b/src/include/gnunet_mesh_service.h @@ -59,7 +59,7 @@ struct GNUNET_MESH_Channel; * instead of the 512 from @c GNUNET_HashCode. * */ -struct GNUNET_MeshHash +struct GNUNET_MESH_Hash { unsigned char bits[256 / 8]; }; diff --git a/src/mesh/gnunet-mesh.c b/src/mesh/gnunet-mesh.c index 7cc5247cf8..9510c100c6 100644 --- a/src/mesh/gnunet-mesh.c +++ b/src/mesh/gnunet-mesh.c @@ -542,7 +542,7 @@ tunnel_callback (void *cls, unsigned int n_channels, unsigned int n_connections, uint32_t *channels, - struct GNUNET_MeshHash *connections, + struct GNUNET_MESH_Hash *connections, unsigned int estate, unsigned int cstate) { diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c index a5b569b486..adc5320dc3 100644 --- a/src/mesh/gnunet-service-mesh_connection.c +++ b/src/mesh/gnunet-service-mesh_connection.c @@ -171,7 +171,7 @@ struct MeshConnection /** * ID of the connection. */ - struct GNUNET_MeshHash id; + struct GNUNET_MESH_Hash id; /** * State of the connection. @@ -413,7 +413,7 @@ fc_init (struct MeshFlowControl *fc) * @param cid Connection ID. */ static struct MeshConnection * -connection_get (const struct GNUNET_MeshHash *cid) +connection_get (const struct GNUNET_MESH_Hash *cid) { return GNUNET_CONTAINER_multihashmap_get (connections, GM_h2hc (cid)); } @@ -840,7 +840,7 @@ send_broken (struct MeshConnection *c, * @param peer Peer to notify (neighbor who sent the connection). */ static void -send_broken2 (struct GNUNET_MeshHash *connection_id, +send_broken2 (struct GNUNET_MESH_Hash *connection_id, const struct GNUNET_PeerIdentity *id1, const struct GNUNET_PeerIdentity *id2, GNUNET_PEER_Id peer_id) @@ -1481,7 +1481,7 @@ build_path_from_peer_ids (struct GNUNET_PeerIdentity *peers, static void log_message (const struct GNUNET_MessageHeader *message, const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_MeshHash *hash) + const struct GNUNET_MESH_Hash *hash) { LOG (GNUNET_ERROR_TYPE_INFO, "<- %s on connection %s from %s\n", GM_m2s (ntohs (message->type)), GNUNET_h2s (GM_h2hc (hash)), @@ -1508,7 +1508,7 @@ GMC_handle_create (void *cls, const struct GNUNET_PeerIdentity *peer, { struct GNUNET_MESH_ConnectionCreate *msg; struct GNUNET_PeerIdentity *id; - struct GNUNET_MeshHash *cid; + struct GNUNET_MESH_Hash *cid; struct MeshPeerPath *path; struct MeshPeer *dest_peer; struct MeshPeer *orig_peer; @@ -2405,7 +2405,7 @@ GMC_shutdown (void) struct MeshConnection * -GMC_new (const struct GNUNET_MeshHash *cid, +GMC_new (const struct GNUNET_MESH_Hash *cid, struct MeshTunnel3 *t, struct MeshPeerPath *p, unsigned int own_pos) @@ -2522,7 +2522,7 @@ GMC_destroy (struct MeshConnection *c) * * @return ID of the connection. */ -const struct GNUNET_MeshHash * +const struct GNUNET_MESH_Hash * GMC_get_id (const struct MeshConnection *c) { return &c->id; diff --git a/src/mesh/gnunet-service-mesh_connection.h b/src/mesh/gnunet-service-mesh_connection.h index f79117f2da..39d62adc96 100644 --- a/src/mesh/gnunet-service-mesh_connection.h +++ b/src/mesh/gnunet-service-mesh_connection.h @@ -266,7 +266,7 @@ GMC_shutdown (void); * @return Newly created connection, NULL in case of error (own id not in path). */ struct MeshConnection * -GMC_new (const struct GNUNET_MeshHash *cid, +GMC_new (const struct GNUNET_MESH_Hash *cid, struct MeshTunnel3 *t, struct MeshPeerPath *p, unsigned int own_pos); @@ -289,7 +289,7 @@ GMC_destroy (struct MeshConnection *c); * * @return ID of the connection. */ -const struct GNUNET_MeshHash * +const struct GNUNET_MESH_Hash * GMC_get_id (const struct MeshConnection *c); diff --git a/src/mesh/gnunet-service-mesh_local.c b/src/mesh/gnunet-service-mesh_local.c index 8970571a4e..854def70f1 100644 --- a/src/mesh/gnunet-service-mesh_local.c +++ b/src/mesh/gnunet-service-mesh_local.c @@ -727,7 +727,7 @@ static void iter_connection (void *cls, struct MeshConnection *c) { struct GNUNET_MESH_LocalInfoTunnel *msg = cls; - struct GNUNET_MeshHash *h = (struct GNUNET_MeshHash *) &msg[1]; + struct GNUNET_MESH_Hash *h = (struct GNUNET_MESH_Hash *) &msg[1]; h[msg->connections] = *(GMC_get_id (c)); msg->connections++; @@ -805,7 +805,7 @@ handle_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client, c_n = GMT_count_connections (t); size = sizeof (struct GNUNET_MESH_LocalInfoTunnel); - size += c_n * sizeof (struct GNUNET_MeshHash); + size += c_n * sizeof (struct GNUNET_MESH_Hash); size += ch_n * sizeof (MESH_ChannelNumber); resp = GNUNET_malloc (size); diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c index 782a02c806..6a86ad2d62 100644 --- a/src/mesh/gnunet-service-mesh_tunnel.c +++ b/src/mesh/gnunet-service-mesh_tunnel.c @@ -756,7 +756,7 @@ queue_data (struct MeshTunnel3 *t, const struct GNUNET_MessageHeader *msg) */ static void t_hmac (struct MeshTunnel3 *t, const void *plaintext, size_t size, uint32_t iv, - int outgoing, struct GNUNET_MeshHash *hmac) + int outgoing, struct GNUNET_MESH_Hash *hmac) { struct GNUNET_CRYPTO_AuthKey auth_key; static const char ctx[] = "mesh authentication key"; @@ -1675,7 +1675,7 @@ GMT_handle_encrypted (struct MeshTunnel3 *t, char cbuf [payload_size]; struct GNUNET_MessageHeader *msgh; unsigned int off; - struct GNUNET_MeshHash hmac; + struct GNUNET_MESH_Hash hmac; decrypted_size = t_decrypt (t, cbuf, &msg[1], payload_size, msg->iv); t_hmac (t, &msg[1], payload_size, msg->iv, GNUNET_NO, &hmac); @@ -2237,7 +2237,7 @@ struct MeshConnection * GMT_use_path (struct MeshTunnel3 *t, struct MeshPeerPath *p) { struct MeshConnection *c; - struct GNUNET_MeshHash cid; + struct GNUNET_MESH_Hash cid; unsigned int own_pos; if (NULL == t || NULL == p) diff --git a/src/mesh/mesh.h b/src/mesh/mesh.h index 02bf96ee61..6e7506fd2c 100644 --- a/src/mesh/mesh.h +++ b/src/mesh/mesh.h @@ -319,14 +319,14 @@ GM_min_pid (uint32_t a, uint32_t b); * @return A HashCode containing the original 256 bit hash right-padded with 0. */ const struct GNUNET_HashCode * -GM_h2hc (const struct GNUNET_MeshHash *id); +GM_h2hc (const struct GNUNET_MESH_Hash *id); /** * Get a string from a Mesh Hash (256 bits). * WARNING: Not reentrant (based on GNUNET_h2s). */ const char * -GM_h2s (const struct GNUNET_MeshHash *id); +GM_h2s (const struct GNUNET_MESH_Hash *id); /** * Convert a message type into a string to help debug diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c index 5fdfe612c2..05d6dde9e4 100644 --- a/src/mesh/mesh_api.c +++ b/src/mesh/mesh_api.c @@ -1074,7 +1074,7 @@ process_get_peer (struct GNUNET_MESH_Handle *h, size_t msize; unsigned int ch_n; unsigned int c_n; - struct GNUNET_MeshHash *conns; + struct GNUNET_MESH_Hash *conns; MESH_ChannelNumber *chns; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Get Tunnel messasge received\n"); @@ -1097,7 +1097,7 @@ process_get_peer (struct GNUNET_MESH_Handle *h, ch_n = ntohl (msg->channels); c_n = ntohl (msg->connections); esize += ch_n * sizeof (MESH_ChannelNumber); - esize += c_n * sizeof (struct GNUNET_MeshHash); + esize += c_n * sizeof (struct GNUNET_MESH_Hash); if (msize != esize) { GNUNET_break_op (0); @@ -1111,7 +1111,7 @@ process_get_peer (struct GNUNET_MESH_Handle *h, } /* Call Callback with tunnel info. */ - conns = (struct GNUNET_MeshHash *) &msg[1]; + conns = (struct GNUNET_MESH_Hash *) &msg[1]; chns = (MESH_ChannelNumber *) &conns[c_n]; h->info_cb.tunnel_cb (h->info_cls, &msg->destination, ch_n, c_n, chns, conns, @@ -1176,7 +1176,7 @@ process_get_tunnel (struct GNUNET_MESH_Handle *h, size_t msize; unsigned int ch_n; unsigned int c_n; - struct GNUNET_MeshHash *conns; + struct GNUNET_MESH_Hash *conns; MESH_ChannelNumber *chns; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Get Tunnel messasge received\n"); @@ -1199,7 +1199,7 @@ process_get_tunnel (struct GNUNET_MESH_Handle *h, ch_n = ntohl (msg->channels); c_n = ntohl (msg->connections); esize += ch_n * sizeof (MESH_ChannelNumber); - esize += c_n * sizeof (struct GNUNET_MeshHash); + esize += c_n * sizeof (struct GNUNET_MESH_Hash); if (msize != esize) { GNUNET_break_op (0); @@ -1213,7 +1213,7 @@ process_get_tunnel (struct GNUNET_MESH_Handle *h, } /* Call Callback with tunnel info. */ - conns = (struct GNUNET_MeshHash *) &msg[1]; + conns = (struct GNUNET_MESH_Hash *) &msg[1]; chns = (MESH_ChannelNumber *) &conns[c_n]; h->info_cb.tunnel_cb (h->info_cls, &msg->destination, ch_n, c_n, chns, conns, diff --git a/src/mesh/mesh_common.c b/src/mesh/mesh_common.c index f9563f461b..d094734b94 100644 --- a/src/mesh/mesh_common.c +++ b/src/mesh/mesh_common.c @@ -78,7 +78,7 @@ GM_min_pid (uint32_t a, uint32_t b) const struct GNUNET_HashCode * -GM_h2hc (const struct GNUNET_MeshHash *id) +GM_h2hc (const struct GNUNET_MESH_Hash *id) { static struct GNUNET_HashCode hc; memcpy (&hc, id, sizeof (*id)); @@ -88,7 +88,7 @@ GM_h2hc (const struct GNUNET_MeshHash *id) const char * -GM_h2s (const struct GNUNET_MeshHash *id) +GM_h2s (const struct GNUNET_MESH_Hash *id) { static char s[53]; diff --git a/src/mesh/mesh_protocol.h b/src/mesh/mesh_protocol.h index 5618360b74..8decab96fe 100644 --- a/src/mesh/mesh_protocol.h +++ b/src/mesh/mesh_protocol.h @@ -63,7 +63,7 @@ struct GNUNET_MESH_ConnectionCreate /** * ID of the connection */ - struct GNUNET_MeshHash cid; + struct GNUNET_MESH_Hash cid; /** * path_length structs defining the *whole* path from the origin [0] to the @@ -85,7 +85,7 @@ struct GNUNET_MESH_ConnectionACK /** * ID of the connection. */ - struct GNUNET_MeshHash cid; + struct GNUNET_MESH_Hash cid; }; @@ -103,7 +103,7 @@ struct GNUNET_MESH_KX /** * ID of the connection. */ - struct GNUNET_MeshHash cid; + struct GNUNET_MESH_Hash cid; /* Specific KX message follows. */ }; @@ -227,7 +227,7 @@ struct GNUNET_MESH_Encrypted /** * ID of the connection. */ - struct GNUNET_MeshHash cid; + struct GNUNET_MESH_Hash cid; /** * ID of the packet (hop by hop). @@ -248,7 +248,7 @@ struct GNUNET_MESH_Encrypted * MAC of the encrypted message, used to verify message integrity. * Everything after this value will be encrypted and authenticated. */ - struct GNUNET_MeshHash hmac; + struct GNUNET_MESH_Hash hmac; /** * Encrypted content follows. @@ -374,7 +374,7 @@ struct GNUNET_MESH_ACK /** * ID of the connection. */ - struct GNUNET_MeshHash cid; + struct GNUNET_MESH_Hash cid; }; @@ -396,7 +396,7 @@ struct GNUNET_MESH_Poll /** * ID of the connection. */ - struct GNUNET_MeshHash cid; + struct GNUNET_MESH_Hash cid; }; @@ -414,7 +414,7 @@ struct GNUNET_MESH_ConnectionBroken /** * ID of the connection. */ - struct GNUNET_MeshHash cid; + struct GNUNET_MESH_Hash cid; /** * ID of the endpoint @@ -441,7 +441,7 @@ struct GNUNET_MESH_ConnectionDestroy /** * ID of the connection. */ - struct GNUNET_MeshHash cid; + struct GNUNET_MESH_Hash cid; }; |