summaryrefslogtreecommitdiff
path: root/src/peerinfo-tool
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-07-07 06:27:10 +0000
committerChristian Grothoff <christian@grothoff.org>2010-07-07 06:27:10 +0000
commitac2de52a5de68f6f4f13b7aa01a481869fffc6aa (patch)
tree856c9f0b2f55f8cae99f3c7b3bf22beaecbf58da /src/peerinfo-tool
parentc1a3c11f8665432d9db6d549c28c0329668e66af (diff)
hacks from trip
Diffstat (limited to 'src/peerinfo-tool')
-rw-r--r--src/peerinfo-tool/gnunet-peerinfo.c49
-rwxr-xr-xsrc/peerinfo-tool/test_gnunet_peerinfo.py.in12
2 files changed, 9 insertions, 52 deletions
diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c
index 88bca1e7d..28f2284ce 100644
--- a/src/peerinfo-tool/gnunet-peerinfo.c
+++ b/src/peerinfo-tool/gnunet-peerinfo.c
@@ -49,7 +49,6 @@ struct PrintContext
char **address_list;
unsigned int num_addresses;
uint32_t off;
- uint32_t trust;
};
@@ -60,9 +59,8 @@ dump_pc (struct PrintContext *pc)
unsigned int i;
GNUNET_CRYPTO_hash_to_enc (&pc->peer.hashPubKey, &enc);
- printf (_("Peer `%s' with trust %8u\n"),
- (const char *) &enc,
- pc->trust);
+ printf (_("Peer `%s'\n"),
+ (const char *) &enc);
for (i=0;i<pc->num_addresses;i++)
{
printf ("\t%s\n",
@@ -156,13 +154,13 @@ print_address (void *cls,
/**
* Print information about the peer.
- * Currently prints the GNUNET_PeerIdentity, trust and the IP.
+ * Currently prints the GNUNET_PeerIdentity and the IP.
* Could of course do more (e.g. resolve via DNS).
*/
static void
print_peer_info (void *cls,
const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_HELLO_Message *hello, uint32_t trust)
+ const struct GNUNET_HELLO_Message *hello)
{
struct GNUNET_CRYPTO_HashAsciiEncoded enc;
struct PrintContext *pc;
@@ -170,22 +168,8 @@ print_peer_info (void *cls,
if (peer == NULL)
{
GNUNET_PEERINFO_disconnect (peerinfo);
- switch (trust)
- {
- case 0:
- break;
- case 1:
- fprintf (stderr,
- _("Timeout trying to interact with PEERINFO service\n"));
- break;
- case 2:
- fprintf (stderr,
- _("Error in communication with PEERINFO service\n"));
- break;
- default:
- GNUNET_break (0);
- break;
- }
+ fprintf (stderr,
+ _("Error in communication with PEERINFO service\n"));
return;
}
if (be_quiet)
@@ -196,7 +180,6 @@ print_peer_info (void *cls,
}
pc = GNUNET_malloc (sizeof (struct PrintContext));
pc->peer = *peer;
- pc->trust = trust;
GNUNET_HELLO_iterate_addresses (hello, GNUNET_NO, &count_address, pc);
if (0 == pc->off)
{
@@ -228,27 +211,10 @@ run (void *cls,
struct GNUNET_PeerIdentity pid;
struct GNUNET_CRYPTO_HashAsciiEncoded enc;
char *fn;
- int delta;
sched = s;
cfg = c;
- delta = 0;
- if ( (args[0] != NULL) &&
- (args[1] != NULL) &&
- (1 == sscanf(args[0], "%d", &delta)) &&
- (GNUNET_OK ==
- GNUNET_CRYPTO_hash_from_string (args[1],
- &pid.hashPubKey)) )
- {
- peerinfo = GNUNET_PEERINFO_connect (sched, cfg);
- GNUNET_PEERINFO_iterate (peerinfo,
- &pid,
- delta,
- GNUNET_TIME_UNIT_SECONDS,
- &print_peer_info, NULL);
- return;
- }
- else if (args[0] != NULL)
+ if (args[0] != NULL)
{
fprintf (stderr,
_("Invalid command line argument `%s'\n"),
@@ -266,7 +232,6 @@ run (void *cls,
}
(void) GNUNET_PEERINFO_iterate (peerinfo,
NULL,
- 0,
GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS, 2),
&print_peer_info, NULL);
diff --git a/src/peerinfo-tool/test_gnunet_peerinfo.py.in b/src/peerinfo-tool/test_gnunet_peerinfo.py.in
index ba542f28a..01f76aa1e 100755
--- a/src/peerinfo-tool/test_gnunet_peerinfo.py.in
+++ b/src/peerinfo-tool/test_gnunet_peerinfo.py.in
@@ -46,12 +46,12 @@ try:
os.system ('gnunet-arm -q -i transport -c test_gnunet_peerinfo_data.conf')
os.system ('sleep 1')
pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf')
- pinfo.expect (re.compile ("Peer `.*\' with trust *0\r"));
+ pinfo.expect (re.compile ("Peer `.*\'\r"));
pinfo.expect (re.compile (" *localhost:24357\r"));
pinfo.expect (pexpect.EOF);
pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf -n')
- pinfo.expect (re.compile ("Peer `.*\' with trust *0\r"));
+ pinfo.expect (re.compile ("Peer `.*\'\r"));
pinfo.expect (re.compile (" *127..*:24357\r"));
pinfo.expect (pexpect.EOF);
@@ -59,14 +59,6 @@ try:
pid = pinfo.read (-1)
pid = pid.strip ()
- pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf 4 ' + pid)
- pinfo.expect (re.compile ("Peer `" + pid + "\' with trust *4\r"));
- pinfo.expect (pexpect.EOF);
-
- pinfo = pexpect.spawn ('gnunet-peerinfo -c test_gnunet_peerinfo_data.conf -- -4 ' + pid)
- pinfo.expect (re.compile ("Peer `" + pid + "\' with trust *0\r"));
- pinfo.expect (pexpect.EOF);
-
finally:
os.system ('gnunet-arm -c test_gnunet_peerinfo_data.conf -eq')
os.system ('rm -rf /tmp/gnunet-test-peerinfo/')