Merge in new protocol interface bits.
[m6w6/libmemcached] / libmemcached / memcached / protocol_binary.h
1 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /*
3 * Copyright (c) <2008>, Sun Microsystems, Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of the nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY SUN MICROSYSTEMS, INC. ``AS IS'' AND ANY
18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 * DISCLAIMED. IN NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY
21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28 /*
29 * Summary: Constants used by to implement the binary protocol.
30 *
31 * Copy: See Copyright for the status of this software.
32 *
33 * Author: Trond Norbye <trond.norbye@sun.com>
34 */
35
36 #ifndef PROTOCOL_BINARY_H
37 #define PROTOCOL_BINARY_H
38
39 #include "vbucket.h"
40
41 /**
42 * \addtogroup Protocol
43 * @{
44 */
45
46 /**
47 * This file contains definitions of the constants and packet formats
48 * defined in the binary specification. Please note that you _MUST_ remember
49 * to convert each multibyte field to / from network byte order to / from
50 * host order.
51 */
52 #ifdef __cplusplus
53 extern "C"
54 {
55 #endif
56
57 /**
58 * Definition of the legal "magic" values used in a packet.
59 * See section 3.1 Magic byte
60 */
61 typedef enum {
62 PROTOCOL_BINARY_REQ = 0x80,
63 PROTOCOL_BINARY_RES = 0x81
64 } protocol_binary_magic;
65
66 /**
67 * Definition of the valid response status numbers.
68 * See section 3.2 Response Status
69 */
70 typedef enum {
71 PROTOCOL_BINARY_RESPONSE_SUCCESS = 0x00,
72 PROTOCOL_BINARY_RESPONSE_KEY_ENOENT = 0x01,
73 PROTOCOL_BINARY_RESPONSE_KEY_EEXISTS = 0x02,
74 PROTOCOL_BINARY_RESPONSE_E2BIG = 0x03,
75 PROTOCOL_BINARY_RESPONSE_EINVAL = 0x04,
76 PROTOCOL_BINARY_RESPONSE_NOT_STORED = 0x05,
77 PROTOCOL_BINARY_RESPONSE_DELTA_BADVAL = 0x06,
78 PROTOCOL_BINARY_RESPONSE_NOT_MY_VBUCKET = 0x07,
79 PROTOCOL_BINARY_RESPONSE_AUTH_ERROR = 0x20,
80 PROTOCOL_BINARY_RESPONSE_AUTH_CONTINUE = 0x21,
81 PROTOCOL_BINARY_RESPONSE_UNKNOWN_COMMAND = 0x81,
82 PROTOCOL_BINARY_RESPONSE_ENOMEM = 0x82,
83 PROTOCOL_BINARY_RESPONSE_NOT_SUPPORTED = 0x83,
84 PROTOCOL_BINARY_RESPONSE_EINTERNAL = 0x84,
85 PROTOCOL_BINARY_RESPONSE_EBUSY = 0x85,
86 PROTOCOL_BINARY_RESPONSE_ETMPFAIL = 0x86
87 } protocol_binary_response_status;
88
89 /**
90 * Defintion of the different command opcodes.
91 * See section 3.3 Command Opcodes
92 */
93 typedef enum {
94 PROTOCOL_BINARY_CMD_GET = 0x00,
95 PROTOCOL_BINARY_CMD_SET = 0x01,
96 PROTOCOL_BINARY_CMD_ADD = 0x02,
97 PROTOCOL_BINARY_CMD_REPLACE = 0x03,
98 PROTOCOL_BINARY_CMD_DELETE = 0x04,
99 PROTOCOL_BINARY_CMD_INCREMENT = 0x05,
100 PROTOCOL_BINARY_CMD_DECREMENT = 0x06,
101 PROTOCOL_BINARY_CMD_QUIT = 0x07,
102 PROTOCOL_BINARY_CMD_FLUSH = 0x08,
103 PROTOCOL_BINARY_CMD_GETQ = 0x09,
104 PROTOCOL_BINARY_CMD_NOOP = 0x0a,
105 PROTOCOL_BINARY_CMD_VERSION = 0x0b,
106 PROTOCOL_BINARY_CMD_GETK = 0x0c,
107 PROTOCOL_BINARY_CMD_GETKQ = 0x0d,
108 PROTOCOL_BINARY_CMD_APPEND = 0x0e,
109 PROTOCOL_BINARY_CMD_PREPEND = 0x0f,
110 PROTOCOL_BINARY_CMD_STAT = 0x10,
111 PROTOCOL_BINARY_CMD_SETQ = 0x11,
112 PROTOCOL_BINARY_CMD_ADDQ = 0x12,
113 PROTOCOL_BINARY_CMD_REPLACEQ = 0x13,
114 PROTOCOL_BINARY_CMD_DELETEQ = 0x14,
115 PROTOCOL_BINARY_CMD_INCREMENTQ = 0x15,
116 PROTOCOL_BINARY_CMD_DECREMENTQ = 0x16,
117 PROTOCOL_BINARY_CMD_QUITQ = 0x17,
118 PROTOCOL_BINARY_CMD_FLUSHQ = 0x18,
119 PROTOCOL_BINARY_CMD_APPENDQ = 0x19,
120 PROTOCOL_BINARY_CMD_PREPENDQ = 0x1a,
121 PROTOCOL_BINARY_CMD_VERBOSITY = 0x1b,
122 PROTOCOL_BINARY_CMD_TOUCH = 0x1c,
123 PROTOCOL_BINARY_CMD_GAT = 0x1d,
124 PROTOCOL_BINARY_CMD_GATQ = 0x1e,
125
126 PROTOCOL_BINARY_CMD_SASL_LIST_MECHS = 0x20,
127 PROTOCOL_BINARY_CMD_SASL_AUTH = 0x21,
128 PROTOCOL_BINARY_CMD_SASL_STEP = 0x22,
129
130 /* These commands are used for range operations and exist within
131 * this header for use in other projects. Range operations are
132 * not expected to be implemented in the memcached server itself.
133 */
134 PROTOCOL_BINARY_CMD_RGET = 0x30,
135 PROTOCOL_BINARY_CMD_RSET = 0x31,
136 PROTOCOL_BINARY_CMD_RSETQ = 0x32,
137 PROTOCOL_BINARY_CMD_RAPPEND = 0x33,
138 PROTOCOL_BINARY_CMD_RAPPENDQ = 0x34,
139 PROTOCOL_BINARY_CMD_RPREPEND = 0x35,
140 PROTOCOL_BINARY_CMD_RPREPENDQ = 0x36,
141 PROTOCOL_BINARY_CMD_RDELETE = 0x37,
142 PROTOCOL_BINARY_CMD_RDELETEQ = 0x38,
143 PROTOCOL_BINARY_CMD_RINCR = 0x39,
144 PROTOCOL_BINARY_CMD_RINCRQ = 0x3a,
145 PROTOCOL_BINARY_CMD_RDECR = 0x3b,
146 PROTOCOL_BINARY_CMD_RDECRQ = 0x3c,
147 /* End Range operations */
148
149 /* VBucket commands */
150 PROTOCOL_BINARY_CMD_SET_VBUCKET = 0x3d,
151 PROTOCOL_BINARY_CMD_GET_VBUCKET = 0x3e,
152 PROTOCOL_BINARY_CMD_DEL_VBUCKET = 0x3f,
153 /* End VBucket commands */
154
155 /* TAP commands */
156 PROTOCOL_BINARY_CMD_TAP_CONNECT = 0x40,
157 PROTOCOL_BINARY_CMD_TAP_MUTATION = 0x41,
158 PROTOCOL_BINARY_CMD_TAP_DELETE = 0x42,
159 PROTOCOL_BINARY_CMD_TAP_FLUSH = 0x43,
160 PROTOCOL_BINARY_CMD_TAP_OPAQUE = 0x44,
161 PROTOCOL_BINARY_CMD_TAP_VBUCKET_SET = 0x45,
162 PROTOCOL_BINARY_CMD_TAP_CHECKPOINT_START = 0x46,
163 PROTOCOL_BINARY_CMD_TAP_CHECKPOINT_END = 0x47,
164 /* End TAP */
165
166 PROTOCOL_BINARY_CMD_LAST_RESERVED = 0xef,
167
168 /* Scrub the data */
169 PROTOCOL_BINARY_CMD_SCRUB = 0xf0
170 } protocol_binary_command;
171
172 /**
173 * Definition of the data types in the packet
174 * See section 3.4 Data Types
175 */
176 typedef enum {
177 PROTOCOL_BINARY_RAW_BYTES = 0x00
178 } protocol_binary_datatypes;
179
180 /**
181 * Definition of the header structure for a request packet.
182 * See section 2
183 */
184 typedef union {
185 struct {
186 uint8_t magic;
187 uint8_t opcode;
188 uint16_t keylen;
189 uint8_t extlen;
190 uint8_t datatype;
191 uint16_t vbucket;
192 uint32_t bodylen;
193 uint32_t opaque;
194 uint64_t cas;
195 } request;
196 uint8_t bytes[24];
197 } protocol_binary_request_header;
198
199 /**
200 * Definition of the header structure for a response packet.
201 * See section 2
202 */
203 typedef union {
204 struct {
205 uint8_t magic;
206 uint8_t opcode;
207 uint16_t keylen;
208 uint8_t extlen;
209 uint8_t datatype;
210 uint16_t status;
211 uint32_t bodylen;
212 uint32_t opaque;
213 uint64_t cas;
214 } response;
215 uint8_t bytes[24];
216 } protocol_binary_response_header;
217
218 /**
219 * Definition of a request-packet containing no extras
220 */
221 typedef union {
222 struct {
223 protocol_binary_request_header header;
224 } message;
225 uint8_t bytes[sizeof(protocol_binary_request_header)];
226 } protocol_binary_request_no_extras;
227
228 /**
229 * Definition of a response-packet containing no extras
230 */
231 typedef union {
232 struct {
233 protocol_binary_response_header header;
234 } message;
235 uint8_t bytes[sizeof(protocol_binary_response_header)];
236 } protocol_binary_response_no_extras;
237
238 /**
239 * Definition of the packet used by the get, getq, getk and getkq command.
240 * See section 4
241 */
242 typedef protocol_binary_request_no_extras protocol_binary_request_get;
243 typedef protocol_binary_request_no_extras protocol_binary_request_getq;
244 typedef protocol_binary_request_no_extras protocol_binary_request_getk;
245 typedef protocol_binary_request_no_extras protocol_binary_request_getkq;
246
247 /**
248 * Definition of the packet returned from a successful get, getq, getk and
249 * getkq.
250 * See section 4
251 */
252 typedef union {
253 struct {
254 protocol_binary_response_header header;
255 struct {
256 uint32_t flags;
257 } body;
258 } message;
259 uint8_t bytes[sizeof(protocol_binary_response_header) + 4];
260 } protocol_binary_response_get;
261
262 typedef protocol_binary_response_get protocol_binary_response_getq;
263 typedef protocol_binary_response_get protocol_binary_response_getk;
264 typedef protocol_binary_response_get protocol_binary_response_getkq;
265
266 /**
267 * Definition of the packet used by the delete command
268 * See section 4
269 */
270 typedef protocol_binary_request_no_extras protocol_binary_request_delete;
271
272 /**
273 * Definition of the packet returned by the delete command
274 * See section 4
275 */
276 typedef protocol_binary_response_no_extras protocol_binary_response_delete;
277
278 /**
279 * Definition of the packet used by the flush command
280 * See section 4
281 * Please note that the expiration field is optional, so remember to see
282 * check the header.bodysize to see if it is present.
283 */
284 typedef union {
285 struct {
286 protocol_binary_request_header header;
287 struct {
288 uint32_t expiration;
289 } body;
290 } message;
291 uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
292 } protocol_binary_request_flush;
293
294 /**
295 * Definition of the packet returned by the flush command
296 * See section 4
297 */
298 typedef protocol_binary_response_no_extras protocol_binary_response_flush;
299
300 /**
301 * Definition of the packet used by set, add and replace
302 * See section 4
303 */
304 typedef union {
305 struct {
306 protocol_binary_request_header header;
307 struct {
308 uint32_t flags;
309 uint32_t expiration;
310 } body;
311 } message;
312 uint8_t bytes[sizeof(protocol_binary_request_header) + 8];
313 } protocol_binary_request_set;
314 typedef protocol_binary_request_set protocol_binary_request_add;
315 typedef protocol_binary_request_set protocol_binary_request_replace;
316
317 /**
318 * Definition of the packet returned by set, add and replace
319 * See section 4
320 */
321 typedef protocol_binary_response_no_extras protocol_binary_response_set;
322 typedef protocol_binary_response_no_extras protocol_binary_response_add;
323 typedef protocol_binary_response_no_extras protocol_binary_response_replace;
324
325 /**
326 * Definition of the noop packet
327 * See section 4
328 */
329 typedef protocol_binary_request_no_extras protocol_binary_request_noop;
330
331 /**
332 * Definition of the packet returned by the noop command
333 * See section 4
334 */
335 typedef protocol_binary_response_no_extras protocol_binary_response_noop;
336
337 /**
338 * Definition of the structure used by the increment and decrement
339 * command.
340 * See section 4
341 */
342 typedef union {
343 struct {
344 protocol_binary_request_header header;
345 struct {
346 uint64_t delta;
347 uint64_t initial;
348 uint32_t expiration;
349 } body;
350 } message;
351 uint8_t bytes[sizeof(protocol_binary_request_header) + 20];
352 } protocol_binary_request_incr;
353 typedef protocol_binary_request_incr protocol_binary_request_decr;
354
355 /**
356 * Definition of the response from an incr or decr command
357 * command.
358 * See section 4
359 */
360 typedef union {
361 struct {
362 protocol_binary_response_header header;
363 struct {
364 uint64_t value;
365 } body;
366 } message;
367 uint8_t bytes[sizeof(protocol_binary_response_header) + 8];
368 } protocol_binary_response_incr;
369 typedef protocol_binary_response_incr protocol_binary_response_decr;
370
371 /**
372 * Definition of the quit
373 * See section 4
374 */
375 typedef protocol_binary_request_no_extras protocol_binary_request_quit;
376
377 /**
378 * Definition of the packet returned by the quit command
379 * See section 4
380 */
381 typedef protocol_binary_response_no_extras protocol_binary_response_quit;
382
383 /**
384 * Definition of the packet used by append and prepend command
385 * See section 4
386 */
387 typedef protocol_binary_request_no_extras protocol_binary_request_append;
388 typedef protocol_binary_request_no_extras protocol_binary_request_prepend;
389
390 /**
391 * Definition of the packet returned from a successful append or prepend
392 * See section 4
393 */
394 typedef protocol_binary_response_no_extras protocol_binary_response_append;
395 typedef protocol_binary_response_no_extras protocol_binary_response_prepend;
396
397 /**
398 * Definition of the packet used by the version command
399 * See section 4
400 */
401 typedef protocol_binary_request_no_extras protocol_binary_request_version;
402
403 /**
404 * Definition of the packet returned from a successful version command
405 * See section 4
406 */
407 typedef protocol_binary_response_no_extras protocol_binary_response_version;
408
409
410 /**
411 * Definition of the packet used by the stats command.
412 * See section 4
413 */
414 typedef protocol_binary_request_no_extras protocol_binary_request_stats;
415
416 /**
417 * Definition of the packet returned from a successful stats command
418 * See section 4
419 */
420 typedef protocol_binary_response_no_extras protocol_binary_response_stats;
421
422 /**
423 * Definition of the packet used by the verbosity command
424 */
425 typedef union {
426 struct {
427 protocol_binary_request_header header;
428 struct {
429 uint32_t level;
430 } body;
431 } message;
432 uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
433 } protocol_binary_request_verbosity;
434
435 /**
436 * Definition of the packet returned from the verbosity command
437 */
438 typedef protocol_binary_response_no_extras protocol_binary_response_verbosity;
439
440 /**
441 * Definition of the packet used by the touch command.
442 */
443 typedef union {
444 struct {
445 protocol_binary_request_header header;
446 struct {
447 uint32_t expiration;
448 } body;
449 } message;
450 uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
451 } protocol_binary_request_touch;
452
453 /**
454 * Definition of the packet returned from the touch command
455 */
456 typedef protocol_binary_response_no_extras protocol_binary_response_touch;
457
458 /**
459 * Definition of the packet used by the GAT(Q) command.
460 */
461 typedef union {
462 struct {
463 protocol_binary_request_header header;
464 struct {
465 uint32_t expiration;
466 } body;
467 } message;
468 uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
469 } protocol_binary_request_gat;
470
471 typedef protocol_binary_request_gat protocol_binary_request_gatq;
472
473 /**
474 * Definition of the packet returned from the GAT(Q)
475 */
476 typedef protocol_binary_response_get protocol_binary_response_gat;
477 typedef protocol_binary_response_get protocol_binary_response_gatq;
478
479
480 /**
481 * Definition of a request for a range operation.
482 * See http://code.google.com/p/memcached/wiki/RangeOps
483 *
484 * These types are used for range operations and exist within
485 * this header for use in other projects. Range operations are
486 * not expected to be implemented in the memcached server itself.
487 */
488 typedef union {
489 struct {
490 protocol_binary_response_header header;
491 struct {
492 uint16_t size;
493 uint8_t reserved;
494 uint8_t flags;
495 uint32_t max_results;
496 } body;
497 } message;
498 uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
499 } protocol_binary_request_rangeop;
500
501 typedef protocol_binary_request_rangeop protocol_binary_request_rget;
502 typedef protocol_binary_request_rangeop protocol_binary_request_rset;
503 typedef protocol_binary_request_rangeop protocol_binary_request_rsetq;
504 typedef protocol_binary_request_rangeop protocol_binary_request_rappend;
505 typedef protocol_binary_request_rangeop protocol_binary_request_rappendq;
506 typedef protocol_binary_request_rangeop protocol_binary_request_rprepend;
507 typedef protocol_binary_request_rangeop protocol_binary_request_rprependq;
508 typedef protocol_binary_request_rangeop protocol_binary_request_rdelete;
509 typedef protocol_binary_request_rangeop protocol_binary_request_rdeleteq;
510 typedef protocol_binary_request_rangeop protocol_binary_request_rincr;
511 typedef protocol_binary_request_rangeop protocol_binary_request_rincrq;
512 typedef protocol_binary_request_rangeop protocol_binary_request_rdecr;
513 typedef protocol_binary_request_rangeop protocol_binary_request_rdecrq;
514
515
516 /**
517 * Definition of tap commands
518 * See To be written
519 *
520 */
521
522 typedef union {
523 struct {
524 protocol_binary_request_header header;
525 struct {
526 /**
527 * flags is a bitmask used to set properties for the
528 * the connection. Please In order to be forward compatible
529 * you should set all undefined bits to 0.
530 *
531 * If the bit require extra userdata, it will be stored
532 * in the user-data field of the body (passed to the engine
533 * as enginespeciffic). That means that when you parse the
534 * flags and the engine-specific data, you have to work your
535 * way from bit 0 and upwards to find the correct offset for
536 * the data.
537 *
538 */
539 uint32_t flags;
540
541 /**
542 * Backfill age
543 *
544 * By using this flag you can limit the amount of data being
545 * transmitted. If you don't specify a backfill age, the
546 * server will transmit everything it contains.
547 *
548 * The first 8 bytes in the engine specific data contains
549 * the oldest entry (from epoc) you're interested in.
550 * Specifying a time in the future (for the server you are
551 * connecting to), will cause it to start streaming current
552 * changes.
553 */
554 #define TAP_CONNECT_FLAG_BACKFILL 0x01
555 /**
556 * Dump will cause the server to send the data stored on the
557 * server, but disconnect when the keys stored in the server
558 * are transmitted.
559 */
560 #define TAP_CONNECT_FLAG_DUMP 0x02
561 /**
562 * The body contains a list of 16 bits words in network byte
563 * order specifying the vbucket ids to monitor. The first 16
564 * bit word contains the number of buckets. The number of 0
565 * means "all buckets"
566 */
567 #define TAP_CONNECT_FLAG_LIST_VBUCKETS 0x04
568 /**
569 * The responsibility of the vbuckets is to be transferred
570 * over to the caller when all items are transferred.
571 */
572 #define TAP_CONNECT_FLAG_TAKEOVER_VBUCKETS 0x08
573 /**
574 * The tap consumer supports ack'ing of tap messages
575 */
576 #define TAP_CONNECT_SUPPORT_ACK 0x10
577 /**
578 * The tap consumer would prefer to just get the keys
579 * back. If the engine supports this it will set
580 * the TAP_FLAG_NO_VALUE flag in each of the
581 * tap packets returned.
582 */
583 #define TAP_CONNECT_REQUEST_KEYS_ONLY 0x20
584 /**
585 * The body contains a list of (vbucket_id, last_checkpoint_id)
586 * pairs. This provides the checkpoint support in TAP streams.
587 * The last checkpoint id represents the last checkpoint that
588 * was successfully persisted.
589 */
590 #define TAP_CONNECT_CHECKPOINT 0x40
591 /**
592 * The tap consumer is a registered tap client, which means that
593 * the tap server will maintain its checkpoint cursor permanently.
594 */
595 #define TAP_CONNECT_REGISTERED_CLIENT 0x80
596 } body;
597 } message;
598 uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
599 } protocol_binary_request_tap_connect;
600
601 typedef union {
602 struct {
603 protocol_binary_request_header header;
604 struct {
605 struct {
606 uint16_t enginespecific_length;
607 /*
608 * The flag section support the following flags
609 */
610 /**
611 * Request that the consumer send a response packet
612 * for this packet. The opaque field must be preserved
613 * in the response.
614 */
615 #define TAP_FLAG_ACK 0x01
616 /**
617 * The value for the key is not included in the packet
618 */
619 #define TAP_FLAG_NO_VALUE 0x02
620 uint16_t flags;
621 uint8_t ttl;
622 uint8_t res1;
623 uint8_t res2;
624 uint8_t res3;
625 } tap;
626 struct {
627 uint32_t flags;
628 uint32_t expiration;
629 } item;
630 } body;
631 } message;
632 uint8_t bytes[sizeof(protocol_binary_request_header) + 16];
633 } protocol_binary_request_tap_mutation;
634
635 typedef union {
636 struct {
637 protocol_binary_request_header header;
638 struct {
639 struct {
640 uint16_t enginespecific_length;
641 /**
642 * See the definition of the flags for
643 * protocol_binary_request_tap_mutation for a description
644 * of the available flags.
645 */
646 uint16_t flags;
647 uint8_t ttl;
648 uint8_t res1;
649 uint8_t res2;
650 uint8_t res3;
651 } tap;
652 } body;
653 } message;
654 uint8_t bytes[sizeof(protocol_binary_request_header) + 8];
655 } protocol_binary_request_tap_no_extras;
656
657 typedef protocol_binary_request_tap_no_extras protocol_binary_request_tap_delete;
658 typedef protocol_binary_request_tap_no_extras protocol_binary_request_tap_flush;
659 typedef protocol_binary_request_tap_no_extras protocol_binary_request_tap_opaque;
660 typedef protocol_binary_request_tap_no_extras protocol_binary_request_tap_vbucket_set;
661
662
663 /**
664 * Definition of the packet used by the scrub.
665 */
666 typedef protocol_binary_request_no_extras protocol_binary_request_scrub;
667
668 /**
669 * Definition of the packet returned from scrub.
670 */
671 typedef protocol_binary_response_no_extras protocol_binary_response_scrub;
672
673
674 /**
675 * Definition of the packet used by set vbucket
676 */
677 typedef union {
678 struct {
679 protocol_binary_request_header header;
680 struct {
681 vbucket_state_t state;
682 } body;
683 } message;
684 uint8_t bytes[sizeof(protocol_binary_request_header) + sizeof(vbucket_state_t)];
685 } protocol_binary_request_set_vbucket;
686 /**
687 * Definition of the packet returned from set vbucket
688 */
689 typedef protocol_binary_response_no_extras protocol_binary_response_set_vbucket;
690 /**
691 * Definition of the packet used by del vbucket
692 */
693 typedef protocol_binary_request_no_extras protocol_binary_request_del_vbucket;
694 /**
695 * Definition of the packet returned from del vbucket
696 */
697 typedef protocol_binary_response_no_extras protocol_binary_response_del_vbucket;
698
699 /**
700 * Definition of the packet used by get vbucket
701 */
702 typedef protocol_binary_request_no_extras protocol_binary_request_get_vbucket;
703
704 /**
705 * Definition of the packet returned from get vbucket
706 */
707 typedef union {
708 struct {
709 protocol_binary_response_header header;
710 struct {
711 vbucket_state_t state;
712 } body;
713 } message;
714 uint8_t bytes[sizeof(protocol_binary_response_header) + sizeof(vbucket_state_t)];
715 } protocol_binary_response_get_vbucket;
716
717
718 /**
719 * @}
720 */
721
722 #ifdef __cplusplus
723 }
724 #endif
725 #endif /* PROTOCOL_BINARY_H */