Blame protocol_binary.h

Packit 4e8bc4
/*
Packit 4e8bc4
 * Copyright (c) <2008>, Sun Microsystems, Inc.
Packit 4e8bc4
 * All rights reserved.
Packit 4e8bc4
 *
Packit 4e8bc4
 * Redistribution and use in source and binary forms, with or without
Packit 4e8bc4
 * modification, are permitted provided that the following conditions are met:
Packit 4e8bc4
 *     * Redistributions of source code must retain the above copyright
Packit 4e8bc4
 *       notice, this list of conditions and the following disclaimer.
Packit 4e8bc4
 *     * Redistributions in binary form must reproduce the above copyright
Packit 4e8bc4
 *       notice, this list of conditions and the following disclaimer in the
Packit 4e8bc4
 *       documentation and/or other materials provided with the distribution.
Packit 4e8bc4
 *     * Neither the name of the  nor the
Packit 4e8bc4
 *       names of its contributors may be used to endorse or promote products
Packit 4e8bc4
 *       derived from this software without specific prior written permission.
Packit 4e8bc4
 *
Packit 4e8bc4
 * THIS SOFTWARE IS PROVIDED BY SUN MICROSYSTEMS, INC. ``AS IS'' AND ANY
Packit 4e8bc4
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
Packit 4e8bc4
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Packit 4e8bc4
 * DISCLAIMED. IN NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY
Packit 4e8bc4
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
Packit 4e8bc4
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
Packit 4e8bc4
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
Packit 4e8bc4
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Packit 4e8bc4
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
Packit 4e8bc4
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit 4e8bc4
 */
Packit 4e8bc4
/*
Packit 4e8bc4
 * Summary: Constants used by to implement the binary protocol.
Packit 4e8bc4
 *
Packit 4e8bc4
 * Copy: See Copyright for the status of this software.
Packit 4e8bc4
 *
Packit 4e8bc4
 * Author: Trond Norbye <trond.norbye@sun.com>
Packit 4e8bc4
 */
Packit 4e8bc4
Packit 4e8bc4
#ifndef PROTOCOL_BINARY_H
Packit 4e8bc4
#define PROTOCOL_BINARY_H
Packit 4e8bc4
Packit 4e8bc4
/**
Packit 4e8bc4
 * This file contains definitions of the constants and packet formats
Packit 4e8bc4
 * defined in the binary specification. Please note that you _MUST_ remember
Packit 4e8bc4
 * to convert each multibyte field to / from network byte order to / from
Packit 4e8bc4
 * host order.
Packit 4e8bc4
 */
