donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

commit 9e2cd9a2f9564974e777024f0f847c2aa197557f
parent aa643b57aa986fe5ad905a737721f02ab794e05b
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
Date:   Tue, 12 Dec 2023 11:42:34 +0100

[donau] rename from TEH to DH

Diffstat:
Msrc/donau/donau-httpd.c | 220++++++++++++++++++++++++++++++++++++++++----------------------------------------
Msrc/donau/donau-httpd.h | 56++++++++++++++++++++++++++++----------------------------
Msrc/donau/donau-httpd_batch-issue_receipts.c | 84++++++++++++++++++++++++++++++++++++++++----------------------------------------
Msrc/donau/donau-httpd_batch-issue_receipts.h | 2+-
Msrc/donau/donau-httpd_batch-submit_receipts.c | 44++++++++++++++++++++++----------------------
Msrc/donau/donau-httpd_batch-submit_receipts.h | 2+-
Msrc/donau/donau-httpd_charities_close.c | 30+++++++++++++++---------------
Msrc/donau/donau-httpd_charities_close.h | 2+-
Msrc/donau/donau-httpd_charities_get.c | 16++++++++--------
Msrc/donau/donau-httpd_charities_get.h | 4++--
Msrc/donau/donau-httpd_charities_history.c | 22+++++++++++-----------
Msrc/donau/donau-httpd_charities_history.h | 2+-
Msrc/donau/donau-httpd_charities_open.c | 42+++++++++++++++++++++---------------------
Msrc/donau/donau-httpd_charities_open.h | 2+-
Msrc/donau/donau-httpd_charities_status.c | 14+++++++-------
Msrc/donau/donau-httpd_charities_status.h | 2+-
Msrc/donau/donau-httpd_common_submit_receipts.c | 30+++++++++++++++---------------
Msrc/donau/donau-httpd_common_submit_receipts.h | 12++++++------
Msrc/donau/donau-httpd_config.c | 4++--
Msrc/donau/donau-httpd_config.h | 2+-
Msrc/donau/donau-httpd_csr.c | 48++++++++++++++++++++++++------------------------
Msrc/donau/donau-httpd_csr.h | 4++--
Msrc/donau/donau-httpd_db.c | 34+++++++++++++++++-----------------
Msrc/donau/donau-httpd_db.h | 10+++++-----
Msrc/donau/donau-httpd_issue_receipts.c | 80++++++++++++++++++++++++++++++++++++++++----------------------------------------
Msrc/donau/donau-httpd_issue_receipts.h | 2+-
Msrc/donau/donau-httpd_keys.c | 360++++++++++++++++++++++++++++++++++++++++----------------------------------------
Msrc/donau/donau-httpd_metrics.c | 68++++++++++++++++++++++++++++++++++----------------------------------
Msrc/donau/donau-httpd_metrics.h | 86++++++++++++++++++++++++++++++++++++++++----------------------------------------
Msrc/donau/donau-httpd_mhd.c | 6+++---
Msrc/donau/donau-httpd_mhd.h | 4++--
Msrc/donau/donau-httpd_responses.c | 24++++++++++++------------
Msrc/donau/donau-httpd_responses.h | 24++++++++++++------------
Msrc/donau/donau-httpd_submit_receipts_get.c | 24++++++++++++------------
Msrc/donau/donau-httpd_submit_receipts_get.h | 4++--
Msrc/donau/donau-httpd_terms.c | 6+++---
Msrc/donau/donau-httpd_terms.h | 6+++---
Msrc/donaudb/pg_activate_signing_key.c | 2+-
Msrc/donaudb/pg_activate_signing_key.h | 2+-
Msrc/donaudb/pg_add_donation_unit_key.c | 2+-
Msrc/donaudb/pg_add_donation_unit_key.h | 2+-
Msrc/donaudb/pg_commit.c | 2+-
Msrc/donaudb/pg_commit.h | 2+-
Msrc/donaudb/pg_create_tables.c | 2+-
Msrc/donaudb/pg_create_tables.h | 2+-
Msrc/donaudb/pg_drop_tables.c | 2+-
Msrc/donaudb/pg_drop_tables.h | 2+-
Msrc/donaudb/pg_event_listen.c | 2+-
Msrc/donaudb/pg_event_listen.h | 2+-
Msrc/donaudb/pg_event_listen_cancel.c | 2+-
Msrc/donaudb/pg_event_listen_cancel.h | 2+-
Msrc/donaudb/pg_event_notify.c | 2+-
Msrc/donaudb/pg_event_notify.h | 2+-
Msrc/donaudb/pg_get_donation_unit_info.c | 2+-
Msrc/donaudb/pg_get_donation_unit_info.h | 2+-
Msrc/donaudb/pg_insert_charity.c | 2+-
Msrc/donaudb/pg_insert_charity.h | 2+-
Msrc/donaudb/pg_insert_history_entry.c | 2+-
Msrc/donaudb/pg_insert_history_entry.h | 2+-
Msrc/donaudb/pg_insert_issued_receipt.c | 2+-
Msrc/donaudb/pg_insert_issued_receipt.h | 2+-
Msrc/donaudb/pg_insert_submitted_receipt.c | 2+-
Msrc/donaudb/pg_insert_submitted_receipt.h | 2+-
Msrc/donaudb/pg_lookup_donation_unit_key.c | 2+-
Msrc/donaudb/pg_lookup_donation_unit_key.h | 2+-
Msrc/donaudb/pg_lookup_signing_key.c | 2+-
Msrc/donaudb/pg_lookup_signing_key.h | 2+-
Msrc/donaudb/pg_preflight.c | 6+++---
Msrc/donaudb/pg_preflight.h | 2+-
Msrc/donaudb/pg_rollback.c | 2+-
Msrc/donaudb/pg_rollback.h | 2+-
Msrc/donaudb/pg_start.c | 4++--
Msrc/donaudb/pg_start.h | 2+-
Msrc/donaudb/pg_start_read_committed.c | 4++--
Msrc/donaudb/pg_start_read_committed.h | 2+-
Msrc/donaudb/pg_start_read_only.c | 4++--
Msrc/donaudb/pg_start_read_only.h | 2+-
Msrc/donaudb/pg_template.sh | 2+-
Msrc/donaudb/plugin_donaudb_postgres.c | 10+++++-----
Msrc/include/donaudb_plugin.h | 4++--
Msrc/lib/donau_api_batch_issue_receipts2.c | 2+-
Msrc/lib/donau_api_batch_submit_receipts.c | 2+-
Msrc/lib/donau_api_charities_close.c | 2+-
Msrc/lib/donau_api_charities_history.c | 2+-
Msrc/lib/donau_api_charities_open.c | 2+-
Msrc/lib/donau_api_charities_status.c | 2+-
Msrc/lib/donau_api_csr_issue_receipts.c | 2+-
Msrc/lib/donau_api_issue_receipts2.c | 2+-
Msrc/lib/donau_api_submit_receipts_get.c | 2+-
89 files changed, 753 insertions(+), 753 deletions(-)

