aboutsummaryrefslogtreecommitdiff
path: root/src/set/set_api.c
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-02-24 15:50:48 +0100
committerFlorian Dold <florian.dold@gmail.com>2017-02-24 18:10:11 +0100
commit592b43fdf3f3572892f4095808daf22010469d0b (patch)
tree74f01c52aa3a2727388f81d0b4a3fc86a08af8a9 /src/set/set_api.c
parent398c70fd7434f3f7891175be96b73191e49a0afe (diff)
downloadgnunet-592b43fdf3f3572892f4095808daf22010469d0b.tar.gz
gnunet-592b43fdf3f3572892f4095808daf22010469d0b.zip
add option parsing
Diffstat (limited to 'src/set/set_api.c')
-rw-r--r--src/set/set_api.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/set/set_api.c b/src/set/set_api.c
index c2e2cd1e9..2b09725e8 100644
--- a/src/set/set_api.c
+++ b/src/set/set_api.c
@@ -773,6 +773,7 @@ GNUNET_SET_prepare (const struct GNUNET_PeerIdentity *other_peer,
773 struct GNUNET_MQ_Envelope *mqm; 773 struct GNUNET_MQ_Envelope *mqm;
774 struct GNUNET_SET_OperationHandle *oh; 774 struct GNUNET_SET_OperationHandle *oh;
775 struct GNUNET_SET_EvaluateMessage *msg; 775 struct GNUNET_SET_EvaluateMessage *msg;
776 struct GNUNET_SET_Option *opt;
776 777
777 LOG (GNUNET_ERROR_TYPE_DEBUG, 778 LOG (GNUNET_ERROR_TYPE_DEBUG,
778 "Client prepares set operation (%d)\n", 779 "Client prepares set operation (%d)\n",
@@ -786,6 +787,25 @@ GNUNET_SET_prepare (const struct GNUNET_PeerIdentity *other_peer,
786 msg->app_id = *app_id; 787 msg->app_id = *app_id;
787 msg->result_mode = htonl (result_mode); 788 msg->result_mode = htonl (result_mode);
788 msg->target_peer = *other_peer; 789 msg->target_peer = *other_peer;
790 for (opt = options; opt->type != 0; opt++)
791 {
792 switch (opt->type)
793 {
794 case GNUNET_SET_OPTION_BYZANTINE:
795 msg->byzantine = GNUNET_YES;
796 msg->byzantine_lower_bound = opt->v.num;
797 break;
798 case GNUNET_SET_OPTION_FORCE_FULL:
799 msg->force_full = GNUNET_YES;
800 break;
801 case GNUNET_SET_OPTION_FORCE_DELTA:
802 msg->force_delta = GNUNET_YES;
803 break;
804 default:
805 LOG (GNUNET_ERROR_TYPE_ERROR,
806 "Option with type %d not recognized\n", (int) opt->type);
807 }
808 }
789 oh->conclude_mqm = mqm; 809 oh->conclude_mqm = mqm;
790 oh->request_id_addr = &msg->request_id; 810 oh->request_id_addr = &msg->request_id;
791 811