X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/7a0ffbb5910bd782ef569b63ce665659e3564e72..b7a8b5277d37b289361ff0cc881632f527e4d5db:/keyd.h?ds=sidebyside diff --git a/keyd.h b/keyd.h index ce19d8d..91959c8 100644 --- a/keyd.h +++ b/keyd.h @@ -1,9 +1,21 @@ -/* - * keyd.h - Public API for keyd. +/** + * @file keyd.h + * @brief Public API for keyd. * - * Jonathan McDowell + * Copyright 2004,2011 Jonathan McDowell * - * Copyright 2004 Project Purple + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __KEYD_H__ @@ -11,8 +23,14 @@ #include +/** + * @brief The name of the keyd Unix domain socket + */ #define KEYD_SOCKET "keyd.sock" +/** + * @brief keyd commands + */ enum keyd_ops { KEYD_CMD_UNKNOWN = 0, KEYD_CMD_VERSION = 1, @@ -25,19 +43,32 @@ enum keyd_ops { KEYD_CMD_CLOSE, KEYD_CMD_QUIT, KEYD_CMD_STATS, + KEYD_CMD_GETSKSHASH, KEYD_CMD_LAST /* Placeholder */ }; +/** + * @brief Reply codes for keyd commands + */ enum keyd_reply { KEYD_REPLY_OK = 0, KEYD_REPLY_UNKNOWN_CMD = 1 }; -static uint32_t keyd_version = 2; +/** + * @brief Version of the keyd protocol currently supported + */ +static const uint32_t keyd_version = 3; +/** + * @brief Response structure for the @a KEYD_CMD_STATS response + */ struct keyd_stats { + /** Unix time of when the keyd daemon was started */ time_t started; + /** Number of connects we've seen to keyd */ uint32_t connects; + /** Count of the number of times each command has been used */ uint32_t command_stats[KEYD_CMD_LAST]; };