diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2024-04-07 18:22:15 +0200 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2024-04-07 18:22:15 +0200 |
commit | a794c0cff16894d1396f95980ce8c4d0a83ae7c1 (patch) | |
tree | 666c2c7110bcdf7167f77c80e61130068b2198f1 | |
parent | cde0578ac9cd4a54e723a63747688e1ca20d1448 (diff) | |
download | libmicrohttpd-a794c0cff16894d1396f95980ce8c4d0a83ae7c1.tar.gz libmicrohttpd-a794c0cff16894d1396f95980ce8c4d0a83ae7c1.zip |
microhttpd2.h: updated with generated content
-rw-r--r-- | src/include/microhttpd2.h | 213 |
1 files changed, 205 insertions, 8 deletions
diff --git a/src/include/microhttpd2.h b/src/include/microhttpd2.h index d15c71ec..63dadd55 100644 --- a/src/include/microhttpd2.h +++ b/src/include/microhttpd2.h | |||
@@ -3832,6 +3832,13 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_DaemonOption | |||
3832 | MHD_D_O_POLL_SYSCALL = 41 | 3832 | MHD_D_O_POLL_SYSCALL = 41 |
3833 | , | 3833 | , |
3834 | /** | 3834 | /** |
3835 | * Set a callback to use for logging | ||
3836 | * The parameter value must be placed to the | ||
3837 | * @a v_log_callback member. | ||
3838 | */ | ||
3839 | MHD_D_O_LOG_CALLBACK = 60 | ||
3840 | , | ||
3841 | /** | ||
3835 | * Bind to the given TCP port and address family. | 3842 | * Bind to the given TCP port and address family. |
3836 | * | 3843 | * |
3837 | * Does not work with #MHD_DAEMON_OPTION_BIND_SA() or | 3844 | * Does not work with #MHD_DAEMON_OPTION_BIND_SA() or |
@@ -3928,11 +3935,28 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_DaemonOption | |||
3928 | MHD_D_O_TLS = 120 | 3935 | MHD_D_O_TLS = 120 |
3929 | , | 3936 | , |
3930 | /** | 3937 | /** |
3938 | * Provide TLS key and certificate data in-memory. | ||
3939 | * Works only if TLS mode is enabled. | ||
3940 | * The parameter value must be placed to the | ||
3941 | * @a v_tls_key_cert member. | ||
3942 | */ | ||
3943 | MHD_D_O_TLS_KEY_CERT = 121 | ||
3944 | , | ||
3945 | /** | ||
3946 | * Provide the certificate of the certificate authority (CA) to be used by | ||
3947 | * the MHD daemon for client authentication. | ||
3948 | * Works only if TLS mode is enabled. | ||
3949 | * The parameter value must be placed to the | ||
3950 | * @a v_tls_client_ca member. | ||
3951 | */ | ||
3952 | MHD_D_O_TLS_CLIENT_CA = 122 | ||
3953 | , | ||
3954 | /** | ||
3931 | * Configure PSK to use for the TLS key exchange. | 3955 | * Configure PSK to use for the TLS key exchange. |
3932 | * The parameter value must be placed to the | 3956 | * The parameter value must be placed to the |
3933 | * @a v_tls_psk_callback member. | 3957 | * @a v_tls_psk_callback member. |
3934 | */ | 3958 | */ |
3935 | MHD_D_O_TLS_PSK_CALLBACK = 121 | 3959 | MHD_D_O_TLS_PSK_CALLBACK = 130 |
3936 | , | 3960 | , |
3937 | /** | 3961 | /** |
3938 | * Control ALPN for TLS connection. | 3962 | * Control ALPN for TLS connection. |
@@ -3941,7 +3965,7 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_DaemonOption | |||
3941 | * The parameter value must be placed to the | 3965 | * The parameter value must be placed to the |
3942 | * @a v_no_alpn member. | 3966 | * @a v_no_alpn member. |
3943 | */ | 3967 | */ |
3944 | MHD_D_O_NO_ALPN = 122 | 3968 | MHD_D_O_NO_ALPN = 140 |
3945 | , | 3969 | , |
3946 | /** | 3970 | /** |
3947 | * Specify inactivity timeout for connection. | 3971 | * Specify inactivity timeout for connection. |
@@ -4126,7 +4150,7 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_DaemonOption | |||
4126 | * | 4150 | * |
4127 | * The specified callback will be called one time, after network | 4151 | * The specified callback will be called one time, after network |
4128 | * initialisation, TLS pre-initialisation, but before the start of the | 4152 | * initialisation, TLS pre-initialisation, but before the start of the |
4129 | * internal threads (if allowed)ю | 4153 | * internal threads (if allowed) |
4130 | * The parameter value must be placed to the | 4154 | * The parameter value must be placed to the |
4131 | * @a v_daemon_ready_callback member. | 4155 | * @a v_daemon_ready_callback member. |
4132 | */ | 4156 | */ |
@@ -4217,6 +4241,22 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_DaemonOption | |||
4217 | 4241 | ||
4218 | /* = MHD Daemon Option structures below are generated automatically = */ | 4242 | /* = MHD Daemon Option structures below are generated automatically = */ |
4219 | /** | 4243 | /** |
4244 | * Data for #MHD_D_O_LOG_CALLBACK | ||
4245 | */ | ||
4246 | struct MHD_DaemonOptionValueLog | ||
4247 | { | ||
4248 | /** | ||
4249 | * The callback to use for logging, | ||
4250 | * NULL to disable logging | ||
4251 | */ | ||
4252 | MHD_LoggingCallback v_log_cb; | ||
4253 | /** | ||
4254 | * The closure for the logging callback | ||
4255 | */ | ||
4256 | void *v_lob_cb_cls; | ||
4257 | }; | ||
4258 | |||
4259 | /** | ||
4220 | * Data for #MHD_D_O_BIND_PORT | 4260 | * Data for #MHD_D_O_BIND_PORT |
4221 | */ | 4261 | */ |
4222 | struct MHD_DaemonOptionValueBind | 4262 | struct MHD_DaemonOptionValueBind |
@@ -4267,6 +4307,26 @@ struct MHD_DaemonOptionValueTFO | |||
4267 | }; | 4307 | }; |
4268 | 4308 | ||
4269 | /** | 4309 | /** |
4310 | * Data for #MHD_D_O_TLS_KEY_CERT | ||
4311 | */ | ||
4312 | struct MHD_DaemonOptionValueTlsCert | ||
4313 | { | ||
4314 | /** | ||
4315 | * The private key loaded into memory (not a filename) | ||
4316 | */ | ||
4317 | const char *v_mem_key; | ||
4318 | /** | ||
4319 | * The certificate loaded into memory (not a filename) | ||
4320 | */ | ||
4321 | const char *v_mem_cert; | ||
4322 | /** | ||
4323 | * The option passphrase phrase to decrypt the private key, | ||
4324 | * could be NULL is private does not need a password | ||
4325 | */ | ||
4326 | const char *v_mem_cert; | ||
4327 | }; | ||
4328 | |||
4329 | /** | ||
4270 | * Data for #MHD_D_O_TLS_PSK_CALLBACK | 4330 | * Data for #MHD_D_O_TLS_PSK_CALLBACK |
4271 | */ | 4331 | */ |
4272 | struct MHD_DaemonOptionValueTlsPskCB | 4332 | struct MHD_DaemonOptionValueTlsPskCB |
@@ -4404,6 +4464,10 @@ union MHD_DaemonOptionValue | |||
4404 | */ | 4464 | */ |
4405 | enum MHD_SockPollSyscall v_poll_syscall; | 4465 | enum MHD_SockPollSyscall v_poll_syscall; |
4406 | /** | 4466 | /** |
4467 | * Value for #MHD_D_O_LOG_CALLBACK | ||
4468 | */ | ||
4469 | struct MHD_DaemonOptionValueLog v_log_callback; | ||
4470 | /** | ||
4407 | * Value for #MHD_D_O_BIND_PORT | 4471 | * Value for #MHD_D_O_BIND_PORT |
4408 | */ | 4472 | */ |
4409 | struct MHD_DaemonOptionValueBind v_bind_port; | 4473 | struct MHD_DaemonOptionValueBind v_bind_port; |
@@ -4436,6 +4500,14 @@ union MHD_DaemonOptionValue | |||
4436 | */ | 4500 | */ |
4437 | enum MHD_TlsBackend v_tls; | 4501 | enum MHD_TlsBackend v_tls; |
4438 | /** | 4502 | /** |
4503 | * Value for #MHD_D_O_TLS_KEY_CERT | ||
4504 | */ | ||
4505 | struct MHD_DaemonOptionValueTlsCert v_tls_key_cert; | ||
4506 | /** | ||
4507 | * Value for #MHD_D_O_TLS_CLIENT_CA | ||
4508 | */ | ||
4509 | const char *v_tls_client_ca; | ||
4510 | /** | ||
4439 | * Value for #MHD_D_O_TLS_PSK_CALLBACK | 4511 | * Value for #MHD_D_O_TLS_PSK_CALLBACK |
4440 | */ | 4512 | */ |
4441 | struct MHD_DaemonOptionValueTlsPskCB v_tls_psk_callback; | 4513 | struct MHD_DaemonOptionValueTlsPskCB v_tls_psk_callback; |
@@ -4604,6 +4676,24 @@ struct MHD_DaemonOptionAndValue | |||
4604 | MHD_RESTORE_WARN_COMPOUND_LITERALS_ | 4676 | MHD_RESTORE_WARN_COMPOUND_LITERALS_ |
4605 | 4677 | ||
4606 | /** | 4678 | /** |
4679 | * Set a callback to use for logging | ||
4680 | * @param log_cb the callback to use for logging, | ||
4681 | * NULL to disable logging | ||
4682 | * @param lob_cb_cls the closure for the logging callback | ||
4683 | * @return the object of struct MHD_DaemonOptionAndValue with the requested | ||
4684 | * values | ||
4685 | */ | ||
4686 | # define MHD_DAEMON_OPTION_LOG_CALLBACK(log_cb,lob_cb_cls) \ | ||
4687 | MHD_NOWARN_COMPOUND_LITERALS_ \ | ||
4688 | (const struct MHD_DaemonOptionAndValue) \ | ||
4689 | { \ | ||
4690 | .opt = (MHD_D_O_LOG_CALLBACK), \ | ||
4691 | .val.v_log_callback.v_log_cb = (log_cb), \ | ||
4692 | .val.v_log_callback.v_lob_cb_cls = (lob_cb_cls) \ | ||
4693 | } \ | ||
4694 | MHD_RESTORE_WARN_COMPOUND_LITERALS_ | ||
4695 | |||
4696 | /** | ||
4607 | * Bind to the given TCP port and address family. | 4697 | * Bind to the given TCP port and address family. |
4608 | * | 4698 | * |
4609 | * Does not work with #MHD_DAEMON_OPTION_BIND_SA() or | 4699 | * Does not work with #MHD_DAEMON_OPTION_BIND_SA() or |
@@ -4779,6 +4869,44 @@ struct MHD_DaemonOptionAndValue | |||
4779 | MHD_RESTORE_WARN_COMPOUND_LITERALS_ | 4869 | MHD_RESTORE_WARN_COMPOUND_LITERALS_ |
4780 | 4870 | ||
4781 | /** | 4871 | /** |
4872 | * Provide TLS key and certificate data in-memory. | ||
4873 | * Works only if TLS mode is enabled. | ||
4874 | * @param mem_key the private key loaded into memory (not a filename) | ||
4875 | * @param mem_cert the certificate loaded into memory (not a filename) | ||
4876 | * @param mem_cert the option passphrase phrase to decrypt the private key, | ||
4877 | * could be NULL is private does not need a password | ||
4878 | * @return the object of struct MHD_DaemonOptionAndValue with the requested | ||
4879 | * values | ||
4880 | */ | ||
4881 | # define MHD_DAEMON_OPTION_TLS_KEY_CERT(mem_key,mem_cert,mem_cert) \ | ||
4882 | MHD_NOWARN_COMPOUND_LITERALS_ \ | ||
4883 | (const struct MHD_DaemonOptionAndValue) \ | ||
4884 | { \ | ||
4885 | .opt = (MHD_D_O_TLS_KEY_CERT), \ | ||
4886 | .val.v_tls_key_cert.v_mem_key = (mem_key), \ | ||
4887 | .val.v_tls_key_cert.v_mem_cert = (mem_cert), \ | ||
4888 | .val.v_tls_key_cert.v_mem_cert = (mem_cert) \ | ||
4889 | } \ | ||
4890 | MHD_RESTORE_WARN_COMPOUND_LITERALS_ | ||
4891 | |||
4892 | /** | ||
4893 | * Provide the certificate of the certificate authority (CA) to be used by the | ||
4894 | * MHD daemon for client authentication. | ||
4895 | * Works only if TLS mode is enabled. | ||
4896 | * @param mem_client_ca the CA certificate in memory (not a filename) | ||
4897 | * @return the object of struct MHD_DaemonOptionAndValue with the requested | ||
4898 | * values | ||
4899 | */ | ||
4900 | # define MHD_DAEMON_OPTION_TLS_CLIENT_CA(mem_client_ca) \ | ||
4901 | MHD_NOWARN_COMPOUND_LITERALS_ \ | ||
4902 | (const struct MHD_DaemonOptionAndValue) \ | ||
4903 | { \ | ||
4904 | .opt = (MHD_D_O_TLS_CLIENT_CA), \ | ||
4905 | .val.v_tls_client_ca = (mem_client_ca) \ | ||
4906 | } \ | ||
4907 | MHD_RESTORE_WARN_COMPOUND_LITERALS_ | ||
4908 | |||
4909 | /** | ||
4782 | * Configure PSK to use for the TLS key exchange. | 4910 | * Configure PSK to use for the TLS key exchange. |
4783 | * @param psk_cb the function to call to obtain pre-shared key | 4911 | * @param psk_cb the function to call to obtain pre-shared key |
4784 | * @param psk_cb_cls the closure for @a psk_cb | 4912 | * @param psk_cb_cls the closure for @a psk_cb |
@@ -5127,7 +5255,7 @@ struct MHD_DaemonOptionAndValue | |||
5127 | * | 5255 | * |
5128 | * The specified callback will be called one time, after network | 5256 | * The specified callback will be called one time, after network |
5129 | * initialisation, TLS pre-initialisation, but before the start of the internal | 5257 | * initialisation, TLS pre-initialisation, but before the start of the internal |
5130 | * threads (if allowed)ю | 5258 | * threads (if allowed) |
5131 | * @param cb the pre-start callback | 5259 | * @param cb the pre-start callback |
5132 | * @param cb_cls the closure for the callback | 5260 | * @param cb_cls the closure for the callback |
5133 | * @return the object of struct MHD_DaemonOptionAndValue with the requested | 5261 | * @return the object of struct MHD_DaemonOptionAndValue with the requested |
@@ -5332,6 +5460,29 @@ MHD_DAEMON_OPTION_POLL_SYSCALL (enum MHD_SockPollSyscall els) | |||
5332 | 5460 | ||
5333 | 5461 | ||
5334 | /** | 5462 | /** |
5463 | * Set a callback to use for logging | ||
5464 | * @param log_cb the callback to use for logging, | ||
5465 | * NULL to disable logging | ||
5466 | * @param lob_cb_cls the closure for the logging callback | ||
5467 | * @return the object of struct MHD_DaemonOptionAndValue with the requested | ||
5468 | * values | ||
5469 | */ | ||
5470 | static MHD_INLINE struct MHD_DaemonOptionAndValue | ||
5471 | MHD_DAEMON_OPTION_LOG_CALLBACK ( | ||
5472 | MHD_LoggingCallback log_cb, | ||
5473 | void *lob_cb_cls) | ||
5474 | { | ||
5475 | struct MHD_DaemonOptionAndValue opt_val; | ||
5476 | |||
5477 | opt_val.opt = MHD_D_O_LOG_CALLBACK; | ||
5478 | opt_val.val.v_log_callback.v_log_cb = log_cb; | ||
5479 | opt_val.val.v_log_callback.v_lob_cb_cls = lob_cb_cls; | ||
5480 | |||
5481 | return opt_val; | ||
5482 | } | ||
5483 | |||
5484 | |||
5485 | /** | ||
5335 | * Bind to the given TCP port and address family. | 5486 | * Bind to the given TCP port and address family. |
5336 | * | 5487 | * |
5337 | * Does not work with #MHD_DAEMON_OPTION_BIND_SA() or | 5488 | * Does not work with #MHD_DAEMON_OPTION_BIND_SA() or |
@@ -5537,6 +5688,53 @@ MHD_DAEMON_OPTION_TLS (enum MHD_TlsBackend backend) | |||
5537 | 5688 | ||
5538 | 5689 | ||
5539 | /** | 5690 | /** |
5691 | * Provide TLS key and certificate data in-memory. | ||
5692 | * Works only if TLS mode is enabled. | ||
5693 | * @param mem_key the private key loaded into memory (not a filename) | ||
5694 | * @param mem_cert the certificate loaded into memory (not a filename) | ||
5695 | * @param mem_cert the option passphrase phrase to decrypt the private key, | ||
5696 | * could be NULL is private does not need a password | ||
5697 | * @return the object of struct MHD_DaemonOptionAndValue with the requested | ||
5698 | * values | ||
5699 | */ | ||
5700 | static MHD_INLINE struct MHD_DaemonOptionAndValue | ||
5701 | MHD_DAEMON_OPTION_TLS_KEY_CERT ( | ||
5702 | const char *mem_key, | ||
5703 | const char *mem_cert, | ||
5704 | const char *mem_cert) | ||
5705 | { | ||
5706 | struct MHD_DaemonOptionAndValue opt_val; | ||
5707 | |||
5708 | opt_val.opt = MHD_D_O_TLS_KEY_CERT; | ||
5709 | opt_val.val.v_tls_key_cert.v_mem_key = mem_key; | ||
5710 | opt_val.val.v_tls_key_cert.v_mem_cert = mem_cert; | ||
5711 | opt_val.val.v_tls_key_cert.v_mem_cert = mem_cert; | ||
5712 | |||
5713 | return opt_val; | ||
5714 | } | ||
5715 | |||
5716 | |||
5717 | /** | ||
5718 | * Provide the certificate of the certificate authority (CA) to be used by the | ||
5719 | * MHD daemon for client authentication. | ||
5720 | * Works only if TLS mode is enabled. | ||
5721 | * @param mem_client_ca the CA certificate in memory (not a filename) | ||
5722 | * @return the object of struct MHD_DaemonOptionAndValue with the requested | ||
5723 | * values | ||
5724 | */ | ||
5725 | static MHD_INLINE struct MHD_DaemonOptionAndValue | ||
5726 | MHD_DAEMON_OPTION_TLS_CLIENT_CA (const char *mem_client_ca) | ||
5727 | { | ||
5728 | struct MHD_DaemonOptionAndValue opt_val; | ||
5729 | |||
5730 | opt_val.opt = MHD_D_O_TLS_CLIENT_CA; | ||
5731 | opt_val.val.v_tls_client_ca = mem_client_ca; | ||
5732 | |||
5733 | return opt_val; | ||
5734 | } | ||
5735 | |||
5736 | |||
5737 | /** | ||
5540 | * Configure PSK to use for the TLS key exchange. | 5738 | * Configure PSK to use for the TLS key exchange. |
5541 | * @param psk_cb the function to call to obtain pre-shared key | 5739 | * @param psk_cb the function to call to obtain pre-shared key |
5542 | * @param psk_cb_cls the closure for @a psk_cb | 5740 | * @param psk_cb_cls the closure for @a psk_cb |
@@ -5947,7 +6145,7 @@ MHD_DAEMON_OPTION_DISALLOW_SUSPEND_RESUME (enum MHD_Bool bool_val) | |||
5947 | * | 6145 | * |
5948 | * The specified callback will be called one time, after network | 6146 | * The specified callback will be called one time, after network |
5949 | * initialisation, TLS pre-initialisation, but before the start of the internal | 6147 | * initialisation, TLS pre-initialisation, but before the start of the internal |
5950 | * threads (if allowed)ю | 6148 | * threads (if allowed) |
5951 | * @param cb the pre-start callback | 6149 | * @param cb the pre-start callback |
5952 | * @param cb_cls the closure for the callback | 6150 | * @param cb_cls the closure for the callback |
5953 | * @return the object of struct MHD_DaemonOptionAndValue with the requested | 6151 | * @return the object of struct MHD_DaemonOptionAndValue with the requested |
@@ -6078,9 +6276,8 @@ MHD_DAEMON_OPTION_DAUTH_MAP_SIZE (size_t size) | |||
6078 | * values | 6276 | * values |
6079 | */ | 6277 | */ |
6080 | static MHD_INLINE struct MHD_DaemonOptionAndValue | 6278 | static MHD_INLINE struct MHD_DaemonOptionAndValue |
6081 | MHD_DAEMON_OPTION_DAUTH_NONCE_BIND_TYPE (enum | 6279 | MHD_DAEMON_OPTION_DAUTH_NONCE_BIND_TYPE ( |
6082 | MHD_DaemonOptionValueDAuthBindNonce | 6280 | enum MHD_DaemonOptionValueDAuthBindNonce bind_type) |
6083 | bind_type) | ||
6084 | { | 6281 | { |
6085 | struct MHD_DaemonOptionAndValue opt_val; | 6282 | struct MHD_DaemonOptionAndValue opt_val; |
6086 | 6283 | ||