diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-05-22 13:33:29 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-05-22 13:33:29 +0000 |
commit | d2d3ea71ed0665d9790fc4a66fbbdb9db3a255fb (patch) | |
tree | 9cd170c989c848fbbdd1c2b3dc7e20e48d33b79d /src/vpn | |
parent | 37d9ce1d4544050396b44a1a1ba94429cb86267a (diff) | |
download | gnunet-d2d3ea71ed0665d9790fc4a66fbbdb9db3a255fb.tar.gz gnunet-d2d3ea71ed0665d9790fc4a66fbbdb9db3a255fb.zip |
-log conclusion of exit search
Diffstat (limited to 'src/vpn')
-rw-r--r-- | src/vpn/gnunet-service-vpn.c | 66 |
1 files changed, 35 insertions, 31 deletions
diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c index d9395cf48..a781937ca 100644 --- a/src/vpn/gnunet-service-vpn.c +++ b/src/vpn/gnunet-service-vpn.c | |||
@@ -693,6 +693,36 @@ send_to_channel (struct ChannelMessageQueueEntry *tnq, | |||
693 | 693 | ||
694 | 694 | ||
695 | /** | 695 | /** |
696 | * Output destination of a channel for diagnostics. | ||
697 | * | ||
698 | * @param de destination to process | ||
699 | * @return diagnostic string describing destination | ||
700 | */ | ||
701 | static const char * | ||
702 | print_channel_destination (const struct DestinationEntry *de) | ||
703 | { | ||
704 | static char dest[256]; | ||
705 | |||
706 | if (de->is_service) | ||
707 | { | ||
708 | GNUNET_snprintf (dest, | ||
709 | sizeof (dest), | ||
710 | "HS: %s-%s\n", | ||
711 | GNUNET_i2s (&de->details.service_destination.target), | ||
712 | GNUNET_h2s (&de->details.service_destination.service_descriptor)); | ||
713 | } | ||
714 | else | ||
715 | { | ||
716 | inet_ntop (de->details.exit_destination.af, | ||
717 | &de->details.exit_destination.ip, | ||
718 | dest, | ||
719 | sizeof (dest)); | ||
720 | } | ||
721 | return dest; | ||
722 | } | ||
723 | |||
724 | |||
725 | /** | ||
696 | * Regex has found a potential exit peer for us; consider using it. | 726 | * Regex has found a potential exit peer for us; consider using it. |
697 | * | 727 | * |
698 | * @param cls the 'struct ChannelState' | 728 | * @param cls the 'struct ChannelState' |
@@ -715,6 +745,9 @@ handle_regex_result (void *cls, | |||
715 | 745 | ||
716 | GNUNET_REGEX_search_cancel (ts->search); | 746 | GNUNET_REGEX_search_cancel (ts->search); |
717 | ts->search = NULL; | 747 | ts->search = NULL; |
748 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
749 | "Exit search for destination %s complete!\n", | ||
750 | print_channel_destination (&ts->destination), | ||
718 | switch (ts->af) | 751 | switch (ts->af) |
719 | { | 752 | { |
720 | case AF_INET: | 753 | case AF_INET: |
@@ -816,7 +849,8 @@ create_channel_to_destination (struct DestinationChannel *dt, | |||
816 | GNUNET_TUN_ipv6toregexsearch (&dt->destination->details.exit_destination.ip.v6, | 849 | GNUNET_TUN_ipv6toregexsearch (&dt->destination->details.exit_destination.ip.v6, |
817 | dt->destination_port, | 850 | dt->destination_port, |
818 | address); | 851 | address); |
819 | GNUNET_asprintf (&policy, "%s%s", | 852 | GNUNET_asprintf (&policy, |
853 | "%s%s", | ||
820 | GNUNET_APPLICATION_TYPE_EXIT_REGEX_PREFIX, | 854 | GNUNET_APPLICATION_TYPE_EXIT_REGEX_PREFIX, |
821 | address); | 855 | address); |
822 | break; | 856 | break; |
@@ -858,36 +892,6 @@ expire_channel (struct ChannelState *except) | |||
858 | 892 | ||
859 | 893 | ||
860 | /** | 894 | /** |
861 | * Output destination of a channel for diagnostics. | ||
862 | * | ||
863 | * @param de destination to process | ||
864 | * @return diagnostic string describing destination | ||
865 | */ | ||
866 | static const char * | ||
867 | print_channel_destination (const struct DestinationEntry *de) | ||
868 | { | ||
869 | static char dest[256]; | ||
870 | |||
871 | if (de->is_service) | ||
872 | { | ||
873 | GNUNET_snprintf (dest, | ||
874 | sizeof (dest), | ||
875 | "HS: %s-%s\n", | ||
876 | GNUNET_i2s (&de->details.service_destination.target), | ||
877 | GNUNET_h2s (&de->details.service_destination.service_descriptor)); | ||
878 | } | ||
879 | else | ||
880 | { | ||
881 | inet_ntop (de->details.exit_destination.af, | ||
882 | &de->details.exit_destination.ip, | ||
883 | dest, | ||
884 | sizeof (dest)); | ||
885 | } | ||
886 | return dest; | ||
887 | } | ||
888 | |||
889 | |||
890 | /** | ||
891 | * Route a packet via cadet to the given destination. | 895 | * Route a packet via cadet to the given destination. |
892 | * | 896 | * |
893 | * @param destination description of the destination | 897 | * @param destination description of the destination |