1/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2
3/*
4    Memcached protocol extensions for testapp.
5
6    Provides extended protocol commands to enable interesting testcases.
7
8    1. Currently supports shifting Memcached's timeofday.
9*/
10
11#ifndef TESTAPP_EXTENSION_H
12#define TESTAPP_EXTENSION_H
13
14#include <memcached/protocol_binary.h>
15
16/** The default command id for the adjust timeofday operation (override with t=) */
17#define PROTOCOL_BINARY_CMD_ADJUST_TIMEOFDAY (uint8_t)(0xE3 & 0xff)
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23    /**
24     * Definition of the packet used by adjust timeofday
25     */
26    typedef union {
27        struct {
28            protocol_binary_request_header header;
29            struct {
30                uint64_t offset;
31            } body;
32        } message;
33        uint8_t bytes[sizeof(protocol_binary_request_header) + 8];
34    } protocol_binary_adjust_time;
35
36    /**
37     * Definition of the packet returned by adjust_timeofday
38     */
39    typedef protocol_binary_response_no_extras protocol_binary_adjust_time_response;
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif
46