Commit e6c186aa1c5462d05ecc0f7103447a3b25c1d71b
1 parent
6d44762e
Exists in
master
and in
3 other branches
Adjusting property names.
Showing
4 changed files
with
53 additions
and
28 deletions
Show diff stats
src/core/properties/string.c
| @@ -79,7 +79,7 @@ | @@ -79,7 +79,7 @@ | ||
| 79 | }, | 79 | }, |
| 80 | 80 | ||
| 81 | { | 81 | { |
| 82 | - .name = "model", // Property name. | 82 | + .name = "model_name", // Property name. |
| 83 | .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. | 83 | .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. |
| 84 | .description = N_( "Model name" ), // Property description. | 84 | .description = N_( "Model name" ), // Property description. |
| 85 | .get = lib3270_get_model_name, // Get value. | 85 | .get = lib3270_get_model_name, // Get value. |
| @@ -132,33 +132,33 @@ | @@ -132,33 +132,33 @@ | ||
| 132 | }, | 132 | }, |
| 133 | 133 | ||
| 134 | { | 134 | { |
| 135 | - .name = "revision", // Property name. | ||
| 136 | - .description = N_( "lib3270 revision" ), // Property description. | ||
| 137 | - .get = get_revision, // Get value. | ||
| 138 | - .set = NULL // Set value. | 135 | + .name = "revision", // Property name. |
| 136 | + .description = N_( "lib3270 revision" ), // Property description. | ||
| 137 | + .get = get_revision, // Get value. | ||
| 138 | + .set = NULL // Set value. | ||
| 139 | }, | 139 | }, |
| 140 | 140 | ||
| 141 | { | 141 | { |
| 142 | - .name = "crlpath", // Property name. | 142 | + .name = "crl_url", // Property name. |
| 143 | .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. | 143 | .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. |
| 144 | - .description = N_( "URL for the certificate revocation list" ), // Property description. | ||
| 145 | - .get = lib3270_get_crl_url, // Get value. | ||
| 146 | - .set = lib3270_set_crl_url, // Set value. | 144 | + .description = N_( "URL for the certificate revocation list" ), // Property description. |
| 145 | + .get = lib3270_crl_get_url, // Get value. | ||
| 146 | + .set = lib3270_crl_set_url, // Set value. | ||
| 147 | }, | 147 | }, |
| 148 | 148 | ||
| 149 | { | 149 | { |
| 150 | - .name = "crlprefer", // Property name. | 150 | + .name = "crl_preferred_protocol", // Property name. |
| 151 | .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. | 151 | .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. |
| 152 | - .description = N_( "Prefered protocol for CRL" ), // Property description. | ||
| 153 | - .get = lib3270_get_crl_prefered_protocol, // Get value. | ||
| 154 | - .set = lib3270_set_crl_prefered_protocol, // Set value. | 152 | + .description = N_( "Preferred protocol for CRL download" ), // Property description. |
| 153 | + .get = lib3270_crl_get_preferred_protocol, // Get value. | ||
| 154 | + .set = lib3270_crl_set_preferred_protocol, // Set value. | ||
| 155 | }, | 155 | }, |
| 156 | 156 | ||
| 157 | { | 157 | { |
| 158 | - .name = "default_host", // Property name. | ||
| 159 | - .description = N_( "Default host URL" ), // Property description. | ||
| 160 | - .get = lib3270_get_default_host, // Get value. | ||
| 161 | - .set = NULL // Set value. | 158 | + .name = "default_host", // Property name. |
| 159 | + .description = N_( "Default host URL" ), // Property description. | ||
| 160 | + .get = lib3270_get_default_host, // Get value. | ||
| 161 | + .set = NULL // Set value. | ||
| 162 | }, | 162 | }, |
| 163 | 163 | ||
| 164 | { | 164 | { |
src/include/lib3270.h
| @@ -524,11 +524,17 @@ | @@ -524,11 +524,17 @@ | ||
| 524 | * @return 0 on sucess, non zero on error (sets errno). | 524 | * @return 0 on sucess, non zero on error (sets errno). |
| 525 | * | 525 | * |
| 526 | */ | 526 | */ |
| 527 | - LIB3270_EXPORT int lib3270_set_crl_url(H3270 *hSession, const char *crl); | ||
| 528 | - LIB3270_EXPORT const char * lib3270_get_crl_url(const H3270 *hSession); | 527 | + LIB3270_EXPORT int lib3270_crl_set_url(H3270 *hSession, const char *crl); |
| 528 | + LIB3270_EXPORT const char * lib3270_crl_get_url(const H3270 *hSession); | ||
| 529 | 529 | ||
| 530 | - LIB3270_EXPORT int lib3270_set_crl_prefered_protocol(H3270 *hSession, const char *protocol); | ||
| 531 | - LIB3270_EXPORT const char * lib3270_get_crl_prefered_protocol(const H3270 *hSession); | 530 | + LIB3270_EXPORT int lib3270_crl_set_preferred_protocol(H3270 *hSession, const char *protocol); |
| 531 | + LIB3270_EXPORT const char * lib3270_crl_get_preferred_protocol(const H3270 *hSession); | ||
| 532 | + | ||
| 533 | + /** | ||
| 534 | + * @brief Get the available protocols for CRL download. | ||
| 535 | + * | ||
| 536 | + */ | ||
| 537 | + LIB3270_EXPORT const char ** lib3270_get_available_crl_protocols(void); | ||
| 532 | 538 | ||
| 533 | /** | 539 | /** |
| 534 | * @brief Get hostname for the connect/reconnect operations. | 540 | * @brief Get hostname for the connect/reconnect operations. |
src/ssl/properties.c
| @@ -118,7 +118,7 @@ LIB3270_EXPORT char * lib3270_get_ssl_peer_certificate_text(const H3270 *hSessio | @@ -118,7 +118,7 @@ LIB3270_EXPORT char * lib3270_get_ssl_peer_certificate_text(const H3270 *hSessio | ||
| 118 | 118 | ||
| 119 | #pragma GCC diagnostic push | 119 | #pragma GCC diagnostic push |
| 120 | #pragma GCC diagnostic ignored "-Wunused-parameter" | 120 | #pragma GCC diagnostic ignored "-Wunused-parameter" |
| 121 | - const char * lib3270_get_crl_url(const H3270 *hSession) | 121 | + const char * lib3270_crl_get_url(const H3270 *hSession) |
| 122 | { | 122 | { |
| 123 | #ifdef SSL_ENABLE_CRL_CHECK | 123 | #ifdef SSL_ENABLE_CRL_CHECK |
| 124 | if(hSession->ssl.crl.url) | 124 | if(hSession->ssl.crl.url) |
| @@ -139,7 +139,7 @@ LIB3270_EXPORT char * lib3270_get_ssl_peer_certificate_text(const H3270 *hSessio | @@ -139,7 +139,7 @@ LIB3270_EXPORT char * lib3270_get_ssl_peer_certificate_text(const H3270 *hSessio | ||
| 139 | 139 | ||
| 140 | #pragma GCC diagnostic push | 140 | #pragma GCC diagnostic push |
| 141 | #pragma GCC diagnostic ignored "-Wunused-parameter" | 141 | #pragma GCC diagnostic ignored "-Wunused-parameter" |
| 142 | - int lib3270_set_crl_url(H3270 *hSession, const char *crl) | 142 | + int lib3270_crl_set_url(H3270 *hSession, const char *crl) |
| 143 | { | 143 | { |
| 144 | 144 | ||
| 145 | FAIL_IF_ONLINE(hSession); | 145 | FAIL_IF_ONLINE(hSession); |
| @@ -174,9 +174,28 @@ LIB3270_EXPORT char * lib3270_get_ssl_peer_certificate_text(const H3270 *hSessio | @@ -174,9 +174,28 @@ LIB3270_EXPORT char * lib3270_get_ssl_peer_certificate_text(const H3270 *hSessio | ||
| 174 | } | 174 | } |
| 175 | #pragma GCC diagnostic pop | 175 | #pragma GCC diagnostic pop |
| 176 | 176 | ||
| 177 | + const char ** lib3270_crl_get_available_protocols(void) | ||
| 178 | + { | ||
| 179 | + static const char * protocols[] = | ||
| 180 | + { | ||
| 181 | +#ifdef HAVE_LDAP | ||
| 182 | + "ldap", | ||
| 183 | +#endif // HAVE_LDAP | ||
| 184 | + | ||
| 185 | +#if defined(_WIN32) || defined(HAVE_LIBCURL) | ||
| 186 | + "http", | ||
| 187 | +#endif // _WIN32 || LIBCURL | ||
| 188 | + | ||
| 189 | + NULL | ||
| 190 | + }; | ||
| 191 | + | ||
| 192 | + return protocols; | ||
| 193 | + } | ||
| 194 | + | ||
| 195 | + | ||
| 177 | #pragma GCC diagnostic push | 196 | #pragma GCC diagnostic push |
| 178 | #pragma GCC diagnostic ignored "-Wunused-parameter" | 197 | #pragma GCC diagnostic ignored "-Wunused-parameter" |
| 179 | - const char * lib3270_get_crl_prefered_protocol(const H3270 *hSession) | 198 | + const char * lib3270_crl_get_preferred_protocol(const H3270 *hSession) |
| 180 | { | 199 | { |
| 181 | #ifdef SSL_ENABLE_CRL_CHECK | 200 | #ifdef SSL_ENABLE_CRL_CHECK |
| 182 | if(hSession->ssl.crl.prefer) | 201 | if(hSession->ssl.crl.prefer) |
| @@ -189,7 +208,7 @@ LIB3270_EXPORT char * lib3270_get_ssl_peer_certificate_text(const H3270 *hSessio | @@ -189,7 +208,7 @@ LIB3270_EXPORT char * lib3270_get_ssl_peer_certificate_text(const H3270 *hSessio | ||
| 189 | 208 | ||
| 190 | #pragma GCC diagnostic push | 209 | #pragma GCC diagnostic push |
| 191 | #pragma GCC diagnostic ignored "-Wunused-parameter" | 210 | #pragma GCC diagnostic ignored "-Wunused-parameter" |
| 192 | - int lib3270_set_crl_prefered_protocol(H3270 *hSession, const char *protocol) | 211 | + int lib3270_crl_set_preferred_protocol(H3270 *hSession, const char *protocol) |
| 193 | { | 212 | { |
| 194 | 213 | ||
| 195 | FAIL_IF_ONLINE(hSession); | 214 | FAIL_IF_ONLINE(hSession); |
src/testprogram/testprogram.c
| @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) | @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) | ||
| 52 | printf("3270 session %p created\n]",h); | 52 | printf("3270 session %p created\n]",h); |
| 53 | 53 | ||
| 54 | #ifdef HAVE_LDAP | 54 | #ifdef HAVE_LDAP |
| 55 | - lib3270_set_crl_prefered_protocol(h,"ldap"); | 55 | + lib3270_crl_set_preferred_protocol(h,"ldap"); |
| 56 | #endif // HAVE_LDAP | 56 | #endif // HAVE_LDAP |
| 57 | 57 | ||
| 58 | lib3270_set_url(h,NULL); | 58 | lib3270_set_url(h,NULL); |
| @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) | @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) | ||
| 66 | break; | 66 | break; |
| 67 | 67 | ||
| 68 | case 'C': | 68 | case 'C': |
| 69 | - lib3270_set_crl_url(h,optarg); | 69 | + lib3270_crl_set_url(h,optarg); |
| 70 | break; | 70 | break; |
| 71 | 71 | ||
| 72 | case 't': | 72 | case 't': |
| @@ -77,7 +77,7 @@ int main(int argc, char *argv[]) | @@ -77,7 +77,7 @@ int main(int argc, char *argv[]) | ||
| 77 | 77 | ||
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | - printf("HOST URL: %s\tHOST CRL: %s\n",lib3270_get_url(h),lib3270_get_crl_url(h)); | 80 | + printf("HOST URL: %s\tHOST CRL: %s\n",lib3270_get_url(h),lib3270_crl_get_url(h)); |
| 81 | 81 | ||
| 82 | #ifdef _WIN32 | 82 | #ifdef _WIN32 |
| 83 | { | 83 | { |