diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-01-29 18:43:35 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-01-29 18:43:35 +0100 |
commit | 81f9e9e971e615e9f1f18d1509168b56bb7360c0 (patch) | |
tree | 84bf2b1e3240ee9190bf1ea7f2dfca63c19dafe1 /src/cadet/gnunet-service-cadet-new_connection.c | |
parent | dc430a9d23f8fd76f700d6836d4f4748429d70cd (diff) | |
download | gnunet-81f9e9e971e615e9f1f18d1509168b56bb7360c0.tar.gz gnunet-81f9e9e971e615e9f1f18d1509168b56bb7360c0.zip |
introduce buffering options on the route level
Diffstat (limited to 'src/cadet/gnunet-service-cadet-new_connection.c')
-rw-r--r-- | src/cadet/gnunet-service-cadet-new_connection.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cadet/gnunet-service-cadet-new_connection.c b/src/cadet/gnunet-service-cadet-new_connection.c index fdc6de620..13d4c4a0c 100644 --- a/src/cadet/gnunet-service-cadet-new_connection.c +++ b/src/cadet/gnunet-service-cadet-new_connection.c | |||
@@ -146,6 +146,11 @@ struct CadetConnection | |||
146 | enum CadetConnectionState state; | 146 | enum CadetConnectionState state; |
147 | 147 | ||
148 | /** | 148 | /** |
149 | * Options for the route, control buffering. | ||
150 | */ | ||
151 | enum GNUNET_CADET_ChannelOption options; | ||
152 | |||
153 | /** | ||
149 | * Offset of our @e destination in @e path. | 154 | * Offset of our @e destination in @e path. |
150 | */ | 155 | */ |
151 | unsigned int off; | 156 | unsigned int off; |
@@ -490,6 +495,7 @@ send_create (void *cls) | |||
490 | env = GNUNET_MQ_msg_extra (create_msg, | 495 | env = GNUNET_MQ_msg_extra (create_msg, |
491 | (1 + path_length) * sizeof (struct GNUNET_PeerIdentity), | 496 | (1 + path_length) * sizeof (struct GNUNET_PeerIdentity), |
492 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE); | 497 | GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE); |
498 | create_msg->options = htonl ((uint32_t) cc->options); | ||
493 | create_msg->cid = cc->cid; | 499 | create_msg->cid = cc->cid; |
494 | pids = (struct GNUNET_PeerIdentity *) &create_msg[1]; | 500 | pids = (struct GNUNET_PeerIdentity *) &create_msg[1]; |
495 | pids[0] = my_full_id; | 501 | pids[0] = my_full_id; |
@@ -666,6 +672,7 @@ manage_first_hop_mq (void *cls, | |||
666 | * | 672 | * |
667 | * @param destination where to go | 673 | * @param destination where to go |
668 | * @param path which path to take (may not be the full path) | 674 | * @param path which path to take (may not be the full path) |
675 | * @param options options for the connection | ||
669 | * @param ct which tunnel uses this connection | 676 | * @param ct which tunnel uses this connection |
670 | * @param init_state initial state for the connection | 677 | * @param init_state initial state for the connection |
671 | * @param ready_cb function to call when ready to transmit | 678 | * @param ready_cb function to call when ready to transmit |
@@ -675,6 +682,7 @@ manage_first_hop_mq (void *cls, | |||
675 | static struct CadetConnection * | 682 | static struct CadetConnection * |
676 | connection_create (struct CadetPeer *destination, | 683 | connection_create (struct CadetPeer *destination, |
677 | struct CadetPeerPath *path, | 684 | struct CadetPeerPath *path, |
685 | enum GNUNET_CADET_ChannelOption options, | ||
678 | struct CadetTConnection *ct, | 686 | struct CadetTConnection *ct, |
679 | const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, | 687 | const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, |
680 | enum CadetConnectionState init_state, | 688 | enum CadetConnectionState init_state, |
@@ -689,6 +697,7 @@ connection_create (struct CadetPeer *destination, | |||
689 | destination); | 697 | destination); |
690 | GNUNET_assert (UINT_MAX > off); | 698 | GNUNET_assert (UINT_MAX > off); |
691 | cc = GNUNET_new (struct CadetConnection); | 699 | cc = GNUNET_new (struct CadetConnection); |
700 | cc->options = options; | ||
692 | cc->state = init_state; | 701 | cc->state = init_state; |
693 | cc->ct = ct; | 702 | cc->ct = ct; |
694 | cc->cid = *cid; | 703 | cc->cid = *cid; |
@@ -729,6 +738,7 @@ connection_create (struct CadetPeer *destination, | |||
729 | * | 738 | * |
730 | * @param destination where to go | 739 | * @param destination where to go |
731 | * @param path which path to take (may not be the full path) | 740 | * @param path which path to take (may not be the full path) |
741 | * @param options options for the connection | ||
732 | * @param ct which tunnel uses this connection | 742 | * @param ct which tunnel uses this connection |
733 | * @param ready_cb function to call when ready to transmit | 743 | * @param ready_cb function to call when ready to transmit |
734 | * @param ready_cb_cls closure for @a cb | 744 | * @param ready_cb_cls closure for @a cb |
@@ -738,6 +748,7 @@ connection_create (struct CadetPeer *destination, | |||
738 | struct CadetConnection * | 748 | struct CadetConnection * |
739 | GCC_create_inbound (struct CadetPeer *destination, | 749 | GCC_create_inbound (struct CadetPeer *destination, |
740 | struct CadetPeerPath *path, | 750 | struct CadetPeerPath *path, |
751 | enum GNUNET_CADET_ChannelOption options, | ||
741 | struct CadetTConnection *ct, | 752 | struct CadetTConnection *ct, |
742 | const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, | 753 | const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, |
743 | GCC_ReadyCallback ready_cb, | 754 | GCC_ReadyCallback ready_cb, |
@@ -793,6 +804,7 @@ GCC_create_inbound (struct CadetPeer *destination, | |||
793 | 804 | ||
794 | return connection_create (destination, | 805 | return connection_create (destination, |
795 | path, | 806 | path, |
807 | options, | ||
796 | ct, | 808 | ct, |
797 | cid, | 809 | cid, |
798 | CADET_CONNECTION_CREATE_RECEIVED, | 810 | CADET_CONNECTION_CREATE_RECEIVED, |
@@ -807,6 +819,7 @@ GCC_create_inbound (struct CadetPeer *destination, | |||
807 | * | 819 | * |
808 | * @param destination where to go | 820 | * @param destination where to go |
809 | * @param path which path to take (may not be the full path) | 821 | * @param path which path to take (may not be the full path) |
822 | * @param options options for the connection | ||
810 | * @param ct tunnel that uses the connection | 823 | * @param ct tunnel that uses the connection |
811 | * @param ready_cb function to call when ready to transmit | 824 | * @param ready_cb function to call when ready to transmit |
812 | * @param ready_cb_cls closure for @a cb | 825 | * @param ready_cb_cls closure for @a cb |
@@ -815,6 +828,7 @@ GCC_create_inbound (struct CadetPeer *destination, | |||
815 | struct CadetConnection * | 828 | struct CadetConnection * |
816 | GCC_create (struct CadetPeer *destination, | 829 | GCC_create (struct CadetPeer *destination, |
817 | struct CadetPeerPath *path, | 830 | struct CadetPeerPath *path, |
831 | enum GNUNET_CADET_ChannelOption options, | ||
818 | struct CadetTConnection *ct, | 832 | struct CadetTConnection *ct, |
819 | GCC_ReadyCallback ready_cb, | 833 | GCC_ReadyCallback ready_cb, |
820 | void *ready_cb_cls) | 834 | void *ready_cb_cls) |
@@ -826,6 +840,7 @@ GCC_create (struct CadetPeer *destination, | |||
826 | sizeof (cid)); | 840 | sizeof (cid)); |
827 | return connection_create (destination, | 841 | return connection_create (destination, |
828 | path, | 842 | path, |
843 | options, | ||
829 | ct, | 844 | ct, |
830 | &cid, | 845 | &cid, |
831 | CADET_CONNECTION_NEW, | 846 | CADET_CONNECTION_NEW, |