Packit 4e8bc4
#ifdef __cplusplus
Packit 4e8bc4
extern "C"
Packit 4e8bc4
{
Packit 4e8bc4
#endif
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the legal "magic" values used in a packet.
Packit 4e8bc4
     * See section 3.1 Magic byte
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef enum {
Packit 4e8bc4
        PROTOCOL_BINARY_REQ = 0x80,
Packit 4e8bc4
        PROTOCOL_BINARY_RES = 0x81
Packit 4e8bc4
    } protocol_binary_magic;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the valid response status numbers.
Packit 4e8bc4
     * See section 3.2 Response Status
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef enum {
Packit 4e8bc4
        PROTOCOL_BINARY_RESPONSE_SUCCESS = 0x00,
Packit 4e8bc4
        PROTOCOL_BINARY_RESPONSE_KEY_ENOENT = 0x01,
Packit 4e8bc4
        PROTOCOL_BINARY_RESPONSE_KEY_EEXISTS = 0x02,
Packit 4e8bc4
        PROTOCOL_BINARY_RESPONSE_E2BIG = 0x03,
Packit 4e8bc4
        PROTOCOL_BINARY_RESPONSE_EINVAL = 0x04,
Packit 4e8bc4
        PROTOCOL_BINARY_RESPONSE_NOT_STORED = 0x05,
Packit 4e8bc4
        PROTOCOL_BINARY_RESPONSE_DELTA_BADVAL = 0x06,
Packit 4e8bc4
        PROTOCOL_BINARY_RESPONSE_AUTH_ERROR = 0x20,
Packit 4e8bc4
        PROTOCOL_BINARY_RESPONSE_AUTH_CONTINUE = 0x21,
Packit 4e8bc4
        PROTOCOL_BINARY_RESPONSE_UNKNOWN_COMMAND = 0x81,
Packit 4e8bc4
        PROTOCOL_BINARY_RESPONSE_ENOMEM = 0x82
Packit 4e8bc4
    } protocol_binary_response_status;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the different command opcodes.
Packit 4e8bc4
     * See section 3.3 Command Opcodes
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef enum {
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_GET = 0x00,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_SET = 0x01,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_ADD = 0x02,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_REPLACE = 0x03,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_DELETE = 0x04,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_INCREMENT = 0x05,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_DECREMENT = 0x06,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_QUIT = 0x07,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_FLUSH = 0x08,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_GETQ = 0x09,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_NOOP = 0x0a,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_VERSION = 0x0b,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_GETK = 0x0c,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_GETKQ = 0x0d,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_APPEND = 0x0e,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_PREPEND = 0x0f,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_STAT = 0x10,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_SETQ = 0x11,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_ADDQ = 0x12,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_REPLACEQ = 0x13,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_DELETEQ = 0x14,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_INCREMENTQ = 0x15,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_DECREMENTQ = 0x16,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_QUITQ = 0x17,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_FLUSHQ = 0x18,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_APPENDQ = 0x19,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_PREPENDQ = 0x1a,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_TOUCH = 0x1c,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_GAT = 0x1d,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_GATQ = 0x1e,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_GATK = 0x23,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_GATKQ = 0x24,
Packit 4e8bc4
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_SASL_LIST_MECHS = 0x20,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_SASL_AUTH = 0x21,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_SASL_STEP = 0x22,
Packit 4e8bc4
Packit 4e8bc4
        /* These commands are used for range operations and exist within
Packit 4e8bc4
         * this header for use in other projects.  Range operations are
Packit 4e8bc4
         * not expected to be implemented in the memcached server itself.
Packit 4e8bc4
         */
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_RGET      = 0x30,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_RSET      = 0x31,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_RSETQ     = 0x32,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_RAPPEND   = 0x33,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_RAPPENDQ  = 0x34,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_RPREPEND  = 0x35,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_RPREPENDQ = 0x36,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_RDELETE   = 0x37,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_RDELETEQ  = 0x38,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_RINCR     = 0x39,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_RINCRQ    = 0x3a,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_RDECR     = 0x3b,
Packit 4e8bc4
        PROTOCOL_BINARY_CMD_RDECRQ    = 0x3c
Packit 4e8bc4
        /* End Range operations */
Packit 4e8bc4
Packit 4e8bc4
    } protocol_binary_command;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the data types in the packet
Packit 4e8bc4
     * See section 3.4 Data Types
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef enum {
Packit 4e8bc4
        PROTOCOL_BINARY_RAW_BYTES = 0x00
Packit 4e8bc4
    } protocol_binary_datatypes;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the header structure for a request packet.
Packit 4e8bc4
     * See section 2
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef union {
Packit 4e8bc4
        struct {
Packit 4e8bc4
            uint8_t magic;
Packit 4e8bc4
            uint8_t opcode;
Packit 4e8bc4
            uint16_t keylen;
Packit 4e8bc4
            uint8_t extlen;
Packit 4e8bc4
            uint8_t datatype;
Packit 4e8bc4
            uint16_t reserved;
Packit 4e8bc4
            uint32_t bodylen;
Packit 4e8bc4
            uint32_t opaque;
Packit 4e8bc4
            uint64_t cas;
Packit 4e8bc4
        } request;
Packit 4e8bc4
        uint8_t bytes[24];
Packit 4e8bc4
    } protocol_binary_request_header;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the header structure for a response packet.
Packit 4e8bc4
     * See section 2
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef union {
Packit 4e8bc4
        struct {
Packit 4e8bc4
            uint8_t magic;
Packit 4e8bc4
            uint8_t opcode;
Packit 4e8bc4
            uint16_t keylen;
Packit 4e8bc4
            uint8_t extlen;
Packit 4e8bc4
            uint8_t datatype;
Packit 4e8bc4
            uint16_t status;
Packit 4e8bc4
            uint32_t bodylen;
Packit 4e8bc4
            uint32_t opaque;
Packit 4e8bc4
            uint64_t cas;
Packit 4e8bc4
        } response;
Packit 4e8bc4
        uint8_t bytes[24];
Packit 4e8bc4
    } protocol_binary_response_header;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of a request-packet containing no extras
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef union {
Packit 4e8bc4
        struct {
Packit 4e8bc4
            protocol_binary_request_header header;
Packit 4e8bc4
        } message;
Packit 4e8bc4
        uint8_t bytes[sizeof(protocol_binary_request_header)];
Packit 4e8bc4
    } protocol_binary_request_no_extras;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of a response-packet containing no extras
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef union {
Packit 4e8bc4
        struct {
Packit 4e8bc4
            protocol_binary_response_header header;
Packit 4e8bc4
        } message;
Packit 4e8bc4
        uint8_t bytes[sizeof(protocol_binary_response_header)];
Packit 4e8bc4
    } protocol_binary_response_no_extras;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet used by the get, getq, getk and getkq command.
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef protocol_binary_request_no_extras protocol_binary_request_get;
Packit 4e8bc4
    typedef protocol_binary_request_no_extras protocol_binary_request_getq;
Packit 4e8bc4
    typedef protocol_binary_request_no_extras protocol_binary_request_getk;
Packit 4e8bc4
    typedef protocol_binary_request_no_extras protocol_binary_request_getkq;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet returned from a successful get, getq, getk and
Packit 4e8bc4
     * getkq.
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef union {
Packit 4e8bc4
        struct {
Packit 4e8bc4
            protocol_binary_response_header header;
Packit 4e8bc4
            struct {
Packit 4e8bc4
                uint32_t flags;
Packit 4e8bc4
            } body;
Packit 4e8bc4
        } message;
Packit 4e8bc4
        uint8_t bytes[sizeof(protocol_binary_response_header) + 4];
Packit 4e8bc4
    } protocol_binary_response_get;
Packit 4e8bc4
Packit 4e8bc4
    typedef protocol_binary_response_get protocol_binary_response_getq;
Packit 4e8bc4
    typedef protocol_binary_response_get protocol_binary_response_getk;
Packit 4e8bc4
    typedef protocol_binary_response_get protocol_binary_response_getkq;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet used by the delete command
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef protocol_binary_request_no_extras protocol_binary_request_delete;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet returned by the delete command
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef protocol_binary_response_no_extras protocol_binary_response_delete;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet used by the flush command
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     * Please note that the expiration field is optional, so remember to see
Packit 4e8bc4
     * check the header.bodysize to see if it is present.
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef union {
Packit 4e8bc4
        struct {
Packit 4e8bc4
            protocol_binary_request_header header;
Packit 4e8bc4
            struct {
Packit 4e8bc4
                uint32_t expiration;
Packit 4e8bc4
            } body;
Packit 4e8bc4
        } message;
Packit 4e8bc4
        uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
Packit 4e8bc4
    } protocol_binary_request_flush;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet returned by the flush command
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef protocol_binary_response_no_extras protocol_binary_response_flush;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet used by set, add and replace
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef union {
Packit 4e8bc4
        struct {
Packit 4e8bc4
            protocol_binary_request_header header;
Packit 4e8bc4
            struct {
Packit 4e8bc4
                uint32_t flags;
Packit 4e8bc4
                uint32_t expiration;
Packit 4e8bc4
            } body;
Packit 4e8bc4
        } message;
Packit 4e8bc4
        uint8_t bytes[sizeof(protocol_binary_request_header) + 8];
Packit 4e8bc4
    } protocol_binary_request_set;
Packit 4e8bc4
    typedef protocol_binary_request_set protocol_binary_request_add;
Packit 4e8bc4
    typedef protocol_binary_request_set protocol_binary_request_replace;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet returned by set, add and replace
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef protocol_binary_response_no_extras protocol_binary_response_set;
Packit 4e8bc4
    typedef protocol_binary_response_no_extras protocol_binary_response_add;
Packit 4e8bc4
    typedef protocol_binary_response_no_extras protocol_binary_response_replace;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the noop packet
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef protocol_binary_request_no_extras protocol_binary_request_noop;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet returned by the noop command
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef protocol_binary_response_no_extras protocol_binary_response_noop;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the structure used by the increment and decrement
Packit 4e8bc4
     * command.
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef union {
Packit 4e8bc4
        struct {
Packit 4e8bc4
            protocol_binary_request_header header;
Packit 4e8bc4
            struct {
Packit 4e8bc4
                uint64_t delta;
Packit 4e8bc4
                uint64_t initial;
Packit 4e8bc4
                uint32_t expiration;
Packit 4e8bc4
            } body;
Packit 4e8bc4
        } message;
Packit 4e8bc4
        uint8_t bytes[sizeof(protocol_binary_request_header) + 20];
Packit 4e8bc4
    } protocol_binary_request_incr;
Packit 4e8bc4
    typedef protocol_binary_request_incr protocol_binary_request_decr;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the response from an incr or decr command
Packit 4e8bc4
     * command.
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef union {
Packit 4e8bc4
        struct {
Packit 4e8bc4
            protocol_binary_response_header header;
Packit 4e8bc4
            struct {
Packit 4e8bc4
                uint64_t value;
Packit 4e8bc4
            } body;
Packit 4e8bc4
        } message;
Packit 4e8bc4
        uint8_t bytes[sizeof(protocol_binary_response_header) + 8];
Packit 4e8bc4
    } protocol_binary_response_incr;
Packit 4e8bc4
    typedef protocol_binary_response_incr protocol_binary_response_decr;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the quit
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef protocol_binary_request_no_extras protocol_binary_request_quit;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet returned by the quit command
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef protocol_binary_response_no_extras protocol_binary_response_quit;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet used by append and prepend command
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef protocol_binary_request_no_extras protocol_binary_request_append;
Packit 4e8bc4
    typedef protocol_binary_request_no_extras protocol_binary_request_prepend;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet returned from a successful append or prepend
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef protocol_binary_response_no_extras protocol_binary_response_append;
Packit 4e8bc4
    typedef protocol_binary_response_no_extras protocol_binary_response_prepend;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet used by the version command
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef protocol_binary_request_no_extras protocol_binary_request_version;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet returned from a successful version command
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef protocol_binary_response_no_extras protocol_binary_response_version;
Packit 4e8bc4
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet used by the stats command.
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef protocol_binary_request_no_extras protocol_binary_request_stats;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet returned from a successful stats command
Packit 4e8bc4
     * See section 4
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef protocol_binary_response_no_extras protocol_binary_response_stats;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet used by the touch command.
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef union {
Packit 4e8bc4
        struct {
Packit 4e8bc4
            protocol_binary_request_header header;
Packit 4e8bc4
            struct {
Packit 4e8bc4
                uint32_t expiration;
Packit 4e8bc4
            } body;
Packit 4e8bc4
        } message;
Packit 4e8bc4
        uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
Packit 4e8bc4
    } protocol_binary_request_touch;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet returned from the touch command
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef protocol_binary_response_no_extras protocol_binary_response_touch;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet used by the GAT(Q) command.
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef union {
Packit 4e8bc4
        struct {
Packit 4e8bc4
            protocol_binary_request_header header;
Packit 4e8bc4
            struct {
Packit 4e8bc4
                uint32_t expiration;
Packit 4e8bc4
            } body;
Packit 4e8bc4
        } message;
Packit 4e8bc4
        uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
Packit 4e8bc4
    } protocol_binary_request_gat;
Packit 4e8bc4
Packit 4e8bc4
    typedef protocol_binary_request_gat protocol_binary_request_gatq;
Packit 4e8bc4
    typedef protocol_binary_request_gat protocol_binary_request_gatk;
Packit 4e8bc4
    typedef protocol_binary_request_gat protocol_binary_request_gatkq;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of the packet returned from the GAT(Q)
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef protocol_binary_response_get protocol_binary_response_gat;
Packit 4e8bc4
    typedef protocol_binary_response_get protocol_binary_response_gatq;
Packit 4e8bc4
    typedef protocol_binary_response_get protocol_binary_response_gatk;
Packit 4e8bc4
    typedef protocol_binary_response_get protocol_binary_response_gatkq;
Packit 4e8bc4
Packit 4e8bc4
    /**
Packit 4e8bc4
     * Definition of a request for a range operation.
Packit 4e8bc4
     * See http://code.google.com/p/memcached/wiki/RangeOps
Packit 4e8bc4
     *
Packit 4e8bc4
     * These types are used for range operations and exist within
Packit 4e8bc4
     * this header for use in other projects.  Range operations are
Packit 4e8bc4
     * not expected to be implemented in the memcached server itself.
Packit 4e8bc4
     */
Packit 4e8bc4
    typedef union {
Packit 4e8bc4
        struct {
Packit 4e8bc4
            protocol_binary_response_header header;
Packit 4e8bc4
            struct {
Packit 4e8bc4
                uint16_t size;
Packit 4e8bc4
                uint8_t  reserved;
Packit 4e8bc4
                uint8_t  flags;
Packit 4e8bc4
                uint32_t max_results;
Packit 4e8bc4
            } body;
Packit 4e8bc4
        } message;
Packit 4e8bc4
        uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
Packit 4e8bc4
    } protocol_binary_request_rangeop;
Packit 4e8bc4
Packit 4e8bc4
    typedef protocol_binary_request_rangeop protocol_binary_request_rget;
Packit 4e8bc4
    typedef protocol_binary_request_rangeop protocol_binary_request_rset;
Packit 4e8bc4
    typedef protocol_binary_request_rangeop protocol_binary_request_rsetq;
Packit 4e8bc4
    typedef protocol_binary_request_rangeop protocol_binary_request_rappend;
Packit 4e8bc4
    typedef protocol_binary_request_rangeop protocol_binary_request_rappendq;
Packit 4e8bc4
    typedef protocol_binary_request_rangeop protocol_binary_request_rprepend;
Packit 4e8bc4
    typedef protocol_binary_request_rangeop protocol_binary_request_rprependq;
Packit 4e8bc4
    typedef protocol_binary_request_rangeop protocol_binary_request_rdelete;
Packit 4e8bc4
    typedef protocol_binary_request_rangeop protocol_binary_request_rdeleteq;
Packit 4e8bc4
    typedef protocol_binary_request_rangeop protocol_binary_request_rincr;
Packit 4e8bc4
    typedef protocol_binary_request_rangeop protocol_binary_request_rincrq;
Packit 4e8bc4
    typedef protocol_binary_request_rangeop protocol_binary_request_rdecr;
Packit 4e8bc4
    typedef protocol_binary_request_rangeop protocol_binary_request_rdecrq;
Packit 4e8bc4
Packit 4e8bc4
#ifdef __cplusplus
Packit 4e8bc4
}
Packit 4e8bc4
#endif
Packit 4e8bc4
#endif /* PROTOCOL_BINARY_H */