Couchbase C Client  2.10.0
Asynchronous C Client for Couchbase
cntl.h
Go to the documentation of this file.
1 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /*
3  * Copyright 2017 Couchbase, Inc.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * 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,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 
30 #ifndef LCB_CNTL_H
31 #define LCB_CNTL_H
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 
124 #define LCB_CNTL_SET 0x01
125 #define LCB_CNTL_GET 0x00
149 #define LCB_CNTL_OP_TIMEOUT 0x00
150 
158 #define LCB_CNTL_VIEW_TIMEOUT 0x01
159 
167 #define LCB_CNTL_N1QL_TIMEOUT 0x3D
177 #define LCB_CNTL_BUCKETNAME 0x30
178 
192 #define LCB_CNTL_BUCKETTYPE 0x48
193 
201 #define LCB_CNTL_HANDLETYPE 0x04
202 
208 #define LCB_CNTL_VBCONFIG 0x05
209 
215 #define LCB_CNTL_IOPS 0x06
217 
219 typedef struct lcb_cntl_vbinfo_st {
220  int version;
221 
222  union {
224  struct {
225  const void *key;
226  lcb_SIZE nkey;
227  int vbucket;
228  int server_index;
229  } v0;
230  } v;
232 
239 #define LCB_CNTL_VBMAP 0x07
241 
245 typedef enum {
246  LCB_IPV6_DISABLED = 0x00,
247  LCB_IPV6_ONLY = 0x1,
248  LCB_IPV6_ALLOW = 0x02
249 } lcb_ipv6_t;
250 
261 #define LCB_CNTL_IP6POLICY 0x0b
262 
272 #define LCB_CNTL_CONFERRTHRESH 0x0c
273 
285 #define LCB_CNTL_DURABILITY_TIMEOUT 0x0d
286 
296 #define LCB_CNTL_DURABILITY_INTERVAL 0x0e
297 
307 #define LCB_CNTL_HTTP_TIMEOUT 0x0f
324 #define LCB_CNTL_IOPS_DLOPEN_DEBUG 0x11
325 
331 #define LCB_CNTL_CONFIGURATION_TIMEOUT 0x12
332 
346 #define LCB_CNTL_RANDOMIZE_BOOTSTRAP_HOSTS 0x14
347 
363 #define LCB_CNTL_CONFIG_CACHE_LOADED 0x15
364 
380 #define LCB_CNTL_FORCE_SASL_MECH 0x16
381 
390 #define LCB_CNTL_MAX_REDIRECTS 0x17
391 
409 typedef enum {
410  LCB_LOG_TRACE = 0,
411  LCB_LOG_DEBUG,
412  LCB_LOG_INFO,
413  LCB_LOG_WARN,
414  LCB_LOG_ERROR,
415  LCB_LOG_FATAL,
416  LCB_LOG_MAX
418 
419 struct lcb_logprocs_st;
420 
435 typedef void (*lcb_logging_callback)(struct lcb_logprocs_st *procs,
436  unsigned int iid, const char *subsys, int severity, const char *srcfile,
437  int srcline, const char *fmt, va_list ap);
438 
447 typedef struct lcb_logprocs_st {
448  int version;
449  union { struct { lcb_logging_callback callback; } v0; } v;
450 } lcb_logprocs;
451 
461 #define LCB_CNTL_LOGGER 0x18
462 
468 #define LCB_LOG_SPEC(fmt) "%s" fmt "%s"
469 
470 #define LCB_LOG_UD_OTAG "<ud>"
471 #define LCB_LOG_UD_CTAG "</ud>"
472 
483 #define LCB_LOG_UD(instance, val) \
484  lcb_is_redacting_logs(instance) ? LCB_LOG_UD_OTAG : "", val, lcb_is_redacting_logs(instance) ? LCB_LOG_UD_CTAG : ""
485 
486 #define LCB_LOG_MD_OTAG "<md>"
487 #define LCB_LOG_MD_CTAG "</md>"
488 
500 #define LCB_LOG_MD(instance, val) \
501  lcb_is_redacting_logs(instance) ? LCB_LOG_MD_OTAG : "", val, lcb_is_redacting_logs(instance) ? LCB_LOG_MD_CTAG : ""
502 
503 #define LCB_LOG_SD_OTAG "<sd>"
504 #define LCB_LOG_SD_CTAG "</sd>"
505 
514 #define LCB_LOG_SD(instance, val) \
515  lcb_is_redacting_logs(instance) ? LCB_LOG_SD_OTAG : "", val, lcb_is_redacting_logs(instance) ? LCB_LOG_SD_CTAG : ""
516 
533 #define LCB_CNTL_CONFDELAY_THRESH 0x19
534 
540 #define LCB_CNTL_CONFIG_TRANSPORT 0x1A
541 
561 #define LCB_CNTL_CONFIG_NODE_TIMEOUT 0x1B
562 
584 #define LCB_CNTL_HTCONFIG_IDLE_TIMEOUT 0x1C
585 
590 #define LCB_CNTL_CHANGESET 0x1F
591 
611 #define LCB_CNTL_CONFIGCACHE 0x21
612 
622 #define LCB_CNTL_CONFIGCACHE_RO 0x36
623 
629 typedef enum {
630  LCB_SSL_ENABLED = 1 << 0,
631  LCB_SSL_NOVERIFY = 1 << 1,
632  LCB_SSL_NOGLOBALINIT = 1 << 2
633 } lcb_SSLOPTS;
634 
645 #define LCB_CNTL_SSL_MODE 0x22
646 
656 #define LCB_CNTL_SSL_CERT 0x23
657 
670 #define LCB_CNTL_SSL_KEY 0x4b
671 
682 #define LCB_CNTL_SSL_TRUSTSTORE 0x4d
683 
688 #define LCB_CNTL_SSL_CACERT LCB_CNTL_SSL_CERT
689 
693 typedef enum {
703 
704 typedef enum {
709 
713  LCB_RETRY_CMDS_GET = 0x01,
714 
718  LCB_RETRY_CMDS_SAFE = 0x03, /* Includes 'GET', plus a new flag (e.g. 0x02|0x01) */
719 
722  LCB_RETRY_CMDS_ALL = 0x07 /* e.g. 0x01|0x03| NEW FLAG: 0x04 */
724 
732 #define LCB_RETRYOPT_CREATE(mode, policy) (((mode) << 16) | policy)
733 
735 #define LCB_RETRYOPT_GETMODE(u) ((u) >> 16)
736 
737 #define LCB_RETRYOPT_GETPOLICY(u) ((u)&0xffff)
738 
779 #define LCB_CNTL_RETRYMODE 0x24
780 
784 typedef enum {
787 
790 
794 
814 #define LCB_CNTL_HTCONFIG_URLTYPE 0x25
815 
826 #define LCB_CNTL_SYNCDESTROY 0x28
827 
844 #define LCB_CNTL_CONLOGGER_LEVEL 0x29
845 
863 #define LCB_CNTL_CONLOGGER_FP 0x3B
864 
877 #define LCB_CNTL_DETAILED_ERRCODES 0x2A
878 
894 #define LCB_CNTL_RETRY_INTERVAL 0x2C
895 
905 #define LCB_CNTL_RETRY_BACKOFF 0x2D
906 
920 #define LCB_CNTL_RETRY_NMV_IMM 0x37
921 
930 #define LCB_CNTL_HTTP_POOLSIZE 0x2E
931 
942 #define LCB_CNTL_HTTP_REFRESH_CONFIG_ON_ERROR 0x2F
953 #define LCB_CNTL_SCHED_IMPLICIT_FLUSH 0x31
954 
967 #define LCB_CNTL_FETCH_MUTATION_TOKENS 0x34
968 
987 #define LCB_CNTL_DURABILITY_MUTATION_TOKENS 0x35
988 
998 #define LCB_CNTL_MUTATION_TOKENS_SUPPORTED 0x38
999 
1000 
1014 #define LCB_CNTL_RESET_TIMEOUT_ON_WAIT 0x3A
1015 
1022 #define LCB_CNTL_N1QL_CLEARACHE 0x3E
1023 
1033 #define LCB_CNTL_CLIENT_STRING 0x3F
1034 
1035 typedef const char *lcb_BUCKETCRED[2];
1036 
1045 #define LCB_CNTL_BUCKET_CRED 0x40
1046 
1056 #define LCB_CNTL_RETRY_NMV_INTERVAL 0x41
1057 
1068 #define LCB_CNTL_READ_CHUNKSIZE 0x42
1069 
1078 #define LCB_CNTL_ENABLE_ERRMAP 0x43
1079 
1092 #define LCB_CNTL_SELECT_BUCKET 0x44
1093 
1102 #define LCB_CNTL_TCP_KEEPALIVE 0x45
1103 
1129 #define LCB_CNTL_CONFIG_POLL_INTERVAL 0x46
1130 
1145 #define LCB_CNTL_SEND_HELLO 0x47
1146 
1158 #define LCB_CNTL_LOG_REDACTION 0x4c
1169 #define LCB_CNTL_ENABLE_TRACING 0x4e
1170 
1171 typedef enum {
1172  LCBTRACE_THRESHOLD_KV = 0,
1173  LCBTRACE_THRESHOLD_N1QL,
1174  LCBTRACE_THRESHOLD_VIEW,
1175  LCBTRACE_THRESHOLD_FTS,
1176  LCBTRACE_THRESHOLD_ANALYTICS,
1177  LCBTRACE_THRESHOLD__MAX
1178 } lcbtrace_THRESHOLDOPTS;
1179 
1200 #define LCB_CNTL_TRACING_ORPHANED_QUEUE_FLUSH_INTERVAL 0x4f
1201 
1213 #define LCB_CNTL_TRACING_ORPHANED_QUEUE_SIZE 0x50
1214 
1235 #define LCB_CNTL_TRACING_THRESHOLD_QUEUE_FLUSH_INTERVAL 0x51
1236 
1248 #define LCB_CNTL_TRACING_THRESHOLD_QUEUE_SIZE 0x52
1249 
1258 #define LCB_CNTL_TRACING_THRESHOLD_KV 0x53
1259 
1268 #define LCB_CNTL_TRACING_THRESHOLD_N1QL 0x54
1269 
1278 #define LCB_CNTL_TRACING_THRESHOLD_VIEW 0x55
1279 
1288 #define LCB_CNTL_TRACING_THRESHOLD_FTS 0x56
1289 
1298 #define LCB_CNTL_TRACING_THRESHOLD_ANALYTICS 0x57
1299 
1305 typedef enum {
1309  LCB_COMPRESS_NONE = 0x00,
1310 
1316  LCB_COMPRESS_IN = 1 << 0,
1317 
1323  LCB_COMPRESS_OUT = 1 << 1,
1324 
1325 
1326  LCB_COMPRESS_INOUT = (LCB_COMPRESS_IN|LCB_COMPRESS_OUT),
1327 
1337  LCB_COMPRESS_FORCE = 1 << 2
1361 #define LCB_CNTL_COMPRESSION_OPTS 0x26
1362 
1371 #define LCB_CNTL_COMPRESSION_MIN_SIZE 0x58
1372 
1381 #define LCB_CNTL_COMPRESSION_MIN_RATIO 0x59
1382 
1383 
1393 #define LCB_CNTL_NETWORK 0x5b
1394 
1403 #define LCB_CNTL_HTTP_POOL_TIMEOUT 0x5d
1404 
1409 #define LCB_CNTL__MAX 0x5e
1410 
1412 #ifdef __cplusplus
1413 }
1414 #endif
1415 
1416 #include "cntl-private.h"
1417 
1418 #endif /* LCB_CNTL_H */
Decompress incoming data, if the data has been compressed at the server.
Definition: cntl.h:1632
Only retry simple retrieval operations (excludes touch, get-and-touch, and get-locked) which may be r...
Definition: cntl.h:867
lcb_SSLOPTS
SSL options
Definition: cntl.h:763
Select retry for NOT_MY_VBUCKET responses.
Definition: cntl.h:850
fatal errors, the library cannot proceed
Definition: cntl.h:512
Select retry for network errors.
Definition: cntl.h:849
Structure containing mapping information for a key.
Definition: cntl.h:256
disable IPv6
Definition: cntl.h:288
void(* lcb_logging_callback)(struct lcb_logprocs_st *procs, unsigned int iid, const char *subsys, int severity, const char *srcfile, int srcline, const char *fmt, va_list ap)
Logger callback.
Definition: cntl.h:532
enforce only IPv6
Definition: cntl.h:289
use both IPv6 and IPv4
Definition: cntl.h:290
Do not perform compression in any direction.
Definition: cntl.h:1625
Compress outgoing data.
Definition: cntl.h:1639
Use SSL.
Definition: cntl.h:764
/pools/default/b[s]/$bucket: Introduced in Couchbase Server 2.5
Definition: cntl.h:945
error notifications
Definition: cntl.h:510
< maximum index
Definition: cntl.h:855
lcb_ipv6_t
Modes for handling IPv6 in the IO layer.
Definition: cntl.h:287
lcb_log_severity_t
Logging Levels
Definition: cntl.h:506
Retry all commands, disregarding any potential unintended receipt of errors or data mutation...
Definition: cntl.h:876
Do not call SSL&#39;s global init functions.
Definition: cntl.h:766
internal value for total number of levels
Definition: cntl.h:513
Select retry for topology.
Definition: cntl.h:848
By default the library will send a HELLO command to the server to determine whether compression is su...
Definition: cntl.h:1653
Try 25PLUS first and fallback to COMPAT
Definition: cntl.h:951
error messages, usually the library have to re-initialize connection instance
Definition: cntl.h:511
Don&#39;t retry any commands.
Definition: cntl.h:862
/pools/default/buckets[Streaming]/$bucket.
Definition: cntl.h:948
lcb_HTCONFIG_URLTYPE
Enumeration representing various URL forms to use for the configuration stream.
Definition: cntl.h:943
the most verbose level
Definition: cntl.h:507
Don&#39;t verify certificates.
Definition: cntl.h:765
Retry operations which may potentially fail because they have been accepted by a previous server...
Definition: cntl.h:872
useful notices, not often
Definition: cntl.h:509
lcb_RETRYCMDOPTS
Definition: cntl.h:858
Logging context
Definition: cntl.h:545
lcb_COMPRESSOPTS
Options for how to handle compression
Definition: cntl.h:1621
lcb_RETRYMODEOPTS
Select retry mode to manipulate.
Definition: cntl.h:847
Retry when there is no node for the item.
Definition: cntl.h:854
diagnostic information, required to investigate problems
Definition: cntl.h:508