diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-09-30 11:02:19 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-09-30 11:02:19 +0000 |
commit | 814457c05d62c8f0c167c6bc2015201151355249 (patch) | |
tree | 8533c8f266ee5ebec1557bcefba78a9af70ab172 /src | |
parent | ba188e0085612a599d67de0151aa514373dbbede (diff) | |
download | gnunet-814457c05d62c8f0c167c6bc2015201151355249.tar.gz gnunet-814457c05d62c8f0c167c6bc2015201151355249.zip |
- rename to GNUNET_TESTBED_BARRIERSTATUS_*
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_testbed_service.h | 6 | ||||
-rw-r--r-- | src/testbed/gnunet-service-testbed_barriers.c | 32 | ||||
-rw-r--r-- | src/testbed/test_testbed_api_barriers.c | 8 | ||||
-rw-r--r-- | src/testbed/testbed_api_barriers.c | 12 |
4 files changed, 29 insertions, 29 deletions
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h index 9e8aabeec..fa07cc63e 100644 --- a/src/include/gnunet_testbed_service.h +++ b/src/include/gnunet_testbed_service.h | |||
@@ -1480,17 +1480,17 @@ enum GNUNET_TESTBED_BarrierStatus | |||
1480 | /** | 1480 | /** |
1481 | * Barrier initialised successfully | 1481 | * Barrier initialised successfully |
1482 | */ | 1482 | */ |
1483 | BARRIER_STATUS_INITIALISED = 1, | 1483 | GNUNET_TESTBED_BARRIERSTATUS_INITIALISED = 1, |
1484 | 1484 | ||
1485 | /** | 1485 | /** |
1486 | * Barrier is crossed | 1486 | * Barrier is crossed |
1487 | */ | 1487 | */ |
1488 | BARRIER_STATUS_CROSSED, | 1488 | GNUNET_TESTBED_BARRIERSTATUS_CROSSED, |
1489 | 1489 | ||
1490 | /** | 1490 | /** |
1491 | * Error status | 1491 | * Error status |
1492 | */ | 1492 | */ |
1493 | BARRIER_STATUS_ERROR, | 1493 | GNUNET_TESTBED_BARRIERSTATUS_ERROR, |
1494 | 1494 | ||
1495 | }; | 1495 | }; |
1496 | 1496 | ||
diff --git a/src/testbed/gnunet-service-testbed_barriers.c b/src/testbed/gnunet-service-testbed_barriers.c index 5668d03cf..c1d5036eb 100644 --- a/src/testbed/gnunet-service-testbed_barriers.c +++ b/src/testbed/gnunet-service-testbed_barriers.c | |||
@@ -394,7 +394,7 @@ cancel_wrappers (struct Barrier *barrier) | |||
394 | * @param name the barrier name | 394 | * @param name the barrier name |
395 | * @param status the status of the barrier | 395 | * @param status the status of the barrier |
396 | * @param emsg the error message; should be non-NULL for | 396 | * @param emsg the error message; should be non-NULL for |
397 | * status=BARRIER_STATUS_ERROR | 397 | * status=GNUNET_TESTBED_BARRIERSTATUS_ERROR |
398 | */ | 398 | */ |
399 | static void | 399 | static void |
400 | send_client_status_msg (struct GNUNET_SERVER_Client *client, | 400 | send_client_status_msg (struct GNUNET_SERVER_Client *client, |
@@ -406,7 +406,7 @@ send_client_status_msg (struct GNUNET_SERVER_Client *client, | |||
406 | size_t name_len; | 406 | size_t name_len; |
407 | uint16_t msize; | 407 | uint16_t msize; |
408 | 408 | ||
409 | GNUNET_assert ((NULL == emsg) || (BARRIER_STATUS_ERROR == status)); | 409 | GNUNET_assert ((NULL == emsg) || (GNUNET_TESTBED_BARRIERSTATUS_ERROR == status)); |
410 | name_len = strlen (name); | 410 | name_len = strlen (name); |
411 | msize = sizeof (struct GNUNET_TESTBED_BarrierStatusMsg) | 411 | msize = sizeof (struct GNUNET_TESTBED_BarrierStatusMsg) |
412 | + (name_len + 1) | 412 | + (name_len + 1) |
@@ -428,7 +428,7 @@ send_client_status_msg (struct GNUNET_SERVER_Client *client, | |||
428 | * | 428 | * |
429 | * @param barrier the corresponding barrier | 429 | * @param barrier the corresponding barrier |
430 | * @param emsg the error message; should be non-NULL for | 430 | * @param emsg the error message; should be non-NULL for |
431 | * status=BARRIER_STATUS_ERROR | 431 | * status=GNUNET_TESTBED_BARRIERSTATUS_ERROR |
432 | */ | 432 | */ |
433 | static void | 433 | static void |
434 | send_barrier_status_msg (struct Barrier *barrier, const char *emsg) | 434 | send_barrier_status_msg (struct Barrier *barrier, const char *emsg) |
@@ -503,7 +503,7 @@ handle_barrier_wait (void *cls, struct GNUNET_SERVER_Client *client, | |||
503 | if ((barrier->num_wbarriers_reached == barrier->num_wbarriers) | 503 | if ((barrier->num_wbarriers_reached == barrier->num_wbarriers) |
504 | && (LOCAL_QUORUM_REACHED (barrier))) | 504 | && (LOCAL_QUORUM_REACHED (barrier))) |
505 | { | 505 | { |
506 | barrier->status = BARRIER_STATUS_CROSSED; | 506 | barrier->status = GNUNET_TESTBED_BARRIERSTATUS_CROSSED; |
507 | send_barrier_status_msg (barrier, NULL); | 507 | send_barrier_status_msg (barrier, NULL); |
508 | } | 508 | } |
509 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 509 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
@@ -596,18 +596,18 @@ wbarrier_status_cb (void *cls, const char *name, | |||
596 | GNUNET_free (wrapper); | 596 | GNUNET_free (wrapper); |
597 | switch (status) | 597 | switch (status) |
598 | { | 598 | { |
599 | case BARRIER_STATUS_ERROR: | 599 | case GNUNET_TESTBED_BARRIERSTATUS_ERROR: |
600 | LOG (GNUNET_ERROR_TYPE_ERROR, | 600 | LOG (GNUNET_ERROR_TYPE_ERROR, |
601 | "Initialising barrier `%s' failed at a sub-controller: %s\n", | 601 | "Initialising barrier `%s' failed at a sub-controller: %s\n", |
602 | barrier->name, (NULL != emsg) ? emsg : "NULL"); | 602 | barrier->name, (NULL != emsg) ? emsg : "NULL"); |
603 | cancel_wrappers (barrier); | 603 | cancel_wrappers (barrier); |
604 | if (NULL == emsg) | 604 | if (NULL == emsg) |
605 | emsg = "Initialisation failed at a sub-controller"; | 605 | emsg = "Initialisation failed at a sub-controller"; |
606 | barrier->status = BARRIER_STATUS_ERROR; | 606 | barrier->status = GNUNET_TESTBED_BARRIERSTATUS_ERROR; |
607 | send_barrier_status_msg (barrier, emsg); | 607 | send_barrier_status_msg (barrier, emsg); |
608 | return; | 608 | return; |
609 | case BARRIER_STATUS_CROSSED: | 609 | case GNUNET_TESTBED_BARRIERSTATUS_CROSSED: |
610 | if (BARRIER_STATUS_INITIALISED != barrier->status) | 610 | if (GNUNET_TESTBED_BARRIERSTATUS_INITIALISED != barrier->status) |
611 | { | 611 | { |
612 | GNUNET_break_op (0); | 612 | GNUNET_break_op (0); |
613 | return; | 613 | return; |
@@ -616,11 +616,11 @@ wbarrier_status_cb (void *cls, const char *name, | |||
616 | if ((barrier->num_wbarriers_reached == barrier->num_wbarriers) | 616 | if ((barrier->num_wbarriers_reached == barrier->num_wbarriers) |
617 | && (LOCAL_QUORUM_REACHED (barrier))) | 617 | && (LOCAL_QUORUM_REACHED (barrier))) |
618 | { | 618 | { |
619 | barrier->status = BARRIER_STATUS_CROSSED; | 619 | barrier->status = GNUNET_TESTBED_BARRIERSTATUS_CROSSED; |
620 | send_barrier_status_msg (barrier, NULL); | 620 | send_barrier_status_msg (barrier, NULL); |
621 | } | 621 | } |
622 | return; | 622 | return; |
623 | case BARRIER_STATUS_INITIALISED: | 623 | case GNUNET_TESTBED_BARRIERSTATUS_INITIALISED: |
624 | if (0 != barrier->status) | 624 | if (0 != barrier->status) |
625 | { | 625 | { |
626 | GNUNET_break_op (0); | 626 | GNUNET_break_op (0); |
@@ -629,7 +629,7 @@ wbarrier_status_cb (void *cls, const char *name, | |||
629 | barrier->num_wbarriers_inited++; | 629 | barrier->num_wbarriers_inited++; |
630 | if (barrier->num_wbarriers_inited == barrier->num_wbarriers) | 630 | if (barrier->num_wbarriers_inited == barrier->num_wbarriers) |
631 | { | 631 | { |
632 | barrier->status = BARRIER_STATUS_INITIALISED; | 632 | barrier->status = GNUNET_TESTBED_BARRIERSTATUS_INITIALISED; |
633 | send_barrier_status_msg (barrier, NULL); | 633 | send_barrier_status_msg (barrier, NULL); |
634 | } | 634 | } |
635 | return; | 635 | return; |
@@ -650,7 +650,7 @@ fwd_tout_barrier_init (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
650 | struct Barrier *barrier = cls; | 650 | struct Barrier *barrier = cls; |
651 | 651 | ||
652 | cancel_wrappers (barrier); | 652 | cancel_wrappers (barrier); |
653 | barrier->status = BARRIER_STATUS_ERROR; | 653 | barrier->status = GNUNET_TESTBED_BARRIERSTATUS_ERROR; |
654 | send_barrier_status_msg (barrier, | 654 | send_barrier_status_msg (barrier, |
655 | "Timedout while propagating barrier initialisation\n"); | 655 | "Timedout while propagating barrier initialisation\n"); |
656 | remove_barrier (barrier); | 656 | remove_barrier (barrier); |
@@ -711,7 +711,7 @@ GST_handle_barrier_init (void *cls, struct GNUNET_SERVER_Client *client, | |||
711 | if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (barrier_map, &hash)) | 711 | if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (barrier_map, &hash)) |
712 | { | 712 | { |
713 | 713 | ||
714 | send_client_status_msg (client, name, BARRIER_STATUS_ERROR, | 714 | send_client_status_msg (client, name, GNUNET_TESTBED_BARRIERSTATUS_ERROR, |
715 | "A barrier with the same name already exists"); | 715 | "A barrier with the same name already exists"); |
716 | GNUNET_free (name); | 716 | GNUNET_free (name); |
717 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 717 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
@@ -751,8 +751,8 @@ GST_handle_barrier_init (void *cls, struct GNUNET_SERVER_Client *client, | |||
751 | } | 751 | } |
752 | if (NULL == barrier->whead) /* No further propagation */ | 752 | if (NULL == barrier->whead) /* No further propagation */ |
753 | { | 753 | { |
754 | barrier->status = BARRIER_STATUS_INITIALISED; | 754 | barrier->status = GNUNET_TESTBED_BARRIERSTATUS_INITIALISED; |
755 | LOG_DEBUG ("Sending BARRIER_STATUS_INITIALISED for barrier `%s'\n", | 755 | LOG_DEBUG ("Sending GNUNET_TESTBED_BARRIERSTATUS_INITIALISED for barrier `%s'\n", |
756 | barrier->name); | 756 | barrier->name); |
757 | send_barrier_status_msg (barrier, NULL); | 757 | send_barrier_status_msg (barrier, NULL); |
758 | }else | 758 | }else |
@@ -866,7 +866,7 @@ GST_handle_barrier_status (void *cls, struct GNUNET_SERVER_Client *client, | |||
866 | } | 866 | } |
867 | msg = (const struct GNUNET_TESTBED_BarrierStatusMsg *) message; | 867 | msg = (const struct GNUNET_TESTBED_BarrierStatusMsg *) message; |
868 | status = ntohs (msg->status); | 868 | status = ntohs (msg->status); |
869 | if (BARRIER_STATUS_CROSSED != status) | 869 | if (GNUNET_TESTBED_BARRIERSTATUS_CROSSED != status) |
870 | { | 870 | { |
871 | GNUNET_break_op (0); /* current we only expect BARRIER_CROSSED | 871 | GNUNET_break_op (0); /* current we only expect BARRIER_CROSSED |
872 | status message this way */ | 872 | status message this way */ |
diff --git a/src/testbed/test_testbed_api_barriers.c b/src/testbed/test_testbed_api_barriers.c index a0c6230b4..2fbd6ea81 100644 --- a/src/testbed/test_testbed_api_barriers.c +++ b/src/testbed/test_testbed_api_barriers.c | |||
@@ -104,19 +104,19 @@ barrier_cb (void *cls, | |||
104 | GNUNET_assert (_barrier == barrier); | 104 | GNUNET_assert (_barrier == barrier); |
105 | switch (status) | 105 | switch (status) |
106 | { | 106 | { |
107 | case BARRIER_STATUS_INITIALISED: | 107 | case GNUNET_TESTBED_BARRIERSTATUS_INITIALISED: |
108 | LOG (GNUNET_ERROR_TYPE_INFO, "Barrier initialised\n"); | 108 | LOG (GNUNET_ERROR_TYPE_INFO, "Barrier initialised\n"); |
109 | old_status = status; | 109 | old_status = status; |
110 | return; | 110 | return; |
111 | case BARRIER_STATUS_ERROR: | 111 | case GNUNET_TESTBED_BARRIERSTATUS_ERROR: |
112 | LOG (GNUNET_ERROR_TYPE_ERROR, "Barrier initialisation failed: %s", | 112 | LOG (GNUNET_ERROR_TYPE_ERROR, "Barrier initialisation failed: %s", |
113 | (NULL == emsg) ? "unknown reason" : emsg); | 113 | (NULL == emsg) ? "unknown reason" : emsg); |
114 | barrier = NULL; | 114 | barrier = NULL; |
115 | GNUNET_SCHEDULER_shutdown (); | 115 | GNUNET_SCHEDULER_shutdown (); |
116 | return; | 116 | return; |
117 | case BARRIER_STATUS_CROSSED: | 117 | case GNUNET_TESTBED_BARRIERSTATUS_CROSSED: |
118 | LOG (GNUNET_ERROR_TYPE_INFO, "Barrier crossed\n"); | 118 | LOG (GNUNET_ERROR_TYPE_INFO, "Barrier crossed\n"); |
119 | if (old_status == BARRIER_STATUS_INITIALISED) | 119 | if (old_status == GNUNET_TESTBED_BARRIERSTATUS_INITIALISED) |
120 | result = GNUNET_OK; | 120 | result = GNUNET_OK; |
121 | barrier = NULL; | 121 | barrier = NULL; |
122 | GNUNET_SCHEDULER_shutdown (); | 122 | GNUNET_SCHEDULER_shutdown (); |
diff --git a/src/testbed/testbed_api_barriers.c b/src/testbed/testbed_api_barriers.c index 9c7ee533c..2a197719f 100644 --- a/src/testbed/testbed_api_barriers.c +++ b/src/testbed/testbed_api_barriers.c | |||
@@ -148,7 +148,7 @@ GNUNET_TESTBED_handle_barrier_status_ (struct GNUNET_TESTBED_Controller *c, | |||
148 | return GNUNET_SYSERR; | 148 | return GNUNET_SYSERR; |
149 | } | 149 | } |
150 | status = ntohs (msg->status); | 150 | status = ntohs (msg->status); |
151 | if (BARRIER_STATUS_ERROR == status) | 151 | if (GNUNET_TESTBED_BARRIERSTATUS_ERROR == status) |
152 | { | 152 | { |
153 | status = -1; | 153 | status = -1; |
154 | emsg_len = msize - (sizeof (struct GNUNET_TESTBED_BarrierStatusMsg) + name_len | 154 | emsg_len = msize - (sizeof (struct GNUNET_TESTBED_BarrierStatusMsg) + name_len |
@@ -177,10 +177,10 @@ GNUNET_TESTBED_handle_barrier_status_ (struct GNUNET_TESTBED_Controller *c, | |||
177 | goto cleanup; | 177 | goto cleanup; |
178 | } | 178 | } |
179 | GNUNET_assert (NULL != barrier->cb); | 179 | GNUNET_assert (NULL != barrier->cb); |
180 | if ((GNUNET_YES == barrier->echo) && (BARRIER_STATUS_CROSSED == status)) | 180 | if ((GNUNET_YES == barrier->echo) && (GNUNET_TESTBED_BARRIERSTATUS_CROSSED == status)) |
181 | GNUNET_TESTBED_queue_message_ (c, GNUNET_copy_message (&msg->header)); | 181 | GNUNET_TESTBED_queue_message_ (c, GNUNET_copy_message (&msg->header)); |
182 | barrier->cb (barrier->cls, name, barrier, status, emsg); | 182 | barrier->cb (barrier->cls, name, barrier, status, emsg); |
183 | if (BARRIER_STATUS_INITIALISED == status) | 183 | if (GNUNET_TESTBED_BARRIERSTATUS_INITIALISED == status) |
184 | return GNUNET_OK; /* just initialised; skip cleanup */ | 184 | return GNUNET_OK; /* just initialised; skip cleanup */ |
185 | 185 | ||
186 | cleanup: | 186 | cleanup: |
@@ -396,12 +396,12 @@ receive_handler (void *cls, const struct GNUNET_MessageHeader *message) | |||
396 | msg = (const struct GNUNET_TESTBED_BarrierStatusMsg *) message; | 396 | msg = (const struct GNUNET_TESTBED_BarrierStatusMsg *) message; |
397 | switch (ntohs (msg->status)) | 397 | switch (ntohs (msg->status)) |
398 | { | 398 | { |
399 | case BARRIER_STATUS_ERROR: | 399 | case GNUNET_TESTBED_BARRIERSTATUS_ERROR: |
400 | goto fail; | 400 | goto fail; |
401 | case BARRIER_STATUS_INITIALISED: | 401 | case GNUNET_TESTBED_BARRIERSTATUS_INITIALISED: |
402 | GNUNET_break (0); /* FIXME */ | 402 | GNUNET_break (0); /* FIXME */ |
403 | goto destroy; | 403 | goto destroy; |
404 | case BARRIER_STATUS_CROSSED: | 404 | case GNUNET_TESTBED_BARRIERSTATUS_CROSSED: |
405 | h->cb (h->cls, h->name, GNUNET_OK); | 405 | h->cb (h->cls, h->name, GNUNET_OK); |
406 | goto destroy; | 406 | goto destroy; |
407 | default: | 407 | default: |