diff options
Diffstat (limited to 'src/cadet/cadet_api.c')
-rw-r--r-- | src/cadet/cadet_api.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c index e141787a0..4bd5911ce 100644 --- a/src/cadet/cadet_api.c +++ b/src/cadet/cadet_api.c | |||
@@ -32,6 +32,17 @@ | |||
32 | 32 | ||
33 | #define LOG(kind, ...) GNUNET_log_from (kind, "cadet-api", __VA_ARGS__) | 33 | #define LOG(kind, ...) GNUNET_log_from (kind, "cadet-api", __VA_ARGS__) |
34 | 34 | ||
35 | enum GNUNET_CADET_ChannelInfoOption | ||
36 | { | ||
37 | /** | ||
38 | * Who is the peer at the other end of the channel. | ||
39 | * Only for use in @c GNUNET_CADET_channel_get_info | ||
40 | * struct GNUNET_PeerIdentity *peer | ||
41 | */ | ||
42 | GNUNET_CADET_OPTION_PEER = 0x0 | ||
43 | |||
44 | }; | ||
45 | |||
35 | /** | 46 | /** |
36 | * Opaque handle to the service. | 47 | * Opaque handle to the service. |
37 | */ | 48 | */ |
@@ -134,11 +145,6 @@ struct GNUNET_CADET_Channel | |||
134 | struct GNUNET_CADET_ClientChannelNumber ccn; | 145 | struct GNUNET_CADET_ClientChannelNumber ccn; |
135 | 146 | ||
136 | /** | 147 | /** |
137 | * Channel options: reliability, etc. | ||
138 | */ | ||
139 | enum GNUNET_CADET_ChannelOption options; | ||
140 | |||
141 | /** | ||
142 | * How many messages are we allowed to send to the service right now? | 148 | * How many messages are we allowed to send to the service right now? |
143 | */ | 149 | */ |
144 | unsigned int allow_send; | 150 | unsigned int allow_send; |
@@ -578,7 +584,6 @@ handle_channel_created ( | |||
578 | ch = create_channel (h, &ccn); | 584 | ch = create_channel (h, &ccn); |
579 | ch->peer = msg->peer; | 585 | ch->peer = msg->peer; |
580 | ch->incoming_port = port; | 586 | ch->incoming_port = port; |
581 | ch->options = ntohl (msg->opt); | ||
582 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 587 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
583 | "Creating incoming channel %X [%s] %p\n", | 588 | "Creating incoming channel %X [%s] %p\n", |
584 | ntohl (ccn.channel_of_client), | 589 | ntohl (ccn.channel_of_client), |
@@ -938,29 +943,21 @@ GNUNET_CADET_channel_destroy (struct GNUNET_CADET_Channel *channel) | |||
938 | */ | 943 | */ |
939 | const union GNUNET_CADET_ChannelInfo * | 944 | const union GNUNET_CADET_ChannelInfo * |
940 | GNUNET_CADET_channel_get_info (struct GNUNET_CADET_Channel *channel, | 945 | GNUNET_CADET_channel_get_info (struct GNUNET_CADET_Channel *channel, |
941 | enum GNUNET_CADET_ChannelOption option, | 946 | enum GNUNET_CADET_ChannelInfoOption option, |
942 | ...) | 947 | ...) |
943 | { | 948 | { |
944 | static int bool_flag; | 949 | static int bool_flag; |
945 | 950 | ||
946 | switch (option) | 951 | switch (option) |
947 | { | 952 | { |
948 | case GNUNET_CADET_OPTION_NOBUFFER: | 953 | case GNUNET_CADET_OPTION_PEER: |
949 | case GNUNET_CADET_OPTION_RELIABLE: | 954 | return (const union GNUNET_CADET_ChannelInfo *) &channel->peer; |
950 | case GNUNET_CADET_OPTION_OUT_OF_ORDER: | 955 | break; |
951 | if (0 != (option & channel->options)) | 956 | default: |
952 | bool_flag = GNUNET_YES; | 957 | GNUNET_break (0); |
953 | else | 958 | return NULL; |
954 | bool_flag = GNUNET_NO; | ||
955 | return (const union GNUNET_CADET_ChannelInfo *) &bool_flag; | ||
956 | break; | ||
957 | case GNUNET_CADET_OPTION_PEER: | ||
958 | return (const union GNUNET_CADET_ChannelInfo *) &channel->peer; | ||
959 | break; | ||
960 | default: | ||
961 | GNUNET_break (0); | ||
962 | return NULL; | ||
963 | } | 959 | } |
960 | return (const union GNUNET_CADET_ChannelInfo *) &channel->peer; | ||
964 | } | 961 | } |
965 | 962 | ||
966 | 963 | ||
@@ -1089,7 +1086,6 @@ GNUNET_CADET_channel_create (struct GNUNET_CADET_Handle *h, | |||
1089 | void *channel_cls, | 1086 | void *channel_cls, |
1090 | const struct GNUNET_PeerIdentity *destination, | 1087 | const struct GNUNET_PeerIdentity *destination, |
1091 | const struct GNUNET_HashCode *port, | 1088 | const struct GNUNET_HashCode *port, |
1092 | enum GNUNET_CADET_ChannelOption options, | ||
1093 | GNUNET_CADET_WindowSizeEventHandler window_changes, | 1089 | GNUNET_CADET_WindowSizeEventHandler window_changes, |
1094 | GNUNET_CADET_DisconnectEventHandler disconnects, | 1090 | GNUNET_CADET_DisconnectEventHandler disconnects, |
1095 | const struct GNUNET_MQ_MessageHandler *handlers) | 1091 | const struct GNUNET_MQ_MessageHandler *handlers) |
@@ -1106,7 +1102,6 @@ GNUNET_CADET_channel_create (struct GNUNET_CADET_Handle *h, | |||
1106 | ch = create_channel (h, NULL); | 1102 | ch = create_channel (h, NULL); |
1107 | ch->ctx = channel_cls; | 1103 | ch->ctx = channel_cls; |
1108 | ch->peer = *destination; | 1104 | ch->peer = *destination; |
1109 | ch->options = options; | ||
1110 | ch->window_changes = window_changes; | 1105 | ch->window_changes = window_changes; |
1111 | ch->disconnects = disconnects; | 1106 | ch->disconnects = disconnects; |
1112 | 1107 | ||
@@ -1125,8 +1120,13 @@ GNUNET_CADET_channel_create (struct GNUNET_CADET_Handle *h, | |||
1125 | msg->ccn = ch->ccn; | 1120 | msg->ccn = ch->ccn; |
1126 | msg->port = *port; | 1121 | msg->port = *port; |
1127 | msg->peer = *destination; | 1122 | msg->peer = *destination; |
1123 | <<<<<<< 17611641fe7da3d2711e1f20eaf2ee81faf0e702 | ||
1128 | msg->opt = htonl (options); | 1124 | msg->opt = htonl (options); |
1129 | GNUNET_MQ_send (h->mq, env); | 1125 | GNUNET_MQ_send (h->mq, env); |
1126 | ======= | ||
1127 | GNUNET_MQ_send (h->mq, | ||
1128 | env); | ||
1129 | >>>>>>> removed GNUNET_CADET_ChannelOption | ||
1130 | return ch; | 1130 | return ch; |
1131 | } | 1131 | } |
1132 | 1132 | ||