blob: 68971430e7c067461626e350dc1777e947d14ce0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
#ifndef NASTIPC_H
#define NASTIPC_H
#define NASTHOLE "/tmp/nastd.sock"
/* Protocol section */
/*
* Send NASTESC to start a new command. The next byte specifies the
* type of command.
*/
#define NASTCMD '\xff'
/*
* Commands, prefixed by NASTCMD.
*/
#define NASTADD '\x01'
#define NASTDEL '\x02'
#define NASTUPD '\x03'
#define NASTGET '\x04'
#define NASTDIE '\x0f'
/* Commands for server options. */
#define NASTOPTGET '\x10'
#define NASTOPTSET '\x11'
/* Command to get stats. */
#define NASTSTATS '\x20'
/* Server -> client responses. These can be postfixed with a string. */
#define NASTOK '\xf1'
#define NASTERR '\xf2'
#define NASTARG '\xe0'
/* The quote character, for globbing multiple strings together. */
#define NASTQUOTE '\xfe'
/*
* The escape character, to send binary that may be interpereted
* incorrectly.
*/
#define NASTESC '\xfd'
/* Item seperator, for returning multiple items in one response. */
#define NASTSEP '\xfc'
/*
* The options. Ass more get added to the protocol, just add them here.
* Do not dupe option numbers. That'd be bad.
* Use these after the NASTCMD NASTOPTGET sequence. All options require
* an argument. Most are true/false, but some will require other types.
* Check nastd.h for option types.
* (e.g.: NASTCMD NASTOPTGET OPTQCACHE OPTFALSE - don't use the query cache)
* (e.g.: NASTCMD NASTOPTGET OPTNTHREADS 0x10 - allocate 16 threads)
*/
#define OPTFALSE '\x00'
#define OPTTRUE '\x01'
#define OPTQCACHE '\x01'
#define OPTLOCALDB '\x02'
#define OPTFALLASYNC '\x03'
#define OPTALWAYSFALL '\x04'
#define OPTFAILONCE '\x05'
#define OPTNTHREADS '\x06'
#define OPTNOFALLTHROUGH '\x07'
#endif
|