All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
as_config.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2017 Aerospike, Inc.
3  *
4  * Portions may be licensed to Aerospike, Inc. under one or more contributor
5  * license agreements.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
8  * use this file except in compliance with the License. You may obtain a copy of
9  * the License at http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14  * License for the specific language governing permissions and limitations under
15  * the License.
16  */
17 #pragma once
18 
19 #include <aerospike/as_error.h>
20 #include <aerospike/as_host.h>
21 #include <aerospike/as_policy.h>
22 #include <aerospike/as_password.h>
23 #include <aerospike/as_vector.h>
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /******************************************************************************
30  * MACROS
31  *****************************************************************************/
32 
33 #ifdef __linux__
34 /**
35  * Default path to the system UDF files.
36  */
37 #define AS_CONFIG_LUA_SYSTEM_PATH "/opt/aerospike/client/sys/udf/lua"
38 
39 /**
40  * Default path to the user UDF files.
41  */
42 #define AS_CONFIG_LUA_USER_PATH "/opt/aerospike/client/usr/udf/lua"
43 #endif
44 
45 #ifdef __APPLE__
46 /**
47  * Default path to the system UDF files.
48  */
49 #define AS_CONFIG_LUA_SYSTEM_PATH "/usr/local/aerospike/client/sys/udf/lua"
50 
51 /**
52  * Default path to the user UDF files.
53  */
54 #define AS_CONFIG_LUA_USER_PATH "/usr/local/aerospike/client/usr/udf/lua"
55 #endif
56 
57 /**
58  * The size of path strings
59  */
60 #define AS_CONFIG_PATH_MAX_SIZE 256
61 
62 /**
63  * The maximum string length of path strings
64  */
65 #define AS_CONFIG_PATH_MAX_LEN (AS_CONFIG_PATH_MAX_SIZE - 1)
66 
67 /******************************************************************************
68  * TYPES
69  *****************************************************************************/
70 
71 /**
72  * IP translation table.
73  *
74  * @ingroup as_config_object
75  */
76 typedef struct as_addr_map_s {
77 
78  /**
79  * Original hostname or IP address in string format.
80  */
81  char* orig;
82 
83  /**
84  * Use this IP address instead.
85  */
86  char* alt;
87 
88 } as_addr_map;
89 
90 /**
91  * Cluster event notification type.
92  *
93  * @ingroup as_config_object
94  */
95 typedef enum as_cluster_event_type_e {
96  /**
97  * Node was added to cluster.
98  */
100 
101  /**
102  * Node was removed fron cluster.
103  */
105 
106  /**
107  * There are no active nodes in the cluster.
108  */
111 
112 /**
113  * Cluster event notification data.
114  *
115  * @ingroup as_config_object
116  */
117 typedef struct as_cluster_event_s {
118  /**
119  * Node name.
120  */
121  const char* node_name;
122 
123  /**
124  * Node IP address in string format.
125  */
126  const char* node_address;
127 
128  /**
129  * User defined data.
130  */
131  void* udata;
132 
133  /**
134  * Cluster event notification type.
135  */
138 
139 /**
140  * Cluster event notification callback function.
141  * as_cluster_event is placed on the stack before calling.
142  * Do not free node_name or node_address.
143  *
144  * @ingroup as_config_object
145  */
147 
148 /**
149  * lua module config
150  *
151  * @ingroup as_config_object
152  */
153 typedef struct as_config_lua_s {
154 
155  /**
156  * Enable caching of UDF files in the client
157  * application.
158  */
160 
161  /**
162  * The path to the system UDF files. These UDF files
163  * are installed with the aerospike client library.
164  * Default location defined in: AS_CONFIG_LUA_SYSTEM_PATH
165  */
166  char system_path[AS_CONFIG_PATH_MAX_SIZE];
167 
168  /**
169  * The path to user's UDF files.
170  * Default location defined in: AS_CONFIG_LUA_USER_PATH
171  */
172  char user_path[AS_CONFIG_PATH_MAX_SIZE];
173 
174 } as_config_lua;
175 
176 /**
177  * TLS module config
178  *
179  * @ingroup as_config_object
180  */
181 typedef struct as_config_tls_s {
182 
183  /**
184  * Enable TLS on connections.
185  * By default TLS is disabled.
186  */
187  bool enable;
188 
189  /**
190  * Only encrypt connections; do not verify certificates.
191  * By default TLS will verify certificates.
192  */
194 
195  /**
196  * Path to a trusted CA certificate file.
197  * By default TLS will use system standard trusted CA certificates.
198  * Use as_config_tls_set_cafile() to set this field.
199  */
200  char* cafile;
201 
202  /**
203  * Path to a directory of trusted certificates.
204  * See the OpenSSL SSL_CTX_load_verify_locations manual page for
205  * more information about the format of the directory.
206  * Use as_config_tls_set_capath() to set this field.
207  */
208  char* capath;
209 
210  /**
211  * Specifies enabled protocols.
212  *
213  * This format is the same as Apache's SSLProtocol documented
214  * at https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslprotocol
215  *
216  * If not specified (NULL) the client will use "-all +TLSv1.2".
217  *
218  * If you are not sure what protocols to select this option is
219  * best left unspecified (NULL).
220  *
221  * Use as_config_tls_set_protocols() to set this field.
222  */
223  char* protocols;
224 
225  /**
226  * Specifies enabled cipher suites.
227  *
228  * The format is the same as OpenSSL's Cipher List Format documented
229  * at https://www.openssl.org/docs/manmaster/apps/ciphers.html
230  *
231  * If not specified the OpenSSL default cipher suite described in
232  * the ciphers documentation will be used.
233  *
234  * If you are not sure what cipher suite to select this option
235  * is best left unspecified (NULL).
236  *
237  * Use as_config_tls_set_cipher_suite() to set this field.
238  */
240 
241  /**
242  * Enable CRL checking for the certificate chain leaf certificate.
243  * An error occurs if a suitable CRL cannot be found.
244  * By default CRL checking is disabled.
245  */
246  bool crl_check;
247 
248  /**
249  * Enable CRL checking for the entire certificate chain.
250  * An error occurs if a suitable CRL cannot be found.
251  * By default CRL checking is disabled.
252  */
254 
255  /**
256  * Path to a certificate blacklist file.
257  * The file should contain one line for each blacklisted certificate.
258  * Each line starts with the certificate serial number expressed in hex.
259  * Each entry may optionally specify the issuer name of the
260  * certificate (serial numbers are only required to be unique per
261  * issuer). Example records:
262  * 867EC87482B2 /C=US/ST=CA/O=Acme/OU=Engineering/CN=Test Chain CA
263  * E2D4B0E570F9EF8E885C065899886461
264  *
265  * Use as_config_tls_set_cert_blacklist() to set this field.
266  */
268 
269  /**
270  * Log session information for each connection.
271  */
273 
274  /**
275  * Path to the client's key for mutual authentication.
276  * By default mutual authentication is disabled.
277  *
278  * Use as_config_tls_set_keyfile() to set this field.
279  */
280  char* keyfile;
281 
282  /**
283  * Path to the client's certificate chain file for mutual authentication.
284  * By default mutual authentication is disabled.
285  *
286  * Use as_config_tls_set_certfile() to set this field.
287  */
288  char* certfile;
289 
290 } as_config_tls;
291 
292 /**
293  * The `as_config` contains the settings for the `aerospike` client. Including
294  * default policies, seed hosts in the cluster and other settings.
295  *
296  * ## Initialization
297  *
298  * Before using as_config, you must first initialize it. This will setup the
299  * default values.
300  *
301  * ~~~~~~~~~~{.c}
302  * as_config config;
303  * as_config_init(&config);
304  * ~~~~~~~~~~
305  *
306  * Once initialized, you can populate the values.
307  *
308  * ## Seed Hosts
309  *
310  * The client will require at least one seed host defined in the
311  * configuration. The seed host is defined in `as_config.hosts`.
312  *
313  * ~~~~~~~~~~{.c}
314  * as_config_add_host(&config, "127.0.0.1", 3000);
315  * ~~~~~~~~~~
316  *
317  * The client will iterate over the list until it connects with one of the hosts.
318  *
319  * ## Policies
320  *
321  * The configuration also defines default policies for the application. The
322  * `as_config_init()` function already presets default values for the policies.
323  *
324  * Policies define the behavior of the client, which can be global across
325  * operations, global to a single operation, or local to a single use of an
326  * operation.
327  *
328  * Each database operation accepts a policy for that operation as an a argument.
329  * This is considered a local policy, and is a single use policy. This policy
330  * supersedes any global policy defined.
331  *
332  * If a value of the policy is not defined, then the rule is to fallback to the
333  * global policy for that operation. If the global policy for that operation is
334  * undefined, then the global default value will be used.
335  *
336  * If you find that you have behavior that you want every use of an operation
337  * to utilize, then you can specify the default policy in as_config.policies.
338  *
339  * For example, the `aerospike_key_put()` operation takes an `as_policy_write`
340  * policy. If you find yourself setting the `key` policy value for every call
341  * to `aerospike_key_put()`, then you may find it beneficial to set the global
342  * `as_policy_write` in `as_policies.write`, which all write operations will use.
343  *
344  * ~~~~~~~~~~{.c}
345  * config.policies.write.key = AS_POLICY_KEY_SEND;
346  * ~~~~~~~~~~
347  *
348  * If you find that you want to use a policy value across all operations, then
349  * you may find it beneficial to set the default policy value for that policy
350  * value.
351  *
352  * For example, if you keep setting the key policy value to
353  * `AS_POLICY_KEY_SEND`, then you may want to just set `as_policies.key`. This
354  * will set the global default value for the policy value. So, if an global
355  * operation policy or a local operation policy does not define a value, then
356  * this value will be used.
357  *
358  * ~~~~~~~~~~{.c}
359  * config.policies.key = AS_POLICY_KEY_SEND;
360  * ~~~~~~~~~~
361  *
362  * Global default policy values:
363  * - as_policies.timeout
364  * - as_policies.retry
365  * - as_policies.key
366  * - as_policies.gen
367  * - as_policies.exists
368  *
369  * Global operation policies:
370  * - as_policies.read
371  * - as_policies.write
372  * - as_policies.operate
373  * - as_policies.remove
374  * - as_policies.query
375  * - as_policies.scan
376  * - as_policies.info
377  *
378  *
379  * ## User-Defined Function Settings
380  *
381  * If you are using user-defined functions (UDF) for processing query
382  * results (i.e aggregations), then you will find it useful to set the
383  * `mod_lua` settings. Of particular importance is the `mod_lua.user_path`,
384  * which allows you to define a path to where the client library will look for
385  * Lua files for processing.
386  *
387  * ~~~~~~~~~~{.c}
388  * strcpy(config.mod_lua.user_path, "/home/me/lua");
389  * ~~~~~~~~~~
390  *
391  * Never call as_config_destroy() directly because ownership of config fields
392  * is transferred to aerospike in aerospike_init() or aerospike_new().
393  *
394  * @ingroup client_objects
395  */
396 typedef struct as_config_s {
397  /**
398  * Seed hosts. Populate with one or more hosts in the cluster that you intend to connect with.
399  * Do not set directly. Use as_config_add_hosts() or as_config_add_host() to add seed hosts.
400  */
402 
403  /**
404  * User authentication to cluster. Leave empty for clusters running without restricted access.
405  */
406  char user[AS_USER_SIZE];
407 
408  /**
409  * Password authentication to cluster. The hashed value of password will be stored by the client
410  * and sent to server in same format. Leave empty for clusters running without restricted access.
411  */
412  char password[AS_PASSWORD_HASH_SIZE];
413 
414  /**
415  * Expected cluster name. If not null, server nodes must return this cluster name in order to
416  * join the client's view of the cluster. Should only be set when connecting to servers that
417  * support the "cluster-name" info command. Use as_config_set_cluster_name() to set this field.
418  * Default: NULL
419  */
421 
422  /**
423  * Cluster event function that will be called when nodes are added/removed from the cluster.
424  *
425  * Default: NULL (no callback will be made)
426  */
428 
429  /**
430  * Cluster event user data that will be passed back to event_callback.
431  *
432  * Default: NULL
433  */
435 
436  /**
437  * A IP translation table is used in cases where different clients use different server
438  * IP addresses. This may be necessary when using clients from both inside and outside
439  * a local area network. Default is no translation.
440  *
441  * The key is the IP address returned from friend info requests to other servers. The
442  * value is the real IP address used to connect to the server.
443  *
444  * A deep copy of ip_map is performed in aerospike_connect(). The caller is
445  * responsible for memory deallocation of the original data structure.
446  */
448 
449  /**
450  * Length of ip_map array.
451  * Default: 0
452  */
453  uint32_t ip_map_size;
454 
455  /**
456  * Maximum number of synchronous connections allowed per server node. Synchronous transactions
457  * will go through retry logic and potentially fail with error code "AEROSPIKE_ERR_NO_MORE_CONNECTIONS"
458  * if the maximum number of connections would be exceeded.
459  *
460  * The number of connections used per node depends on how many concurrent threads issue
461  * database commands plus sub-threads used for parallel multi-node commands (batch, scan,
462  * and query). One connection will be used for each thread.
463  *
464  * Default: 300
465  */
467 
468  /**
469  * Maximum number of asynchronous (non-pipeline) connections allowed for each node.
470  * This limit will be enforced at the node/event loop level. If the value is 100 and 2 event
471  * loops are created, then each node/event loop asynchronous (non-pipeline) connection pool
472  * will have a limit of 50. Async transactions will be rejected if the limit would be exceeded.
473  * This variable is ignored if asynchronous event loops are not created.
474  * Default: 300
475  */
477 
478  /**
479  * Maximum number of pipeline connections allowed for each node.
480  * This limit will be enforced at the node/event loop level. If the value is 100 and 2 event
481  * loops are created, then each node/event loop pipeline connection pool will have a limit of 50.
482  * Async transactions will be rejected if the limit would be exceeded.
483  * This variable is ignored if asynchronous event loops are not created.
484  * Default: 64
485  */
487 
488  /**
489  * Number of synchronous connection pools used for each node. Machines with 8 cpu cores or
490  * less usually need just one connection pool per node. Machines with a large number of cpu
491  * cores may have their synchronous performance limited by contention for pooled connections.
492  * Contention for pooled connections can be reduced by creating multiple mini connection pools
493  * per node.
494  *
495  * Default: 1
496  */
498 
499  /**
500  * Initial host connection timeout in milliseconds. The timeout when opening a connection
501  * to the server host for the first time.
502  * Default: 1000
503  */
504  uint32_t conn_timeout_ms;
505 
506  /**
507  * Maximum socket idle time in seconds. Connection pools will discard sockets that have
508  * been idle longer than the maximum. The value is limited to 24 hours (86400).
509  *
510  * It's important to set this value to a few seconds less than the server's proto-fd-idle-ms
511  * (default 60000 milliseconds or 1 minute), so the client does not attempt to use a socket
512  * that has already been reaped by the server.
513  *
514  * Default: 0 seconds (disabled) for non-TLS connections, 55 seconds for TLS connections.
515  */
516  uint32_t max_socket_idle;
517 
518  /**
519  * Polling interval in milliseconds for cluster tender
520  * Default: 1000
521  */
522  uint32_t tender_interval;
523 
524  /**
525  * Number of threads stored in underlying thread pool used by synchronous batch/scan/query commands.
526  * These commands are often sent to multiple server nodes in parallel threads. A thread pool
527  * improves performance because threads do not have to be created/destroyed for each command.
528  * Calculate your value using the following formula:
529  *
530  * thread_pool_size = (concurrent synchronous batch/scan/query commands) * (server nodes)
531  *
532  * If your application only uses async commands, this field can be set to zero.
533  * Default: 16
534  */
536 
537  /**
538  * Client policies
539  */
541 
542  /**
543  * lua config. This is a global config even though it's located here in cluster config.
544  * This config has been left here to avoid breaking the API.
545  *
546  * The global lua config will only be changed once on first cluster initialization.
547  * A better method for initializing lua configuration is to leave this field alone and
548  * instead call aerospike_init_lua():
549  *
550  * ~~~~~~~~~~{.c}
551  * // Get default global lua configuration.
552  * as_config_lua lua;
553  * as_config_lua_init(&lua);
554  *
555  * // Optionally modify lua defaults.
556  * lua.cache_enabled = <enable lua cache>;
557  * strcpy(lua.system_path, <lua system directory>);
558  * strcpy(lua.user_path, <lua user directory>);
559  *
560  * // Initialize global lua configuration.
561  * aerospike_init_lua(&lua);
562  * ~~~~~~~~~~
563  */
565 
566  /*
567  * TLS configuration parameters.
568  */
570 
571  /**
572  * Action to perform if client fails to connect to seed hosts.
573  *
574  * If fail_if_not_connected is true (default), the cluster creation will fail
575  * when all seed hosts are not reachable.
576  *
577  * If fail_if_not_connected is false, an empty cluster will be created and the
578  * client will automatically connect when Aerospike server becomes available.
579  */
581 
582  /**
583  * Flag to signify if "services-alternate" should be used instead of "services"
584  * Default : false
585  */
587 
588  /**
589  * Indicates if shared memory should be used for cluster tending. Shared memory
590  * is useful when operating in single threaded mode with multiple client processes.
591  * This model is used by wrapper languages such as PHP and Python. When enabled,
592  * the data partition maps are maintained by only one process and all other processes
593  * use these shared memory maps.
594  *
595  * Shared memory should not be enabled for multi-threaded programs.
596  * Default: false
597  */
598  bool use_shm;
599 
600  /**
601  * Identifier for the shared memory segment associated with the target Aerospike cluster.
602  * Each shared memory segment contains state for one Aerospike cluster. If there are
603  * multiple Aerospike clusters, a different shm_key must be defined for each cluster.
604  *
605  * Default: 0xA7000000
606  */
607  int shm_key;
608 
609  /**
610  * Shared memory maximum number of server nodes allowed. This value is used to size
611  * the fixed shared memory segment. Leave a cushion between actual server node
612  * count and shm_max_nodes so new nodes can be added without having to reboot the client.
613  * Default: 16
614  */
615  uint32_t shm_max_nodes;
616 
617  /**
618  * Shared memory maximum number of namespaces allowed. This value is used to size
619  * the fixed shared memory segment. Leave a cushion between actual namespaces
620  * and shm_max_namespaces so new namespaces can be added without having to reboot the client.
621  * Default: 8
622  */
624 
625  /**
626  * Take over shared memory cluster tending if the cluster hasn't been tended by this
627  * threshold in seconds.
628  * Default: 30
629  */
631 } as_config;
632 
633 /******************************************************************************
634  * FUNCTIONS
635  *****************************************************************************/
636 
637 /**
638  * Initialize the configuration to default values.
639  *
640  * You should do this to ensure the configuration has valid values, before
641  * populating it with custom options.
642  *
643  * ~~~~~~~~~~{.c}
644  * as_config config;
645  * as_config_init(&config);
646  * as_config_add_host(&config, "127.0.0.1", 3000);
647  * ~~~~~~~~~~
648  *
649  * @relates as_config
650  */
651 as_config*
652 as_config_init(as_config* config);
653 
654 /**
655  * Add seed host(s) from a string with format: hostname1[:tlsname1][:port1],...
656  * Hostname may also be an IP address in the following formats.
657  *
658  * ~~~~~~~~~~{.c}
659  * IPv4: xxx.xxx.xxx.xxx
660  * IPv6: [xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]
661  * IPv6: [xxxx::xxxx]
662  * ~~~~~~~~~~
663  *
664  * The host addresses will be copied.
665  * The caller is responsible for the original string.
666  *
667  * ~~~~~~~~~~{.c}
668  * as_config config;
669  * as_config_init(&config);
670  * as_config_add_hosts(&config, "host1,host2:3010,192.168.20.1:3020,[2001::1000]:3030", 3000);
671  * ~~~~~~~~~~
672  *
673  * @relates as_config
674  */
675 bool
676 as_config_add_hosts(as_config* config, const char* string, uint16_t default_port);
677 
678 /**
679  * Add host to seed the cluster.
680  * The host address will be copied.
681  * The caller is responsible for the original address string.
682  *
683  * ~~~~~~~~~~{.c}
684  * as_config config;
685  * as_config_init(&config);
686  * as_config_add_host(&config, "127.0.0.1", 3000);
687  * ~~~~~~~~~~
688  *
689  * @relates as_config
690  */
691 void
692 as_config_add_host(as_config* config, const char* address, uint16_t port);
693 
694 /**
695  * Remove all hosts.
696  *
697  * @relates as_config
698  */
699 void
701 
702 /**
703  * User authentication for servers with restricted access. The password will be stored by the
704  * client and sent to server in hashed format.
705  *
706  * ~~~~~~~~~~{.c}
707  * as_config config;
708  * as_config_init(&config);
709  * as_config_set_user(&config, "charlie", "mypassword");
710  * ~~~~~~~~~~
711  *
712  * @relates as_config
713  */
714 bool
715 as_config_set_user(as_config* config, const char* user, const char* password);
716 
717 /**
718  * Free existing string if not null and copy value to string.
719  */
720 void
721 as_config_set_string(char** str, const char* value);
722 
723 /**
724  * Set expected cluster name.
725  *
726  * @relates as_config
727  */
728 static inline void
729 as_config_set_cluster_name(as_config* config, const char* cluster_name)
730 {
731  as_config_set_string(&config->cluster_name, cluster_name);
732 }
733 
734 /**
735  * Set cluster event callback and user data.
736  *
737  * @relates as_config
738  */
739 static inline void
741 {
742  config->event_callback = callback;
743  config->event_callback_udata = udata;
744 }
745 
746 /**
747  * Initialize global lua configuration to defaults.
748  *
749  * @relates as_config
750  */
751 static inline void
753 {
754  lua->cache_enabled = false;
755  strcpy(lua->system_path, AS_CONFIG_LUA_SYSTEM_PATH);
756  strcpy(lua->user_path, AS_CONFIG_LUA_USER_PATH);
757 }
758 
759 /**
760  * Set TLS path to a trusted CA certificate file.
761  *
762  * @relates as_config
763  */
764 static inline void
765 as_config_tls_set_cafile(as_config* config, const char* cafile)
766 {
767  as_config_set_string(&config->tls.cafile, cafile);
768 }
769 
770 /**
771  * Set TLS path to a directory of trusted certificates.
772  *
773  * @relates as_config
774  */
775 static inline void
776 as_config_tls_set_capath(as_config* config, const char* capath)
777 {
778  as_config_set_string(&config->tls.capath, capath);
779 }
780 
781 /**
782  * Set TLS enabled protocols.
783  *
784  * @relates as_config
785  */
786 static inline void
787 as_config_tls_set_protocols(as_config* config, const char* protocols)
788 {
789  as_config_set_string(&config->tls.protocols, protocols);
790 }
791 
792 /**
793  * Set TLS enabled cipher suites.
794  *
795  * @relates as_config
796  */
797 static inline void
798 as_config_tls_set_cipher_suite(as_config* config, const char* cipher_suite)
799 {
800  as_config_set_string(&config->tls.cipher_suite, cipher_suite);
801 }
802 
803 /**
804  * Set TLS path to a certificate blacklist file.
805  *
806  * @relates as_config
807  */
808 static inline void
809 as_config_tls_set_cert_blacklist(as_config* config, const char* cert_blacklist)
810 {
811  as_config_set_string(&config->tls.cert_blacklist, cert_blacklist);
812 }
813 
814 /**
815  * Set TLS path to the client's key for mutual authentication.
816  *
817  * @relates as_config
818  */
819 static inline void
820 as_config_tls_set_keyfile(as_config* config, const char* keyfile)
821 {
822  as_config_set_string(&config->tls.keyfile, keyfile);
823 }
824 
825 /**
826  * Set TLS path to the client's certificate chain file for mutual authentication.
827  *
828  * @relates as_config
829  */
830 static inline void
831 as_config_tls_set_certfile(as_config* config, const char* certfile)
832 {
833  as_config_set_string(&config->tls.certfile, certfile);
834 }
835 
836 /**
837  * Add TLS host to seed the cluster.
838  * The host address and TLS name will be copied.
839  * The caller is responsible for the original address string.
840  *
841  * ~~~~~~~~~~{.c}
842  * as_config config;
843  * as_config_init(&config);
844  * as_config_tls_add_host(&config, "127.0.0.1", "node1.test.org", 3000);
845  * ~~~~~~~~~~
846  *
847  * @relates as_config
848  */
849 void
850 as_config_tls_add_host(as_config* config, const char* address, const char* tls_name, uint16_t port);
851 
852 #ifdef __cplusplus
853 } // end extern "C"
854 #endif
uint32_t tender_interval
Definition: as_config.h:522
bool use_services_alternate
Definition: as_config.h:586
uint32_t conn_timeout_ms
Definition: as_config.h:504
uint32_t shm_takeover_threshold_sec
Definition: as_config.h:630
#define AS_USER_SIZE
Definition: as_password.h:29
static void as_config_set_cluster_name(as_config *config, const char *cluster_name)
Definition: as_config.h:729
char * keyfile
Definition: as_config.h:280
bool as_config_set_user(as_config *config, const char *user, const char *password)
as_addr_map * ip_map
Definition: as_config.h:447
bool use_shm
Definition: as_config.h:598
void * event_callback_udata
Definition: as_config.h:434
bool fail_if_not_connected
Definition: as_config.h:580
char * cipher_suite
Definition: as_config.h:239
static void as_config_tls_set_protocols(as_config *config, const char *protocols)
Definition: as_config.h:787
int shm_key
Definition: as_config.h:607
as_config_lua lua
Definition: as_config.h:564
uint32_t shm_max_nodes
Definition: as_config.h:615
uint32_t thread_pool_size
Definition: as_config.h:535
uint32_t shm_max_namespaces
Definition: as_config.h:623
const char * node_address
Definition: as_config.h:126
uint32_t conn_pools_per_node
Definition: as_config.h:497
bool as_config_add_hosts(as_config *config, const char *string, uint16_t default_port)
bool log_session_info
Definition: as_config.h:272
as_cluster_event_callback event_callback
Definition: as_config.h:427
uint32_t ip_map_size
Definition: as_config.h:453
static void as_config_tls_set_certfile(as_config *config, const char *certfile)
Definition: as_config.h:831
static void as_config_tls_set_cert_blacklist(as_config *config, const char *cert_blacklist)
Definition: as_config.h:809
const char * node_name
Definition: as_config.h:121
char * capath
Definition: as_config.h:208
char * cafile
Definition: as_config.h:200
uint32_t max_socket_idle
Definition: as_config.h:516
char * protocols
Definition: as_config.h:223
char * cert_blacklist
Definition: as_config.h:267
as_cluster_event_type type
Definition: as_config.h:136
as_config * as_config_init(as_config *config)
uint32_t pipe_max_conns_per_node
Definition: as_config.h:486
as_vector * hosts
Definition: as_config.h:401
as_policies policies
Definition: as_config.h:540
void(* as_cluster_event_callback)(as_cluster_event *event)
Definition: as_config.h:146
void as_config_add_host(as_config *config, const char *address, uint16_t port)
uint32_t max_conns_per_node
Definition: as_config.h:466
#define AS_CONFIG_PATH_MAX_SIZE
Definition: as_config.h:60
static void as_config_tls_set_cafile(as_config *config, const char *cafile)
Definition: as_config.h:765
as_cluster_event_type
Definition: as_config.h:95
as_config_tls tls
Definition: as_config.h:569
void as_config_set_string(char **str, const char *value)
bool crl_check
Definition: as_config.h:246
void as_config_tls_add_host(as_config *config, const char *address, const char *tls_name, uint16_t port)
static void as_config_tls_set_capath(as_config *config, const char *capath)
Definition: as_config.h:776
bool cache_enabled
Definition: as_config.h:159
static void as_config_tls_set_cipher_suite(as_config *config, const char *cipher_suite)
Definition: as_config.h:798
static void as_config_set_cluster_event_callback(as_config *config, as_cluster_event_callback callback, void *udata)
Definition: as_config.h:740
static void as_config_tls_set_keyfile(as_config *config, const char *keyfile)
Definition: as_config.h:820
uint32_t async_max_conns_per_node
Definition: as_config.h:476
char * certfile
Definition: as_config.h:288
char system_path[AS_CONFIG_PATH_MAX_SIZE]
Definition: as_config.h:166
bool crl_check_all
Definition: as_config.h:253
static void as_config_lua_init(as_config_lua *lua)
Definition: as_config.h:752
bool encrypt_only
Definition: as_config.h:193
char user_path[AS_CONFIG_PATH_MAX_SIZE]
Definition: as_config.h:172
char * cluster_name
Definition: as_config.h:420
char * alt
Definition: as_config.h:86
#define AS_PASSWORD_HASH_SIZE
Definition: as_password.h:34
char * orig
Definition: as_config.h:81
void as_config_clear_hosts(as_config *config)