diff options
Diffstat (limited to 'src/backend/anastasis-httpd_policy.h')
-rw-r--r-- | src/backend/anastasis-httpd_policy.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src/backend/anastasis-httpd_policy.h b/src/backend/anastasis-httpd_policy.h new file mode 100644 index 0000000..9fb630d --- /dev/null +++ b/src/backend/anastasis-httpd_policy.h | |||
@@ -0,0 +1,66 @@ | |||
1 | /* | ||
2 | This file is part of TALER | ||
3 | Copyright (C) 2014, 2015, 2016 GNUnet e.V. | ||
4 | |||
5 | TALER is free software; you can redistribute it and/or modify it under the | ||
6 | terms of the GNU Affero General Public License as published by the Free Software | ||
7 | Foundation; either version 3, or (at your option) any later version. | ||
8 | |||
9 | TALER is distributed in the hope that it will be useful, but WITHOUT ANY | ||
10 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
11 | A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. | ||
12 | |||
13 | You should have received a copy of the GNU Affero General Public License along with | ||
14 | TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> | ||
15 | */ | ||
16 | /** | ||
17 | * @file anastasis-httpd_policy.h | ||
18 | * @brief functions to handle incoming requests on /policy/ | ||
19 | * @author Dennis Neufeld | ||
20 | * @author Dominik Meister | ||
21 | * @author Christian Grothoff | ||
22 | */ | ||
23 | #ifndef ANASTASIS_HTTPD_POLICY_H | ||
24 | #define ANASTASIS_HTTPD_POLICY_H | ||
25 | #include <microhttpd.h> | ||
26 | |||
27 | |||
28 | /** | ||
29 | * Service is shutting down, resume all MHD connections NOW. | ||
30 | */ | ||
31 | void | ||
32 | AH_resume_all_bc (void); | ||
33 | |||
34 | |||
35 | /** | ||
36 | * Handle GET /policy/$ACCOUNT_PUB request. | ||
37 | * | ||
38 | * @param connection the MHD connection to handle | ||
39 | * @param account_pub public key of the account | ||
40 | * @return MHD result code | ||
41 | */ | ||
42 | MHD_RESULT | ||
43 | AH_policy_get (struct MHD_Connection *connection, | ||
44 | const struct ANASTASIS_CRYPTO_AccountPublicKeyP *account_pub); | ||
45 | |||
46 | |||
47 | /** | ||
48 | * Handle POST /policy/$ACCOUNT_PUB request. | ||
49 | * | ||
50 | * @param connection the MHD connection to handle | ||
51 | * @param con_cls the connection's closure | ||
52 | * @param account_pub public key of the account | ||
53 | * @param upload_data upload data | ||
54 | * @param upload_data_size number of bytes (left) in @a upload_data | ||
55 | * @return MHD result code | ||
56 | */ | ||
57 | MHD_RESULT | ||
58 | AH_handler_policy_post ( | ||
59 | struct MHD_Connection *connection, | ||
60 | struct TM_HandlerContext *hc, | ||
61 | const struct ANASTASIS_CRYPTO_AccountPublicKeyP *account_pub, | ||
62 | const char *upload_data, | ||
63 | size_t *upload_data_size); | ||
64 | |||
65 | |||
66 | #endif | ||