diff --git a/src/donau/donau-httpd.c b/src/donau/donau-httpd.c @@ -58,7 +58,7 @@ * as building new /keys responses is expensive. Should only be * enabled for testcases, development and test systems. */ -int TEH_allow_keys_timetravel; +int DH_allow_keys_timetravel; /** * Should we allow two HTTPDs to bind to the same port? @@ -68,15 +68,15 @@ static int allow_address_reuse; /** * The donau's configuration (global) */ -const struct GNUNET_CONFIGURATION_Handle *TEH_cfg; +const struct GNUNET_CONFIGURATION_Handle *DH_cfg; /** * Configuration of age restriction * * Set after loading the library, enabled in database event handler. */ -bool TEH_age_restriction_enabled = false; -struct TALER_AgeRestrictionConfig TEH_age_restriction_config = {0}; +bool DH_age_restriction_enabled = false; +struct TALER_AgeRestrictionConfig DH_age_restriction_config = {0}; /** * Handle to the HTTP server. @@ -86,76 +86,76 @@ static struct MHD_Daemon *mhd; /** * How long is caching /keys allowed at most? (global) */ -struct GNUNET_TIME_Relative TEH_max_keys_caching; +struct GNUNET_TIME_Relative DH_max_keys_caching; /** * How long is the delay before we close reserves? */ -struct GNUNET_TIME_Relative TEH_reserve_closing_delay; +struct GNUNET_TIME_Relative DH_reserve_closing_delay; /** * Master public key (according to the * configuration in the donau directory). (global) */ -struct TALER_MasterPublicKeyP TEH_master_public_key; +struct TALER_MasterPublicKeyP DH_master_public_key; /** * Key used to encrypt KYC attribute data in our database. */ -struct TALER_AttributeEncryptionKeyP TEH_attribute_key; +struct TALER_AttributeEncryptionKeyP DH_attribute_key; /** * Our DB plugin. (global) */ -struct DONAUDB_Plugin *TEH_plugin; +struct DONAUDB_Plugin *DH_plugin; /** * Absolute STEFAN parameter. */ -struct TALER_Amount TEH_stefan_abs; +struct TALER_Amount DH_stefan_abs; /** * Logarithmic STEFAN parameter. */ -struct TALER_Amount TEH_stefan_log; +struct TALER_Amount DH_stefan_log; /** * Linear STEFAN parameter. */ -struct TALER_Amount TEH_stefan_lin; +struct TALER_Amount DH_stefan_lin; /** * Default number of fractional digits to render * amounts with. */ -unsigned int TEH_currency_fraction_digits; +unsigned int DH_currency_fraction_digits; /** * Our currency. */ -char *TEH_currency; +char *DH_currency; /** * Name of the KYC-AML-trigger evaluation binary. */ -char *TEH_kyc_aml_trigger; +char *DH_kyc_aml_trigger; /** * Option set to #GNUNET_YES if rewards are enabled. */ -int TEH_enable_rewards; +int DH_enable_rewards; /** * What is the largest amount we allow a peer to * merge into a reserve before always triggering * an AML check? */ -struct TALER_Amount TEH_aml_threshold; +struct TALER_Amount DH_aml_threshold; /** * Our base URL. */ -char *TEH_base_url; +char *DH_base_url; /** * Default timeout in seconds for HTTP requests. @@ -170,21 +170,21 @@ static int connection_close; /** * -I command-line flag given? */ -int TEH_check_invariants_flag; +int DH_check_invariants_flag; /** * True if we should commit suicide once all active * connections are finished. */ -bool TEH_suicide; +bool DH_suicide; /** * Signature of the configuration of all enabled extensions, * signed by the donau's offline master key with purpose * TALER_SIGNATURE_MASTER_EXTENSION. */ -struct TALER_MasterSignatureP TEH_extensions_sig; -bool TEH_extensions_signed = false; +struct TALER_MasterSignatureP DH_extensions_sig; +bool DH_extensions_signed = false; /** * Value to return from main() @@ -216,10 +216,10 @@ static unsigned long long req_max; /** * Context for all CURL operations (useful to the event loop) */ -struct GNUNET_CURL_Context *TEH_curl_ctx; +struct GNUNET_CURL_Context *DH_curl_ctx; /** - * Context for integrating #TEH_curl_ctx with the + * Context for integrating #DH_curl_ctx with the * GNUnet event loop. */ static struct GNUNET_CURL_RescheduleContext *donau_curl_rc; @@ -285,10 +285,10 @@ handle_mhd_completion_callback (void *cls, GNUNET_async_scope_enter (&rc->async_scope_id, &old_scope); //check_suicide (); - //TEH_check_invariants (); + //DH_check_invariants (); if (NULL != rc->rh_cleaner) rc->rh_cleaner (rc); - //TEH_check_invariants (); + //DH_check_invariants (); { #if MHD_VERSION >= 0x00097304 const union MHD_ConnectionInfo *ci; @@ -315,7 +315,7 @@ handle_mhd_completion_callback (void *cls, TALER_MHD_parse_post_cleanup_callback (rc->opaque_post_parsing_context); /* Sanity-check that we didn't leave any transactions hanging */ GNUNET_break (GNUNET_OK == - TEH_plugin->preflight (TEH_plugin->cls)); + DH_plugin->preflight (DH_plugin->cls)); { struct GNUNET_TIME_Relative latency; @@ -351,7 +351,7 @@ proceed_with_handler (struct DH_RequestContext *rc, const char *upload_data, size_t *upload_data_size) { - const struct TEH_RequestHandler *rh = rc->rh; + const struct DH_RequestHandler *rh = rc->rh; const char *args[rh->nargs + 2]; size_t ulen = strlen (url) + 1; json_t *root = NULL; @@ -518,12 +518,12 @@ handle_mhd_request (void *cls, size_t *upload_data_size, void **con_cls) { - static struct TEH_RequestHandler handlers[] = { + static struct DH_RequestHandler handlers[] = { /* /robots.txt: disallow everything */ { .url = "robots.txt", .method = MHD_HTTP_METHOD_GET, - //.handler.get = &TEH_handler_static_response, + //.handler.get = &DH_handler_static_response, .mime_type = "text/plain", .data = "User-agent: *\nDisallow: /\n", .response_code = MHD_HTTP_OK @@ -532,7 +532,7 @@ handle_mhd_request (void *cls, { .url = "", .method = MHD_HTTP_METHOD_GET, - //.handler.get = TEH_handler_static_response, + //.handler.get = DH_handler_static_response, .mime_type = "text/plain", .data = "Hello, I'm the Taler donau. This HTTP server is not for humans.\n", @@ -545,7 +545,7 @@ handle_mhd_request (void *cls, { .url = "agpl", .method = MHD_HTTP_METHOD_GET, - //.handler.get = &TEH_handler_agpl_redirect + //.handler.get = &DH_handler_agpl_redirect }, { .url = "seed", @@ -556,37 +556,37 @@ handle_mhd_request (void *cls, { .url = "config", .method = MHD_HTTP_METHOD_GET, - //.handler.get = &TEH_handler_config + //.handler.get = &DH_handler_config }, /* Performance metrics */ { .url = "metrics", .method = MHD_HTTP_METHOD_GET, - //.handler.get = &TEH_handler_metrics + //.handler.get = &DH_handler_metrics }, /* Terms of service */ { .url = "terms", .method = MHD_HTTP_METHOD_GET, - //.handler.get = &TEH_handler_terms + //.handler.get = &DH_handler_terms }, /* Privacy policy */ { .url = "privacy", .method = MHD_HTTP_METHOD_GET, - //.handler.get = &TEH_handler_privacy + //.handler.get = &DH_handler_privacy }, /* Return key material and fundamental properties for this donau */ { .url = "keys", .method = MHD_HTTP_METHOD_GET, - //.handler.get = &TEH_keys_get_handler, + //.handler.get = &DH_keys_get_handler, }, /* request R, used in clause schnorr withdraw and refresh */ { .url = "csr-melt", .method = MHD_HTTP_METHOD_POST, - //.handler.post = &TEH_handler_csr_melt, + //.handler.post = &DH_handler_csr_melt, .nargs = 0 }, @@ -611,7 +611,7 @@ handle_mhd_request (void *cls, rc = *con_cls = GNUNET_new (struct DH_RequestContext); rc->start_time = GNUNET_TIME_absolute_get (); GNUNET_async_scope_fresh (&rc->async_scope_id); - //TEH_check_invariants (); + //DH_check_invariants (); rc->url = url; rc->connection = connection; /* We only read the correlation ID on the first callback for every client */ @@ -638,7 +638,7 @@ handle_mhd_request (void *cls, GNUNET_async_scope_enter (&rc->async_scope_id, &old_scope); - //TEH_check_invariants (); + //DH_check_invariants (); if (NULL != correlation_id) GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Handling request (%s) for URL '%s', correlation_id=%s\n", @@ -703,7 +703,7 @@ handle_mhd_request (void *cls, } for (unsigned int i = 0; NULL != handlers[i].url; i++) { - struct TEH_RequestHandler *rh = &handlers[i]; + struct DH_RequestHandler *rh = &handlers[i]; if ( (0 != strncmp (tok, rh->url, @@ -746,7 +746,7 @@ handle_mhd_request (void *cls, GNUNET_break_op (0); for (unsigned int i = 0; NULL != handlers[i].url; i++) { - struct TEH_RequestHandler *rh = &handlers[i]; + struct DH_RequestHandler *rh = &handlers[i]; if ( (0 != strncmp (tok, rh->url, @@ -820,7 +820,7 @@ static enum GNUNET_GenericReturnValue donau_serve_process_config (void) { if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_number (TEH_cfg, + GNUNET_CONFIGURATION_get_value_number (DH_cfg, "donau", "MAX_REQUESTS", &req_max)) @@ -828,25 +828,25 @@ donau_serve_process_config (void) req_max = ULLONG_MAX; } if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_time (TEH_cfg, + GNUNET_CONFIGURATION_get_value_time (DH_cfg, "donaudb", "IDLE_RESERVE_EXPIRATION_TIME", - &TEH_reserve_closing_delay)) + &DH_reserve_closing_delay)) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "donaudb", "IDLE_RESERVE_EXPIRATION_TIME"); /* use default */ - TEH_reserve_closing_delay + DH_reserve_closing_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_WEEKS, 4); } if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_time (TEH_cfg, + GNUNET_CONFIGURATION_get_value_time (DH_cfg, "donau", "MAX_KEYS_CACHING", - &TEH_max_keys_caching)) + &DH_max_keys_caching)) { GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, "donau", @@ -855,10 +855,10 @@ donau_serve_process_config (void) return GNUNET_SYSERR; } if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_string (TEH_cfg, + GNUNET_CONFIGURATION_get_value_string (DH_cfg, "donau", "KYC_AML_TRIGGER", - &TEH_kyc_aml_trigger)) + &DH_kyc_aml_trigger)) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "donau", @@ -866,8 +866,8 @@ donau_serve_process_config (void) return GNUNET_SYSERR; } if (GNUNET_OK != - TALER_config_get_currency (TEH_cfg, - &TEH_currency)) + TALER_config_get_currency (DH_cfg, + &DH_currency)) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "taler", @@ -878,7 +878,7 @@ donau_serve_process_config (void) unsigned long long cfd; if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_number (TEH_cfg, + GNUNET_CONFIGURATION_get_value_number (DH_cfg, "donau", "CURRENCY_FRACTION_DIGITS", &cfd)) @@ -891,79 +891,79 @@ donau_serve_process_config (void) "Value must be below 8"); return GNUNET_SYSERR; } - TEH_currency_fraction_digits = (unsigned int) cfd; + DH_currency_fraction_digits = (unsigned int) cfd; } if (GNUNET_OK != - TALER_config_get_amount (TEH_cfg, + TALER_config_get_amount (DH_cfg, "donau", "AML_THRESHOLD", - &TEH_aml_threshold)) + &DH_aml_threshold)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Need amount in section `donau' under `AML_THRESHOLD'\n"); return GNUNET_SYSERR; } if (GNUNET_OK != - TALER_config_get_amount (TEH_cfg, + TALER_config_get_amount (DH_cfg, "donau", "STEFAN_ABS", - &TEH_stefan_abs)) + &DH_stefan_abs)) { GNUNET_assert (GNUNET_OK == - TALER_amount_set_zero (TEH_currency, - &TEH_stefan_abs)); + TALER_amount_set_zero (DH_currency, + &DH_stefan_abs)); } if (GNUNET_OK != - TALER_config_get_amount (TEH_cfg, + TALER_config_get_amount (DH_cfg, "donau", "STEFAN_LOG", - &TEH_stefan_log)) + &DH_stefan_log)) { GNUNET_assert (GNUNET_OK == - TALER_amount_set_zero (TEH_currency, - &TEH_stefan_log)); + TALER_amount_set_zero (DH_currency, + &DH_stefan_log)); } if (GNUNET_OK != - TALER_config_get_amount (TEH_cfg, + TALER_config_get_amount (DH_cfg, "donau", "STEFAN_LIN", - &TEH_stefan_lin)) + &DH_stefan_lin)) { GNUNET_assert (GNUNET_OK == - TALER_amount_set_zero (TEH_currency, - &TEH_stefan_lin)); + TALER_amount_set_zero (DH_currency, + &DH_stefan_lin)); } - if (0 != strcmp (TEH_currency, - TEH_aml_threshold.currency)) + if (0 != strcmp (DH_currency, + DH_aml_threshold.currency)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Amount in section `donau' under `AML_THRESHOLD' uses the wrong currency!\n"); return GNUNET_SYSERR; } - TEH_enable_rewards + DH_enable_rewards = GNUNET_CONFIGURATION_get_value_yesno ( - TEH_cfg, + DH_cfg, "donau", "ENABLE_REWARDS"); - if (GNUNET_SYSERR == TEH_enable_rewards) + if (GNUNET_SYSERR == DH_enable_rewards) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Need YES or NO in section `donau' under `ENABLE_REWARDS'\n"); return GNUNET_SYSERR; } if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_string (TEH_cfg, + GNUNET_CONFIGURATION_get_value_string (DH_cfg, "donau", "BASE_URL", - &TEH_base_url)) + &DH_base_url)) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "donau", "BASE_URL"); return GNUNET_SYSERR; } - if (! TALER_url_valid_charset (TEH_base_url)) + if (! TALER_url_valid_charset (DH_base_url)) { GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, "donau", @@ -976,7 +976,7 @@ donau_serve_process_config (void) char *master_public_key_str; if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_string (TEH_cfg, + GNUNET_CONFIGURATION_get_value_string (DH_cfg, "donau", "MASTER_PUBLIC_KEY", &master_public_key_str)) @@ -990,7 +990,7 @@ donau_serve_process_config (void) GNUNET_CRYPTO_eddsa_public_key_from_string (master_public_key_str, strlen ( master_public_key_str), - &TEH_master_public_key. + &DH_master_public_key. eddsa_pub)) { GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, @@ -1010,7 +1010,7 @@ donau_serve_process_config (void) char *attr_enc_key_str; if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_string (TEH_cfg, + GNUNET_CONFIGURATION_get_value_string (DH_cfg, "donau", "ATTRIBUTE_ENCRYPTION_KEY", &attr_enc_key_str)) @@ -1022,21 +1022,21 @@ donau_serve_process_config (void) } GNUNET_CRYPTO_hash (attr_enc_key_str, strlen (attr_enc_key_str), - &TEH_attribute_key.hash); + &DH_attribute_key.hash); GNUNET_free (attr_enc_key_str); } for (unsigned int i = 0; i<MAX_DB_RETRIES; i++) { - TEH_plugin = DONAUDB_plugin_load (TEH_cfg); - if (NULL != TEH_plugin) + DH_plugin = DONAUDB_plugin_load (DH_cfg); + if (NULL != DH_plugin) break; GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to connect to DB, will try again %u times\n", MAX_DB_RETRIES - i); sleep (1); } - if (NULL == TEH_plugin) + if (NULL == DH_plugin) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to initialize DB subsystem. Giving up.\n"); @@ -1108,7 +1108,7 @@ static char *input_filename; /** * Run 'nc' or 'ncat' as a fake HTTP client using #input_filename * as the input for the request. If launching the client worked, - * run the #TEH_KS_loop() event loop as usual. + * run the #DH_KS_loop() event loop as usual. * * @return child pid */ @@ -1243,7 +1243,7 @@ connection_done (void *cls, break; case MHD_CONNECTION_NOTIFY_CLOSED: active_connections--; - if (TEH_suicide && + if (DH_suicide && (0 == active_connections) ) GNUNET_SCHEDULER_shutdown (); break; @@ -1270,30 +1270,30 @@ do_shutdown (void *cls) (void) cls; mhd = TALER_MHD_daemon_stop (); - // TEH_resume_keys_requests (true); - // TEH_deposits_get_cleanup (); - // TEH_reserves_get_cleanup (); - // TEH_purses_get_cleanup (); - // TEH_kyc_check_cleanup (); - // TEH_kyc_proof_cleanup (); + // DH_resume_keys_requests (true); + // DH_deposits_get_cleanup (); + // DH_reserves_get_cleanup (); + // DH_purses_get_cleanup (); + // DH_kyc_check_cleanup (); + // DH_kyc_proof_cleanup (); // TALER_KYCLOGIC_kyc_done (); if (NULL != mhd) { MHD_stop_daemon (mhd); mhd = NULL; } - // TEH_wire_done (); - // TEH_extensions_done (); - // TEH_keys_finished (); - if (NULL != TEH_plugin) + // DH_wire_done (); + // DH_extensions_done (); + // DH_keys_finished (); + if (NULL != DH_plugin) { - DONAUDB_plugin_unload (TEH_plugin); - TEH_plugin = NULL; + DONAUDB_plugin_unload (DH_plugin); + DH_plugin = NULL; } - if (NULL != TEH_curl_ctx) + if (NULL != DH_curl_ctx) { - GNUNET_CURL_fini (TEH_curl_ctx); - TEH_curl_ctx = NULL; + GNUNET_CURL_fini (DH_curl_ctx); + DH_curl_ctx = NULL; } if (NULL != donau_curl_rc) { @@ -1329,7 +1329,7 @@ run (void *cls, if (connection_close) go |= TALER_MHD_GO_FORCE_CONNECTION_CLOSE; TALER_MHD_setup (go); - TEH_cfg = config; + DH_cfg = config; if (GNUNET_OK != donau_serve_process_config ()) @@ -1346,49 +1346,49 @@ run (void *cls, return; } if (GNUNET_SYSERR == - TEH_plugin->preflight (TEH_plugin->cls)) + DH_plugin->preflight (DH_plugin->cls)) { global_ret = EXIT_FAILURE; GNUNET_SCHEDULER_shutdown (); return; } // if (GNUNET_OK != - // TEH_extensions_init ()) + // DH_extensions_init ()) // { // global_ret = EXIT_FAILURE; // GNUNET_SCHEDULER_shutdown (); // return; // } // if (GNUNET_OK != - // TEH_keys_init ()) + // DH_keys_init ()) // { // global_ret = EXIT_FAILURE; // GNUNET_SCHEDULER_shutdown (); // return; // } // if (GNUNET_OK != - // TEH_wire_init ()) + // DH_wire_init ()) // { // global_ret = EXIT_FAILURE; // GNUNET_SCHEDULER_shutdown (); // return; // } - //TEH_load_terms (TEH_cfg); - TEH_curl_ctx + //DH_load_terms (DH_cfg); + DH_curl_ctx = GNUNET_CURL_init (&GNUNET_CURL_gnunet_scheduler_reschedule, &donau_curl_rc); - if (NULL == TEH_curl_ctx) + if (NULL == DH_curl_ctx) { GNUNET_break (0); global_ret = EXIT_FAILURE; GNUNET_SCHEDULER_shutdown (); return; } - donau_curl_rc = GNUNET_CURL_gnunet_rc_create (TEH_curl_ctx); + donau_curl_rc = GNUNET_CURL_gnunet_rc_create (DH_curl_ctx); GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL); - fh = TALER_MHD_bind (TEH_cfg, + fh = TALER_MHD_bind (DH_cfg, "donau", &serve_port); if ( (0 == serve_port) && diff --git a/src/donau/donau-httpd.h b/src/donau/donau-httpd.h @@ -33,27 +33,27 @@ /** * How long is caching /keys allowed at most? */ -extern struct GNUNET_TIME_Relative TEH_max_keys_caching; +extern struct GNUNET_TIME_Relative DH_max_keys_caching; /** * How long is the delay before we close reserves? */ -extern struct GNUNET_TIME_Relative TEH_reserve_closing_delay; +extern struct GNUNET_TIME_Relative DH_reserve_closing_delay; /** * The donau's configuration. */ -extern const struct GNUNET_CONFIGURATION_Handle *TEH_cfg; +extern const struct GNUNET_CONFIGURATION_Handle *DH_cfg; /** * Main directory with donau data. */ -extern char *TEH_donau_directory; +extern char *DH_donau_directory; /** * -I command-line flag given? */ -extern int TEH_check_invariants_flag; +extern int DH_check_invariants_flag; /** * Are clients allowed to request /keys for times other than the @@ -61,83 +61,83 @@ extern int TEH_check_invariants_flag; * as building new /keys responses is expensive. Should only be * enabled for testcases, development and test systems. */ -extern int TEH_allow_keys_timetravel; +extern int DH_allow_keys_timetravel; /** * Option set to #GNUNET_YES if rewards are allowed. */ -extern int TEH_enable_rewards; +extern int DH_enable_rewards; /** * Main directory with revocation data. */ -extern char *TEH_revocation_directory; +extern char *DH_revocation_directory; /** * True if we should commit suicide once all active * connections are finished. Also forces /keys requests * to terminate if they are long-polling. */ -extern bool TEH_suicide; +extern bool DH_suicide; /** * Master public key (according to the * configuration in the donau directory). */ -extern struct TALER_MasterPublicKeyP TEH_master_public_key; +extern struct TALER_MasterPublicKeyP DH_master_public_key; /** * Key used to encrypt KYC attribute data in our database. */ -extern struct TALER_AttributeEncryptionKeyP TEH_attribute_key; +extern struct TALER_AttributeEncryptionKeyP DH_attribute_key; /** * Our DB plugin. */ -extern struct DONAUDB_Plugin *TEH_plugin; +extern struct DONAUDB_Plugin *DH_plugin; /** * Absolute STEFAN parameter. */ -extern struct TALER_Amount TEH_stefan_abs; +extern struct TALER_Amount DH_stefan_abs; /** * Logarithmic STEFAN parameter. */ -extern struct TALER_Amount TEH_stefan_log; +extern struct TALER_Amount DH_stefan_log; /** * Linear STEFAN parameter. */ -extern struct TALER_Amount TEH_stefan_lin; +extern struct TALER_Amount DH_stefan_lin; /** * Default number of fractional digits to render * amounts with. */ -extern unsigned int TEH_currency_fraction_digits; +extern unsigned int DH_currency_fraction_digits; /** * Our currency. */ -extern char *TEH_currency; +extern char *DH_currency; /** * Name of the KYC-AML-trigger evaluation binary. */ -extern char *TEH_kyc_aml_trigger; +extern char *DH_kyc_aml_trigger; /** * What is the largest amount we allow a peer to * merge into a reserve before always triggering * an AML check? */ -extern struct TALER_Amount TEH_aml_threshold; +extern struct TALER_Amount DH_aml_threshold; /** * Our (externally visible) base URL. */ -extern char *TEH_base_url; +extern char *DH_base_url; /** * Are we shutting down? @@ -147,18 +147,18 @@ extern volatile bool MHD_terminating; /** * Context for all CURL operations (useful to the event loop) */ -extern struct GNUNET_CURL_Context *TEH_curl_ctx; +extern struct GNUNET_CURL_Context *DH_curl_ctx; /* * Signature of the offline master key of all enabled extensions' configuration */ -extern struct TALER_MasterSignatureP TEH_extensions_sig; -extern bool TEH_extensions_signed; +extern struct TALER_MasterSignatureP DH_extensions_sig; +extern bool DH_extensions_signed; /** * @brief Struct describing an URL and the handler for it. */ -struct TEH_RequestHandler; +struct DH_RequestHandler; /** @@ -186,7 +186,7 @@ struct DH_RequestContext /** * Request handler responsible for this request. */ - const struct TEH_RequestHandler *rh; + const struct DH_RequestHandler *rh; /** * Request URL (for logging). @@ -218,7 +218,7 @@ struct DH_RequestContext /** * @brief Struct describing an URL and the handler for it. */ -struct TEH_RequestHandler +struct DH_RequestHandler { /** @@ -310,7 +310,7 @@ struct TEH_RequestHandler /* Age restriction configuration */ -extern bool TEH_age_restriction_enabled; -extern struct TALER_AgeRestrictionConfig TEH_age_restriction_config; +extern bool DH_age_restriction_enabled; +extern struct TALER_AgeRestrictionConfig DH_age_restriction_config; #endif diff --git a/src/donau/donau-httpd_batch-issue_receipts.c b/src/donau/donau-httpd_batch-issue_receipts.c @@ -152,8 +152,8 @@ batch_withdraw_amount_cb (void *cls, &wc->batch_total, wc->now.abs_time)) return; - qs = TEH_plugin->select_withdraw_amounts_for_kyc_check ( - TEH_plugin->cls, + qs = DH_plugin->select_withdraw_amounts_for_kyc_check ( + DH_plugin->cls, &wc->h_payto, limit, cb, @@ -206,12 +206,12 @@ generate_reply_success (const struct DH_RequestContext *rc, if (! wc->kyc.ok) { /* KYC required */ - return TEH_RESPONSE_reply_kyc_required (rc->connection, + return DH_RESPONSE_reply_kyc_required (rc->connection, &wc->h_payto, &wc->kyc); } if (TALER_AML_NORMAL != wc->aml_decision) - return TEH_RESPONSE_reply_aml_blocked (rc->connection, + return DH_RESPONSE_reply_aml_blocked (rc->connection, wc->aml_decision); sigs = json_array (); @@ -229,7 +229,7 @@ generate_reply_success (const struct DH_RequestContext *rc, "ev_sig", &pc->collectable.sig)))); } - TEH_METRICS_batch_withdraw_num_coins += wc->planchets_length; + DH_METRICS_batch_withdraw_num_coins += wc->planchets_length; return TALER_MHD_REPLY_JSON_PACK ( rc->connection, MHD_HTTP_OK, @@ -259,7 +259,7 @@ check_request_idempotent (const struct BatchWithdrawContext *wc, struct PlanchetContext *pc = &wc->planchets[i]; enum GNUNET_DB_QueryStatus qs; - qs = TEH_plugin->get_withdraw_info (TEH_plugin->cls, + qs = DH_plugin->get_withdraw_info (DH_plugin->cls, &pc->h_coin_envelope, &pc->collectable); if (0 > qs) @@ -276,7 +276,7 @@ check_request_idempotent (const struct BatchWithdrawContext *wc, return false; } /* generate idempotent reply */ - TEH_METRICS_num_requests[TEH_MT_REQUEST_IDEMPOTENT_BATCH_WITHDRAW]++; + DH_METRICS_num_requests[DH_MT_REQUEST_IDEMPOTENT_BATCH_WITHDRAW]++; *mret = generate_reply_success (rc, wc); return true; @@ -321,7 +321,7 @@ batch_withdraw_transaction (void *cls, { char *reserve_payto; - reserve_payto = TALER_reserve_make_payto (TEH_base_url, + reserve_payto = TALER_reserve_make_payto (DH_base_url, wc->reserve_pub); TALER_payto_hash (reserve_payto, &reserve_h_payto); @@ -336,9 +336,9 @@ batch_withdraw_transaction (void *cls, = GNUNET_TIME_absolute_subtract (wc->now.abs_time, GNUNET_TIME_UNIT_MONTHS); GNUNET_assert (GNUNET_OK == - TALER_amount_set_zero (TEH_currency, + TALER_amount_set_zero (DH_currency, &merge_amount)); - qs = TEH_plugin->select_merge_amounts_for_kyc_check (TEH_plugin->cls, + qs = DH_plugin->select_merge_amounts_for_kyc_check (DH_plugin->cls, &reserve_h_payto, now_minus_one_month, &aml_amount_cb, @@ -353,7 +353,7 @@ batch_withdraw_transaction (void *cls, "select_merge_amounts_for_kyc_check"); return qs; } - qs = TEH_plugin->select_aml_threshold (TEH_plugin->cls, + qs = DH_plugin->select_aml_threshold (DH_plugin->cls, &reserve_h_payto, &wc->aml_decision, &wc->kyc, @@ -370,7 +370,7 @@ batch_withdraw_transaction (void *cls, } if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs) { - threshold = TEH_aml_threshold; /* use default */ + threshold = DH_aml_threshold; /* use default */ wc->aml_decision = TALER_AML_NORMAL; } @@ -384,7 +384,7 @@ batch_withdraw_transaction (void *cls, break; } wc->aml_decision = TALER_AML_PENDING; - qs = TEH_plugin->trigger_aml_process (TEH_plugin->cls, + qs = DH_plugin->trigger_aml_process (DH_plugin->cls, &reserve_h_payto, &merge_amount); if (qs <= 0) @@ -410,7 +410,7 @@ batch_withdraw_transaction (void *cls, } /* Check if the money came from a wire transfer */ - qs = TEH_plugin->reserves_get_origin (TEH_plugin->cls, + qs = DH_plugin->reserves_get_origin (DH_plugin->cls, wc->reserve_pub, &wc->h_payto); if (qs < 0) @@ -429,8 +429,8 @@ batch_withdraw_transaction (void *cls, qs = TALER_KYCLOGIC_kyc_test_required ( TALER_KYCLOGIC_KYC_TRIGGER_WITHDRAW, &wc->h_payto, - TEH_plugin->select_satisfied_kyc_processes, - TEH_plugin->cls, + DH_plugin->select_satisfied_kyc_processes, + DH_plugin->cls, &batch_withdraw_amount_cb, wc, &kyc_required); @@ -448,8 +448,8 @@ batch_withdraw_transaction (void *cls, { /* insert KYC requirement into DB! */ wc->kyc.ok = false; - qs = TEH_plugin->insert_kyc_requirement_for_account ( - TEH_plugin->cls, + qs = DH_plugin->insert_kyc_requirement_for_account ( + DH_plugin->cls, kyc_required, &wc->h_payto, wc->reserve_pub, @@ -469,11 +469,11 @@ batch_withdraw_transaction (void *cls, } wc->kyc.ok = true; - qs = TEH_plugin->do_batch_withdraw (TEH_plugin->cls, + qs = DH_plugin->do_batch_withdraw (DH_plugin->cls, wc->now, wc->reserve_pub, &wc->batch_total, - TEH_age_restriction_enabled, + DH_age_restriction_enabled, &found, &balance_ok, &age_ok, @@ -505,11 +505,11 @@ batch_withdraw_transaction (void *cls, /* We respond with the lowest age in the corresponding age group * of the required age */ uint16_t lowest_age = TALER_get_lowest_age ( - &TEH_age_restriction_config.mask, + &DH_age_restriction_config.mask, allowed_maximum_age); - TEH_plugin->rollback (TEH_plugin->cls); - *mhd_ret = TEH_RESPONSE_reply_reserve_age_restriction_required ( + DH_plugin->rollback (DH_plugin->cls); + *mhd_ret = DH_RESPONSE_reply_reserve_age_restriction_required ( connection, lowest_age); return GNUNET_DB_STATUS_HARD_ERROR; @@ -517,8 +517,8 @@ batch_withdraw_transaction (void *cls, if (! balance_ok) { - TEH_plugin->rollback (TEH_plugin->cls); - *mhd_ret = TEH_RESPONSE_reply_reserve_insufficient_balance ( + DH_plugin->rollback (DH_plugin->cls); + *mhd_ret = DH_RESPONSE_reply_reserve_insufficient_balance ( connection, TALER_EC_DONAU_WITHDRAW_INSUFFICIENT_FUNDS, &wc->batch_total, @@ -539,7 +539,7 @@ batch_withdraw_transaction (void *cls, nonce = (TALER_DENOMINATION_CS == bp->cipher) ? &bp->details.cs_blinded_planchet.nonce : NULL; - qs = TEH_plugin->do_batch_withdraw_insert (TEH_plugin->cls, + qs = DH_plugin->do_batch_withdraw_insert (DH_plugin->cls, nonce, &pc->collectable, wc->now, @@ -592,7 +592,7 @@ batch_withdraw_transaction (void *cls, return GNUNET_DB_STATUS_HARD_ERROR; } } - TEH_METRICS_num_success[TEH_MT_SUCCESS_BATCH_WITHDRAW]++; + DH_METRICS_num_success[DH_MT_SUCCESS_BATCH_WITHDRAW]++; return GNUNET_DB_STATUS_SUCCESS_ONE_RESULT; } @@ -609,7 +609,7 @@ static MHD_RESULT prepare_transaction (const struct DH_RequestContext *rc, struct BatchWithdrawContext *wc) { - struct TEH_CoinSignData csds[wc->planchets_length]; + struct DH_CoinSignData csds[wc->planchets_length]; struct TALER_BlindedDenominationSignature bss[wc->planchets_length]; for (unsigned int i = 0; i<wc->planchets_length; i++) @@ -622,7 +622,7 @@ prepare_transaction (const struct DH_RequestContext *rc, { enum TALER_ErrorCode ec; - ec = TEH_keys_denomination_batch_sign ( + ec = DH_keys_denomination_batch_sign ( csds, wc->planchets_length, false, @@ -647,9 +647,9 @@ prepare_transaction (const struct DH_RequestContext *rc, MHD_RESULT mhd_ret; if (GNUNET_OK != - TEH_DB_run_transaction (rc->connection, + DH_DB_run_transaction (rc->connection, "run batch withdraw", - TEH_MT_REQUEST_WITHDRAW, + DH_MT_REQUEST_WITHDRAW, &mhd_ret, &batch_withdraw_transaction, wc)) @@ -677,7 +677,7 @@ parse_planchets (const struct DH_RequestContext *rc, struct BatchWithdrawContext *wc, const json_t *planchets) { - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; MHD_RESULT mret; for (unsigned int i = 0; i<wc->planchets_length; i++) @@ -721,7 +721,7 @@ parse_planchets (const struct DH_RequestContext *rc, } } - ksh = TEH_keys_get_state (); + ksh = DH_keys_get_state (); if (NULL == ksh) { if (! check_request_idempotent (wc, @@ -737,9 +737,9 @@ parse_planchets (const struct DH_RequestContext *rc, for (unsigned int i = 0; i<wc->planchets_length; i++) { struct PlanchetContext *pc = &wc->planchets[i]; - struct TEH_DenominationKey *dk; + struct DH_DenominationKey *dk; - dk = TEH_keys_denomination_by_hash_from_state ( + dk = DH_keys_denomination_by_hash_from_state ( ksh, &pc->collectable.denom_pub_hash, NULL, @@ -750,7 +750,7 @@ parse_planchets (const struct DH_RequestContext *rc, if (! check_request_idempotent (wc, &mret)) { - return TEH_RESPONSE_reply_unknown_denom_pub_hash ( + return DH_RESPONSE_reply_unknown_denom_pub_hash ( rc->connection, &pc->collectable.denom_pub_hash); } @@ -762,7 +762,7 @@ parse_planchets (const struct DH_RequestContext *rc, if (! check_request_idempotent (wc, &mret)) { - return TEH_RESPONSE_reply_expired_denom_pub_hash ( + return DH_RESPONSE_reply_expired_denom_pub_hash ( rc->connection, &pc->collectable.denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_EXPIRED, @@ -774,7 +774,7 @@ parse_planchets (const struct DH_RequestContext *rc, { /* This denomination is not yet valid, no need to check for idempotency! */ - return TEH_RESPONSE_reply_expired_denom_pub_hash ( + return DH_RESPONSE_reply_expired_denom_pub_hash ( rc->connection, &pc->collectable.denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_VALIDITY_IN_FUTURE, @@ -786,7 +786,7 @@ parse_planchets (const struct DH_RequestContext *rc, if (! check_request_idempotent (wc, &mret)) { - return TEH_RESPONSE_reply_expired_denom_pub_hash ( + return DH_RESPONSE_reply_expired_denom_pub_hash ( rc->connection, &pc->collectable.denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_REVOKED, @@ -837,7 +837,7 @@ parse_planchets (const struct DH_RequestContext *rc, TALER_EC_GENERIC_INTERNAL_INVARIANT_FAILURE, NULL); } - TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_EDDSA]++; + DH_METRICS_num_verifications[DH_MT_SIGNATURE_EDDSA]++; if (GNUNET_OK != TALER_wallet_withdraw_verify (&pc->collectable.denom_pub_hash, &pc->collectable.amount_with_fee, @@ -859,7 +859,7 @@ parse_planchets (const struct DH_RequestContext *rc, MHD_RESULT -TEH_handler_batch_withdraw (struct DH_RequestContext *rc, +DH_handler_batch_withdraw (struct DH_RequestContext *rc, const struct TALER_ReservePublicKeyP *reserve_pub, const json_t *root) { @@ -875,7 +875,7 @@ TEH_handler_batch_withdraw (struct DH_RequestContext *rc, }; GNUNET_assert (GNUNET_OK == - TALER_amount_set_zero (TEH_currency, + TALER_amount_set_zero (DH_currency, &wc.batch_total)); { enum GNUNET_GenericReturnValue res; diff --git a/src/donau/donau-httpd_batch-issue_receipts.h b/src/donau/donau-httpd_batch-issue_receipts.h @@ -41,7 +41,7 @@ * @return MHD result code */ MHD_RESULT -TEH_handler_batch_withdraw (struct DH_RequestContext *rc, +DH_handler_batch_withdraw (struct DH_RequestContext *rc, const struct TALER_ReservePublicKeyP *reserve_pub, const json_t *root); diff --git a/src/donau/donau-httpd_batch-submit_receipts.c b/src/donau/donau-httpd_batch-submit_receipts.c @@ -129,7 +129,7 @@ again: &dc->deposit_fees[i])); if (TALER_EC_NONE != (ec = TALER_donau_online_deposit_confirmation_sign ( - &TEH_keys_donau_sign_, + &DH_keys_donau_sign_, &bd->h_contract_terms, &dc->h_wire, NULL != dc->policy_json ? &dc->h_policy : NULL, @@ -209,8 +209,8 @@ batch_deposit_transaction (void *cls, * insert or update the record. */ if (NULL != dc->policy_json) { - qs = TEH_plugin->persist_policy_details ( - TEH_plugin->cls, + qs = DH_plugin->persist_policy_details ( + DH_plugin->cls, &dc->policy_details, &dc->bd.policy_details_serial_id, &dc->policy_details.accumulated_total, @@ -228,7 +228,7 @@ batch_deposit_transaction (void *cls, = &bd->cdis[i]; uint64_t known_coin_id; - qs = TEH_make_coin_known (&cdi->coin, + qs = DH_make_coin_known (&cdi->coin, connection, &known_coin_id, mhd_ret); @@ -240,8 +240,8 @@ batch_deposit_transaction (void *cls, return qs; } - qs = TEH_plugin->do_deposit ( - TEH_plugin->cls, + qs = DH_plugin->do_deposit ( + DH_plugin->cls, bd, &dc->donau_timestamp, &balance_ok, @@ -269,7 +269,7 @@ batch_deposit_transaction (void *cls, { /* FIXME: #7267 conflicting contract != insufficient funds */ *mhd_ret - = TEH_RESPONSE_reply_coin_insufficient_funds ( + = DH_RESPONSE_reply_coin_insufficient_funds ( connection, TALER_EC_DONAU_DEPOSIT_CONFLICTING_CONTRACT, &bd->cdis[0 /* SEE FIXME above! */].coin.denom_pub_hash, @@ -283,14 +283,14 @@ batch_deposit_transaction (void *cls, "returning history of conflicting coin (%s)\n", TALER_B2S (&bd->cdis[bad_balance_coin_index].coin.coin_pub)); *mhd_ret - = TEH_RESPONSE_reply_coin_insufficient_funds ( + = DH_RESPONSE_reply_coin_insufficient_funds ( connection, TALER_EC_DONAU_GENERIC_INSUFFICIENT_FUNDS, &bd->cdis[bad_balance_coin_index].coin.denom_pub_hash, &bd->cdis[bad_balance_coin_index].coin.coin_pub); return GNUNET_DB_STATUS_HARD_ERROR; } - TEH_METRICS_num_success[TEH_MT_SUCCESS_DEPOSIT]++; + DH_METRICS_num_success[DH_MT_SUCCESS_DEPOSIT]++; return qs; } @@ -318,7 +318,7 @@ parse_coin (struct MHD_Connection *connection, const struct DONAUDB_BatchDeposit *bd = &dc->bd; struct GNUNET_JSON_Specification spec[] = { TALER_JSON_spec_amount ("contribution", - TEH_currency, + DH_currency, &cdi->amount_with_fee), GNUNET_JSON_spec_fixed_auto ("denom_pub_hash", &cdi->coin.denom_pub_hash), @@ -343,10 +343,10 @@ parse_coin (struct MHD_Connection *connection, return res; /* check denomination exists and is valid */ { - struct TEH_DenominationKey *dk; + struct DH_DenominationKey *dk; MHD_RESULT mret; - dk = TEH_keys_denomination_by_hash (&cdi->coin.denom_pub_hash, + dk = DH_keys_denomination_by_hash (&cdi->coin.denom_pub_hash, connection, &mret); if (NULL == dk) @@ -372,7 +372,7 @@ parse_coin (struct MHD_Connection *connection, /* This denomination is past the expiration time for deposits */ GNUNET_JSON_parse_free (spec); return (MHD_YES == - TEH_RESPONSE_reply_expired_denom_pub_hash ( + DH_RESPONSE_reply_expired_denom_pub_hash ( connection, &cdi->coin.denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_EXPIRED, @@ -385,7 +385,7 @@ parse_coin (struct MHD_Connection *connection, /* This denomination is not yet valid */ GNUNET_JSON_parse_free (spec); return (MHD_YES == - TEH_RESPONSE_reply_expired_denom_pub_hash ( + DH_RESPONSE_reply_expired_denom_pub_hash ( connection, &cdi->coin.denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_VALIDITY_IN_FUTURE, @@ -398,7 +398,7 @@ parse_coin (struct MHD_Connection *connection, /* This denomination has been revoked */ GNUNET_JSON_parse_free (spec); return (MHD_YES == - TEH_RESPONSE_reply_expired_denom_pub_hash ( + DH_RESPONSE_reply_expired_denom_pub_hash ( connection, &cdi->coin.denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_REVOKED, @@ -424,10 +424,10 @@ parse_coin (struct MHD_Connection *connection, switch (dk->denom_pub.cipher) { case TALER_DENOMINATION_RSA: - TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_RSA]++; + DH_METRICS_num_verifications[DH_MT_SIGNATURE_RSA]++; break; case TALER_DENOMINATION_CS: - TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_CS]++; + DH_METRICS_num_verifications[DH_MT_SIGNATURE_CS]++; break; default: break; @@ -461,7 +461,7 @@ parse_coin (struct MHD_Connection *connection, : GNUNET_SYSERR; } - TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_EDDSA]++; + DH_METRICS_num_verifications[DH_MT_SIGNATURE_EDDSA]++; if (GNUNET_OK != TALER_wallet_deposit_verify ( &cdi->amount_with_fee, @@ -495,7 +495,7 @@ parse_coin (struct MHD_Connection *connection, MHD_RESULT -TEH_handler_batch_deposit (struct DH_RequestContext *rc, +DH_handler_batch_deposit (struct DH_RequestContext *rc, const json_t *root, const char *const args[]) { @@ -682,7 +682,7 @@ TEH_handler_batch_deposit (struct DH_RequestContext *rc, dc.donau_timestamp = GNUNET_TIME_timestamp_get (); if (GNUNET_SYSERR == - TEH_plugin->preflight (TEH_plugin->cls)) + DH_plugin->preflight (DH_plugin->cls)) { GNUNET_break (0); GNUNET_JSON_parse_free (spec); @@ -697,9 +697,9 @@ TEH_handler_batch_deposit (struct DH_RequestContext *rc, MHD_RESULT mhd_ret; if (GNUNET_OK != - TEH_DB_run_transaction (connection, + DH_DB_run_transaction (connection, "execute batch deposit", - TEH_MT_REQUEST_BATCH_DEPOSIT, + DH_MT_REQUEST_BATCH_DEPOSIT, &mhd_ret, &batch_deposit_transaction, &dc)) diff --git a/src/donau/donau-httpd_batch-submit_receipts.h b/src/donau/donau-httpd_batch-submit_receipts.h @@ -41,7 +41,7 @@ * @return MHD result code */ MHD_RESULT -TEH_handler_batch_deposit (struct DH_RequestContext *rc, +DH_handler_batch_deposit (struct DH_RequestContext *rc, const json_t *root, const char *const args[]); diff --git a/src/donau/donau-httpd_charities_close.c b/src/donau/donau-httpd_charities_close.c @@ -147,8 +147,8 @@ amount_it (void *cls, if (GNUNET_OK != ret) return; rcc->qs - = TEH_plugin->iterate_reserve_close_info ( - TEH_plugin->cls, + = DH_plugin->iterate_reserve_close_info ( + DH_plugin->cls, &rcc->kyc_payto, limit, cb, @@ -181,8 +181,8 @@ reserve_close_transaction (void *cls, char *payto_uri = NULL; const struct TALER_WireFeeSet *wf; - qs = TEH_plugin->select_reserve_close_info ( - TEH_plugin->cls, + qs = DH_plugin->select_reserve_close_info ( + DH_plugin->cls, rcc->reserve_pub, &rcc->balance, &payto_uri); @@ -236,8 +236,8 @@ reserve_close_transaction (void *cls, qs = TALER_KYCLOGIC_kyc_test_required ( TALER_KYCLOGIC_KYC_TRIGGER_RESERVE_CLOSE, &rcc->kyc_payto, - TEH_plugin->select_satisfied_kyc_processes, - TEH_plugin->cls, + DH_plugin->select_satisfied_kyc_processes, + DH_plugin->cls, &amount_it, rcc, &kyc_needed); @@ -268,8 +268,8 @@ reserve_close_transaction (void *cls, if (NULL != kyc_needed) { rcc->kyc.ok = false; - qs = TEH_plugin->insert_kyc_requirement_for_account ( - TEH_plugin->cls, + qs = DH_plugin->insert_kyc_requirement_for_account ( + DH_plugin->cls, kyc_needed, &rcc->kyc_payto, rcc->reserve_pub, @@ -296,7 +296,7 @@ reserve_close_transaction (void *cls, char *method; method = TALER_payto_get_method (rcc->payto_uri); - wf = TEH_wire_fees_by_time (rcc->timestamp, + wf = DH_wire_fees_by_time (rcc->timestamp, method); if (NULL == wf) { @@ -319,14 +319,14 @@ reserve_close_transaction (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Client attempted to close reserve with insufficient balance.\n"); GNUNET_assert (GNUNET_OK == - TALER_amount_set_zero (TEH_currency, + TALER_amount_set_zero (DH_currency, &rcc->wire_amount)); *mhd_ret = reply_reserve_close_success (connection, rcc); return GNUNET_DB_STATUS_HARD_ERROR; } - qs = TEH_plugin->insert_close_request (TEH_plugin->cls, + qs = DH_plugin->insert_close_request (DH_plugin->cls, rcc->reserve_pub, payto_uri, &rcc->reserve_sig, @@ -354,7 +354,7 @@ reserve_close_transaction (void *cls, MHD_RESULT -TEH_handler_reserves_close (struct DH_RequestContext *rc, +DH_handler_reserves_close (struct DH_RequestContext *rc, const struct TALER_ReservePublicKeyP *reserve_pub, const json_t *root) { @@ -426,9 +426,9 @@ TEH_handler_reserves_close (struct DH_RequestContext *rc, } if (GNUNET_OK != - TEH_DB_run_transaction (rc->connection, + DH_DB_run_transaction (rc->connection, "reserve close", - TEH_MT_REQUEST_OTHER, + DH_MT_REQUEST_OTHER, &mhd_ret, &reserve_close_transaction, &rcc)) @@ -436,7 +436,7 @@ TEH_handler_reserves_close (struct DH_RequestContext *rc, return mhd_ret; } if (! rcc.kyc.ok) - return TEH_RESPONSE_reply_kyc_required (rc->connection, + return DH_RESPONSE_reply_kyc_required (rc->connection, &rcc.kyc_payto, &rcc.kyc); diff --git a/src/donau/donau-httpd_charities_close.h b/src/donau/donau-httpd_charities_close.h @@ -34,7 +34,7 @@ * @return MHD result code */ MHD_RESULT -TEH_handler_reserves_close (struct DH_RequestContext *rc, +DH_handler_reserves_close (struct DH_RequestContext *rc, const struct TALER_ReservePublicKeyP *reserve_pub, const json_t *root); diff --git a/src/donau/donau-httpd_charities_get.c b/src/donau/donau-httpd_charities_get.c @@ -96,7 +96,7 @@ static struct ReservePoller *rp_tail; void -TEH_reserves_get_cleanup () +DH_reserves_get_cleanup () { for (struct ReservePoller *rp = rp_head; NULL != rp; @@ -127,7 +127,7 @@ rp_cleanup (struct DH_RequestContext *rc) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Cancelling DB event listening on cleanup (odd unless during shutdown)\n"); - TEH_plugin->event_listen_cancel (TEH_plugin->cls, + DH_plugin->event_listen_cancel (DH_plugin->cls, rp->eh); rp->eh = NULL; } @@ -160,17 +160,17 @@ db_event_cb (void *cls, return; /* might get multiple wake-up events */ GNUNET_async_scope_enter (&rp->rc->async_scope_id, &old_scope); - TEH_check_invariants (); + DH_check_invariants (); rp->suspended = false; MHD_resume_connection (rp->connection); TALER_MHD_daemon_trigger (); - TEH_check_invariants (); + DH_check_invariants (); GNUNET_async_scope_restore (&old_scope); } MHD_RESULT -TEH_handler_reserves_get (struct DH_RequestContext *rc, +DH_handler_reserves_get (struct DH_RequestContext *rc, const char *const args[1]) { struct ReservePoller *rp = rc->rh_ctx; @@ -213,8 +213,8 @@ TEH_handler_reserves_get (struct DH_RequestContext *rc, GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Starting DB event listening until %s\n", GNUNET_TIME_absolute2s (rp->timeout)); - rp->eh = TEH_plugin->event_listen ( - TEH_plugin->cls, + rp->eh = DH_plugin->event_listen ( + DH_plugin->cls, GNUNET_TIME_absolute_get_remaining (rp->timeout), &rep.header, &db_event_cb, @@ -223,7 +223,7 @@ TEH_handler_reserves_get (struct DH_RequestContext *rc, { enum GNUNET_DB_QueryStatus qs; - qs = TEH_plugin->get_reserve_balance (TEH_plugin->cls, + qs = DH_plugin->get_reserve_balance (DH_plugin->cls, &rp->reserve_pub, &rp->balance); switch (qs) diff --git a/src/donau/donau-httpd_charities_get.h b/src/donau/donau-httpd_charities_get.h @@ -33,7 +33,7 @@ * data structures. */ void -TEH_reserves_get_cleanup (void); +DH_reserves_get_cleanup (void); /** @@ -47,7 +47,7 @@ TEH_reserves_get_cleanup (void); * @return MHD result code */ MHD_RESULT -TEH_handler_reserves_get (struct DH_RequestContext *rc, +DH_handler_reserves_get (struct DH_RequestContext *rc, const char *const args[1]); #endif diff --git a/src/donau/donau-httpd_charities_history.c b/src/donau/donau-httpd_charities_history.c @@ -67,7 +67,7 @@ struct ReserveHistoryContext /** * Global fees applying to the request. */ - const struct TEH_GlobalFee *gf; + const struct DH_GlobalFee *gf; /** * Current reserve balance. @@ -90,7 +90,7 @@ reply_reserve_history_success (struct MHD_Connection *connection, const struct DONAUDB_ReserveHistory *rh = rhc->rh; json_t *json_history; - json_history = TEH_RESPONSE_compile_reserve_history (rh); + json_history = DH_RESPONSE_compile_reserve_history (rh); if (NULL == json_history) return TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, @@ -134,7 +134,7 @@ reserve_history_transaction (void *cls, bool balance_ok = false; bool idempotent = true; - qs = TEH_plugin->insert_history_request (TEH_plugin->cls, + qs = DH_plugin->insert_history_request (DH_plugin->cls, rsc->reserve_pub, &rsc->reserve_sig, rsc->timestamp, @@ -168,7 +168,7 @@ reserve_history_transaction (void *cls, "Idempotent /reserves/history request observed. Is caching working?\n"); } } - qs = TEH_plugin->get_reserve_history (TEH_plugin->cls, + qs = DH_plugin->get_reserve_history (DH_plugin->cls, rsc->reserve_pub, &rsc->balance, &rsc->rh); @@ -186,7 +186,7 @@ reserve_history_transaction (void *cls, MHD_RESULT -TEH_handler_reserves_history (struct DH_RequestContext *rc, +DH_handler_reserves_history (struct DH_RequestContext *rc, const struct TALER_ReservePublicKeyP *reserve_pub, const json_t *root) { @@ -231,9 +231,9 @@ TEH_handler_reserves_history (struct DH_RequestContext *rc, NULL); } { - struct TEH_KeyStateHandle *keys; + struct DH_KeyStateHandle *keys; - keys = TEH_keys_get_state (); + keys = DH_keys_get_state (); if (NULL == keys) { GNUNET_break (0); @@ -243,7 +243,7 @@ TEH_handler_reserves_history (struct DH_RequestContext *rc, TALER_EC_DONAU_GENERIC_KEYS_MISSING, NULL); } - rsc.gf = TEH_keys_global_fee_by_time (keys, + rsc.gf = DH_keys_global_fee_by_time (keys, rsc.timestamp); } if (NULL == rsc.gf) @@ -268,9 +268,9 @@ TEH_handler_reserves_history (struct DH_RequestContext *rc, } rsc.rh = NULL; if (GNUNET_OK != - TEH_DB_run_transaction (rc->connection, + DH_DB_run_transaction (rc->connection, "get reserve history", - TEH_MT_REQUEST_OTHER, + DH_MT_REQUEST_OTHER, &mhd_ret, &reserve_history_transaction, &rsc)) @@ -286,7 +286,7 @@ TEH_handler_reserves_history (struct DH_RequestContext *rc, } mhd_ret = reply_reserve_history_success (rc->connection, &rsc); - TEH_plugin->free_reserve_history (TEH_plugin->cls, + DH_plugin->free_reserve_history (DH_plugin->cls, rsc.rh); return mhd_ret; } diff --git a/src/donau/donau-httpd_charities_history.h b/src/donau/donau-httpd_charities_history.h @@ -35,7 +35,7 @@ * @return MHD result code */ MHD_RESULT -TEH_handler_reserves_history (struct DH_RequestContext *rc, +DH_handler_reserves_history (struct DH_RequestContext *rc, const struct TALER_ReservePublicKeyP *reserve_pub, const json_t *root); diff --git a/src/donau/donau-httpd_charities_open.c b/src/donau/donau-httpd_charities_open.c @@ -71,7 +71,7 @@ struct ReserveOpenContext /** * Global fees applying to the request. */ - const struct TEH_GlobalFee *gf; + const struct DH_GlobalFee *gf; /** * Amount to be paid from the reserve. @@ -91,7 +91,7 @@ struct ReserveOpenContext /** * Information about payments by coin. */ - struct TEH_PurseDepositedCoin *payments; + struct DH_PurseDepositedCoin *payments; /** * Length of the @e payments array. @@ -160,7 +160,7 @@ cleanup_rsc (struct ReserveOpenContext *rsc) { for (unsigned int i = 0; i<rsc->payments_len; i++) { - TEH_common_purse_deposit_free_coin (&rsc->payments[i]); + DH_common_purse_deposit_free_coin (&rsc->payments[i]); } GNUNET_free (rsc->payments); } @@ -191,13 +191,13 @@ reserve_open_transaction (void *cls, for (unsigned int i = 0; i<rsc->payments_len; i++) { - struct TEH_PurseDepositedCoin *coin = &rsc->payments[i]; + struct DH_PurseDepositedCoin *coin = &rsc->payments[i]; bool insufficient_funds = true; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Make coin %u known\n", i); - qs = TEH_make_coin_known (&coin->cpi, + qs = DH_make_coin_known (&coin->cpi, connection, &coin->known_coin_id, mhd_ret); @@ -206,8 +206,8 @@ reserve_open_transaction (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Insert open deposit %u known\n", i); - qs = TEH_plugin->insert_reserve_open_deposit ( - TEH_plugin->cls, + qs = DH_plugin->insert_reserve_open_deposit ( + DH_plugin->cls, &coin->cpi, &coin->coin_sig, coin->known_coin_id, @@ -234,7 +234,7 @@ reserve_open_transaction (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Handle insufficient funds\n"); *mhd_ret - = TEH_RESPONSE_reply_coin_insufficient_funds ( + = DH_RESPONSE_reply_coin_insufficient_funds ( connection, TALER_EC_DONAU_GENERIC_INSUFFICIENT_FUNDS, &coin->cpi.denom_pub_hash, @@ -246,7 +246,7 @@ reserve_open_transaction (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Do reserve open with reserve payment of %s\n", TALER_amount2s (&rsc->total)); - qs = TEH_plugin->do_reserve_open (TEH_plugin->cls, + qs = DH_plugin->do_reserve_open (DH_plugin->cls, /* inputs */ rsc->reserve_pub, &rsc->total, @@ -284,9 +284,9 @@ reserve_open_transaction (void *cls, } if (rsc->no_funds) { - TEH_plugin->rollback (TEH_plugin->cls); + DH_plugin->rollback (DH_plugin->cls); *mhd_ret - = TEH_RESPONSE_reply_reserve_insufficient_balance ( + = DH_RESPONSE_reply_reserve_insufficient_balance ( connection, TALER_EC_DONAU_RESERVES_OPEN_INSUFFICIENT_FUNDS, &rsc->reserve_payment, @@ -298,7 +298,7 @@ reserve_open_transaction (void *cls, MHD_RESULT -TEH_handler_reserves_open (struct DH_RequestContext *rc, +DH_handler_reserves_open (struct DH_RequestContext *rc, const struct TALER_ReservePublicKeyP *reserve_pub, const json_t *root) { @@ -316,7 +316,7 @@ TEH_handler_reserves_open (struct DH_RequestContext *rc, GNUNET_JSON_spec_array_const ("payments", &payments), TALER_JSON_spec_amount ("reserve_payment", - TEH_currency, + DH_currency, &rsc.reserve_payment), GNUNET_JSON_spec_end () }; @@ -358,14 +358,14 @@ TEH_handler_reserves_open (struct DH_RequestContext *rc, rsc.payments_len = json_array_size (payments); rsc.payments = GNUNET_new_array (rsc.payments_len, - struct TEH_PurseDepositedCoin); + struct DH_PurseDepositedCoin); rsc.total = rsc.reserve_payment; for (unsigned int i = 0; i<rsc.payments_len; i++) { - struct TEH_PurseDepositedCoin *coin = &rsc.payments[i]; + struct DH_PurseDepositedCoin *coin = &rsc.payments[i]; enum GNUNET_GenericReturnValue res; - res = TEH_common_purse_deposit_parse_coin ( + res = DH_common_purse_deposit_parse_coin ( rc->connection, coin, json_array_get (payments, @@ -397,9 +397,9 @@ TEH_handler_reserves_open (struct DH_RequestContext *rc, } { - struct TEH_KeyStateHandle *keys; + struct DH_KeyStateHandle *keys; - keys = TEH_keys_get_state (); + keys = DH_keys_get_state (); if (NULL == keys) { GNUNET_break (0); @@ -409,7 +409,7 @@ TEH_handler_reserves_open (struct DH_RequestContext *rc, TALER_EC_DONAU_GENERIC_KEYS_MISSING, NULL); } - rsc.gf = TEH_keys_global_fee_by_time (keys, + rsc.gf = DH_keys_global_fee_by_time (keys, rsc.timestamp); } if (NULL == rsc.gf) @@ -442,9 +442,9 @@ TEH_handler_reserves_open (struct DH_RequestContext *rc, MHD_RESULT mhd_ret; if (GNUNET_OK != - TEH_DB_run_transaction (rc->connection, + DH_DB_run_transaction (rc->connection, "reserve open", - TEH_MT_REQUEST_OTHER, + DH_MT_REQUEST_OTHER, &mhd_ret, &reserve_open_transaction, &rsc)) diff --git a/src/donau/donau-httpd_charities_open.h b/src/donau/donau-httpd_charities_open.h @@ -34,7 +34,7 @@ * @return MHD result code */ MHD_RESULT -TEH_handler_reserves_open (struct DH_RequestContext *rc, +DH_handler_reserves_open (struct DH_RequestContext *rc, const struct TALER_ReservePublicKeyP *reserve_pub, const json_t *root); diff --git a/src/donau/donau-httpd_charities_status.c b/src/donau/donau-httpd_charities_status.c @@ -86,7 +86,7 @@ reply_reserve_status_success (struct MHD_Connection *connection, const struct DONAUDB_ReserveHistory *rh = rhc->rh; json_t *json_history; - json_history = TEH_RESPONSE_compile_reserve_history (rh); + json_history = DH_RESPONSE_compile_reserve_history (rh); if (NULL == json_history) return TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, @@ -126,7 +126,7 @@ reserve_status_transaction (void *cls, struct ReserveStatusContext *rsc = cls; enum GNUNET_DB_QueryStatus qs; - qs = TEH_plugin->get_reserve_status (TEH_plugin->cls, + qs = DH_plugin->get_reserve_status (DH_plugin->cls, rsc->reserve_pub, &rsc->balance_in, &rsc->balance_out, @@ -140,7 +140,7 @@ reserve_status_transaction (void *cls, TALER_EC_GENERIC_DB_FETCH_FAILED, "get_reserve_status"); } - qs = TEH_plugin->get_reserve_balance (TEH_plugin->cls, + qs = DH_plugin->get_reserve_balance (DH_plugin->cls, rsc->reserve_pub, &rsc->balance); if (GNUNET_DB_STATUS_HARD_ERROR == qs) @@ -157,7 +157,7 @@ reserve_status_transaction (void *cls, MHD_RESULT -TEH_handler_reserves_status (struct DH_RequestContext *rc, +DH_handler_reserves_status (struct DH_RequestContext *rc, const struct TALER_ReservePublicKeyP *reserve_pub, const json_t *root) { @@ -216,9 +216,9 @@ TEH_handler_reserves_status (struct DH_RequestContext *rc, } rsc.rh = NULL; if (GNUNET_OK != - TEH_DB_run_transaction (rc->connection, + DH_DB_run_transaction (rc->connection, "get reserve status", - TEH_MT_REQUEST_OTHER, + DH_MT_REQUEST_OTHER, &mhd_ret, &reserve_status_transaction, &rsc)) @@ -234,7 +234,7 @@ TEH_handler_reserves_status (struct DH_RequestContext *rc, } mhd_ret = reply_reserve_status_success (rc->connection, &rsc); - TEH_plugin->free_reserve_history (TEH_plugin->cls, + DH_plugin->free_reserve_history (DH_plugin->cls, rsc.rh); return mhd_ret; } diff --git a/src/donau/donau-httpd_charities_status.h b/src/donau/donau-httpd_charities_status.h @@ -36,7 +36,7 @@ * @return MHD result code */ MHD_RESULT -TEH_handler_reserves_status (struct DH_RequestContext *rc, +DH_handler_reserves_status (struct DH_RequestContext *rc, const struct TALER_ReservePublicKeyP *reserve_pub, const json_t *root); diff --git a/src/donau/donau-httpd_common_submit_receipts.c b/src/donau/donau-httpd_common_submit_receipts.c @@ -25,14 +25,14 @@ enum GNUNET_GenericReturnValue -TEH_common_purse_deposit_parse_coin ( +DH_common_purse_deposit_parse_coin ( struct MHD_Connection *connection, - struct TEH_PurseDepositedCoin *coin, + struct DH_PurseDepositedCoin *coin, const json_t *jcoin) { struct GNUNET_JSON_Specification spec[] = { TALER_JSON_spec_amount ("amount", - TEH_currency, + DH_currency, &coin->amount), GNUNET_JSON_spec_fixed_auto ("denom_pub_hash", &coin->cpi.denom_pub_hash), @@ -70,10 +70,10 @@ TEH_common_purse_deposit_parse_coin ( /* check denomination exists and is valid */ { - struct TEH_DenominationKey *dk; + struct DH_DenominationKey *dk; MHD_RESULT mret; - dk = TEH_keys_denomination_by_hash (&coin->cpi.denom_pub_hash, + dk = DH_keys_denomination_by_hash (&coin->cpi.denom_pub_hash, connection, &mret); if (NULL == dk) @@ -104,7 +104,7 @@ TEH_common_purse_deposit_parse_coin ( /* This denomination is past the expiration time for deposits */ GNUNET_JSON_parse_free (spec); return (MHD_YES == - TEH_RESPONSE_reply_expired_denom_pub_hash ( + DH_RESPONSE_reply_expired_denom_pub_hash ( connection, &coin->cpi.denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_EXPIRED, @@ -116,7 +116,7 @@ TEH_common_purse_deposit_parse_coin ( /* This denomination is not yet valid */ GNUNET_JSON_parse_free (spec); return (MHD_YES == - TEH_RESPONSE_reply_expired_denom_pub_hash ( + DH_RESPONSE_reply_expired_denom_pub_hash ( connection, &coin->cpi.denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_VALIDITY_IN_FUTURE, @@ -128,7 +128,7 @@ TEH_common_purse_deposit_parse_coin ( /* This denomination has been revoked */ GNUNET_JSON_parse_free (spec); return (MHD_YES == - TEH_RESPONSE_reply_expired_denom_pub_hash ( + DH_RESPONSE_reply_expired_denom_pub_hash ( connection, &coin->cpi.denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_REVOKED, @@ -167,10 +167,10 @@ TEH_common_purse_deposit_parse_coin ( switch (dk->denom_pub.cipher) { case TALER_DENOMINATION_RSA: - TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_RSA]++; + DH_METRICS_num_verifications[DH_MT_SIGNATURE_RSA]++; break; case TALER_DENOMINATION_CS: - TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_CS]++; + DH_METRICS_num_verifications[DH_MT_SIGNATURE_CS]++; break; default: break; @@ -194,14 +194,14 @@ TEH_common_purse_deposit_parse_coin ( enum GNUNET_GenericReturnValue -TEH_common_deposit_check_purse_deposit ( +DH_common_deposit_check_purse_deposit ( struct MHD_Connection *connection, - const struct TEH_PurseDepositedCoin *coin, + const struct DH_PurseDepositedCoin *coin, const struct TALER_PurseContractPublicKeyP *purse_pub, uint32_t min_age) { if (GNUNET_OK != - TALER_wallet_purse_deposit_verify (TEH_base_url, + TALER_wallet_purse_deposit_verify (DH_base_url, purse_pub, &coin->amount, &coin->cpi.denom_pub_hash, @@ -215,7 +215,7 @@ TEH_common_deposit_check_purse_deposit ( TALER_MHD_reply_with_error (connection, MHD_HTTP_FORBIDDEN, TALER_EC_DONAU_PURSE_DEPOSIT_COIN_SIGNATURE_INVALID, - TEH_base_url)) + DH_base_url)) ? GNUNET_NO : GNUNET_SYSERR; } @@ -259,7 +259,7 @@ TEH_common_deposit_check_purse_deposit ( * @param[in] coin information to release */ void -TEH_common_purse_deposit_free_coin (struct TEH_PurseDepositedCoin *coin) +DH_common_purse_deposit_free_coin (struct DH_PurseDepositedCoin *coin) { TALER_denom_sig_free (&coin->cpi.denom_sig); if (! coin->cpi.no_age_commitment) diff --git a/src/donau/donau-httpd_common_submit_receipts.h b/src/donau/donau-httpd_common_submit_receipts.h @@ -32,7 +32,7 @@ /** * Information about an individual coin being deposited. */ -struct TEH_PurseDepositedCoin +struct DH_PurseDepositedCoin { /** * Public information about the coin. @@ -93,9 +93,9 @@ struct TEH_PurseDepositedCoin * #GNUNET_SYSERR on failure and no error could be returned */ enum GNUNET_GenericReturnValue -TEH_common_purse_deposit_parse_coin ( +DH_common_purse_deposit_parse_coin ( struct MHD_Connection *connection, - struct TEH_PurseDepositedCoin *coin, + struct DH_PurseDepositedCoin *coin, const json_t *jcoin); @@ -111,9 +111,9 @@ TEH_common_purse_deposit_parse_coin ( * #GNUNET_SYSERR on failure and no error could be returned */ enum GNUNET_GenericReturnValue -TEH_common_deposit_check_purse_deposit ( +DH_common_deposit_check_purse_deposit ( struct MHD_Connection *connection, - const struct TEH_PurseDepositedCoin *coin, + const struct DH_PurseDepositedCoin *coin, const struct TALER_PurseContractPublicKeyP *purse_pub, uint32_t min_age); @@ -125,6 +125,6 @@ TEH_common_deposit_check_purse_deposit ( * @param[in] coin information to release */ void -TEH_common_purse_deposit_free_coin (struct TEH_PurseDepositedCoin *coin); +DH_common_purse_deposit_free_coin (struct DH_PurseDepositedCoin *coin); #endif diff --git a/src/donau/donau-httpd_config.c b/src/donau/donau-httpd_config.c @@ -29,7 +29,7 @@ MHD_RESULT -TEH_handler_config (struct DH_RequestContext *rc, +DH_handler_config (struct DH_RequestContext *rc, const char *const args[]) { static struct MHD_Response *resp; @@ -40,7 +40,7 @@ TEH_handler_config (struct DH_RequestContext *rc, GNUNET_JSON_pack_array_steal ("supported_kyc_requirements", TALER_KYCLOGIC_get_satisfiable ()), GNUNET_JSON_pack_string ("currency", - TEH_currency), + DH_currency), GNUNET_JSON_pack_string ("name", "taler-donau"), GNUNET_JSON_pack_string ("version", diff --git a/src/donau/donau-httpd_config.h b/src/donau/donau-httpd_config.h @@ -52,7 +52,7 @@ * @return MHD result code */ MHD_RESULT -TEH_handler_config (struct DH_RequestContext *rc, +DH_handler_config (struct DH_RequestContext *rc, const char *const args[]); #endif diff --git a/src/donau/donau-httpd_csr.c b/src/donau/donau-httpd_csr.c @@ -33,7 +33,7 @@ MHD_RESULT -TEH_handler_csr_melt (struct DH_RequestContext *rc, +DH_handler_csr_melt (struct DH_RequestContext *rc, const json_t *root, const char *const args[]) { @@ -48,7 +48,7 @@ TEH_handler_csr_melt (struct DH_RequestContext *rc, GNUNET_JSON_spec_end () }; enum TALER_ErrorCode ec; - struct TEH_DenominationKey *dk; + struct DH_DenominationKey *dk; (void) args; /* parse input */ @@ -78,7 +78,7 @@ TEH_handler_csr_melt (struct DH_RequestContext *rc, { struct TALER_CsNonce nonces[csr_requests_num]; struct TALER_DenominationHashP denom_pub_hashes[csr_requests_num]; - struct TEH_CsDeriveData cdds[csr_requests_num]; + struct DH_CsDeriveData cdds[csr_requests_num]; struct TALER_DenominationCSPublicRPairP r_pubs[csr_requests_num]; for (unsigned int i = 0; i < csr_requests_num; i++) @@ -117,9 +117,9 @@ TEH_handler_csr_melt (struct DH_RequestContext *rc, ewvs[i].cipher = TALER_DENOMINATION_CS; /* check denomination referenced by denom_pub_hash */ { - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; - ksh = TEH_keys_get_state (); + ksh = DH_keys_get_state (); if (NULL == ksh) { return TALER_MHD_reply_with_error (rc->connection, @@ -127,20 +127,20 @@ TEH_handler_csr_melt (struct DH_RequestContext *rc, TALER_EC_DONAU_GENERIC_KEYS_MISSING, NULL); } - dk = TEH_keys_denomination_by_hash_from_state (ksh, + dk = DH_keys_denomination_by_hash_from_state (ksh, denom_pub_hash, NULL, NULL); if (NULL == dk) { - return TEH_RESPONSE_reply_unknown_denom_pub_hash ( + return DH_RESPONSE_reply_unknown_denom_pub_hash ( rc->connection, &denom_pub_hash[i]); } if (GNUNET_TIME_absolute_is_past (dk->meta.expire_withdraw.abs_time)) { /* This denomination is past the expiration time for withdraws/refreshes*/ - return TEH_RESPONSE_reply_expired_denom_pub_hash ( + return DH_RESPONSE_reply_expired_denom_pub_hash ( rc->connection, denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_EXPIRED, @@ -150,7 +150,7 @@ TEH_handler_csr_melt (struct DH_RequestContext *rc, { /* This denomination is not yet valid, no need to check for idempotency! */ - return TEH_RESPONSE_reply_expired_denom_pub_hash ( + return DH_RESPONSE_reply_expired_denom_pub_hash ( rc->connection, denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_VALIDITY_IN_FUTURE, @@ -159,7 +159,7 @@ TEH_handler_csr_melt (struct DH_RequestContext *rc, if (dk->recoup_possible) { /* This denomination has been revoked */ - return TEH_RESPONSE_reply_expired_denom_pub_hash ( + return DH_RESPONSE_reply_expired_denom_pub_hash ( rc->connection, denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_REVOKED, @@ -168,7 +168,7 @@ TEH_handler_csr_melt (struct DH_RequestContext *rc, if (TALER_DENOMINATION_CS != dk->denom_pub.cipher) { /* denomination is valid but not for CS */ - return TEH_RESPONSE_reply_invalid_denom_cipher_for_operation ( + return DH_RESPONSE_reply_invalid_denom_cipher_for_operation ( rc->connection, denom_pub_hash); } @@ -176,7 +176,7 @@ TEH_handler_csr_melt (struct DH_RequestContext *rc, cdds[i].h_denom_pub = denom_pub_hash; cdds[i].nonce = nonce; } /* for (i) */ - ec = TEH_keys_denomination_cs_batch_r_pub (cdds, + ec = DH_keys_denomination_cs_batch_r_pub (cdds, csr_requests_num, true, r_pubs); @@ -222,7 +222,7 @@ TEH_handler_csr_melt (struct DH_RequestContext *rc, MHD_RESULT -TEH_handler_csr_withdraw (struct DH_RequestContext *rc, +DH_handler_csr_withdraw (struct DH_RequestContext *rc, const json_t *root, const char *const args[]) { @@ -238,7 +238,7 @@ TEH_handler_csr_withdraw (struct DH_RequestContext *rc, &denom_pub_hash), GNUNET_JSON_spec_end () }; - struct TEH_DenominationKey *dk; + struct DH_DenominationKey *dk; (void) args; { @@ -252,9 +252,9 @@ TEH_handler_csr_withdraw (struct DH_RequestContext *rc, } { - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; - ksh = TEH_keys_get_state (); + ksh = DH_keys_get_state (); if (NULL == ksh) { return TALER_MHD_reply_with_error (rc->connection, @@ -262,20 +262,20 @@ TEH_handler_csr_withdraw (struct DH_RequestContext *rc, TALER_EC_DONAU_GENERIC_KEYS_MISSING, NULL); } - dk = TEH_keys_denomination_by_hash_from_state (ksh, + dk = DH_keys_denomination_by_hash_from_state (ksh, &denom_pub_hash, NULL, NULL); if (NULL == dk) { - return TEH_RESPONSE_reply_unknown_denom_pub_hash ( + return DH_RESPONSE_reply_unknown_denom_pub_hash ( rc->connection, &denom_pub_hash); } if (GNUNET_TIME_absolute_is_past (dk->meta.expire_withdraw.abs_time)) { /* This denomination is past the expiration time for withdraws/refreshes*/ - return TEH_RESPONSE_reply_expired_denom_pub_hash ( + return DH_RESPONSE_reply_expired_denom_pub_hash ( rc->connection, &denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_EXPIRED, @@ -285,7 +285,7 @@ TEH_handler_csr_withdraw (struct DH_RequestContext *rc, { /* This denomination is not yet valid, no need to check for idempotency! */ - return TEH_RESPONSE_reply_expired_denom_pub_hash ( + return DH_RESPONSE_reply_expired_denom_pub_hash ( rc->connection, &denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_VALIDITY_IN_FUTURE, @@ -294,7 +294,7 @@ TEH_handler_csr_withdraw (struct DH_RequestContext *rc, if (dk->recoup_possible) { /* This denomination has been revoked */ - return TEH_RESPONSE_reply_expired_denom_pub_hash ( + return DH_RESPONSE_reply_expired_denom_pub_hash ( rc->connection, &denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_REVOKED, @@ -303,7 +303,7 @@ TEH_handler_csr_withdraw (struct DH_RequestContext *rc, if (TALER_DENOMINATION_CS != dk->denom_pub.cipher) { /* denomination is valid but not for CS */ - return TEH_RESPONSE_reply_invalid_denom_cipher_for_operation ( + return DH_RESPONSE_reply_invalid_denom_cipher_for_operation ( rc->connection, &denom_pub_hash); } @@ -312,12 +312,12 @@ TEH_handler_csr_withdraw (struct DH_RequestContext *rc, /* derive r_pub */ { enum TALER_ErrorCode ec; - const struct TEH_CsDeriveData cdd = { + const struct DH_CsDeriveData cdd = { .h_denom_pub = &denom_pub_hash, .nonce = &nonce }; - ec = TEH_keys_denomination_cs_r_pub (&cdd, + ec = DH_keys_denomination_cs_r_pub (&cdd, false, &ewv.details.cs_values); if (TALER_EC_NONE != ec) diff --git a/src/donau/donau-httpd_csr.h b/src/donau/donau-httpd_csr.h @@ -35,7 +35,7 @@ * @return MHD result code */ MHD_RESULT -TEH_handler_csr_melt (struct DH_RequestContext *rc, +DH_handler_csr_melt (struct DH_RequestContext *rc, const json_t *root, const char *const args[]); @@ -49,7 +49,7 @@ TEH_handler_csr_melt (struct DH_RequestContext *rc, * @return MHD result code */ MHD_RESULT -TEH_handler_csr_withdraw (struct DH_RequestContext *rc, +DH_handler_csr_withdraw (struct DH_RequestContext *rc, const json_t *root, const char *const args[]); diff --git a/src/donau/donau-httpd_db.c b/src/donau/donau-httpd_db.c @@ -30,7 +30,7 @@ enum GNUNET_DB_QueryStatus -TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin, +DH_make_coin_known (const struct TALER_CoinPublicInfo *coin, struct MHD_Connection *connection, uint64_t *known_coin_id, MHD_RESULT *mhd_ret) @@ -40,7 +40,7 @@ TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin, struct TALER_AgeCommitmentHash age_hash; /* make sure coin is 'known' in database */ - cks = TEH_plugin->ensure_coin_known (TEH_plugin->cls, + cks = DH_plugin->ensure_coin_known (DH_plugin->cls, coin, known_coin_id, &h_denom_pub, @@ -63,7 +63,7 @@ TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin, case DONAUDB_CKS_DENOM_CONFLICT: /* FIXME: insufficient_funds != denom conflict! See issue #7267, need new * strategy for evidence gathering */ - *mhd_ret = TEH_RESPONSE_reply_coin_insufficient_funds ( + *mhd_ret = DH_RESPONSE_reply_coin_insufficient_funds ( connection, TALER_EC_DONAU_GENERIC_COIN_CONFLICTING_DENOMINATION_KEY, &h_denom_pub, @@ -72,7 +72,7 @@ TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin, case DONAUDB_CKS_AGE_CONFLICT: /* FIXME: insufficient_funds != Age conflict! See issue #7267, need new * strategy for evidence gathering */ - *mhd_ret = TEH_RESPONSE_reply_coin_insufficient_funds ( + *mhd_ret = DH_RESPONSE_reply_coin_insufficient_funds ( connection, TALER_EC_DONAU_GENERIC_COIN_CONFLICTING_AGE_HASH, &h_denom_pub, @@ -85,17 +85,17 @@ TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin, enum GNUNET_GenericReturnValue -TEH_DB_run_transaction (struct MHD_Connection *connection, +DH_DB_run_transaction (struct MHD_Connection *connection, const char *name, - enum TEH_MetricTypeRequest mt, + enum DH_MetricTypeRequest mt, MHD_RESULT *mhd_ret, - TEH_DB_TransactionCallback cb, + DH_DB_TransactionCallback cb, void *cb_cls) { if (NULL != mhd_ret) *mhd_ret = -1; /* set to invalid value, to help detect bugs */ if (GNUNET_OK != - TEH_plugin->preflight (TEH_plugin->cls)) + DH_plugin->preflight (DH_plugin->cls)) { GNUNET_break (0); if (NULL != mhd_ret) @@ -105,8 +105,8 @@ TEH_DB_run_transaction (struct MHD_Connection *connection, NULL); return GNUNET_SYSERR; } - GNUNET_assert (mt < TEH_MT_REQUEST_COUNT); - TEH_METRICS_num_requests[mt]++; + GNUNET_assert (mt < DH_MT_REQUEST_COUNT); + DH_METRICS_num_requests[mt]++; for (unsigned int retries = 0; retries < MAX_TRANSACTION_COMMIT_RETRIES; retries++) @@ -114,7 +114,7 @@ TEH_DB_run_transaction (struct MHD_Connection *connection, enum GNUNET_DB_QueryStatus qs; if (GNUNET_OK != - TEH_plugin->start (TEH_plugin->cls, + DH_plugin->start (DH_plugin->cls, name)) { GNUNET_break (0); @@ -130,16 +130,16 @@ TEH_DB_run_transaction (struct MHD_Connection *connection, mhd_ret); if (0 > qs) { - TEH_plugin->rollback (TEH_plugin->cls); + DH_plugin->rollback (DH_plugin->cls); if (GNUNET_DB_STATUS_HARD_ERROR == qs) return GNUNET_SYSERR; } else { - qs = TEH_plugin->commit (TEH_plugin->cls); + qs = DH_plugin->commit (DH_plugin->cls); if (GNUNET_DB_STATUS_HARD_ERROR == qs) { - TEH_plugin->rollback (TEH_plugin->cls); + DH_plugin->rollback (DH_plugin->cls); if (NULL != mhd_ret) *mhd_ret = TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, @@ -148,16 +148,16 @@ TEH_DB_run_transaction (struct MHD_Connection *connection, return GNUNET_SYSERR; } if (0 > qs) - TEH_plugin->rollback (TEH_plugin->cls); + DH_plugin->rollback (DH_plugin->cls); } /* make sure callback did not violate invariants! */ GNUNET_assert ( (NULL == mhd_ret) || (-1 == (int) *mhd_ret) ); if (0 <= qs) return GNUNET_OK; - TEH_METRICS_num_conflict[mt]++; + DH_METRICS_num_conflict[mt]++; } - TEH_plugin->rollback (TEH_plugin->cls); + DH_plugin->rollback (DH_plugin->cls); TALER_LOG_ERROR ("Transaction `%s' commit failed %u times\n", name, MAX_TRANSACTION_COMMIT_RETRIES); diff --git a/src/donau/donau-httpd_db.h b/src/donau/donau-httpd_db.h @@ -50,7 +50,7 @@ * @return transaction status, negative on error (@a mhd_ret will be set in this case) */ enum GNUNET_DB_QueryStatus -TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin, +DH_make_coin_known (const struct TALER_CoinPublicInfo *coin, struct MHD_Connection *connection, uint64_t *known_coin_id, MHD_RESULT *mhd_ret); @@ -71,7 +71,7 @@ TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin, * @return transaction status */ typedef enum GNUNET_DB_QueryStatus -(*TEH_DB_TransactionCallback)(void *cls, +(*DH_DB_TransactionCallback)(void *cls, struct MHD_Connection *connection, MHD_RESULT *mhd_ret); @@ -94,11 +94,11 @@ typedef enum GNUNET_DB_QueryStatus * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure */ enum GNUNET_GenericReturnValue -TEH_DB_run_transaction (struct MHD_Connection *connection, +DH_DB_run_transaction (struct MHD_Connection *connection, const char *name, - enum TEH_MetricTypeRequest mt, + enum DH_MetricTypeRequest mt, MHD_RESULT *mhd_ret, - TEH_DB_TransactionCallback cb, + DH_DB_TransactionCallback cb, void *cb_cls); diff --git a/src/donau/donau-httpd_issue_receipts.c b/src/donau/donau-httpd_issue_receipts.c @@ -112,8 +112,8 @@ withdraw_amount_cb (void *cls, &wc->collectable.amount_with_fee, wc->now.abs_time)) return; - qs = TEH_plugin->select_withdraw_amounts_for_kyc_check ( - TEH_plugin->cls, + qs = DH_plugin->select_withdraw_amounts_for_kyc_check ( + DH_plugin->cls, &wc->h_account_payto, limit, cb, @@ -194,7 +194,7 @@ withdraw_transaction (void *cls, { char *reserve_payto; - reserve_payto = TALER_reserve_make_payto (TEH_base_url, + reserve_payto = TALER_reserve_make_payto (DH_base_url, &wc->collectable.reserve_pub); TALER_payto_hash (reserve_payto, &reserve_h_payto); @@ -209,9 +209,9 @@ withdraw_transaction (void *cls, = GNUNET_TIME_absolute_subtract (wc->now.abs_time, GNUNET_TIME_UNIT_MONTHS); GNUNET_assert (GNUNET_OK == - TALER_amount_set_zero (TEH_currency, + TALER_amount_set_zero (DH_currency, &merge_amount)); - qs = TEH_plugin->select_merge_amounts_for_kyc_check (TEH_plugin->cls, + qs = DH_plugin->select_merge_amounts_for_kyc_check (DH_plugin->cls, &reserve_h_payto, now_minus_one_month, &aml_amount_cb, @@ -226,7 +226,7 @@ withdraw_transaction (void *cls, "select_merge_amounts_for_kyc_check"); return qs; } - qs = TEH_plugin->select_aml_threshold (TEH_plugin->cls, + qs = DH_plugin->select_aml_threshold (DH_plugin->cls, &reserve_h_payto, &wc->aml_decision, &wc->kyc, @@ -243,7 +243,7 @@ withdraw_transaction (void *cls, } if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs) { - threshold = TEH_aml_threshold; /* use default */ + threshold = DH_aml_threshold; /* use default */ wc->aml_decision = TALER_AML_NORMAL; } @@ -257,7 +257,7 @@ withdraw_transaction (void *cls, break; } wc->aml_decision = TALER_AML_PENDING; - qs = TEH_plugin->trigger_aml_process (TEH_plugin->cls, + qs = DH_plugin->trigger_aml_process (DH_plugin->cls, &reserve_h_payto, &merge_amount); if (qs <= 0) @@ -283,7 +283,7 @@ withdraw_transaction (void *cls, } /* Check if the money came from a wire transfer */ - qs = TEH_plugin->reserves_get_origin (TEH_plugin->cls, + qs = DH_plugin->reserves_get_origin (DH_plugin->cls, &wc->collectable.reserve_pub, &wc->h_account_payto); if (qs < 0) @@ -297,8 +297,8 @@ withdraw_transaction (void *cls, qs = TALER_KYCLOGIC_kyc_test_required ( TALER_KYCLOGIC_KYC_TRIGGER_WITHDRAW, &wc->h_account_payto, - TEH_plugin->select_satisfied_kyc_processes, - TEH_plugin->cls, + DH_plugin->select_satisfied_kyc_processes, + DH_plugin->cls, &withdraw_amount_cb, wc, &kyc_required); @@ -318,8 +318,8 @@ withdraw_transaction (void *cls, { /* insert KYC requirement into DB! */ wc->kyc.ok = false; - qs = TEH_plugin->insert_kyc_requirement_for_account ( - TEH_plugin->cls, + qs = DH_plugin->insert_kyc_requirement_for_account ( + DH_plugin->cls, kyc_required, &wc->h_account_payto, &wc->collectable.reserve_pub, @@ -341,11 +341,11 @@ withdraw_transaction (void *cls, nonce = (TALER_DENOMINATION_CS == bp->cipher) ? &bp->details.cs_blinded_planchet.nonce : NULL; - qs = TEH_plugin->do_withdraw (TEH_plugin->cls, + qs = DH_plugin->do_withdraw (DH_plugin->cls, nonce, &wc->collectable, wc->now, - TEH_age_restriction_enabled, + DH_age_restriction_enabled, &found, &balance_ok, &nonce_ok, @@ -377,21 +377,21 @@ withdraw_transaction (void *cls, /* We respond with the lowest age in the corresponding age group * of the required age */ uint16_t lowest_age = TALER_get_lowest_age ( - &TEH_age_restriction_config.mask, + &DH_age_restriction_config.mask, allowed_maximum_age); - TEH_plugin->rollback (TEH_plugin->cls); - *mhd_ret = TEH_RESPONSE_reply_reserve_age_restriction_required ( + DH_plugin->rollback (DH_plugin->cls); + *mhd_ret = DH_RESPONSE_reply_reserve_age_restriction_required ( connection, lowest_age); return GNUNET_DB_STATUS_HARD_ERROR; } if (! balance_ok) { - TEH_plugin->rollback (TEH_plugin->cls); + DH_plugin->rollback (DH_plugin->cls); GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Balance insufficient for /withdraw\n"); - *mhd_ret = TEH_RESPONSE_reply_reserve_insufficient_balance ( + *mhd_ret = DH_RESPONSE_reply_reserve_insufficient_balance ( connection, TALER_EC_DONAU_WITHDRAW_INSUFFICIENT_FUNDS, &wc->collectable.amount_with_fee, @@ -400,7 +400,7 @@ withdraw_transaction (void *cls, } if (! nonce_ok) { - TEH_plugin->rollback (TEH_plugin->cls); + DH_plugin->rollback (DH_plugin->cls); *mhd_ret = TALER_MHD_reply_with_error (connection, MHD_HTTP_CONFLICT, TALER_EC_DONAU_WITHDRAW_NONCE_REUSE, @@ -408,7 +408,7 @@ withdraw_transaction (void *cls, return GNUNET_DB_STATUS_HARD_ERROR; } if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qs) - TEH_METRICS_num_success[TEH_MT_SUCCESS_WITHDRAW]++; + DH_METRICS_num_success[DH_MT_SUCCESS_WITHDRAW]++; return qs; } @@ -431,7 +431,7 @@ check_request_idempotent (struct DH_RequestContext *rc, { enum GNUNET_DB_QueryStatus qs; - qs = TEH_plugin->get_withdraw_info (TEH_plugin->cls, + qs = DH_plugin->get_withdraw_info (DH_plugin->cls, &wc->h_coin_envelope, &wc->collectable); if (0 > qs) @@ -447,7 +447,7 @@ check_request_idempotent (struct DH_RequestContext *rc, if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs) return false; /* generate idempotent reply */ - TEH_METRICS_num_requests[TEH_MT_REQUEST_IDEMPOTENT_WITHDRAW]++; + DH_METRICS_num_requests[DH_MT_REQUEST_IDEMPOTENT_WITHDRAW]++; *mret = TALER_MHD_REPLY_JSON_PACK ( rc->connection, MHD_HTTP_OK, @@ -459,7 +459,7 @@ check_request_idempotent (struct DH_RequestContext *rc, MHD_RESULT -TEH_handler_withdraw (struct DH_RequestContext *rc, +DH_handler_withdraw (struct DH_RequestContext *rc, const struct TALER_ReservePublicKeyP *reserve_pub, const json_t *root) { @@ -474,7 +474,7 @@ TEH_handler_withdraw (struct DH_RequestContext *rc, GNUNET_JSON_spec_end () }; enum TALER_ErrorCode ec; - struct TEH_DenominationKey *dk; + struct DH_DenominationKey *dk; memset (&wc, 0, @@ -491,9 +491,9 @@ TEH_handler_withdraw (struct DH_RequestContext *rc, } { MHD_RESULT mret; - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; - ksh = TEH_keys_get_state (); + ksh = DH_keys_get_state (); if (NULL == ksh) { if (! check_request_idempotent (rc, @@ -510,7 +510,7 @@ TEH_handler_withdraw (struct DH_RequestContext *rc, return mret; } - dk = TEH_keys_denomination_by_hash_from_state ( + dk = DH_keys_denomination_by_hash_from_state ( ksh, &wc.collectable.denom_pub_hash, NULL, @@ -523,7 +523,7 @@ TEH_handler_withdraw (struct DH_RequestContext *rc, &mret)) { GNUNET_JSON_parse_free (spec); - return TEH_RESPONSE_reply_unknown_denom_pub_hash ( + return DH_RESPONSE_reply_unknown_denom_pub_hash ( rc->connection, &wc.collectable.denom_pub_hash); } @@ -538,7 +538,7 @@ TEH_handler_withdraw (struct DH_RequestContext *rc, &mret)) { GNUNET_JSON_parse_free (spec); - return TEH_RESPONSE_reply_expired_denom_pub_hash ( + return DH_RESPONSE_reply_expired_denom_pub_hash ( rc->connection, &wc.collectable.denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_EXPIRED, @@ -552,7 +552,7 @@ TEH_handler_withdraw (struct DH_RequestContext *rc, /* This denomination is not yet valid, no need to check for idempotency! */ GNUNET_JSON_parse_free (spec); - return TEH_RESPONSE_reply_expired_denom_pub_hash ( + return DH_RESPONSE_reply_expired_denom_pub_hash ( rc->connection, &wc.collectable.denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_VALIDITY_IN_FUTURE, @@ -566,7 +566,7 @@ TEH_handler_withdraw (struct DH_RequestContext *rc, &mret)) { GNUNET_JSON_parse_free (spec); - return TEH_RESPONSE_reply_expired_denom_pub_hash ( + return DH_RESPONSE_reply_expired_denom_pub_hash ( rc->connection, &wc.collectable.denom_pub_hash, TALER_EC_DONAU_GENERIC_DENOMINATION_REVOKED, @@ -611,7 +611,7 @@ TEH_handler_withdraw (struct DH_RequestContext *rc, NULL); } - TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_EDDSA]++; + DH_METRICS_num_verifications[DH_MT_SIGNATURE_EDDSA]++; if (GNUNET_OK != TALER_wallet_withdraw_verify (&wc.collectable.denom_pub_hash, &wc.collectable.amount_with_fee, @@ -628,13 +628,13 @@ TEH_handler_withdraw (struct DH_RequestContext *rc, } { - struct TEH_CoinSignData csd = { + struct DH_CoinSignData csd = { .h_denom_pub = &wc.collectable.denom_pub_hash, .bp = &wc.blinded_planchet }; /* Sign before transaction! */ - ec = TEH_keys_denomination_sign ( + ec = DH_keys_denomination_sign ( &csd, false, &wc.collectable.sig); @@ -656,9 +656,9 @@ TEH_handler_withdraw (struct DH_RequestContext *rc, MHD_RESULT mhd_ret; if (GNUNET_OK != - TEH_DB_run_transaction (rc->connection, + DH_DB_run_transaction (rc->connection, "run withdraw", - TEH_MT_REQUEST_WITHDRAW, + DH_MT_REQUEST_WITHDRAW, &mhd_ret, &withdraw_transaction, &wc)) @@ -675,12 +675,12 @@ TEH_handler_withdraw (struct DH_RequestContext *rc, GNUNET_JSON_parse_free (spec); if (! wc.kyc.ok) - return TEH_RESPONSE_reply_kyc_required (rc->connection, + return DH_RESPONSE_reply_kyc_required (rc->connection, &wc.h_account_payto, &wc.kyc); if (TALER_AML_NORMAL != wc.aml_decision) - return TEH_RESPONSE_reply_aml_blocked (rc->connection, + return DH_RESPONSE_reply_aml_blocked (rc->connection, wc.aml_decision); { diff --git a/src/donau/donau-httpd_issue_receipts.h b/src/donau/donau-httpd_issue_receipts.h @@ -40,7 +40,7 @@ * @return MHD result code */ MHD_RESULT -TEH_handler_withdraw (struct DH_RequestContext *rc, +DH_handler_withdraw (struct DH_RequestContext *rc, const struct TALER_ReservePublicKeyP *reserve_pub, const json_t *root); diff --git a/src/donau/donau-httpd_keys.c b/src/donau/donau-httpd_keys.c @@ -107,17 +107,17 @@ struct HelperDenomination /** * Signatures of an auditor over a denomination key of this donau. */ -struct TEH_AuditorSignature +struct DH_AuditorSignature { /** * We store the signatures in a DLL. */ - struct TEH_AuditorSignature *prev; + struct DH_AuditorSignature *prev; /** * We store the signatures in a DLL. */ - struct TEH_AuditorSignature *next; + struct DH_AuditorSignature *next; /** * A signature from the auditor. @@ -164,7 +164,7 @@ struct HelperSignkey /** * State associated with the crypto helpers / security modules. NOT updated * when the #key_generation is updated (instead constantly kept in sync - * whenever #TEH_keys_get_state() is called). + * whenever #DH_keys_get_state() is called). */ struct HelperState { @@ -268,7 +268,7 @@ struct SigningKey }; -struct TEH_KeyStateHandle +struct DH_KeyStateHandle { /** @@ -287,12 +287,12 @@ struct TEH_KeyStateHandle /** * Head of DLL of our global fees. */ - struct TEH_GlobalFee *gf_head; + struct DH_GlobalFee *gf_head; /** * Tail of DLL of our global fees. */ - struct TEH_GlobalFee *gf_tail; + struct DH_GlobalFee *gf_tail; /** * json array with the auditors of this donau. Contains exactly @@ -392,12 +392,12 @@ struct SuspendedKeysRequests /** * Stores the latest generation of our key state. */ -static struct TEH_KeyStateHandle *key_state; +static struct DH_KeyStateHandle *key_state; /** * Counter incremented whenever we have a reason to re-build the keys because - * something external changed. See #TEH_keys_get_state() and - * #TEH_keys_update_states() for uses of this variable. + * something external changed. See #DH_keys_get_state() and + * #DH_keys_update_states() for uses of this variable. */ static uint64_t key_generation; @@ -548,7 +548,7 @@ suspend_request (struct MHD_Connection *connection) * * @param cls NULL * @param hc denomination hash (unused) - * @param value a `struct TEH_DenominationKey` + * @param value a `struct DH_DenominationKey` * @return #GNUNET_OK */ static enum GNUNET_GenericReturnValue @@ -556,7 +556,7 @@ check_dk (void *cls, const struct GNUNET_HashCode *hc, void *value) { - struct TEH_DenominationKey *dk = value; + struct DH_DenominationKey *dk = value; (void) cls; (void) hc; @@ -570,13 +570,13 @@ check_dk (void *cls, void -TEH_check_invariants () +DH_check_invariants () { - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; - if (0 == TEH_check_invariants_flag) + if (0 == DH_check_invariants_flag) return; - ksh = TEH_keys_get_state (); + ksh = DH_keys_get_state (); if (NULL == ksh) return; GNUNET_CONTAINER_multihashmap_iterate (ksh->denomkey_map, @@ -586,7 +586,7 @@ TEH_check_invariants () void -TEH_resume_keys_requests (bool do_shutdown) +DH_resume_keys_requests (bool do_shutdown) { struct SuspendedKeysRequests *skr; @@ -611,7 +611,7 @@ TEH_resume_keys_requests (bool do_shutdown) * @param[in,out] ksh key state to update */ static void -clear_response_cache (struct TEH_KeyStateHandle *ksh) +clear_response_cache (struct DH_KeyStateHandle *ksh) { for (unsigned int i = 0; i<ksh->krd_array_length; i++) { @@ -802,13 +802,13 @@ load_age_mask (const char *section_name) enum GNUNET_GenericReturnValue ret; if (GNUNET_OK != (GNUNET_CONFIGURATION_have_value ( - TEH_cfg, + DH_cfg, section_name, "AGE_RESTRICTED"))) return null_mask; if (GNUNET_SYSERR == - (ret = GNUNET_CONFIGURATION_get_value_yesno (TEH_cfg, + (ret = GNUNET_CONFIGURATION_get_value_yesno (DH_cfg, section_name, "AGE_RESTRICTED"))) { @@ -821,11 +821,11 @@ load_age_mask (const char *section_name) if (GNUNET_OK == ret) { - if (! TEH_age_restriction_enabled) + if (! DH_age_restriction_enabled) GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "age restriction set in section %s, yet, age restriction is not enabled\n", section_name); - return TEH_age_restriction_config.mask; + return DH_age_restriction_config.mask; } @@ -872,7 +872,7 @@ helper_rsa_cb ( GNUNET_STRINGS_relative_time_to_string (validity_duration, GNUNET_NO)); key_generation++; - TEH_resume_keys_requests (false); + DH_resume_keys_requests (false); hd = GNUNET_CONTAINER_multihashmap_get (hs->rsa_keys, &h_rsa->hash); if (NULL != hd) @@ -953,7 +953,7 @@ helper_cs_cb ( GNUNET_STRINGS_relative_time_to_string (validity_duration, GNUNET_NO)); key_generation++; - TEH_resume_keys_requests (false); + DH_resume_keys_requests (false); hd = GNUNET_CONTAINER_multihashmap_get (hs->cs_keys, &h_cs->hash); if (NULL != hd) @@ -1028,7 +1028,7 @@ helper_esign_cb ( GNUNET_STRINGS_relative_time_to_string (validity_duration, GNUNET_NO)); key_generation++; - TEH_resume_keys_requests (false); + DH_resume_keys_requests (false); pid.public_key = donau_pub->eddsa_pub; hsk = GNUNET_CONTAINER_multipeermap_get (hs->esign_keys, &pid); @@ -1076,7 +1076,7 @@ setup_key_helpers (struct HelperState *hs) hs->esign_keys = GNUNET_CONTAINER_multipeermap_create (32, GNUNET_NO /* MUST BE NO! */); - hs->rsadh = TALER_CRYPTO_helper_rsa_connect (TEH_cfg, + hs->rsadh = TALER_CRYPTO_helper_rsa_connect (DH_cfg, &helper_rsa_cb, hs); if (NULL == hs->rsadh) @@ -1084,7 +1084,7 @@ setup_key_helpers (struct HelperState *hs) destroy_key_helpers (hs); return GNUNET_SYSERR; } - hs->csdh = TALER_CRYPTO_helper_cs_connect (TEH_cfg, + hs->csdh = TALER_CRYPTO_helper_cs_connect (DH_cfg, &helper_cs_cb, hs); if (NULL == hs->csdh) @@ -1092,7 +1092,7 @@ setup_key_helpers (struct HelperState *hs) destroy_key_helpers (hs); return GNUNET_SYSERR; } - hs->esh = TALER_CRYPTO_helper_esign_connect (TEH_cfg, + hs->esh = TALER_CRYPTO_helper_esign_connect (DH_cfg, &helper_esign_cb, hs); if (NULL == hs->esh) @@ -1121,9 +1121,9 @@ sync_key_helpers (struct HelperState *hs) /** * Free denomination key data. * - * @param cls a `struct TEH_KeyStateHandle`, unused + * @param cls a `struct DH_KeyStateHandle`, unused * @param h_denom_pub hash of the denomination public key, unused - * @param value a `struct TEH_DenominationKey` to free + * @param value a `struct DH_DenominationKey` to free * @return #GNUNET_OK (continue to iterate) */ static enum GNUNET_GenericReturnValue @@ -1131,8 +1131,8 @@ clear_denomination_cb (void *cls, const struct GNUNET_HashCode *h_denom_pub, void *value) { - struct TEH_DenominationKey *dk = value; - struct TEH_AuditorSignature *as; + struct DH_DenominationKey *dk = value; + struct DH_AuditorSignature *as; (void) cls; (void) h_denom_pub; @@ -1152,7 +1152,7 @@ clear_denomination_cb (void *cls, /** * Free denomination key data. * - * @param cls a `struct TEH_KeyStateHandle`, unused + * @param cls a `struct DH_KeyStateHandle`, unused * @param pid the online signing key (type-disguised), unused * @param value a `struct SigningKey` to free * @return #GNUNET_OK (continue to iterate) @@ -1179,10 +1179,10 @@ clear_signkey_cb (void *cls, * @param free_helper true to also release the helper state */ static void -destroy_key_state (struct TEH_KeyStateHandle *ksh, +destroy_key_state (struct DH_KeyStateHandle *ksh, bool free_helper) { - struct TEH_GlobalFee *gf; + struct DH_GlobalFee *gf; clear_response_cache (ksh); while (NULL != (gf = ksh->gf_head)) @@ -1236,15 +1236,15 @@ keys_update_event_cb (void *cls, (void) extra_size; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Received /keys update event\n"); - TEH_check_invariants (); + DH_check_invariants (); key_generation++; - TEH_resume_keys_requests (false); - TEH_check_invariants (); + DH_resume_keys_requests (false); + DH_check_invariants (); } enum GNUNET_GenericReturnValue -TEH_keys_init () +DH_keys_init () { struct GNUNET_DB_EventHeaderP es = { .size = htons (sizeof (es)), @@ -1252,7 +1252,7 @@ TEH_keys_init () }; if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_time (TEH_cfg, + GNUNET_CONFIGURATION_get_value_time (DH_cfg, "donau", "SIGNKEY_LEGAL_DURATION", &signkey_legal_duration)) @@ -1263,7 +1263,7 @@ TEH_keys_init () return GNUNET_SYSERR; } if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_string (TEH_cfg, + GNUNET_CONFIGURATION_get_value_string (DH_cfg, "donau", "ASSET_TYPE", &asset_type)) @@ -1273,7 +1273,7 @@ TEH_keys_init () "ASSET_TYPE"); asset_type = GNUNET_strdup ("fiat"); } - keys_eh = TEH_plugin->event_listen (TEH_plugin->cls, + keys_eh = DH_plugin->event_listen (DH_plugin->cls, GNUNET_TIME_UNIT_FOREVER_REL, &es, &keys_update_event_cb, @@ -1291,7 +1291,7 @@ TEH_keys_init () * Fully clean up our state. */ void -TEH_keys_finished () +DH_keys_finished () { if (NULL != keys_tt) { @@ -1303,7 +1303,7 @@ TEH_keys_finished () true); if (NULL != keys_eh) { - TEH_plugin->event_listen_cancel (TEH_plugin->cls, + DH_plugin->event_listen_cancel (DH_plugin->cls, keys_eh); keys_eh = NULL; } @@ -1313,7 +1313,7 @@ TEH_keys_finished () /** * Function called with information about the donau's denomination keys. * - * @param cls closure with a `struct TEH_KeyStateHandle *` + * @param cls closure with a `struct DH_KeyStateHandle *` * @param denom_pub public key of the denomination * @param h_denom_pub hash of @a denom_pub * @param meta meta data information about the denomination type (value, expirations, fees) @@ -1330,8 +1330,8 @@ denomination_info_cb ( const struct TALER_MasterSignatureP *master_sig, bool recoup_possible) { - struct TEH_KeyStateHandle *ksh = cls; - struct TEH_DenominationKey *dk; + struct DH_KeyStateHandle *ksh = cls; + struct DH_DenominationKey *dk; if (GNUNET_OK != TALER_donau_offline_denom_validity_verify ( @@ -1342,7 +1342,7 @@ denomination_info_cb ( meta->expire_legal, &meta->value, &meta->fees, - &TEH_master_public_key, + &DH_master_public_key, master_sig)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, @@ -1361,7 +1361,7 @@ denomination_info_cb ( GNUNET_h2s (&h_denom_pub->hash)); return; } - dk = GNUNET_new (struct TEH_DenominationKey); + dk = GNUNET_new (struct DH_DenominationKey); TALER_denom_pub_deep_copy (&dk->denom_pub, denom_pub); dk->h_denom_pub = *h_denom_pub; @@ -1382,7 +1382,7 @@ denomination_info_cb ( /** * Function called with information about the donau's online signing keys. * - * @param cls closure with a `struct TEH_KeyStateHandle *` + * @param cls closure with a `struct DH_KeyStateHandle *` * @param donau_pub the public key * @param meta meta data information about the denomination type (expirations) * @param master_sig master signature affirming the validity of this denomination @@ -1394,7 +1394,7 @@ signkey_info_cb ( const struct DONAUDB_SignkeyMetaData *meta, const struct TALER_MasterSignatureP *master_sig) { - struct TEH_KeyStateHandle *ksh = cls; + struct DH_KeyStateHandle *ksh = cls; struct SigningKey *sk; struct GNUNET_PeerIdentity pid; @@ -1404,7 +1404,7 @@ signkey_info_cb ( meta->start, meta->expire_sign, meta->expire_legal, - &TEH_master_public_key, + &DH_master_public_key, master_sig)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, @@ -1448,7 +1448,7 @@ struct GetAuditorSigsContext * * @param cls a `struct GetAuditorSigsContext` * @param h_denom_pub hash of the denomination public key - * @param value a `struct TEH_DenominationKey` + * @param value a `struct DH_DenominationKey` * @return #GNUNET_OK (continue to iterate) */ static enum GNUNET_GenericReturnValue @@ -1457,9 +1457,9 @@ get_auditor_sigs (void *cls, void *value) { struct GetAuditorSigsContext *ctx = cls; - struct TEH_DenominationKey *dk = value; + struct DH_DenominationKey *dk = value; - for (struct TEH_AuditorSignature *as = dk->as_head; + for (struct DH_AuditorSignature *as = dk->as_head; NULL != as; as = as->next) { @@ -1483,7 +1483,7 @@ get_auditor_sigs (void *cls, /** * Function called with information about the donau's auditors. * - * @param cls closure with a `struct TEH_KeyStateHandle *` + * @param cls closure with a `struct DH_KeyStateHandle *` * @param auditor_pub the public key of the auditor * @param auditor_url URL of the REST API of the auditor * @param auditor_name human readable official name of the auditor @@ -1495,7 +1495,7 @@ auditor_info_cb ( const char *auditor_url, const char *auditor_name) { - struct TEH_KeyStateHandle *ksh = cls; + struct DH_KeyStateHandle *ksh = cls; struct GetAuditorSigsContext ctx; ctx.denom_keys = json_array (); @@ -1523,7 +1523,7 @@ auditor_info_cb ( * Function called with information about the denominations * audited by the donau's auditors. * - * @param cls closure with a `struct TEH_KeyStateHandle *` + * @param cls closure with a `struct DH_KeyStateHandle *` * @param auditor_pub the public key of an auditor * @param h_denom_pub hash of a denomination key audited by this auditor * @param auditor_sig signature from the auditor affirming this @@ -1535,9 +1535,9 @@ auditor_denom_cb ( const struct TALER_DenominationHashP *h_denom_pub, const struct TALER_AuditorSignatureP *auditor_sig) { - struct TEH_KeyStateHandle *ksh = cls; - struct TEH_DenominationKey *dk; - struct TEH_AuditorSignature *as; + struct DH_KeyStateHandle *ksh = cls; + struct DH_DenominationKey *dk; + struct DH_AuditorSignature *as; dk = GNUNET_CONTAINER_multihashmap_get (ksh->denomkey_map, &h_denom_pub->hash); @@ -1549,7 +1549,7 @@ auditor_denom_cb ( GNUNET_break (0); return; } - as = GNUNET_new (struct TEH_AuditorSignature); + as = GNUNET_new (struct DH_AuditorSignature); as->asig = *auditor_sig; as->apub = *auditor_pub; GNUNET_CONTAINER_DLL_insert (dk->as_head, @@ -1650,7 +1650,7 @@ struct DenomKeyCtx * * @param cls a `struct DenomKeyCtx` * @param h_denom_pub hash of the denomination key - * @param value a `struct TEH_DenominationKey` + * @param value a `struct DH_DenominationKey` * @return #GNUNET_OK (continue to iterate) */ static enum GNUNET_GenericReturnValue @@ -1659,7 +1659,7 @@ add_denom_key_cb (void *cls, void *value) { struct DenomKeyCtx *dkc = cls; - struct TEH_DenominationKey *dk = value; + struct DH_DenominationKey *dk = value; if (dk->recoup_possible) { @@ -1698,7 +1698,7 @@ add_denom_key_cb (void *cls, * @return #GNUNET_OK on success */ static enum GNUNET_GenericReturnValue -setup_general_response_headers (struct TEH_KeyStateHandle *ksh, +setup_general_response_headers (struct DH_KeyStateHandle *ksh, struct WireStateHandle *wsh, struct MHD_Response *response) { @@ -1723,7 +1723,7 @@ setup_general_response_headers (struct TEH_KeyStateHandle *ksh, struct GNUNET_TIME_Timestamp m; struct GNUNET_TIME_Timestamp we; - r = GNUNET_TIME_relative_min (TEH_max_keys_caching, + r = GNUNET_TIME_relative_min (DH_max_keys_caching, ksh->rekey_frequency); a = GNUNET_TIME_relative_to_absolute (r); km = GNUNET_TIME_absolute_to_timestamp (a); @@ -1794,7 +1794,7 @@ wallet_threshold_cb (void *cls, * @return #GNUNET_OK on success */ static enum GNUNET_GenericReturnValue -create_krd (struct TEH_KeyStateHandle *ksh, +create_krd (struct DH_KeyStateHandle *ksh, const struct GNUNET_HashCode *denom_keys_hash, struct GNUNET_TIME_Timestamp last_cherry_pick_date, json_t *signkeys, @@ -1823,7 +1823,7 @@ create_krd (struct TEH_KeyStateHandle *ksh, GNUNET_assert (NULL != grouped_denominations); GNUNET_assert (NULL != h_grouped); GNUNET_assert (NULL != ksh->auditors); - GNUNET_assert (NULL != TEH_currency); + GNUNET_assert (NULL != DH_currency); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Creating /keys at cherry pick date %s\n", GNUNET_TIME_timestamp2s (last_cherry_pick_date)); @@ -1835,7 +1835,7 @@ create_krd (struct TEH_KeyStateHandle *ksh, if (TALER_EC_NONE != (ec = TALER_donau_online_key_set_sign ( - &TEH_keys_donau_sign2_, + &DH_keys_donau_sign2_, ksh, last_cherry_pick_date, denom_keys_hash, @@ -1856,7 +1856,7 @@ create_krd (struct TEH_KeyStateHandle *ksh, if (TALER_EC_NONE != (ec = TALER_donau_online_key_set_sign ( - &TEH_keys_donau_sign2_, + &DH_keys_donau_sign2_, ksh, last_cherry_pick_date, h_grouped, @@ -1896,26 +1896,26 @@ create_krd (struct TEH_KeyStateHandle *ksh, GNUNET_JSON_pack_string ("version", DONAU_PROTOCOL_VERSION), GNUNET_JSON_pack_string ("base_url", - TEH_base_url), + DH_base_url), GNUNET_JSON_pack_string ("currency", - TEH_currency), + DH_currency), GNUNET_JSON_pack_uint64 ("currency_fraction_digits", - TEH_currency_fraction_digits), + DH_currency_fraction_digits), TALER_JSON_pack_amount ("stefan_abs", - &TEH_stefan_abs), + &DH_stefan_abs), TALER_JSON_pack_amount ("stefan_log", - &TEH_stefan_log), + &DH_stefan_log), TALER_JSON_pack_amount ("stefan_lin", - &TEH_stefan_lin), + &DH_stefan_lin), GNUNET_JSON_pack_string ("asset_type", asset_type), GNUNET_JSON_pack_bool ("rewards_allowed", GNUNET_YES == - TEH_enable_rewards), + DH_enable_rewards), GNUNET_JSON_pack_data_auto ("master_public_key", - &TEH_master_public_key), + &DH_master_public_key), GNUNET_JSON_pack_time_rel ("reserve_closing_delay", - TEH_reserve_closing_delay), + DH_reserve_closing_delay), GNUNET_JSON_pack_array_incref ("signkeys", signkeys), GNUNET_JSON_pack_array_incref ("recoup", @@ -2008,11 +2008,11 @@ create_krd (struct TEH_KeyStateHandle *ksh, GNUNET_assert (0 == r); /* Add the signature of the extensions, if it is not zero */ - if (TEH_extensions_signed) + if (DH_extensions_signed) { sig = GNUNET_JSON_PACK ( GNUNET_JSON_pack_data_auto ("extensions_sig", - &TEH_extensions_sig)); + &DH_extensions_sig)); r = json_object_update (keys, sig); GNUNET_assert (0 == r); @@ -2124,7 +2124,7 @@ create_krd (struct TEH_KeyStateHandle *ksh, * @return #GNUNET_OK on success */ static enum GNUNET_GenericReturnValue -finish_keys_response (struct TEH_KeyStateHandle *ksh) +finish_keys_response (struct DH_KeyStateHandle *ksh) { enum GNUNET_GenericReturnValue ret = GNUNET_SYSERR; json_t *recoup; @@ -2172,7 +2172,7 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh) // "denom_pubs" array along with the new grouped "denominations". // "denom_pubs" Will be removed sooner or later. { - struct TEH_DenominationKey *dk; + struct DH_DenominationKey *dk; struct GNUNET_CONTAINER_MultiHashMap *denominations_by_group; /* GroupData is the value we store for each group meta-data */ struct GroupData @@ -2455,13 +2455,13 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh) /* Sanity check: Make sure that age restriction is enabled IFF at least * one age restricted denomination exist */ - if (! has_age_restricted_denomination && TEH_age_restriction_enabled) + if (! has_age_restricted_denomination && DH_age_restriction_enabled) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Age restriction is enabled, but NO denominations with age restriction found!\n"); goto CLEANUP; } - else if (has_age_restricted_denomination && ! TEH_age_restriction_enabled) + else if (has_age_restricted_denomination && ! DH_age_restriction_enabled) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Age restriction is NOT enabled, but denominations with age restriction found!\n"); @@ -2488,7 +2488,7 @@ CLEANUP: /** * Called with information about global fees. * - * @param cls `struct TEH_KeyStateHandle *` we are building + * @param cls `struct DH_KeyStateHandle *` we are building * @param fees the global fees we charge * @param purse_timeout when do purses time out * @param history_expiration how long are account histories preserved @@ -2509,8 +2509,8 @@ global_fee_info_cb ( struct GNUNET_TIME_Timestamp end_date, const struct TALER_MasterSignatureP *master_sig) { - struct TEH_KeyStateHandle *ksh = cls; - struct TEH_GlobalFee *gf; + struct DH_KeyStateHandle *ksh = cls; + struct DH_GlobalFee *gf; if (GNUNET_OK != TALER_donau_offline_global_fee_verify ( @@ -2520,7 +2520,7 @@ global_fee_info_cb ( purse_timeout, history_expiration, purse_account_limit, - &TEH_master_public_key, + &DH_master_public_key, master_sig)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, @@ -2530,7 +2530,7 @@ global_fee_info_cb ( GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Found global fees with %u purses\n", purse_account_limit); - gf = GNUNET_new (struct TEH_GlobalFee); + gf = GNUNET_new (struct DH_GlobalFee); gf->start_date = start_date; gf->end_date = end_date; gf->fees = *fees; @@ -2570,14 +2570,14 @@ global_fee_info_cb ( * because we only need the state for the /management/keys API * @return NULL on error (i.e. failed to access database) */ -static struct TEH_KeyStateHandle * +static struct DH_KeyStateHandle * build_key_state (struct HelperState *hs, bool management_only) { - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; enum GNUNET_DB_QueryStatus qs; - ksh = GNUNET_new (struct TEH_KeyStateHandle); + ksh = GNUNET_new (struct DH_KeyStateHandle); ksh->signature_expires = GNUNET_TIME_UNIT_FOREVER_TS; ksh->reload_time = GNUNET_TIME_timestamp_get (); /* We must use the key_generation from when we STARTED the process! */ @@ -2606,11 +2606,11 @@ build_key_state (struct HelperState *hs, GNUNET_assert (NULL != ksh->auditors); /* NOTE: fetches master-signed signkeys, but ALSO those that were revoked! */ GNUNET_break (GNUNET_OK == - TEH_plugin->preflight (TEH_plugin->cls)); + DH_plugin->preflight (DH_plugin->cls)); if (NULL != ksh->global_fees) json_decref (ksh->global_fees); ksh->global_fees = json_array (); - qs = TEH_plugin->get_global_fees (TEH_plugin->cls, + qs = DH_plugin->get_global_fees (DH_plugin->cls, &global_fee_info_cb, ksh); GNUNET_log (GNUNET_ERROR_TYPE_INFO, @@ -2624,7 +2624,7 @@ build_key_state (struct HelperState *hs, true); return NULL; } - qs = TEH_plugin->iterate_denominations (TEH_plugin->cls, + qs = DH_plugin->iterate_denominations (DH_plugin->cls, &denomination_info_cb, ksh); if (qs < 0) @@ -2636,7 +2636,7 @@ build_key_state (struct HelperState *hs, return NULL; } /* NOTE: ONLY fetches non-revoked AND master-signed signkeys! */ - qs = TEH_plugin->iterate_active_signkeys (TEH_plugin->cls, + qs = DH_plugin->iterate_active_signkeys (DH_plugin->cls, &signkey_info_cb, ksh); if (qs < 0) @@ -2646,7 +2646,7 @@ build_key_state (struct HelperState *hs, true); return NULL; } - qs = TEH_plugin->iterate_auditor_denominations (TEH_plugin->cls, + qs = DH_plugin->iterate_auditor_denominations (DH_plugin->cls, &auditor_denom_cb, ksh); if (qs < 0) @@ -2656,7 +2656,7 @@ build_key_state (struct HelperState *hs, true); return NULL; } - qs = TEH_plugin->iterate_active_auditors (TEH_plugin->cls, + qs = DH_plugin->iterate_active_auditors (DH_plugin->cls, &auditor_info_cb, ksh); if (qs < 0) @@ -2688,27 +2688,27 @@ build_key_state (struct HelperState *hs, void -TEH_keys_update_states () +DH_keys_update_states () { struct GNUNET_DB_EventHeaderP es = { .size = htons (sizeof (es)), .type = htons (TALER_DBEVENT_DONAU_KEYS_UPDATED), }; - TEH_plugin->event_notify (TEH_plugin->cls, + DH_plugin->event_notify (DH_plugin->cls, &es, NULL, 0); key_generation++; - TEH_resume_keys_requests (false); + DH_resume_keys_requests (false); } -static struct TEH_KeyStateHandle * +static struct DH_KeyStateHandle * keys_get_state (bool management_only) { - struct TEH_KeyStateHandle *old_ksh; - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *old_ksh; + struct DH_KeyStateHandle *ksh; old_ksh = key_state; if (NULL == old_ksh) @@ -2740,17 +2740,17 @@ keys_get_state (bool management_only) } -struct TEH_KeyStateHandle * -TEH_keys_get_state_for_management_only (void) +struct DH_KeyStateHandle * +DH_keys_get_state_for_management_only (void) { return keys_get_state (true); } -struct TEH_KeyStateHandle * -TEH_keys_get_state (void) +struct DH_KeyStateHandle * +DH_keys_get_state (void) { - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; ksh = keys_get_state (false); if (NULL == ksh) @@ -2767,12 +2767,12 @@ TEH_keys_get_state (void) } -const struct TEH_GlobalFee * -TEH_keys_global_fee_by_time ( - struct TEH_KeyStateHandle *ksh, +const struct DH_GlobalFee * +DH_keys_global_fee_by_time ( + struct DH_KeyStateHandle *ksh, struct GNUNET_TIME_Timestamp ts) { - for (const struct TEH_GlobalFee *gf = ksh->gf_head; + for (const struct DH_GlobalFee *gf = ksh->gf_head; NULL != gf; gf = gf->next) { @@ -2788,15 +2788,15 @@ TEH_keys_global_fee_by_time ( } -struct TEH_DenominationKey * -TEH_keys_denomination_by_hash ( +struct DH_DenominationKey * +DH_keys_denomination_by_hash ( const struct TALER_DenominationHashP *h_denom_pub, struct MHD_Connection *conn, MHD_RESULT *mret) { - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; - ksh = TEH_keys_get_state (); + ksh = DH_keys_get_state (); if (NULL == ksh) { *mret = TALER_MHD_reply_with_error (conn, @@ -2806,21 +2806,21 @@ TEH_keys_denomination_by_hash ( return NULL; } - return TEH_keys_denomination_by_hash_from_state (ksh, + return DH_keys_denomination_by_hash_from_state (ksh, h_denom_pub, conn, mret); } -struct TEH_DenominationKey * -TEH_keys_denomination_by_hash_from_state ( - const struct TEH_KeyStateHandle *ksh, +struct DH_DenominationKey * +DH_keys_denomination_by_hash_from_state ( + const struct DH_KeyStateHandle *ksh, const struct TALER_DenominationHashP *h_denom_pub, struct MHD_Connection *conn, MHD_RESULT *mret) { - struct TEH_DenominationKey *dk; + struct DH_DenominationKey *dk; dk = GNUNET_CONTAINER_multihashmap_get (ksh->denomkey_map, &h_denom_pub->hash); @@ -2828,7 +2828,7 @@ TEH_keys_denomination_by_hash_from_state ( { if (NULL == conn) return NULL; - *mret = TEH_RESPONSE_reply_unknown_denom_pub_hash (conn, + *mret = DH_RESPONSE_reply_unknown_denom_pub_hash (conn, h_denom_pub); return NULL; } @@ -2837,17 +2837,17 @@ TEH_keys_denomination_by_hash_from_state ( enum TALER_ErrorCode -TEH_keys_denomination_sign ( +DH_keys_denomination_sign ( const struct DONAU_BlindedUniqueDonationIdentifierKeyPair *budi_key, bool for_melt, struct TALER_BlindedDenominationSignature *bs) { - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; struct HelperDenomination *hd; const struct TALER_DenominationHashP *h_denom_pub = csd->h_denom_pub; const struct TALER_BlindedPlanchet *bp = csd->bp; - ksh = TEH_keys_get_state (); + ksh = DH_keys_get_state (); if (NULL == ksh) return TALER_EC_DONAU_GENERIC_KEYS_MISSING; hd = GNUNET_CONTAINER_multihashmap_get (ksh->helpers->denom_keys, @@ -2859,7 +2859,7 @@ TEH_keys_denomination_sign ( switch (hd->denom_pub.cipher) { case TALER_DENOMINATION_RSA: - TEH_METRICS_num_signatures[TEH_MT_SIGNATURE_RSA]++; + DH_METRICS_num_signatures[DH_MT_SIGNATURE_RSA]++; { struct TALER_CRYPTO_RsaSignRequest rsr = { .h_rsa = &hd->h_details.h_rsa, @@ -2873,7 +2873,7 @@ TEH_keys_denomination_sign ( bs); } case TALER_DENOMINATION_CS: - TEH_METRICS_num_signatures[TEH_MT_SIGNATURE_CS]++; + DH_METRICS_num_signatures[DH_MT_SIGNATURE_CS]++; { struct TALER_CRYPTO_CsSignRequest csr; @@ -2892,13 +2892,13 @@ TEH_keys_denomination_sign ( enum TALER_ErrorCode -TEH_keys_donation_unit_batch_sign ( +DH_keys_donation_unit_batch_sign ( const struct DONAU_BlindedUniqueDonationIdentifierKeyPair *budi_key, unsigned int csds_length, bool for_melt, struct TALER_BlindedDenominationSignature *bss) { - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; struct HelperDenomination *hd; struct TALER_CRYPTO_RsaSignRequest rsrs[csds_length]; struct TALER_CRYPTO_CsSignRequest csrs[csds_length]; @@ -2908,7 +2908,7 @@ TEH_keys_donation_unit_batch_sign ( unsigned int csrs_pos = 0; enum TALER_ErrorCode ec; - ksh = TEH_keys_get_state (); + ksh = DH_keys_get_state (); if (NULL == ksh) return TALER_EC_DONAU_GENERIC_KEYS_MISSING; for (unsigned int i = 0; i<csds_length; i++) @@ -2967,7 +2967,7 @@ TEH_keys_donation_unit_batch_sign ( TALER_blinded_denom_sig_free (&cs[i]); return ec; } - TEH_METRICS_num_signatures[TEH_MT_SIGNATURE_CS] += csrs_pos; + DH_METRICS_num_signatures[DH_MT_SIGNATURE_CS] += csrs_pos; } if (0 != rsrs_pos) { @@ -2984,7 +2984,7 @@ TEH_keys_donation_unit_batch_sign ( TALER_blinded_denom_sig_free (&rs[i]); return ec; } - TEH_METRICS_num_signatures[TEH_MT_SIGNATURE_RSA] += rsrs_pos; + DH_METRICS_num_signatures[DH_MT_SIGNATURE_RSA] += rsrs_pos; } if ( (0 != csrs_pos) && @@ -3014,17 +3014,17 @@ TEH_keys_donation_unit_batch_sign ( enum TALER_ErrorCode -TEH_keys_denomination_cs_r_pub ( - const struct TEH_CsDeriveData *cdd, +DH_keys_denomination_cs_r_pub ( + const struct DH_CsDeriveData *cdd, bool for_melt, struct TALER_DenominationCSPublicRPairP *r_pub) { const struct TALER_DenominationHashP *h_denom_pub = cdd->h_denom_pub; const struct TALER_CsNonce *nonce = cdd->nonce; - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; struct HelperDenomination *hd; - ksh = TEH_keys_get_state (); + ksh = DH_keys_get_state (); if (NULL == ksh) { return TALER_EC_DONAU_GENERIC_KEYS_MISSING; @@ -3054,17 +3054,17 @@ TEH_keys_denomination_cs_r_pub ( enum TALER_ErrorCode -TEH_keys_denomination_cs_batch_r_pub ( - const struct TEH_CsDeriveData *cdds, +DH_keys_denomination_cs_batch_r_pub ( + const struct DH_CsDeriveData *cdds, unsigned int cdds_length, bool for_melt, struct TALER_DenominationCSPublicRPairP *r_pubs) { - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; struct HelperDenomination *hd; struct TALER_CRYPTO_CsDeriveRequest cdrs[cdds_length]; - ksh = TEH_keys_get_state (); + ksh = DH_keys_get_state (); if (NULL == ksh) { return TALER_EC_DONAU_GENERIC_KEYS_MISSING; @@ -3097,12 +3097,12 @@ TEH_keys_denomination_cs_batch_r_pub ( void -TEH_keys_denomination_revoke (const struct TALER_DenominationHashP *h_denom_pub) +DH_keys_denomination_revoke (const struct TALER_DenominationHashP *h_denom_pub) { - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; struct HelperDenomination *hd; - ksh = TEH_keys_get_state (); + ksh = DH_keys_get_state (); if (NULL == ksh) { GNUNET_break (0); @@ -3120,12 +3120,12 @@ TEH_keys_denomination_revoke (const struct TALER_DenominationHashP *h_denom_pub) case TALER_DENOMINATION_RSA: TALER_CRYPTO_helper_rsa_revoke (ksh->helpers->rsadh, &hd->h_details.h_rsa); - TEH_keys_update_states (); + DH_keys_update_states (); return; case TALER_DENOMINATION_CS: TALER_CRYPTO_helper_cs_revoke (ksh->helpers->csdh, &hd->h_details.h_cs); - TEH_keys_update_states (); + DH_keys_update_states (); return; default: GNUNET_break (0); @@ -3135,14 +3135,14 @@ TEH_keys_denomination_revoke (const struct TALER_DenominationHashP *h_denom_pub) enum TALER_ErrorCode -TEH_keys_donau_sign_ ( +DH_keys_donau_sign_ ( const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, struct DONAU_DonauPublicKeyP *pub, struct TALER_DonauSignatureP *sig) { - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; - ksh = TEH_keys_get_state (); + ksh = DH_keys_get_state (); if (NULL == ksh) { /* This *can* happen if the donau's crypto helper is not running @@ -3151,7 +3151,7 @@ TEH_keys_donau_sign_ ( "Cannot sign request, no valid signing keys available.\n"); return TALER_EC_DONAU_GENERIC_KEYS_MISSING; } - return TEH_keys_donau_sign2_ (ksh, + return DH_keys_donau_sign2_ (ksh, purpose, pub, sig); @@ -3159,16 +3159,16 @@ TEH_keys_donau_sign_ ( enum TALER_ErrorCode -TEH_keys_donau_sign2_ ( +DH_keys_donau_sign2_ ( void *cls, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, struct DONAU_DonauPublicKeyP *pub, struct TALER_DonauSignatureP *sig) { - struct TEH_KeyStateHandle *ksh = cls; + struct DH_KeyStateHandle *ksh = cls; enum TALER_ErrorCode ec; - TEH_METRICS_num_signatures[TEH_MT_SIGNATURE_EDDSA]++; + DH_METRICS_num_signatures[DH_MT_SIGNATURE_EDDSA]++; ec = TALER_CRYPTO_helper_esign_sign_ (ksh->helpers->esh, purpose, pub, @@ -3203,11 +3203,11 @@ TEH_keys_donau_sign2_ ( void -TEH_keys_donau_revoke (const struct DONAU_DonauPublicKeyP *donau_pub) +DH_keys_donau_revoke (const struct DONAU_DonauPublicKeyP *donau_pub) { - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; - ksh = TEH_keys_get_state (); + ksh = DH_keys_get_state (); if (NULL == ksh) { GNUNET_break (0); @@ -3215,7 +3215,7 @@ TEH_keys_donau_revoke (const struct DONAU_DonauPublicKeyP *donau_pub) } TALER_CRYPTO_helper_esign_revoke (ksh->helpers->esh, donau_pub); - TEH_keys_update_states (); + DH_keys_update_states (); } @@ -3247,7 +3247,7 @@ krd_search_comparator (const void *key, MHD_RESULT -TEH_keys_get_handler (struct DH_RequestContext *rc, +DH_keys_get_handler (struct DH_RequestContext *rc, const char *const args[]) { struct GNUNET_TIME_Timestamp last_issue_date; @@ -3293,22 +3293,22 @@ TEH_keys_get_handler (struct DH_RequestContext *rc, } { - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; const struct KeysResponseData *krd; - ksh = TEH_keys_get_state (); + ksh = DH_keys_get_state (); if ( (NULL == ksh) || (0 == ksh->krd_array_length) ) { if ( ( (SKR_LIMIT == skr_size) && (rc->connection == skr_connection) ) || - TEH_suicide) + DH_suicide) { return TALER_MHD_reply_with_error ( rc->connection, MHD_HTTP_SERVICE_UNAVAILABLE, TALER_EC_DONAU_GENERIC_KEYS_MISSING, - TEH_suicide + DH_suicide ? "server terminating" : "too many connections suspended waiting on /keys"); } @@ -3394,7 +3394,7 @@ load_extension_data (const char *section_name, GNUNET_assert (! GNUNET_TIME_absolute_is_zero (meta->start.abs_time)); /* caller bug */ if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_time (TEH_cfg, + GNUNET_CONFIGURATION_get_value_time (DH_cfg, section_name, "DURATION_SPEND", &deposit_duration)) @@ -3405,7 +3405,7 @@ load_extension_data (const char *section_name, return GNUNET_SYSERR; } if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_time (TEH_cfg, + GNUNET_CONFIGURATION_get_value_time (DH_cfg, section_name, "DURATION_LEGAL", &legal_duration)) @@ -3423,7 +3423,7 @@ load_extension_data (const char *section_name, GNUNET_TIME_absolute_add (meta->expire_deposit.abs_time, legal_duration)); if (GNUNET_OK != - TALER_config_get_amount (TEH_cfg, + TALER_config_get_amount (DH_cfg, section_name, "VALUE", &meta->value)) @@ -3434,18 +3434,18 @@ load_extension_data (const char *section_name, section_name); return GNUNET_SYSERR; } - if (0 != strcasecmp (TEH_currency, + if (0 != strcasecmp (DH_currency, meta->value.currency)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Need denomination value in section `%s' to use currency `%s'\n", section_name, - TEH_currency); + DH_currency); return GNUNET_SYSERR; } if (GNUNET_OK != - TALER_config_get_denom_fees (TEH_cfg, - TEH_currency, + TALER_config_get_denom_fees (DH_cfg, + DH_currency, section_name, &meta->fees)) return GNUNET_SYSERR; @@ -3455,7 +3455,7 @@ load_extension_data (const char *section_name, enum GNUNET_GenericReturnValue -TEH_keys_load_fees (struct TEH_KeyStateHandle *ksh, +DH_keys_load_fees (struct DH_KeyStateHandle *ksh, const struct TALER_DenominationHashP *h_denom_pub, struct TALER_DenominationPublicKey *denom_pub, struct DONAUDB_DenominationKeyMetaData *meta) @@ -3498,14 +3498,14 @@ TEH_keys_load_fees (struct TEH_KeyStateHandle *ksh, enum GNUNET_GenericReturnValue -TEH_keys_get_timing (const struct DONAU_DonauPublicKeyP *donau_pub, +DH_keys_get_timing (const struct DONAU_DonauPublicKeyP *donau_pub, struct DONAUDB_SignkeyMetaData *meta) { - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; struct HelperSignkey *hsk; struct GNUNET_PeerIdentity pid; - ksh = TEH_keys_get_state_for_management_only (); + ksh = DH_keys_get_state_for_management_only (); if (NULL == ksh) { GNUNET_break (0); @@ -3535,7 +3535,7 @@ struct FutureBuilderContext /** * Our key state. */ - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; /** * Array of denomination keys. @@ -3568,7 +3568,7 @@ add_future_denomkey_cb (void *cls, { struct FutureBuilderContext *fbc = cls; struct HelperDenomination *hd = value; - struct TEH_DenominationKey *dk; + struct DH_DenominationKey *dk; struct DONAUDB_DenominationKeyMetaData meta = {0}; dk = GNUNET_CONTAINER_multihashmap_get (fbc->ksh->denomkey_map, @@ -3668,14 +3668,14 @@ add_future_signkey_cb (void *cls, MHD_RESULT -TEH_keys_management_get_keys_handler (const struct TEH_RequestHandler *rh, +DH_keys_management_get_keys_handler (const struct DH_RequestHandler *rh, struct MHD_Connection *connection) { - struct TEH_KeyStateHandle *ksh; + struct DH_KeyStateHandle *ksh; json_t *reply; (void) rh; - ksh = TEH_keys_get_state_for_management_only (); + ksh = DH_keys_get_state_for_management_only (); if (NULL == ksh) { return TALER_MHD_reply_with_error (connection, @@ -3722,7 +3722,7 @@ TEH_keys_management_get_keys_handler (const struct TEH_RequestHandler *rh, GNUNET_JSON_pack_array_steal ("future_signkeys", fbc.signkeys), GNUNET_JSON_pack_data_auto ("master_pub", - &TEH_master_public_key), + &DH_master_public_key), GNUNET_JSON_pack_data_auto ("denom_secmod_public_key", &denom_rsa_sm_pub), GNUNET_JSON_pack_data_auto ("denom_secmod_cs_public_key", diff --git a/src/donau/donau-httpd_metrics.c b/src/donau/donau-httpd_metrics.c @@ -29,23 +29,23 @@ #include <jansson.h> -unsigned long long TEH_METRICS_num_requests[TEH_MT_REQUEST_COUNT]; +unsigned long long DH_METRICS_num_requests[DH_MT_REQUEST_COUNT]; -unsigned long long TEH_METRICS_batch_withdraw_num_coins; +unsigned long long DH_METRICS_batch_withdraw_num_coins; -unsigned long long TEH_METRICS_num_conflict[TEH_MT_REQUEST_COUNT]; +unsigned long long DH_METRICS_num_conflict[DH_MT_REQUEST_COUNT]; -unsigned long long TEH_METRICS_num_signatures[TEH_MT_SIGNATURE_COUNT]; +unsigned long long DH_METRICS_num_signatures[DH_MT_SIGNATURE_COUNT]; -unsigned long long TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_COUNT]; +unsigned long long DH_METRICS_num_verifications[DH_MT_SIGNATURE_COUNT]; -unsigned long long TEH_METRICS_num_keydonaus[TEH_MT_KEYX_COUNT]; +unsigned long long DH_METRICS_num_keydonaus[DH_MT_KEYX_COUNT]; -unsigned long long TEH_METRICS_num_success[TEH_MT_SUCCESS_COUNT]; +unsigned long long DH_METRICS_num_success[DH_MT_SUCCESS_COUNT]; MHD_RESULT -TEH_handler_metrics (struct DH_RequestContext *rc, +DH_handler_metrics (struct DH_RequestContext *rc, const char *const args[]) { char *reply; @@ -100,57 +100,57 @@ TEH_handler_metrics (struct DH_RequestContext *rc, "# TYPE taler_donau_batch_withdraw_num_coins counter\n" "taler_donau_batch_withdraw_num_coins{} %llu\n", "deposit", - TEH_METRICS_num_success[TEH_MT_SUCCESS_DEPOSIT], + DH_METRICS_num_success[DH_MT_SUCCESS_DEPOSIT], "withdraw", - TEH_METRICS_num_success[TEH_MT_SUCCESS_WITHDRAW], + DH_METRICS_num_success[DH_MT_SUCCESS_WITHDRAW], "batch-withdraw", - TEH_METRICS_num_success[TEH_MT_SUCCESS_BATCH_WITHDRAW], + DH_METRICS_num_success[DH_MT_SUCCESS_BATCH_WITHDRAW], "melt", - TEH_METRICS_num_success[TEH_MT_SUCCESS_MELT], + DH_METRICS_num_success[DH_MT_SUCCESS_MELT], "refresh-reveal", - TEH_METRICS_num_success[TEH_MT_SUCCESS_REFRESH_REVEAL], + DH_METRICS_num_success[DH_MT_SUCCESS_REFRESH_REVEAL], "other", - TEH_METRICS_num_conflict[TEH_MT_REQUEST_OTHER], + DH_METRICS_num_conflict[DH_MT_REQUEST_OTHER], "deposit", - TEH_METRICS_num_conflict[TEH_MT_REQUEST_DEPOSIT], + DH_METRICS_num_conflict[DH_MT_REQUEST_DEPOSIT], "withdraw", - TEH_METRICS_num_conflict[TEH_MT_REQUEST_WITHDRAW], + DH_METRICS_num_conflict[DH_MT_REQUEST_WITHDRAW], "melt", - TEH_METRICS_num_conflict[TEH_MT_REQUEST_MELT], + DH_METRICS_num_conflict[DH_MT_REQUEST_MELT], "other", - TEH_METRICS_num_requests[TEH_MT_REQUEST_OTHER], + DH_METRICS_num_requests[DH_MT_REQUEST_OTHER], "deposit", - TEH_METRICS_num_requests[TEH_MT_REQUEST_DEPOSIT], + DH_METRICS_num_requests[DH_MT_REQUEST_DEPOSIT], "withdraw", - TEH_METRICS_num_requests[TEH_MT_REQUEST_WITHDRAW], + DH_METRICS_num_requests[DH_MT_REQUEST_WITHDRAW], "melt", - TEH_METRICS_num_requests[TEH_MT_REQUEST_MELT], + DH_METRICS_num_requests[DH_MT_REQUEST_MELT], "withdraw", - TEH_METRICS_num_requests[TEH_MT_REQUEST_IDEMPOTENT_WITHDRAW], + DH_METRICS_num_requests[DH_MT_REQUEST_IDEMPOTENT_WITHDRAW], #if NOT_YET_IMPLEMENTED "deposit", - TEH_METRICS_num_requests[TEH_MT_REQUEST_IDEMPOTENT_DEPOSIT], + DH_METRICS_num_requests[DH_MT_REQUEST_IDEMPOTENT_DEPOSIT], "melt", - TEH_METRICS_num_requests[TEH_MT_REQUEST_IDEMPOTENT_MELT], + DH_METRICS_num_requests[DH_MT_REQUEST_IDEMPOTENT_MELT], #endif "batch-withdraw", - TEH_METRICS_num_requests[ - TEH_MT_REQUEST_IDEMPOTENT_BATCH_WITHDRAW], + DH_METRICS_num_requests[ + DH_MT_REQUEST_IDEMPOTENT_BATCH_WITHDRAW], "rsa", - TEH_METRICS_num_signatures[TEH_MT_SIGNATURE_RSA], + DH_METRICS_num_signatures[DH_MT_SIGNATURE_RSA], "cs", - TEH_METRICS_num_signatures[TEH_MT_SIGNATURE_CS], + DH_METRICS_num_signatures[DH_MT_SIGNATURE_CS], "eddsa", - TEH_METRICS_num_signatures[TEH_MT_SIGNATURE_EDDSA], + DH_METRICS_num_signatures[DH_MT_SIGNATURE_EDDSA], "rsa", - TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_RSA], + DH_METRICS_num_verifications[DH_MT_SIGNATURE_RSA], "cs", - TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_CS], + DH_METRICS_num_verifications[DH_MT_SIGNATURE_CS], "eddsa", - TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_EDDSA], + DH_METRICS_num_verifications[DH_MT_SIGNATURE_EDDSA], "ecdh", - TEH_METRICS_num_keydonaus[TEH_MT_KEYX_ECDH], - TEH_METRICS_batch_withdraw_num_coins); + DH_METRICS_num_keydonaus[DH_MT_KEYX_ECDH], + DH_METRICS_batch_withdraw_num_coins); resp = MHD_create_response_from_buffer (strlen (reply), reply, MHD_RESPMEM_MUST_FREE); diff --git a/src/donau/donau-httpd_metrics.h b/src/donau/donau-httpd_metrics.h @@ -28,97 +28,97 @@ /** * Request types for which we collect metrics. */ -enum TEH_MetricTypeRequest +enum DH_MetricTypeRequest { - TEH_MT_REQUEST_OTHER = 0, - TEH_MT_REQUEST_DEPOSIT = 1, - TEH_MT_REQUEST_WITHDRAW = 2, - TEH_MT_REQUEST_AGE_WITHDRAW = 3, - TEH_MT_REQUEST_MELT = 4, - TEH_MT_REQUEST_PURSE_CREATE = 5, - TEH_MT_REQUEST_PURSE_MERGE = 6, - TEH_MT_REQUEST_RESERVE_PURSE = 7, - TEH_MT_REQUEST_PURSE_DEPOSIT = 8, - TEH_MT_REQUEST_IDEMPOTENT_DEPOSIT = 9, - TEH_MT_REQUEST_IDEMPOTENT_WITHDRAW = 10, - TEH_MT_REQUEST_IDEMPOTENT_AGE_WITHDRAW = 11, - TEH_MT_REQUEST_IDEMPOTENT_MELT = 12, - TEH_MT_REQUEST_IDEMPOTENT_BATCH_WITHDRAW = 13, - TEH_MT_REQUEST_BATCH_DEPOSIT = 14, - TEH_MT_REQUEST_POLICY_FULFILLMENT = 15, - TEH_MT_REQUEST_COUNT = 16 /* MUST BE LAST! */ + DH_MT_REQUEST_OTHER = 0, + DH_MT_REQUEST_DEPOSIT = 1, + DH_MT_REQUEST_WITHDRAW = 2, + DH_MT_REQUEST_AGE_WITHDRAW = 3, + DH_MT_REQUEST_MELT = 4, + DH_MT_REQUEST_PURSE_CREATE = 5, + DH_MT_REQUEST_PURSE_MERGE = 6, + DH_MT_REQUEST_RESERVE_PURSE = 7, + DH_MT_REQUEST_PURSE_DEPOSIT = 8, + DH_MT_REQUEST_IDEMPOTENT_DEPOSIT = 9, + DH_MT_REQUEST_IDEMPOTENT_WITHDRAW = 10, + DH_MT_REQUEST_IDEMPOTENT_AGE_WITHDRAW = 11, + DH_MT_REQUEST_IDEMPOTENT_MELT = 12, + DH_MT_REQUEST_IDEMPOTENT_BATCH_WITHDRAW = 13, + DH_MT_REQUEST_BATCH_DEPOSIT = 14, + DH_MT_REQUEST_POLICY_FULFILLMENT = 15, + DH_MT_REQUEST_COUNT = 16 /* MUST BE LAST! */ }; /** * Success types for which we collect metrics. */ -enum TEH_MetricTypeSuccess +enum DH_MetricTypeSuccess { - TEH_MT_SUCCESS_DEPOSIT = 0, - TEH_MT_SUCCESS_WITHDRAW = 1, - TEH_MT_SUCCESS_AGE_WITHDRAW = 2, - TEH_MT_SUCCESS_BATCH_WITHDRAW = 3, - TEH_MT_SUCCESS_MELT = 4, - TEH_MT_SUCCESS_REFRESH_REVEAL = 5, - TEH_MT_SUCCESS_AGE_WITHDRAW_REVEAL = 6, - TEH_MT_SUCCESS_COUNT = 7 /* MUST BE LAST! */ + DH_MT_SUCCESS_DEPOSIT = 0, + DH_MT_SUCCESS_WITHDRAW = 1, + DH_MT_SUCCESS_AGE_WITHDRAW = 2, + DH_MT_SUCCESS_BATCH_WITHDRAW = 3, + DH_MT_SUCCESS_MELT = 4, + DH_MT_SUCCESS_REFRESH_REVEAL = 5, + DH_MT_SUCCESS_AGE_WITHDRAW_REVEAL = 6, + DH_MT_SUCCESS_COUNT = 7 /* MUST BE LAST! */ }; /** * Cipher types for which we collect signature metrics. */ -enum TEH_MetricTypeSignature +enum DH_MetricTypeSignature { - TEH_MT_SIGNATURE_RSA = 0, - TEH_MT_SIGNATURE_CS = 1, - TEH_MT_SIGNATURE_EDDSA = 2, - TEH_MT_SIGNATURE_COUNT = 3 + DH_MT_SIGNATURE_RSA = 0, + DH_MT_SIGNATURE_CS = 1, + DH_MT_SIGNATURE_EDDSA = 2, + DH_MT_SIGNATURE_COUNT = 3 }; /** * Cipher types for which we collect key donau metrics. */ -enum TEH_MetricTypeKeyX +enum DH_MetricTypeKeyX { - TEH_MT_KEYX_ECDH = 0, - TEH_MT_KEYX_COUNT = 1 + DH_MT_KEYX_ECDH = 0, + DH_MT_KEYX_COUNT = 1 }; /** * Number of requests handled of the respective type. */ -extern unsigned long long TEH_METRICS_num_requests[TEH_MT_REQUEST_COUNT]; +extern unsigned long long DH_METRICS_num_requests[DH_MT_REQUEST_COUNT]; /** * Number of successful requests handled of the respective type. */ -extern unsigned long long TEH_METRICS_num_success[TEH_MT_SUCCESS_COUNT]; +extern unsigned long long DH_METRICS_num_success[DH_MT_SUCCESS_COUNT]; /** * Number of coins withdrawn in a batch-withdraw request */ -extern unsigned long long TEH_METRICS_batch_withdraw_num_coins; +extern unsigned long long DH_METRICS_batch_withdraw_num_coins; /** * Number of serialization errors encountered when * handling requests of the respective type. */ -extern unsigned long long TEH_METRICS_num_conflict[TEH_MT_REQUEST_COUNT]; +extern unsigned long long DH_METRICS_num_conflict[DH_MT_REQUEST_COUNT]; /** * Number of signatures created by the respective cipher. */ -extern unsigned long long TEH_METRICS_num_signatures[TEH_MT_SIGNATURE_COUNT]; +extern unsigned long long DH_METRICS_num_signatures[DH_MT_SIGNATURE_COUNT]; /** * Number of signatures verified by the respective cipher. */ -extern unsigned long long TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_COUNT]; +extern unsigned long long DH_METRICS_num_verifications[DH_MT_SIGNATURE_COUNT]; /** * Number of key donaus done with the respective cipher. */ -extern unsigned long long TEH_METRICS_num_keydonaus[TEH_MT_KEYX_COUNT]; +extern unsigned long long DH_METRICS_num_keydonaus[DH_MT_KEYX_COUNT]; /** * Handle a "/metrics" request. @@ -128,7 +128,7 @@ extern unsigned long long TEH_METRICS_num_keydonaus[TEH_MT_KEYX_COUNT]; * @return MHD result code */ MHD_RESULT -TEH_handler_metrics (struct DH_RequestContext *rc, +DH_handler_metrics (struct DH_RequestContext *rc, const char *const args[]); diff --git a/src/donau/donau-httpd_mhd.c b/src/donau/donau-httpd_mhd.c @@ -35,10 +35,10 @@ MHD_RESULT -TEH_handler_static_response (struct DH_RequestContext *rc, +DH_handler_static_response (struct DH_RequestContext *rc, const char *const args[]) { - const struct TEH_RequestHandler *rh = rc->rh; + const struct DH_RequestHandler *rh = rc->rh; size_t dlen; (void) args; @@ -54,7 +54,7 @@ TEH_handler_static_response (struct DH_RequestContext *rc, MHD_RESULT -TEH_handler_agpl_redirect (struct DH_RequestContext *rc, +DH_handler_agpl_redirect (struct DH_RequestContext *rc, const char *const args[]) { (void) args; diff --git a/src/donau/donau-httpd_mhd.h b/src/donau/donau-httpd_mhd.h @@ -37,7 +37,7 @@ * @return MHD result code */ MHD_RESULT -TEH_handler_static_response (struct DH_RequestContext *rc, +DH_handler_static_response (struct DH_RequestContext *rc, const char *const args[]); @@ -50,7 +50,7 @@ TEH_handler_static_response (struct DH_RequestContext *rc, * @return MHD result code */ MHD_RESULT -TEH_handler_agpl_redirect (struct DH_RequestContext *rc, +DH_handler_agpl_redirect (struct DH_RequestContext *rc, const char *const args[]); diff --git a/src/donau/donau-httpd_responses.c b/src/donau/donau-httpd_responses.c @@ -16,7 +16,7 @@ /** * @file taler-donau-httpd_responses.c * @brief API for generating generic replies of the donau; these - * functions are called TEH_RESPONSE_reply_ and they generate + * functions are called DH_RESPONSE_reply_ and they generate * and queue MHD response objects for a given connection. * @author Florian Dold * @author Benedikt Mueller @@ -40,7 +40,7 @@ // * @return json representation of the @a rh, NULL on error // */ // json_t * -// TEH_RESPONSE_compile_transaction_history ( +// DH_RESPONSE_compile_transaction_history ( // const struct TALER_CoinSpendPublicKeyP *coin_pub, // const struct DONAUDB_TransactionList *tl) // { @@ -69,7 +69,7 @@ // &h_wire); // #if ENABLE_SANITY_CHECKS // /* internal sanity check before we hand out a bogus sig... */ -// TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_EDDSA]++; +// DH_METRICS_num_verifications[DH_MT_SIGNATURE_EDDSA]++; // if (GNUNET_OK != // TALER_wallet_deposit_verify ( // &deposit->amount_with_fee, @@ -138,7 +138,7 @@ // const struct TALER_AgeCommitmentHash *phac = NULL; // #if ENABLE_SANITY_CHECKS -// TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_EDDSA]++; +// DH_METRICS_num_verifications[DH_MT_SIGNATURE_EDDSA]++; // if (GNUNET_OK != // TALER_wallet_melt_verify ( // &melt->amount_with_fee, @@ -191,7 +191,7 @@ // struct TALER_Amount value; // #if ENABLE_SANITY_CHECKS -// TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_EDDSA]++; +// DH_METRICS_num_verifications[DH_MT_SIGNATURE_EDDSA]++; // if (GNUNET_OK != // TALER_charity_refund_verify ( // coin_pub, @@ -249,7 +249,7 @@ // if (TALER_EC_NONE != // TALER_donau_online_confirm_recoup_refresh_sign ( -// &TEH_keys_donau_sign_, +// &DH_keys_donau_sign_, // pr->timestamp, // &pr->value, // &pr->coin.coin_pub, @@ -298,7 +298,7 @@ // if (TALER_EC_NONE != // TALER_donau_online_confirm_recoup_sign ( -// &TEH_keys_donau_sign_, +// &DH_keys_donau_sign_, // recoup->timestamp, // &recoup->value, // coin_pub, @@ -348,7 +348,7 @@ // if (TALER_EC_NONE != // TALER_donau_online_confirm_recoup_refresh_sign ( -// &TEH_keys_donau_sign_, +// &DH_keys_donau_sign_, // pr->timestamp, // &pr->value, // coin_pub, @@ -412,7 +412,7 @@ // &pd->amount), // GNUNET_JSON_pack_string ("donau_base_url", // NULL == pd->donau_base_url -// ? TEH_base_url +// ? DH_base_url // : pd->donau_base_url), // GNUNET_JSON_pack_allow_null ( // GNUNET_JSON_pack_data_auto ("h_age_commitment", @@ -450,7 +450,7 @@ // return NULL; // } // ec = TALER_donau_online_purse_refund_sign ( -// &TEH_keys_donau_sign_, +// &DH_keys_donau_sign_, // &value, // &prefund->refund_fee, // coin_pub, @@ -518,7 +518,7 @@ // MHD_RESULT -// TEH_RESPONSE_reply_unknown_denom_pub_hash ( +// DH_RESPONSE_reply_unknown_denom_pub_hash ( // struct MHD_Connection *connection, // const struct TALER_DenominationHashP *dph) // { @@ -529,7 +529,7 @@ // now = GNUNET_TIME_timestamp_get (); // ec = TALER_donau_online_denomination_unknown_sign ( -// &TEH_keys_donau_sign_, +// &DH_keys_donau_sign_, // now, // dph, // &epub, diff --git a/src/donau/donau-httpd_responses.h b/src/donau/donau-httpd_responses.h @@ -16,7 +16,7 @@ /** * @file taler-donau-httpd_responses.h * @brief API for generating generic replies of the donau; these - * functions are called TEH_RESPONSE_reply_ and they generate + * functions are called DH_RESPONSE_reply_ and they generate * and queue MHD response objects for a given connection. * @author Florian Dold * @author Benedikt Mueller @@ -41,7 +41,7 @@ * @return json representation of the @a rh, NULL on error */ //json_t * -//TEH_RESPONSE_compile_reserve_history ( +//DH_RESPONSE_compile_reserve_history ( // const struct DONAUDB_ReserveHistory *rh); @@ -54,7 +54,7 @@ * @return MHD result code */ MHD_RESULT -TEH_RESPONSE_reply_unknown_denom_pub_hash ( +DH_RESPONSE_reply_unknown_denom_pub_hash ( struct MHD_Connection *connection, const struct TALER_DenominationHashP *dph); @@ -70,7 +70,7 @@ TEH_RESPONSE_reply_unknown_denom_pub_hash ( * @return MHD result code */ MHD_RESULT -TEH_RESPONSE_reply_reserve_insufficient_balance ( +DH_RESPONSE_reply_reserve_insufficient_balance ( struct MHD_Connection *connection, enum TALER_ErrorCode ec, const struct TALER_Amount *balance_required, @@ -86,7 +86,7 @@ TEH_RESPONSE_reply_reserve_insufficient_balance ( * @return MHD result code */ MHD_RESULT -TEH_RESPONSE_reply_aml_blocked (struct MHD_Connection *connection, +DH_RESPONSE_reply_aml_blocked (struct MHD_Connection *connection, enum TALER_AmlDecisionState status); @@ -101,7 +101,7 @@ TEH_RESPONSE_reply_aml_blocked (struct MHD_Connection *connection, * @return MHD result code */ MHD_RESULT -TEH_RESPONSE_reply_expired_denom_pub_hash ( +DH_RESPONSE_reply_expired_denom_pub_hash ( struct MHD_Connection *connection, const struct TALER_DenominationHashP *dph, enum TALER_ErrorCode ec, @@ -116,7 +116,7 @@ TEH_RESPONSE_reply_expired_denom_pub_hash ( * @return MHD result code */ MHD_RESULT -TEH_RESPONSE_reply_invalid_denom_cipher_for_operation ( +DH_RESPONSE_reply_invalid_denom_cipher_for_operation ( struct MHD_Connection *connection, const struct TALER_DenominationHashP *dph); @@ -134,7 +134,7 @@ TEH_RESPONSE_reply_invalid_denom_cipher_for_operation ( * @return MHD result code */ MHD_RESULT -TEH_RESPONSE_reply_coin_insufficient_funds ( +DH_RESPONSE_reply_coin_insufficient_funds ( struct MHD_Connection *connection, enum TALER_ErrorCode ec, const struct TALER_DenominationHashP *h_denom_pub, @@ -143,7 +143,7 @@ TEH_RESPONSE_reply_coin_insufficient_funds ( /** * Fundamental details about a purse. */ -struct TEH_PurseDetails +struct DH_PurseDetails { /** * When should the purse expire. @@ -178,11 +178,11 @@ struct TEH_PurseDetails * @return MHD result code */ MHD_RESULT -TEH_RESPONSE_reply_purse_created ( +DH_RESPONSE_reply_purse_created ( struct MHD_Connection *connection, struct GNUNET_TIME_Timestamp donau_timestamp, const struct TALER_Amount *purse_balance, - const struct TEH_PurseDetails *pd); + const struct DH_PurseDetails *pd); /** @@ -193,7 +193,7 @@ TEH_RESPONSE_reply_purse_created ( * @return json representation of the @a rh, NULL on error */ json_t * -TEH_RESPONSE_compile_transaction_history ( +DH_RESPONSE_compile_transaction_history ( const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct DONAUDB_TransactionList *tl); diff --git a/src/donau/donau-httpd_submit_receipts_get.c b/src/donau/donau-httpd_submit_receipts_get.c @@ -154,7 +154,7 @@ static struct DepositWtidContext *dwc_tail; void -TEH_deposits_get_cleanup () +DH_deposits_get_cleanup () { struct DepositWtidContext *n; for (struct DepositWtidContext *ctx = dwc_head; @@ -191,7 +191,7 @@ reply_deposit_details ( if (TALER_EC_NONE != (ec = TALER_donau_online_confirm_wire_sign ( - &TEH_keys_donau_sign_, + &DH_keys_donau_sign_, &ctx->h_wire, &ctx->h_contract_terms, &ctx->wtid, @@ -248,7 +248,7 @@ deposits_get_transaction (void *cls, bool pending; struct TALER_Amount fee; - qs = TEH_plugin->lookup_transfer_by_deposit (TEH_plugin->cls, + qs = DH_plugin->lookup_transfer_by_deposit (DH_plugin->cls, &ctx->h_contract_terms, &ctx->h_wire, &ctx->coin_pub, @@ -320,11 +320,11 @@ db_event_cb (void *cls, ctx); GNUNET_async_scope_enter (&ctx->rc->async_scope_id, &old_scope); - TEH_check_invariants (); + DH_check_invariants (); ctx->suspended = GNUNET_NO; MHD_resume_connection (ctx->rc->connection); TALER_MHD_daemon_trigger (); - TEH_check_invariants (); + DH_check_invariants (); GNUNET_async_scope_restore (&old_scope); } @@ -350,8 +350,8 @@ handle_track_transaction_request ( .charity_pub = ctx->charity }; - ctx->eh = TEH_plugin->event_listen ( - TEH_plugin->cls, + ctx->eh = DH_plugin->event_listen ( + DH_plugin->cls, GNUNET_TIME_absolute_get_remaining (ctx->timeout), &rep.header, &db_event_cb, @@ -361,9 +361,9 @@ handle_track_transaction_request ( MHD_RESULT mhd_ret; if (GNUNET_OK != - TEH_DB_run_transaction (connection, + DH_DB_run_transaction (connection, "handle deposits GET", - TEH_MT_REQUEST_OTHER, + DH_MT_REQUEST_OTHER, &mhd_ret, &deposits_get_transaction, ctx)) @@ -420,7 +420,7 @@ dwc_cleaner (struct DH_RequestContext *rc) GNUNET_assert (GNUNET_NO == ctx->suspended); if (NULL != ctx->eh) { - TEH_plugin->event_listen_cancel (TEH_plugin->cls, + DH_plugin->event_listen_cancel (DH_plugin->cls, ctx->eh); ctx->eh = NULL; } @@ -429,7 +429,7 @@ dwc_cleaner (struct DH_RequestContext *rc) MHD_RESULT -TEH_handler_deposits_get (struct DH_RequestContext *rc, +DH_handler_deposits_get (struct DH_RequestContext *rc, const char *const args[4]) { struct DepositWtidContext *ctx = rc->rh_ctx; @@ -494,7 +494,7 @@ TEH_handler_deposits_get (struct DH_RequestContext *rc, &ctx->charity_sig); TALER_MHD_parse_request_timeout (rc->connection, &ctx->timeout); - TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_EDDSA]++; + DH_METRICS_num_verifications[DH_MT_SIGNATURE_EDDSA]++; { if (GNUNET_OK != TALER_charity_deposit_verify (&ctx->charity, diff --git a/src/donau/donau-httpd_submit_receipts_get.h b/src/donau/donau-httpd_submit_receipts_get.h @@ -30,7 +30,7 @@ * Resume long pollers on GET /deposits. */ void -TEH_deposits_get_cleanup (void); +DH_deposits_get_cleanup (void); /** @@ -43,7 +43,7 @@ TEH_deposits_get_cleanup (void); * @return MHD result code */ MHD_RESULT -TEH_handler_deposits_get (struct DH_RequestContext *rc, +DH_handler_deposits_get (struct DH_RequestContext *rc, const char *const args[4]); diff --git a/src/donau/donau-httpd_terms.c b/src/donau/donau-httpd_terms.c @@ -39,7 +39,7 @@ // MHD_RESULT -// TEH_handler_terms (struct DH_RequestContext *rc, +// DH_handler_terms (struct DH_RequestContext *rc, // const char *const args[]) // { // (void) args; @@ -49,7 +49,7 @@ // MHD_RESULT -// TEH_handler_privacy (struct DH_RequestContext *rc, +// DH_handler_privacy (struct DH_RequestContext *rc, // const char *const args[]) // { // (void) args; @@ -59,7 +59,7 @@ // void -// TEH_load_terms (const struct GNUNET_CONFIGURATION_Handle *cfg) +// DH_load_terms (const struct GNUNET_CONFIGURATION_Handle *cfg) // { // tos = TALER_MHD_legal_load (cfg, // "donau", diff --git a/src/donau/donau-httpd_terms.h b/src/donau/donau-httpd_terms.h @@ -37,7 +37,7 @@ * @return MHD result code */ MHD_RESULT -TEH_handler_terms (struct DH_RequestContext *rc, +DH_handler_terms (struct DH_RequestContext *rc, const char *const args[]); @@ -49,7 +49,7 @@ TEH_handler_terms (struct DH_RequestContext *rc, * @return MHD result code */ MHD_RESULT -TEH_handler_privacy (struct DH_RequestContext *rc, +DH_handler_privacy (struct DH_RequestContext *rc, const char *const args[]); @@ -59,7 +59,7 @@ TEH_handler_privacy (struct DH_RequestContext *rc, * @param cfg configuration to process */ void -TEH_load_terms (const struct GNUNET_CONFIGURATION_Handle *cfg); +DH_load_terms (const struct GNUNET_CONFIGURATION_Handle *cfg); #endif diff --git a/src/donaudb/pg_activate_signing_key.c b/src/donaudb/pg_activate_signing_key.c @@ -26,7 +26,7 @@ #include "pg_helper.h" enum GNUNET_DB_QueryStatus -TEH_PG_activate_signing_key ( +DH_PG_activate_signing_key ( void *cls, const struct DONAU_DonauPublicKeyP *donau_pub, const struct DONAUDB_SignkeyMetaData *meta) diff --git a/src/donaudb/pg_activate_signing_key.h b/src/donaudb/pg_activate_signing_key.h @@ -34,7 +34,7 @@ * @return transaction status code */ enum GNUNET_DB_QueryStatus -TEH_PG_activate_signing_key ( +DH_PG_activate_signing_key ( void *cls, const struct DONAU_DonauPublicKeyP *donau_pub, const struct DONAUDB_SignkeyMetaData *meta); diff --git a/src/donaudb/pg_add_donation_unit_key.c b/src/donaudb/pg_add_donation_unit_key.c @@ -27,7 +27,7 @@ enum GNUNET_DB_QueryStatus -TEH_PG_add_donation_unit_key ( +DH_PG_add_donation_unit_key ( void *cls, const struct DONAU_DonationUnitPublicKey *donation_unit_pub, const struct DONAUDB_DonationUnitKeyMetaData *meta) diff --git a/src/donaudb/pg_add_donation_unit_key.h b/src/donaudb/pg_add_donation_unit_key.h @@ -35,7 +35,7 @@ * @return transaction status code */ enum GNUNET_DB_QueryStatus -TEH_PG_add_donation_unit_key ( +DH_PG_add_donation_unit_key ( void *cls, const struct DONAU_DonationUnitPublicKey *donation_unit_pub, const struct DONAUDB_DonationUnitKeyMetaInfo *meta) diff --git a/src/donaudb/pg_commit.c b/src/donaudb/pg_commit.c @@ -33,7 +33,7 @@ * @return final transaction status */ enum GNUNET_DB_QueryStatus -TEH_PG_commit (void *cls) +DH_PG_commit (void *cls) { struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { diff --git a/src/donaudb/pg_commit.h b/src/donaudb/pg_commit.h @@ -32,6 +32,6 @@ * @return final transaction status */ enum GNUNET_DB_QueryStatus -TEH_PG_commit (void *cls); +DH_PG_commit (void *cls); #endif diff --git a/src/donaudb/pg_create_tables.c b/src/donaudb/pg_create_tables.c @@ -27,7 +27,7 @@ enum GNUNET_GenericReturnValue -TEH_PG_create_tables (void *cls, +DH_PG_create_tables (void *cls, bool support_partitions, uint32_t num_partitions) { diff --git a/src/donaudb/pg_create_tables.h b/src/donaudb/pg_create_tables.h @@ -36,7 +36,7 @@ * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure */ enum GNUNET_GenericReturnValue -TEH_PG_create_tables (void *cls, +DH_PG_create_tables (void *cls, bool support_partitions, uint32_t num_partitions); diff --git a/src/donaudb/pg_drop_tables.c b/src/donaudb/pg_drop_tables.c @@ -33,7 +33,7 @@ * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure */ enum GNUNET_GenericReturnValue -TEH_PG_drop_tables (void *cls) +DH_PG_drop_tables (void *cls) { struct PostgresClosure *pg = cls; struct GNUNET_PQ_Context *conn; diff --git a/src/donaudb/pg_drop_tables.h b/src/donaudb/pg_drop_tables.h @@ -33,6 +33,6 @@ * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure */ enum GNUNET_GenericReturnValue -TEH_PG_drop_tables (void *cls); +DH_PG_drop_tables (void *cls); #endif diff --git a/src/donaudb/pg_event_listen.c b/src/donaudb/pg_event_listen.c @@ -37,7 +37,7 @@ * @return handle useful to cancel the listener */ struct GNUNET_DB_EventHandler * -TEH_PG_event_listen (void *cls, +DH_PG_event_listen (void *cls, struct GNUNET_TIME_Relative timeout, const struct GNUNET_DB_EventHeaderP *es, GNUNET_DB_EventCallback cb, diff --git a/src/donaudb/pg_event_listen.h b/src/donaudb/pg_event_listen.h @@ -36,7 +36,7 @@ * @return handle useful to cancel the listener */ struct GNUNET_DB_EventHandler * -TEH_PG_event_listen (void *cls, +DH_PG_event_listen (void *cls, struct GNUNET_TIME_Relative timeout, const struct GNUNET_DB_EventHeaderP *es, GNUNET_DB_EventCallback cb, diff --git a/src/donaudb/pg_event_listen_cancel.c b/src/donaudb/pg_event_listen_cancel.c @@ -27,7 +27,7 @@ void -TEH_PG_event_listen_cancel (void *cls, +DH_PG_event_listen_cancel (void *cls, struct GNUNET_DB_EventHandler *eh) { diff --git a/src/donaudb/pg_event_listen_cancel.h b/src/donaudb/pg_event_listen_cancel.h @@ -33,6 +33,6 @@ * @param eh handle to unregister. */ void -TEH_PG_event_listen_cancel (void *cls, +DH_PG_event_listen_cancel (void *cls, struct GNUNET_DB_EventHandler *eh); #endif diff --git a/src/donaudb/pg_event_notify.c b/src/donaudb/pg_event_notify.c @@ -27,7 +27,7 @@ void -TEH_PG_event_notify (void *cls, +DH_PG_event_notify (void *cls, const struct GNUNET_DB_EventHeaderP *es, const void *extra, size_t extra_size) diff --git a/src/donaudb/pg_event_notify.h b/src/donaudb/pg_event_notify.h @@ -34,7 +34,7 @@ * @param extra_size number of bytes in @a extra */ void -TEH_PG_event_notify (void *cls, +DH_PG_event_notify (void *cls, const struct GNUNET_DB_EventHeaderP *es, const void *extra, size_t extra_size); diff --git a/src/donaudb/pg_get_donation_unit_info.c b/src/donaudb/pg_get_donation_unit_info.c @@ -27,7 +27,7 @@ enum GNUNET_DB_QueryStatus -TEH_PG_get_donation_unit_info ( +DH_PG_get_donation_unit_info ( void *cls, const struct DONAU_DonationUnitHashP *donation_unit_pub_hash, struct DONAUDB_DonationUnitKeyMetaData *meta) diff --git a/src/donaudb/pg_get_donation_unit_info.h b/src/donaudb/pg_get_donation_unit_info.h @@ -33,7 +33,7 @@ * @return transaction status code */ enum GNUNET_DB_QueryStatus -TEH_PG_get_donation_unit_info ( +DH_PG_get_donation_unit_info ( void *cls, const struct DONAU_DonationUnitHashP *donation_unit_pub_hash, struct DONAUDB_DonationUnitKeyMetaData *meta); diff --git a/src/donaudb/pg_insert_charity.c b/src/donaudb/pg_insert_charity.c @@ -26,7 +26,7 @@ #include "pg_helper.h" enum GNUNET_DB_QueryStatus -TEH_PG_insert_charity (void *cls, +DH_PG_insert_charity (void *cls, const struct DONAU_CharityPublicKeyP *charity_pub, const char *charity_url, const char *charity_name, diff --git a/src/donaudb/pg_insert_charity.h b/src/donaudb/pg_insert_charity.h @@ -37,7 +37,7 @@ * @return transaction status code */ enum GNUNET_DB_QueryStatus -TEH_PG_insert_charity ( +DH_PG_insert_charity ( void *cls, const struct DONAU_CharityPublicKey *charity_pub, const char *charity_name, diff --git a/src/donaudb/pg_insert_history_entry.c b/src/donaudb/pg_insert_history_entry.c @@ -26,7 +26,7 @@ #include "pg_helper.h" enum GNUNET_DB_QueryStatus -TEH_PG_insert_history_entry (void *cls, +DH_PG_insert_history_entry (void *cls, const uint64_t charity_id, const struct TALER_Amount *final_amount, const uint64_t donation_year) diff --git a/src/donaudb/pg_insert_history_entry.h b/src/donaudb/pg_insert_history_entry.h @@ -35,7 +35,7 @@ * @return transaction status code */ enum GNUNET_DB_QueryStatus -TEH_PG_insert_history_entry (void *cls, +DH_PG_insert_history_entry (void *cls, const uint64_t charity_id, const struct TALER_Amount *final_amount, const uint64_t donation_year); diff --git a/src/donaudb/pg_insert_issued_receipt.c b/src/donaudb/pg_insert_issued_receipt.c @@ -26,7 +26,7 @@ #include "pg_helper.h" enum GNUNET_DB_QueryStatus -TEH_PG_insert_issued_receipt (void *cls, +DH_PG_insert_issued_receipt (void *cls, const struct DONAU_CharitySignatureP *charity_sig, const uint64_t charity_id, const struct DONAU_DonationReceiptHashP h_receipt, diff --git a/src/donaudb/pg_insert_issued_receipt.h b/src/donaudb/pg_insert_issued_receipt.h @@ -36,7 +36,7 @@ * @return transaction status code */ enum GNUNET_DB_QueryStatus -TEH_PG_insert_issued_receipt (void *cls, +DH_PG_insert_issued_receipt (void *cls, const struct DONAU_CharitySignatureP *charity_sig, const uint64_t charity_id, const struct diff --git a/src/donaudb/pg_insert_submitted_receipt.c b/src/donaudb/pg_insert_submitted_receipt.c @@ -26,7 +26,7 @@ #include "pg_helper.h" enum GNUNET_DB_QueryStatus -TEH_PG_insert_submitted_receipt (void *cls, +DH_PG_insert_submitted_receipt (void *cls, const struct TALER_TaxNumberHashP *h_tax_number, const struct TALER_CsNonce *nonce, diff --git a/src/donaudb/pg_insert_submitted_receipt.h b/src/donaudb/pg_insert_submitted_receipt.h @@ -37,7 +37,7 @@ * @return transaction status code */ enum GNUNET_DB_QueryStatus -TEH_PG_insert_submitted_receipt (void *cls, +DH_PG_insert_submitted_receipt (void *cls, const struct TALER_TaxNumberHashP *h_tax_number, const struct TALER_CsNonce *nonce, diff --git a/src/donaudb/pg_lookup_donation_unit_key.c b/src/donaudb/pg_lookup_donation_unit_key.c @@ -26,7 +26,7 @@ #include "pg_helper.h" enum GNUNET_DB_QueryStatus -TEH_PG_lookup_donation_unit_key ( +DH_PG_lookup_donation_unit_key ( void *cls, const struct DONAU_DonationUnitHashP *h_donation_unit_pub, struct DONAUDB_DonationUnitKeyMetaData *meta) diff --git a/src/donaudb/pg_lookup_donation_unit_key.h b/src/donaudb/pg_lookup_donation_unit_key.h @@ -33,7 +33,7 @@ * @return transaction status code */ enum GNUNET_DB_QueryStatus -TEH_PG_lookup_donation_unit_key ( +DH_PG_lookup_donation_unit_key ( void *cls, const struct DONAU_DonationUnitHashP *h_denom_pub, struct DONAUDB_DonationUnitKeyMetaData *meta); diff --git a/src/donaudb/pg_lookup_signing_key.c b/src/donaudb/pg_lookup_signing_key.c @@ -27,7 +27,7 @@ enum GNUNET_DB_QueryStatus -TEH_PG_lookup_signing_key ( +DH_PG_lookup_signing_key ( void *cls, const struct DONAU_DonauPublicKeyP *donau_pub, struct DONAUDB_SignkeyMetaData *meta) diff --git a/src/donaudb/pg_lookup_signing_key.h b/src/donaudb/pg_lookup_signing_key.h @@ -35,7 +35,7 @@ * @return transaction status code */ enum GNUNET_DB_QueryStatus -TEH_PG_lookup_signing_key ( +DH_PG_lookup_signing_key ( void *cls, const struct DONAU_DonauPublicKeyP *donau_pub, struct DONAUDB_SignkeyMetaData *meta); diff --git a/src/donaudb/pg_preflight.c b/src/donaudb/pg_preflight.c @@ -33,11 +33,11 @@ * @return #GNUNET_OK on success */ enum GNUNET_GenericReturnValue -TEH_PG_internal_setup (struct PostgresClosure *pg); +DH_PG_internal_setup (struct PostgresClosure *pg); enum GNUNET_GenericReturnValue -TEH_PG_preflight (void *cls) +DH_PG_preflight (void *cls) { struct PostgresClosure *pg = cls; struct GNUNET_PQ_ExecuteStatement es[] = { @@ -46,7 +46,7 @@ TEH_PG_preflight (void *cls) }; if (GNUNET_OK != - TEH_PG_internal_setup (pg)) + DH_PG_internal_setup (pg)) return GNUNET_SYSERR; if (NULL == pg->transaction_name) return GNUNET_OK; /* all good */ diff --git a/src/donaudb/pg_preflight.h b/src/donaudb/pg_preflight.h @@ -39,6 +39,6 @@ enum GNUNET_GenericReturnValue -TEH_PG_preflight (void *cls); +DH_PG_preflight (void *cls); #endif diff --git a/src/donaudb/pg_rollback.c b/src/donaudb/pg_rollback.c @@ -27,7 +27,7 @@ void -TEH_PG_rollback (void *cls) +DH_PG_rollback (void *cls) { struct PostgresClosure *pg = cls; struct GNUNET_PQ_ExecuteStatement es[] = { diff --git a/src/donaudb/pg_rollback.h b/src/donaudb/pg_rollback.h @@ -31,6 +31,6 @@ * @param cls the `struct PostgresClosure` with the plugin-specific state */ void -TEH_PG_rollback (void *cls); +DH_PG_rollback (void *cls); #endif diff --git a/src/donaudb/pg_start.c b/src/donaudb/pg_start.c @@ -27,7 +27,7 @@ #include "pg_helper.h" enum GNUNET_GenericReturnValue -TEH_PG_start (void *cls, +DH_PG_start (void *cls, const char *name) { struct PostgresClosure *pg = cls; @@ -38,7 +38,7 @@ TEH_PG_start (void *cls, GNUNET_assert (NULL != name); if (GNUNET_SYSERR == - TEH_PG_preflight (pg)) + DH_PG_preflight (pg)) return GNUNET_SYSERR; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Starting transaction `%s'\n", diff --git a/src/donaudb/pg_start.h b/src/donaudb/pg_start.h @@ -34,7 +34,7 @@ * @return #GNUNET_OK on success */ enum GNUNET_GenericReturnValue -TEH_PG_start (void *cls, +DH_PG_start (void *cls, const char *name); #endif diff --git a/src/donaudb/pg_start_read_committed.c b/src/donaudb/pg_start_read_committed.c @@ -27,7 +27,7 @@ #include "pg_helper.h" enum GNUNET_GenericReturnValue -TEH_PG_start_read_committed (void *cls, +DH_PG_start_read_committed (void *cls, const char *name) { struct PostgresClosure *pg = cls; @@ -38,7 +38,7 @@ TEH_PG_start_read_committed (void *cls, GNUNET_assert (NULL != name); if (GNUNET_SYSERR == - TEH_PG_preflight (pg)) + DH_PG_preflight (pg)) return GNUNET_SYSERR; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Starting READ COMMITTED transaction `%s`\n", diff --git a/src/donaudb/pg_start_read_committed.h b/src/donaudb/pg_start_read_committed.h @@ -33,7 +33,7 @@ * @return #GNUNET_OK on success */ enum GNUNET_GenericReturnValue -TEH_PG_start_read_committed (void *cls, +DH_PG_start_read_committed (void *cls, const char *name); #endif diff --git a/src/donaudb/pg_start_read_only.c b/src/donaudb/pg_start_read_only.c @@ -27,7 +27,7 @@ #include "pg_helper.h" enum GNUNET_GenericReturnValue -TEH_PG_start_read_only (void *cls, +DH_PG_start_read_only (void *cls, const char *name) { struct PostgresClosure *pg = cls; @@ -39,7 +39,7 @@ TEH_PG_start_read_only (void *cls, GNUNET_assert (NULL != name); if (GNUNET_SYSERR == - TEH_PG_preflight (pg)) + DH_PG_preflight (pg)) return GNUNET_SYSERR; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Starting READ ONLY transaction `%s`\n", diff --git a/src/donaudb/pg_start_read_only.h b/src/donaudb/pg_start_read_only.h @@ -34,7 +34,7 @@ * @return #GNUNET_OK on success */ enum GNUNET_GenericReturnValue -TEH_PG_start_read_only (void *cls, +DH_PG_start_read_only (void *cls, const char *name); #endif diff --git a/src/donaudb/pg_template.sh b/src/donaudb/pg_template.sh @@ -10,7 +10,7 @@ do then cat pg_template.c | sed -e s/template/$n/g -e s/TEMPLATE/$NCAPS/g > pg_$n.c cat pg_template.h | sed -e s/template/$n/g -e s/TEMPLATE/$NCAPS/g > pg_$n.h - echo " plugin->$n\n = &TEH_PG_$n;" >> tmpl.c + echo " plugin->$n\n = &DH_PG_$n;" >> tmpl.c echo "#include \"pg_$n.h\"" >> tmpl.inc echo " pg_$n.h pg_$n.c \\" >> tmpl.am fi diff --git a/src/donaudb/plugin_donaudb_postgres.c b/src/donaudb/plugin_donaudb_postgres.c @@ -71,7 +71,7 @@ // * @return #GNUNET_OK on success // */ // enum GNUNET_GenericReturnValue -// TEH_PG_internal_setup (struct PostgresClosure *pg) +// DH_PG_internal_setup (struct PostgresClosure *pg) // { // if (NULL == pg->conn) // { @@ -220,7 +220,7 @@ // return NULL; // } // if (GNUNET_OK != -// TEH_PG_internal_setup (pg)) +// DH_PG_internal_setup (pg)) // { // GNUNET_free (pg->donau_url); // GNUNET_free (pg->currency); @@ -231,11 +231,11 @@ // plugin = GNUNET_new (struct DONAUDB_Plugin); // plugin->cls = pg; // plugin->do_reserve_open -// = &TEH_PG_do_reserve_open; +// = &DH_PG_do_reserve_open; // plugin->drop_tables -// = &TEH_PG_drop_tables; +// = &DH_PG_drop_tables; // plugin->do_withdraw -// = &TEH_PG_do_withdraw; +// = &DH_PG_do_withdraw; // return plugin; // } diff --git a/src/include/donaudb_plugin.h b/src/include/donaudb_plugin.h @@ -98,7 +98,7 @@ struct DONAUDB_DonationUnitKey * Signature of a function called with information about the donau's * donation unit keys. * - * @param cls closure with a `struct TEH_KeyStateHandle *` + * @param cls closure with a `struct DH_KeyStateHandle *` * @param donation_unit_pub public key of the donation unit * @param info donation unit key information */ @@ -113,7 +113,7 @@ typedef void * Signature of a function called with information about the donau's * signing keys. * - * @param cls closure with a `struct TEH_KeyStateHandle *` + * @param cls closure with a `struct DH_KeyStateHandle *` * @param donau_pub public key of the donau * @param meta meta data information about the signing type (expirations) */ diff --git a/src/lib/donau_api_batch_issue_receipts2.c b/src/lib/donau_api_batch_issue_receipts2.c @@ -64,7 +64,7 @@ struct DONAU_BatchWithdraw2Handle void *cb_cls; /** - * Context for #TEH_curl_easy_post(). Keeps the data that must + * Context for #DH_curl_easy_post(). Keeps the data that must * persist for Curl to make the upload. */ struct TALER_CURL_PostContext post_ctx; diff --git a/src/lib/donau_api_batch_submit_receipts.c b/src/lib/donau_api_batch_submit_receipts.c @@ -99,7 +99,7 @@ struct DONAU_BatchDepositHandle char *url; /** - * Context for #TEH_curl_easy_post(). Keeps the data that must + * Context for #DH_curl_easy_post(). Keeps the data that must * persist for Curl to make the upload. */ struct TALER_CURL_PostContext post_ctx; diff --git a/src/lib/donau_api_charities_close.c b/src/lib/donau_api_charities_close.c @@ -49,7 +49,7 @@ struct DONAU_ReservesCloseHandle struct GNUNET_CURL_Job *job; /** - * Context for #TEH_curl_easy_post(). Keeps the data that must + * Context for #DH_curl_easy_post(). Keeps the data that must * persist for Curl to make the upload. */ struct TALER_CURL_PostContext post_ctx; diff --git a/src/lib/donau_api_charities_history.c b/src/lib/donau_api_charities_history.c @@ -54,7 +54,7 @@ struct DONAU_ReservesHistoryHandle struct GNUNET_CURL_Job *job; /** - * Context for #TEH_curl_easy_post(). Keeps the data that must + * Context for #DH_curl_easy_post(). Keeps the data that must * persist for Curl to make the upload. */ struct TALER_CURL_PostContext post_ctx; diff --git a/src/lib/donau_api_charities_open.c b/src/lib/donau_api_charities_open.c @@ -81,7 +81,7 @@ struct CoinData // struct GNUNET_CURL_Job *job; // /** -// * Context for #TEH_curl_easy_post(). Keeps the data that must +// * Context for #DH_curl_easy_post(). Keeps the data that must // * persist for Curl to make the upload. // */ // struct TALER_CURL_PostContext post_ctx; diff --git a/src/lib/donau_api_charities_status.c b/src/lib/donau_api_charities_status.c @@ -54,7 +54,7 @@ struct DONAU_ReservesStatusHandle struct GNUNET_CURL_Job *job; /** - * Context for #TEH_curl_easy_post(). Keeps the data that must + * Context for #DH_curl_easy_post(). Keeps the data that must * persist for Curl to make the upload. */ struct TALER_CURL_PostContext post_ctx; diff --git a/src/lib/donau_api_csr_issue_receipts.c b/src/lib/donau_api_csr_issue_receipts.c @@ -59,7 +59,7 @@ struct DONAU_CsRWithdrawHandle struct GNUNET_CURL_Job *job; /** - * Context for #TEH_curl_easy_post(). Keeps the data that must + * Context for #DH_curl_easy_post(). Keeps the data that must * persist for Curl to make the upload. */ struct TALER_CURL_PostContext post_ctx; diff --git a/src/lib/donau_api_issue_receipts2.c b/src/lib/donau_api_issue_receipts2.c @@ -64,7 +64,7 @@ struct DONAU_Withdraw2Handle void *cb_cls; /** - * Context for #TEH_curl_easy_post(). Keeps the data that must + * Context for #DH_curl_easy_post(). Keeps the data that must * persist for Curl to make the upload. */ struct TALER_CURL_PostContext post_ctx; diff --git a/src/lib/donau_api_submit_receipts_get.c b/src/lib/donau_api_submit_receipts_get.c @@ -49,7 +49,7 @@ struct DONAU_DepositGetHandle char *url; /** - * Context for #TEH_curl_easy_post(). Keeps the data that must + * Context for #DH_curl_easy_post(). Keeps the data that must * persist for Curl to make the upload. */ struct TALER_CURL_PostContext ctx;