diff options
author | Bart Polot <bart@net.in.tum.de> | 2015-10-06 12:03:14 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2015-10-06 12:03:14 +0000 |
commit | 79f53fe65e00a29889b290fca9c9390101ea537e (patch) | |
tree | e169fc09e181acc9d73cc51f224bbbc3898564cf /src/cadet/gnunet-service-cadet_tunnel.c | |
parent | c3c8597a4ce377b7825e4a526b7de1daeba2105d (diff) | |
download | gnunet-79f53fe65e00a29889b290fca9c9390101ea537e.tar.gz gnunet-79f53fe65e00a29889b290fca9c9390101ea537e.zip |
- Revamp traffic logging, small bugfixes, complete doxygen
Diffstat (limited to 'src/cadet/gnunet-service-cadet_tunnel.c')
-rw-r--r-- | src/cadet/gnunet-service-cadet_tunnel.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c index 987d307f0..a944f9e5f 100644 --- a/src/cadet/gnunet-service-cadet_tunnel.c +++ b/src/cadet/gnunet-service-cadet_tunnel.c | |||
@@ -2276,7 +2276,7 @@ send_kx (struct CadetTunnel *t, | |||
2276 | static void | 2276 | static void |
2277 | send_ephemeral (struct CadetTunnel *t) | 2277 | send_ephemeral (struct CadetTunnel *t) |
2278 | { | 2278 | { |
2279 | LOG (GNUNET_ERROR_TYPE_INFO, "===> EPHM for %s\n", GCT_2s (t)); | 2279 | LOG (GNUNET_ERROR_TYPE_INFO, "==> EPHM for %s\n", GCT_2s (t)); |
2280 | if (NULL != t->ephm_h) | 2280 | if (NULL != t->ephm_h) |
2281 | { | 2281 | { |
2282 | LOG (GNUNET_ERROR_TYPE_INFO, " already queued\n"); | 2282 | LOG (GNUNET_ERROR_TYPE_INFO, " already queued\n"); |
@@ -2305,7 +2305,7 @@ send_pong (struct CadetTunnel *t, uint32_t challenge) | |||
2305 | { | 2305 | { |
2306 | struct GNUNET_CADET_KX_Pong msg; | 2306 | struct GNUNET_CADET_KX_Pong msg; |
2307 | 2307 | ||
2308 | LOG (GNUNET_ERROR_TYPE_INFO, "===> PONG for %s\n", GCT_2s (t)); | 2308 | LOG (GNUNET_ERROR_TYPE_INFO, "==> PONG for %s\n", GCT_2s (t)); |
2309 | if (NULL != t->pong_h) | 2309 | if (NULL != t->pong_h) |
2310 | { | 2310 | { |
2311 | LOG (GNUNET_ERROR_TYPE_INFO, " already queued\n"); | 2311 | LOG (GNUNET_ERROR_TYPE_INFO, " already queued\n"); |
@@ -2560,7 +2560,7 @@ handle_data (struct CadetTunnel *t, | |||
2560 | } | 2560 | } |
2561 | type = ntohs (msg[1].header.type); | 2561 | type = ntohs (msg[1].header.type); |
2562 | LOG (GNUNET_ERROR_TYPE_DEBUG, " payload of type %s\n", GC_m2s (type)); | 2562 | LOG (GNUNET_ERROR_TYPE_DEBUG, " payload of type %s\n", GC_m2s (type)); |
2563 | sprintf (buf, "# received payload of type %hu", type); | 2563 | SPRINTF (buf, "# received payload of type %hu", type); |
2564 | GNUNET_STATISTICS_update (stats, buf, 1, GNUNET_NO); | 2564 | GNUNET_STATISTICS_update (stats, buf, 1, GNUNET_NO); |
2565 | 2565 | ||
2566 | 2566 | ||
@@ -2570,8 +2570,7 @@ handle_data (struct CadetTunnel *t, | |||
2570 | { | 2570 | { |
2571 | GNUNET_STATISTICS_update (stats, "# data on unknown channel", | 2571 | GNUNET_STATISTICS_update (stats, "# data on unknown channel", |
2572 | 1, GNUNET_NO); | 2572 | 1, GNUNET_NO); |
2573 | LOG (GNUNET_ERROR_TYPE_DEBUG, "WARNING channel 0x%X unknown\n", | 2573 | LOG (GNUNET_ERROR_TYPE_DEBUG, "channel 0x%X unknown\n", ntohl (msg->chid)); |
2574 | ntohl (msg->chid)); | ||
2575 | send_channel_destroy (t, ntohl (msg->chid)); | 2574 | send_channel_destroy (t, ntohl (msg->chid)); |
2576 | return; | 2575 | return; |
2577 | } | 2576 | } |
@@ -2624,8 +2623,8 @@ handle_data_ack (struct CadetTunnel *t, | |||
2624 | /** | 2623 | /** |
2625 | * Handle channel create. | 2624 | * Handle channel create. |
2626 | * | 2625 | * |
2627 | * @param t Tunnel on which the data came. | 2626 | * @param t Tunnel on which the message came. |
2628 | * @param msg Data message. | 2627 | * @param msg ChannelCreate message. |
2629 | */ | 2628 | */ |
2630 | static void | 2629 | static void |
2631 | handle_ch_create (struct CadetTunnel *t, | 2630 | handle_ch_create (struct CadetTunnel *t, |
@@ -2638,7 +2637,7 @@ handle_ch_create (struct CadetTunnel *t, | |||
2638 | size = ntohs (msg->header.size); | 2637 | size = ntohs (msg->header.size); |
2639 | if (size != sizeof (struct GNUNET_CADET_ChannelCreate)) | 2638 | if (size != sizeof (struct GNUNET_CADET_ChannelCreate)) |
2640 | { | 2639 | { |
2641 | GNUNET_break (0); | 2640 | GNUNET_break_op (0); |
2642 | return; | 2641 | return; |
2643 | } | 2642 | } |
2644 | 2643 | ||
@@ -2814,7 +2813,7 @@ static void | |||
2814 | handle_ephemeral (struct CadetTunnel *t, | 2813 | handle_ephemeral (struct CadetTunnel *t, |
2815 | const struct GNUNET_CADET_KX_Ephemeral *msg) | 2814 | const struct GNUNET_CADET_KX_Ephemeral *msg) |
2816 | { | 2815 | { |
2817 | LOG (GNUNET_ERROR_TYPE_INFO, "<=== EPHM for %s\n", GCT_2s (t)); | 2816 | LOG (GNUNET_ERROR_TYPE_INFO, "<== EPHM for %s\n", GCT_2s (t)); |
2818 | 2817 | ||
2819 | /* Some old versions are still around, don't log as error. */ | 2818 | /* Some old versions are still around, don't log as error. */ |
2820 | if (GNUNET_OK != check_ephemeral (t, msg)) | 2819 | if (GNUNET_OK != check_ephemeral (t, msg)) |
@@ -2900,7 +2899,7 @@ handle_pong (struct CadetTunnel *t, | |||
2900 | { | 2899 | { |
2901 | uint32_t challenge; | 2900 | uint32_t challenge; |
2902 | 2901 | ||
2903 | LOG (GNUNET_ERROR_TYPE_INFO, "<=== PONG for %s\n", GCT_2s (t)); | 2902 | LOG (GNUNET_ERROR_TYPE_INFO, "<== PONG for %s\n", GCT_2s (t)); |
2904 | if (NULL == t->rekey_task) | 2903 | if (NULL == t->rekey_task) |
2905 | { | 2904 | { |
2906 | GNUNET_STATISTICS_update (stats, "# duplicate PONG messages", 1, GNUNET_NO); | 2905 | GNUNET_STATISTICS_update (stats, "# duplicate PONG messages", 1, GNUNET_NO); |
@@ -2952,7 +2951,7 @@ handle_kx_ax (struct CadetTunnel *t, const struct GNUNET_CADET_AX_KX *msg) | |||
2952 | const struct GNUNET_PeerIdentity *pid; | 2951 | const struct GNUNET_PeerIdentity *pid; |
2953 | int am_I_alice; | 2952 | int am_I_alice; |
2954 | 2953 | ||
2955 | LOG (GNUNET_ERROR_TYPE_INFO, "<=== AX_KX on %s\n", GCT_2s (t)); | 2954 | LOG (GNUNET_ERROR_TYPE_INFO, "<== { AX_KX} on %s\n", GCT_2s (t)); |
2956 | 2955 | ||
2957 | if (NULL == t->ax) | 2956 | if (NULL == t->ax) |
2958 | { | 2957 | { |
@@ -3099,8 +3098,8 @@ handle_decrypted (struct CadetTunnel *t, | |||
3099 | char buf[256]; | 3098 | char buf[256]; |
3100 | 3099 | ||
3101 | type = ntohs (msgh->type); | 3100 | type = ntohs (msgh->type); |
3102 | LOG (GNUNET_ERROR_TYPE_INFO, "<=== %s on %s\n", GC_m2s (type), GCT_2s (t)); | 3101 | LOG (GNUNET_ERROR_TYPE_DEBUG, "<-- %s on %s\n", GC_m2s (type), GCT_2s (t)); |
3103 | sprintf (buf, "# received encrypted of type %hu (%s)", type, GC_m2s (type)); | 3102 | SPRINTF (buf, "# received encrypted of type %hu (%s)", type, GC_m2s (type)); |
3104 | GNUNET_STATISTICS_update (stats, buf, 1, GNUNET_NO); | 3103 | GNUNET_STATISTICS_update (stats, buf, 1, GNUNET_NO); |
3105 | 3104 | ||
3106 | switch (type) | 3105 | switch (type) |
@@ -4374,7 +4373,7 @@ GCT_send_ax_kx (struct CadetTunnel *t, int force_reply) | |||
4374 | struct GNUNET_CADET_AX_KX msg; | 4373 | struct GNUNET_CADET_AX_KX msg; |
4375 | enum GNUNET_CADET_AX_KX_Flags flags; | 4374 | enum GNUNET_CADET_AX_KX_Flags flags; |
4376 | 4375 | ||
4377 | LOG (GNUNET_ERROR_TYPE_INFO, "===> AX_KX for %s\n", GCT_2s (t)); | 4376 | LOG (GNUNET_ERROR_TYPE_INFO, "==> { AX_KX} on %s\n", GCT_2s (t)); |
4378 | if (NULL != t->ephm_h) | 4377 | if (NULL != t->ephm_h) |
4379 | { | 4378 | { |
4380 | LOG (GNUNET_ERROR_TYPE_INFO, " already queued\n"); | 4379 | LOG (GNUNET_ERROR_TYPE_INFO, " already queued\n"); |
@@ -4418,7 +4417,8 @@ GCT_resend_message (const struct GNUNET_MessageHeader *message, | |||
4418 | return; | 4417 | return; |
4419 | } | 4418 | } |
4420 | fwd = GCC_is_origin (c, GNUNET_YES); | 4419 | fwd = GCC_is_origin (c, GNUNET_YES); |
4421 | GNUNET_break (NULL == GCC_send_prebuilt_message (message, 0, 0, c, fwd, | 4420 | GNUNET_break (NULL == GCC_send_prebuilt_message (message, UINT16_MAX, 0, |
4421 | c, fwd, | ||
4422 | GNUNET_YES, NULL, NULL)); | 4422 | GNUNET_YES, NULL, NULL)); |
4423 | } | 4423 | } |
4424 | 4424 | ||