diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-04-07 17:27:01 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-04-07 17:27:01 +0200 |
commit | b1d840b2104b9cf4a1cd6997bce39bd4b6c1b8bf (patch) | |
tree | 7b63350c853fa119b0c306cc11559c7add0d703b | |
parent | 0142079ce2e7a5e062d06aa8dddf2fdc1529035d (diff) | |
download | gnunet-b1d840b2104b9cf4a1cd6997bce39bd4b6c1b8bf.tar.gz gnunet-b1d840b2104b9cf4a1cd6997bce39bd4b6c1b8bf.zip |
indentation, GNUNET_memcmp introduction, housekeeping
-rw-r--r-- | src/transport/gnunet-service-tng.c | 159 |
1 files changed, 73 insertions, 86 deletions
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c index b41168d82..4d4ac509a 100644 --- a/src/transport/gnunet-service-tng.c +++ b/src/transport/gnunet-service-tng.c | |||
@@ -42,7 +42,6 @@ | |||
42 | * #4 to ensure flow control and RTT are OK, we always do the | 42 | * #4 to ensure flow control and RTT are OK, we always do the |
43 | * 'validation', even if address comes from PEERSTORE | 43 | * 'validation', even if address comes from PEERSTORE |
44 | * - ACK handling / retransmission | 44 | * - ACK handling / retransmission |
45 | * - address verification | ||
46 | * - track RTT, distance, loss, etc. | 45 | * - track RTT, distance, loss, etc. |
47 | * - DV data structures: | 46 | * - DV data structures: |
48 | * + learning | 47 | * + learning |
@@ -51,7 +50,6 @@ | |||
51 | * - routing of messages (using DV data structures!) | 50 | * - routing of messages (using DV data structures!) |
52 | * - handling of DV-boxed messages that need to be forwarded | 51 | * - handling of DV-boxed messages that need to be forwarded |
53 | * - backchannel message encryption & decryption | 52 | * - backchannel message encryption & decryption |
54 | * - | ||
55 | * | 53 | * |
56 | * Later: | 54 | * Later: |
57 | * - change transport-core API to provide proper flow control in both | 55 | * - change transport-core API to provide proper flow control in both |
@@ -1672,8 +1670,6 @@ notify_monitors (const struct GNUNET_PeerIdentity *peer, | |||
1672 | enum GNUNET_NetworkType nt, | 1670 | enum GNUNET_NetworkType nt, |
1673 | const struct MonitorEvent *me) | 1671 | const struct MonitorEvent *me) |
1674 | { | 1672 | { |
1675 | static struct GNUNET_PeerIdentity zero; | ||
1676 | |||
1677 | for (struct TransportClient *tc = clients_head; | 1673 | for (struct TransportClient *tc = clients_head; |
1678 | NULL != tc; | 1674 | NULL != tc; |
1679 | tc = tc->next) | 1675 | tc = tc->next) |
@@ -1682,12 +1678,9 @@ notify_monitors (const struct GNUNET_PeerIdentity *peer, | |||
1682 | continue; | 1678 | continue; |
1683 | if (tc->details.monitor.one_shot) | 1679 | if (tc->details.monitor.one_shot) |
1684 | continue; | 1680 | continue; |
1685 | if ( (0 != memcmp (&tc->details.monitor.peer, | 1681 | if ( (0 != GNUNET_is_zero (&tc->details.monitor.peer)) && |
1686 | &zero, | 1682 | (0 != GNUNET_memcmp (&tc->details.monitor.peer, |
1687 | sizeof (zero))) && | 1683 | peer)) ) |
1688 | (0 != memcmp (&tc->details.monitor.peer, | ||
1689 | peer, | ||
1690 | sizeof (*peer))) ) | ||
1691 | continue; | 1684 | continue; |
1692 | notify_monitor (tc, | 1685 | notify_monitor (tc, |
1693 | peer, | 1686 | peer, |
@@ -2212,9 +2205,8 @@ handle_client_start (void *cls, | |||
2212 | options = ntohl (start->options); | 2205 | options = ntohl (start->options); |
2213 | if ( (0 != (1 & options)) && | 2206 | if ( (0 != (1 & options)) && |
2214 | (0 != | 2207 | (0 != |
2215 | memcmp (&start->self, | 2208 | GNUNET_memcmp (&start->self, |
2216 | &GST_my_identity, | 2209 | &GST_my_identity)) ) |
2217 | sizeof (struct GNUNET_PeerIdentity)) ) ) | ||
2218 | { | 2210 | { |
2219 | /* client thinks this is a different peer, reject */ | 2211 | /* client thinks this is a different peer, reject */ |
2220 | GNUNET_break (0); | 2212 | GNUNET_break (0); |
@@ -2718,10 +2710,10 @@ handle_communicator_backchannel (void *cls, | |||
2718 | enc->header.size = htons (sizeof (*enc) + msize); | 2710 | enc->header.size = htons (sizeof (*enc) + msize); |
2719 | enc->target = cb->pid; | 2711 | enc->target = cb->pid; |
2720 | lookup_ephemeral (&cb->pid, | 2712 | lookup_ephemeral (&cb->pid, |
2721 | &private_key, | 2713 | &private_key, |
2722 | &enc->ephemeral_key, | 2714 | &enc->ephemeral_key, |
2723 | &ppay.sender_sig, | 2715 | &ppay.sender_sig, |
2724 | &ephemeral_validity); | 2716 | &ephemeral_validity); |
2725 | // FIXME: setup 'iv' | 2717 | // FIXME: setup 'iv' |
2726 | #if FIXME | 2718 | #if FIXME |
2727 | dh_key_derive (&private_key, | 2719 | dh_key_derive (&private_key, |
@@ -2794,14 +2786,14 @@ peerstore_store_cb (void *cls, | |||
2794 | ale->sc = NULL; | 2786 | ale->sc = NULL; |
2795 | if (GNUNET_YES != success) | 2787 | if (GNUNET_YES != success) |
2796 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 2788 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
2797 | "Failed to store our own address `%s' in peerstore!\n", | 2789 | "Failed to store our own address `%s' in peerstore!\n", |
2798 | ale->address); | 2790 | ale->address); |
2799 | /* refresh period is 1/4 of expiration time, that should be plenty | 2791 | /* refresh period is 1/4 of expiration time, that should be plenty |
2800 | without being excessive. */ | 2792 | without being excessive. */ |
2801 | ale->st = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_divide (ale->expiration, | 2793 | ale->st = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_divide (ale->expiration, |
2802 | 4ULL), | 2794 | 4ULL), |
2803 | &store_pi, | 2795 | &store_pi, |
2804 | ale); | 2796 | ale); |
2805 | } | 2797 | } |
2806 | 2798 | ||
2807 | 2799 | ||
@@ -2821,30 +2813,30 @@ store_pi (void *cls) | |||
2821 | ale->st = NULL; | 2813 | ale->st = NULL; |
2822 | expiration = GNUNET_TIME_relative_to_absolute (ale->expiration); | 2814 | expiration = GNUNET_TIME_relative_to_absolute (ale->expiration); |
2823 | GNUNET_HELLO_sign_address (ale->address, | 2815 | GNUNET_HELLO_sign_address (ale->address, |
2824 | ale->nt, | 2816 | ale->nt, |
2825 | expiration, | 2817 | expiration, |
2826 | GST_my_private_key, | 2818 | GST_my_private_key, |
2827 | &addr, | 2819 | &addr, |
2828 | &addr_len); | 2820 | &addr_len); |
2829 | ale->sc = GNUNET_PEERSTORE_store (peerstore, | 2821 | ale->sc = GNUNET_PEERSTORE_store (peerstore, |
2830 | "transport", | 2822 | "transport", |
2831 | &GST_my_identity, | 2823 | &GST_my_identity, |
2832 | GNUNET_HELLO_PEERSTORE_KEY, | 2824 | GNUNET_HELLO_PEERSTORE_KEY, |
2833 | addr, | 2825 | addr, |
2834 | addr_len, | 2826 | addr_len, |
2835 | expiration, | 2827 | expiration, |
2836 | GNUNET_PEERSTORE_STOREOPTION_MULTIPLE, | 2828 | GNUNET_PEERSTORE_STOREOPTION_MULTIPLE, |
2837 | &peerstore_store_cb, | 2829 | &peerstore_store_cb, |
2838 | ale); | 2830 | ale); |
2839 | GNUNET_free (addr); | 2831 | GNUNET_free (addr); |
2840 | if (NULL == ale->sc) | 2832 | if (NULL == ale->sc) |
2841 | { | 2833 | { |
2842 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 2834 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
2843 | "Failed to store our address `%s' with peerstore\n", | 2835 | "Failed to store our address `%s' with peerstore\n", |
2844 | ale->address); | 2836 | ale->address); |
2845 | ale->st = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, | 2837 | ale->st = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, |
2846 | &store_pi, | 2838 | &store_pi, |
2847 | ale); | 2839 | ale); |
2848 | } | 2840 | } |
2849 | } | 2841 | } |
2850 | 2842 | ||
@@ -2877,7 +2869,7 @@ handle_add_address (void *cls, | |||
2877 | tc->details.communicator.addr_tail, | 2869 | tc->details.communicator.addr_tail, |
2878 | ale); | 2870 | ale); |
2879 | ale->st = GNUNET_SCHEDULER_add_now (&store_pi, | 2871 | ale->st = GNUNET_SCHEDULER_add_now (&store_pi, |
2880 | ale); | 2872 | ale); |
2881 | GNUNET_SERVICE_client_continue (tc->client); | 2873 | GNUNET_SERVICE_client_continue (tc->client); |
2882 | } | 2874 | } |
2883 | 2875 | ||
@@ -2948,7 +2940,7 @@ struct CommunicatorMessageContext | |||
2948 | */ | 2940 | */ |
2949 | static void | 2941 | static void |
2950 | demultiplex_with_cmc (struct CommunicatorMessageContext *cmc, | 2942 | demultiplex_with_cmc (struct CommunicatorMessageContext *cmc, |
2951 | const struct GNUNET_MessageHeader *msg); | 2943 | const struct GNUNET_MessageHeader *msg); |
2952 | 2944 | ||
2953 | 2945 | ||
2954 | /** | 2946 | /** |
@@ -2966,12 +2958,12 @@ finish_cmc_handling (struct CommunicatorMessageContext *cmc) | |||
2966 | struct GNUNET_TRANSPORT_IncomingMessageAck *ack; | 2958 | struct GNUNET_TRANSPORT_IncomingMessageAck *ack; |
2967 | 2959 | ||
2968 | env = GNUNET_MQ_msg (ack, | 2960 | env = GNUNET_MQ_msg (ack, |
2969 | GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG_ACK); | 2961 | GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG_ACK); |
2970 | ack->reserved = htonl (0); | 2962 | ack->reserved = htonl (0); |
2971 | ack->fc_id = cmc->im.fc_id; | 2963 | ack->fc_id = cmc->im.fc_id; |
2972 | ack->sender = cmc->im.sender; | 2964 | ack->sender = cmc->im.sender; |
2973 | GNUNET_MQ_send (cmc->tc->mq, | 2965 | GNUNET_MQ_send (cmc->tc->mq, |
2974 | env); | 2966 | env); |
2975 | } | 2967 | } |
2976 | GNUNET_SERVICE_client_continue (cmc->tc->client); | 2968 | GNUNET_SERVICE_client_continue (cmc->tc->client); |
2977 | GNUNET_free (cmc); | 2969 | GNUNET_free (cmc); |
@@ -2987,7 +2979,7 @@ finish_cmc_handling (struct CommunicatorMessageContext *cmc) | |||
2987 | */ | 2979 | */ |
2988 | static void | 2980 | static void |
2989 | handle_raw_message (void *cls, | 2981 | handle_raw_message (void *cls, |
2990 | const struct GNUNET_MessageHeader *mh) | 2982 | const struct GNUNET_MessageHeader *mh) |
2991 | { | 2983 | { |
2992 | struct CommunicatorMessageContext *cmc = cls; | 2984 | struct CommunicatorMessageContext *cmc = cls; |
2993 | uint16_t size = ntohs (mh->size); | 2985 | uint16_t size = ntohs (mh->size); |
@@ -3013,14 +3005,14 @@ handle_raw_message (void *cls, | |||
3013 | if (CT_CORE != tc->type) | 3005 | if (CT_CORE != tc->type) |
3014 | continue; | 3006 | continue; |
3015 | env = GNUNET_MQ_msg_extra (im, | 3007 | env = GNUNET_MQ_msg_extra (im, |
3016 | size, | 3008 | size, |
3017 | GNUNET_MESSAGE_TYPE_TRANSPORT_RECV); | 3009 | GNUNET_MESSAGE_TYPE_TRANSPORT_RECV); |
3018 | im->peer = cmc->im.sender; | 3010 | im->peer = cmc->im.sender; |
3019 | memcpy (&im[1], | 3011 | memcpy (&im[1], |
3020 | mh, | 3012 | mh, |
3021 | size); | 3013 | size); |
3022 | GNUNET_MQ_send (tc->mq, | 3014 | GNUNET_MQ_send (tc->mq, |
3023 | env); | 3015 | env); |
3024 | } | 3016 | } |
3025 | /* FIXME: consider doing this _only_ once the message | 3017 | /* FIXME: consider doing this _only_ once the message |
3026 | was drained from the CORE MQs to extend flow control to CORE! | 3018 | was drained from the CORE MQs to extend flow control to CORE! |
@@ -3038,7 +3030,7 @@ handle_raw_message (void *cls, | |||
3038 | */ | 3030 | */ |
3039 | static int | 3031 | static int |
3040 | check_fragment_box (void *cls, | 3032 | check_fragment_box (void *cls, |
3041 | const struct TransportFragmentBox *fb) | 3033 | const struct TransportFragmentBox *fb) |
3042 | { | 3034 | { |
3043 | uint16_t size = ntohs (fb->header.size); | 3035 | uint16_t size = ntohs (fb->header.size); |
3044 | uint16_t bsize = size - sizeof (*fb); | 3036 | uint16_t bsize = size - sizeof (*fb); |
@@ -3116,7 +3108,7 @@ handle_fragment_box (void *cls, | |||
3116 | int ack_now; | 3108 | int ack_now; |
3117 | 3109 | ||
3118 | n = GNUNET_CONTAINER_multipeermap_get (neighbours, | 3110 | n = GNUNET_CONTAINER_multipeermap_get (neighbours, |
3119 | &cmc->im.sender); | 3111 | &cmc->im.sender); |
3120 | if (NULL == n) | 3112 | if (NULL == n) |
3121 | { | 3113 | { |
3122 | struct GNUNET_SERVICE_Client *client = cmc->tc->client; | 3114 | struct GNUNET_SERVICE_Client *client = cmc->tc->client; |
@@ -3129,15 +3121,15 @@ handle_fragment_box (void *cls, | |||
3129 | if (NULL == n->reassembly_map) | 3121 | if (NULL == n->reassembly_map) |
3130 | { | 3122 | { |
3131 | n->reassembly_map = GNUNET_CONTAINER_multishortmap_create (8, | 3123 | n->reassembly_map = GNUNET_CONTAINER_multishortmap_create (8, |
3132 | GNUNET_YES); | 3124 | GNUNET_YES); |
3133 | n->reassembly_heap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); | 3125 | n->reassembly_heap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); |
3134 | n->reassembly_timeout_task = GNUNET_SCHEDULER_add_delayed (REASSEMBLY_EXPIRATION, | 3126 | n->reassembly_timeout_task = GNUNET_SCHEDULER_add_delayed (REASSEMBLY_EXPIRATION, |
3135 | &reassembly_cleanup_task, | 3127 | &reassembly_cleanup_task, |
3136 | n); | 3128 | n); |
3137 | } | 3129 | } |
3138 | msize = ntohs (fb->msg_size); | 3130 | msize = ntohs (fb->msg_size); |
3139 | rc = GNUNET_CONTAINER_multishortmap_get (n->reassembly_map, | 3131 | rc = GNUNET_CONTAINER_multishortmap_get (n->reassembly_map, |
3140 | &fb->msg_uuid); | 3132 | &fb->msg_uuid); |
3141 | if (NULL == rc) | 3133 | if (NULL == rc) |
3142 | { | 3134 | { |
3143 | rc = GNUNET_malloc (sizeof (*rc) + | 3135 | rc = GNUNET_malloc (sizeof (*rc) + |
@@ -3149,13 +3141,13 @@ handle_fragment_box (void *cls, | |||
3149 | rc->reassembly_timeout = GNUNET_TIME_relative_to_absolute (REASSEMBLY_EXPIRATION); | 3141 | rc->reassembly_timeout = GNUNET_TIME_relative_to_absolute (REASSEMBLY_EXPIRATION); |
3150 | rc->last_frag = GNUNET_TIME_absolute_get (); | 3142 | rc->last_frag = GNUNET_TIME_absolute_get (); |
3151 | rc->hn = GNUNET_CONTAINER_heap_insert (n->reassembly_heap, | 3143 | rc->hn = GNUNET_CONTAINER_heap_insert (n->reassembly_heap, |
3152 | rc, | 3144 | rc, |
3153 | rc->reassembly_timeout.abs_value_us); | 3145 | rc->reassembly_timeout.abs_value_us); |
3154 | GNUNET_assert (GNUNET_OK == | 3146 | GNUNET_assert (GNUNET_OK == |
3155 | GNUNET_CONTAINER_multishortmap_put (n->reassembly_map, | 3147 | GNUNET_CONTAINER_multishortmap_put (n->reassembly_map, |
3156 | &rc->msg_uuid, | 3148 | &rc->msg_uuid, |
3157 | rc, | 3149 | rc, |
3158 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); | 3150 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); |
3159 | target = (char *) &rc[1]; | 3151 | target = (char *) &rc[1]; |
3160 | rc->bitfield = (uint8_t *) (target + rc->msg_size); | 3152 | rc->bitfield = (uint8_t *) (target + rc->msg_size); |
3161 | rc->msg_missing = rc->msg_size; | 3153 | rc->msg_missing = rc->msg_size; |
@@ -3175,8 +3167,8 @@ handle_fragment_box (void *cls, | |||
3175 | fsize = ntohs (fb->header.size) - sizeof (*fb); | 3167 | fsize = ntohs (fb->header.size) - sizeof (*fb); |
3176 | frag_off = ntohs (fb->frag_off); | 3168 | frag_off = ntohs (fb->frag_off); |
3177 | memcpy (&target[frag_off], | 3169 | memcpy (&target[frag_off], |
3178 | &fb[1], | 3170 | &fb[1], |
3179 | fsize); | 3171 | fsize); |
3180 | /* update bitfield and msg_missing */ | 3172 | /* update bitfield and msg_missing */ |
3181 | for (unsigned int i=frag_off;i<frag_off+fsize;i++) | 3173 | for (unsigned int i=frag_off;i<frag_off+fsize;i++) |
3182 | { | 3174 | { |
@@ -3191,10 +3183,10 @@ handle_fragment_box (void *cls, | |||
3191 | frag_uuid = ntohl (fb->frag_uuid); | 3183 | frag_uuid = ntohl (fb->frag_uuid); |
3192 | cdelay = GNUNET_TIME_absolute_get_duration (rc->last_frag); | 3184 | cdelay = GNUNET_TIME_absolute_get_duration (rc->last_frag); |
3193 | cdelay = GNUNET_TIME_relative_multiply (cdelay, | 3185 | cdelay = GNUNET_TIME_relative_multiply (cdelay, |
3194 | rc->num_acks); | 3186 | rc->num_acks); |
3195 | rc->last_frag = GNUNET_TIME_absolute_get (); | 3187 | rc->last_frag = GNUNET_TIME_absolute_get (); |
3196 | rc->avg_ack_delay = GNUNET_TIME_relative_add (rc->avg_ack_delay, | 3188 | rc->avg_ack_delay = GNUNET_TIME_relative_add (rc->avg_ack_delay, |
3197 | cdelay); | 3189 | cdelay); |
3198 | ack_now = GNUNET_NO; | 3190 | ack_now = GNUNET_NO; |
3199 | if (0 == rc->num_acks) | 3191 | if (0 == rc->num_acks) |
3200 | { | 3192 | { |
@@ -3258,7 +3250,7 @@ handle_fragment_box (void *cls, | |||
3258 | /* successful reassembly */ | 3250 | /* successful reassembly */ |
3259 | send_fragment_ack (rc); | 3251 | send_fragment_ack (rc); |
3260 | demultiplex_with_cmc (cmc, | 3252 | demultiplex_with_cmc (cmc, |
3261 | msg); | 3253 | msg); |
3262 | /* FIXME: really free here? Might be bad if fragments are still | 3254 | /* FIXME: really free here? Might be bad if fragments are still |
3263 | en-route and we forget that we finished this reassembly immediately! | 3255 | en-route and we forget that we finished this reassembly immediately! |
3264 | -> keep around until timeout? | 3256 | -> keep around until timeout? |
@@ -3296,7 +3288,7 @@ handle_fragment_ack (void *cls, | |||
3296 | */ | 3288 | */ |
3297 | static int | 3289 | static int |
3298 | check_reliability_box (void *cls, | 3290 | check_reliability_box (void *cls, |
3299 | const struct TransportReliabilityBox *rb) | 3291 | const struct TransportReliabilityBox *rb) |
3300 | { | 3292 | { |
3301 | GNUNET_MQ_check_boxed_message (rb); | 3293 | GNUNET_MQ_check_boxed_message (rb); |
3302 | return GNUNET_YES; | 3294 | return GNUNET_YES; |
@@ -3311,7 +3303,7 @@ check_reliability_box (void *cls, | |||
3311 | */ | 3303 | */ |
3312 | static void | 3304 | static void |
3313 | handle_reliability_box (void *cls, | 3305 | handle_reliability_box (void *cls, |
3314 | const struct TransportReliabilityBox *rb) | 3306 | const struct TransportReliabilityBox *rb) |
3315 | { | 3307 | { |
3316 | struct CommunicatorMessageContext *cmc = cls; | 3308 | struct CommunicatorMessageContext *cmc = cls; |
3317 | const struct GNUNET_MessageHeader *inbox = (const struct GNUNET_MessageHeader *) &rb[1]; | 3309 | const struct GNUNET_MessageHeader *inbox = (const struct GNUNET_MessageHeader *) &rb[1]; |
@@ -3323,10 +3315,10 @@ handle_reliability_box (void *cls, | |||
3323 | /* FIXME: implement cummulative ACKs and ack_countdown, | 3315 | /* FIXME: implement cummulative ACKs and ack_countdown, |
3324 | then setting the avg_ack_delay field below: */ | 3316 | then setting the avg_ack_delay field below: */ |
3325 | ack = GNUNET_malloc (sizeof (*ack) + | 3317 | ack = GNUNET_malloc (sizeof (*ack) + |
3326 | sizeof (struct GNUNET_ShortHashCode)); | 3318 | sizeof (struct GNUNET_ShortHashCode)); |
3327 | ack->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_RELIABILITY_ACK); | 3319 | ack->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_RELIABILITY_ACK); |
3328 | ack->header.size = htons (sizeof (*ack) + | 3320 | ack->header.size = htons (sizeof (*ack) + |
3329 | sizeof (struct GNUNET_ShortHashCode)); | 3321 | sizeof (struct GNUNET_ShortHashCode)); |
3330 | memcpy (&ack[1], | 3322 | memcpy (&ack[1], |
3331 | &rb->msg_uuid, | 3323 | &rb->msg_uuid, |
3332 | sizeof (struct GNUNET_ShortHashCode)); | 3324 | sizeof (struct GNUNET_ShortHashCode)); |
@@ -3391,13 +3383,12 @@ handle_backchannel_encapsulation (void *cls, | |||
3391 | { | 3383 | { |
3392 | struct CommunicatorMessageContext *cmc = cls; | 3384 | struct CommunicatorMessageContext *cmc = cls; |
3393 | 3385 | ||
3394 | if (0 != memcmp (&be->target, | 3386 | if (0 != GNUNET_memcmp (&be->target, |
3395 | &GST_my_identity, | 3387 | &GST_my_identity)) |
3396 | sizeof (struct GNUNET_PeerIdentity))) | ||
3397 | { | 3388 | { |
3398 | /* not for me, try to route to target */ | 3389 | /* not for me, try to route to target */ |
3399 | route_message (&be->target, | 3390 | route_message (&be->target, |
3400 | GNUNET_copy_message (&be->header)); | 3391 | GNUNET_copy_message (&be->header)); |
3401 | finish_cmc_handling (cmc); | 3392 | finish_cmc_handling (cmc); |
3402 | return; | 3393 | return; |
3403 | } | 3394 | } |
@@ -3432,16 +3423,14 @@ check_dv_learn (void *cls, | |||
3432 | } | 3423 | } |
3433 | for (unsigned int i=0;i<num_hops;i++) | 3424 | for (unsigned int i=0;i<num_hops;i++) |
3434 | { | 3425 | { |
3435 | if (0 == memcmp (&dvl->initiator, | 3426 | if (0 == GNUNET_memcmp (&dvl->initiator, |
3436 | &hops[i], | 3427 | &hops[i])) |
3437 | sizeof (struct GNUNET_PeerIdentity))) | ||
3438 | { | 3428 | { |
3439 | GNUNET_break_op (0); | 3429 | GNUNET_break_op (0); |
3440 | return GNUNET_SYSERR; | 3430 | return GNUNET_SYSERR; |
3441 | } | 3431 | } |
3442 | if (0 == memcmp (&GST_my_identity, | 3432 | if (0 == GNUNET_memcmp (&GST_my_identity, |
3443 | &hops[i], | 3433 | &hops[i])) |
3444 | sizeof (struct GNUNET_PeerIdentity))) | ||
3445 | { | 3434 | { |
3446 | GNUNET_break_op (0); | 3435 | GNUNET_break_op (0); |
3447 | return GNUNET_SYSERR; | 3436 | return GNUNET_SYSERR; |
@@ -4241,9 +4230,8 @@ handle_del_queue_message (void *cls, | |||
4241 | struct Neighbour *neighbour = queue->neighbour; | 4230 | struct Neighbour *neighbour = queue->neighbour; |
4242 | 4231 | ||
4243 | if ( (dqm->qid != queue->qid) || | 4232 | if ( (dqm->qid != queue->qid) || |
4244 | (0 != memcmp (&dqm->receiver, | 4233 | (0 != GNUNET_memcmp (&dqm->receiver, |
4245 | &neighbour->pid, | 4234 | &neighbour->pid)) ) |
4246 | sizeof (struct GNUNET_PeerIdentity))) ) | ||
4247 | continue; | 4235 | continue; |
4248 | free_queue (queue); | 4236 | free_queue (queue); |
4249 | GNUNET_SERVICE_client_continue (tc->client); | 4237 | GNUNET_SERVICE_client_continue (tc->client); |
@@ -4280,9 +4268,8 @@ handle_send_message_ack (void *cls, | |||
4280 | NULL != queue; | 4268 | NULL != queue; |
4281 | queue = queue->next_client) | 4269 | queue = queue->next_client) |
4282 | { | 4270 | { |
4283 | if (0 != memcmp (&queue->neighbour->pid, | 4271 | if (0 != GNUNET_memcmp (&queue->neighbour->pid, |
4284 | &sma->receiver, | 4272 | &sma->receiver)) |
4285 | sizeof (struct GNUNET_PeerIdentity))) | ||
4286 | continue; | 4273 | continue; |
4287 | for (struct QueueEntry *qep = queue->queue_head; | 4274 | for (struct QueueEntry *qep = queue->queue_head; |
4288 | NULL != qep; | 4275 | NULL != qep; |