diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-10-30 14:25:49 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-10-30 14:25:49 +0000 |
commit | 1267da6ec732de0c5f86c6aecaf77e65778734b0 (patch) | |
tree | 4ac30498d0c902ddfeb66aa90544932e7cdfcd28 /src/mesh/gnunet-service-mesh-new.c | |
parent | 56a7b2b75c2b125212f948a20fb6c5e4af7459e1 (diff) | |
download | gnunet-1267da6ec732de0c5f86c6aecaf77e65778734b0.tar.gz gnunet-1267da6ec732de0c5f86c6aecaf77e65778734b0.zip |
- refactoring, cinfo -> fcinfo
Diffstat (limited to 'src/mesh/gnunet-service-mesh-new.c')
-rw-r--r-- | src/mesh/gnunet-service-mesh-new.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/mesh/gnunet-service-mesh-new.c b/src/mesh/gnunet-service-mesh-new.c index 64f9beb13..15abfa1a8 100644 --- a/src/mesh/gnunet-service-mesh-new.c +++ b/src/mesh/gnunet-service-mesh-new.c | |||
@@ -357,7 +357,7 @@ struct MeshTunnel | |||
357 | uint32_t skip; | 357 | uint32_t skip; |
358 | 358 | ||
359 | /** | 359 | /** |
360 | * MeshTunnelChildInfo of all children, indexed by GNUNET_PEER_Id. | 360 | * MeshTunnelFlowControlInfo of all children, indexed by GNUNET_PEER_Id. |
361 | * Contains the Flow Control info: FWD ACK value received, | 361 | * Contains the Flow Control info: FWD ACK value received, |
362 | * last BCK ACK sent, PID and SKIP values. | 362 | * last BCK ACK sent, PID and SKIP values. |
363 | */ | 363 | */ |
@@ -433,7 +433,7 @@ struct MeshTunnel | |||
433 | /** | 433 | /** |
434 | * Flow control info for each client. | 434 | * Flow control info for each client. |
435 | */ | 435 | */ |
436 | struct MeshTunnelClientInfo *clients_fc; | 436 | struct MeshTunnelFlowControlInfo *clients_fc; |
437 | 437 | ||
438 | /** | 438 | /** |
439 | * Number of elements in clients/clients_fc | 439 | * Number of elements in clients/clients_fc |
@@ -3219,7 +3219,7 @@ tunnel_destroy_child (void *cls, | |||
3219 | const struct GNUNET_HashCode * key, | 3219 | const struct GNUNET_HashCode * key, |
3220 | void *value) | 3220 | void *value) |
3221 | { | 3221 | { |
3222 | struct MeshTunnelChildInfo *cinfo = value; | 3222 | struct MeshTunnelFlowControlInfo *cinfo = value; |
3223 | struct MeshTunnel *t = cls; | 3223 | struct MeshTunnel *t = cls; |
3224 | struct MeshPeerQueue *q; | 3224 | struct MeshPeerQueue *q; |
3225 | unsigned int c; | 3225 | unsigned int c; |
@@ -3563,8 +3563,8 @@ tunnel_add_skip (void *cls, | |||
3563 | /** | 3563 | /** |
3564 | * @brief Get neighbor's Flow Control information. | 3564 | * @brief Get neighbor's Flow Control information. |
3565 | * | 3565 | * |
3566 | * Retrieves the MeshTunnelChildInfo containing Flow Control data about a direct | 3566 | * Retrieves the MeshTunnelFlowControlInfo containing Flow Control data about |
3567 | * descendant of the local node in a certain tunnel. | 3567 | * a direct descendant of the local node in a certain tunnel. |
3568 | * If the info is not yet there (recently created path), creates the data struct | 3568 | * If the info is not yet there (recently created path), creates the data struct |
3569 | * and inserts it into the tunnel info, initialized to the current tunnel ACK | 3569 | * and inserts it into the tunnel info, initialized to the current tunnel ACK |
3570 | * values. | 3570 | * values. |
@@ -3574,41 +3574,41 @@ tunnel_add_skip (void *cls, | |||
3574 | * | 3574 | * |
3575 | * @return Neighbor's Flow Control info. | 3575 | * @return Neighbor's Flow Control info. |
3576 | */ | 3576 | */ |
3577 | static struct MeshTunnelChildInfo * | 3577 | static struct MeshTunnelFlowControlInfo * |
3578 | tunnel_get_neighbor_fc (struct MeshTunnel *t, | 3578 | tunnel_get_neighbor_fc (struct MeshTunnel *t, |
3579 | const struct GNUNET_PeerIdentity *peer) | 3579 | const struct GNUNET_PeerIdentity *peer) |
3580 | { | 3580 | { |
3581 | struct MeshTunnelChildInfo *cinfo; | 3581 | struct MeshTunnelFlowControlInfo *fcinfo; |
3582 | 3582 | ||
3583 | if (NULL == t->children_fc) | 3583 | if (NULL == t->children_fc) |
3584 | return NULL; | 3584 | return NULL; |
3585 | 3585 | ||
3586 | cinfo = GNUNET_CONTAINER_multihashmap_get (t->children_fc, | 3586 | fcinfo = GNUNET_CONTAINER_multihashmap_get (t->children_fc, |
3587 | &peer->hashPubKey); | 3587 | &peer->hashPubKey); |
3588 | if (NULL == cinfo) | 3588 | if (NULL == fcinfo) |
3589 | { | 3589 | { |
3590 | uint32_t delta; | 3590 | uint32_t delta; |
3591 | 3591 | ||
3592 | cinfo = GNUNET_malloc (sizeof (struct MeshTunnelChildInfo)); | 3592 | fcinfo = GNUNET_malloc (sizeof (struct MeshTunnelFlowControlInfo)); |
3593 | cinfo->id = GNUNET_PEER_intern (peer); | 3593 | fcinfo->peer = peer_info_get(peer); |
3594 | cinfo->skip = t->fwd_pid; | 3594 | fcinfo->skip = t->fwd_pid; |
3595 | cinfo->t = t; | 3595 | fcinfo->t = t; |
3596 | 3596 | ||
3597 | delta = t->nobuffer ? 1 : INITIAL_WINDOW_SIZE; | 3597 | delta = t->nobuffer ? 1 : INITIAL_WINDOW_SIZE; |
3598 | cinfo->fwd_ack = t->fwd_pid + delta; | 3598 | fcinfo->fwd_ack = t->fwd_pid + delta; |
3599 | cinfo->bck_ack = delta; | 3599 | fcinfo->bck_ack = delta; |
3600 | cinfo->bck_pid = -1; | 3600 | fcinfo->bck_pid = -1; |
3601 | 3601 | ||
3602 | cinfo->send_buffer = | 3602 | fcinfo->send_buffer = |
3603 | GNUNET_malloc (sizeof(struct MeshPeerQueue *) * t->fwd_queue_max); | 3603 | GNUNET_malloc (sizeof(struct MeshPeerQueue *) * t->fwd_queue_max); |
3604 | 3604 | ||
3605 | GNUNET_assert (GNUNET_OK == | 3605 | GNUNET_assert (GNUNET_OK == |
3606 | GNUNET_CONTAINER_multihashmap_put (t->children_fc, | 3606 | GNUNET_CONTAINER_multihashmap_put (t->children_fc, |
3607 | &peer->hashPubKey, | 3607 | &peer->hashPubKey, |
3608 | cinfo, | 3608 | fcinfo, |
3609 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST)); | 3609 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST)); |
3610 | } | 3610 | } |
3611 | return cinfo; | 3611 | return fcinfo; |
3612 | } | 3612 | } |
3613 | 3613 | ||
3614 | 3614 | ||