Clean up file header copyrights
[onak.git] / keyd.h
1 /*
2  * keyd.h - Public API for keyd.
3  *
4  * Copyright 2004,2011 Jonathan McDowell <noodles@earth.li>
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the Free
8  * Software Foundation; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along with
16  * this program; if not, write to the Free Software Foundation, Inc., 51
17  * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef __KEYD_H__
21 #define __KEYD_H__
22
23 #include <stdint.h>
24
25 #define KEYD_SOCKET "keyd.sock"
26
27 enum keyd_ops {
28         KEYD_CMD_UNKNOWN = 0,
29         KEYD_CMD_VERSION = 1,
30         KEYD_CMD_GET,
31         KEYD_CMD_STORE,
32         KEYD_CMD_DELETE,
33         KEYD_CMD_GETTEXT,
34         KEYD_CMD_GETFULLKEYID,
35         KEYD_CMD_KEYITER,
36         KEYD_CMD_CLOSE,
37         KEYD_CMD_QUIT,
38         KEYD_CMD_STATS,
39         KEYD_CMD_GETSKSHASH,
40         KEYD_CMD_LAST                   /* Placeholder */
41 };
42
43 enum keyd_reply {
44         KEYD_REPLY_OK = 0,
45         KEYD_REPLY_UNKNOWN_CMD = 1
46 };
47
48 static uint32_t keyd_version = 3;
49
50 struct keyd_stats {
51         time_t started;
52         uint32_t connects;
53         uint32_t command_stats[KEYD_CMD_LAST];
54 };
55
56 #endif /* __KEYD_H__ */