* 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.
+ * this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <errno.h>
#include <sys/socket.h>
#include <sys/un.h>
+#include "build-config.h"
+
#include "keyd.h"
#include "onak-conf.h"
-#include "version.h"
-
-/* HACK: We need to stop onak-conf.o requiring this. */
-void *DBFUNCS = NULL;
static int keyd_fd = -1;
static int verbose = 0;
sock.sun_family = AF_UNIX;
snprintf(sock.sun_path, sizeof(sock.sun_path) - 1, "%s/%s",
- config.db_dir,
+ config.sock_dir,
KEYD_SOCKET);
if (connect(keyd_fd, (struct sockaddr *) &sock, sizeof(sock)) < 0) {
if (verbose >= 0) {
uint32_t reply;
struct keyd_stats stats;
- keyd_do_command(KEYD_CMD_VERSION, &reply, sizeof(reply));
+ if (keyd_do_command(KEYD_CMD_VERSION, &reply, sizeof(reply)) == -1) {
+ printf("Got failure asking for keyd version.\n");
+ return;
+ }
printf("Using keyd protocol version %d.\n", reply);
- keyd_do_command(KEYD_CMD_STATS, &stats, sizeof(stats));
+ if (keyd_do_command(KEYD_CMD_STATS, &stats, sizeof(stats)) == -1) {
+ printf("Got failure asking for keyd statistics.\n");
+ return;
+ }
+
printf("keyd running since %s", ctime(&stats.started));
printf("%d client connections received\n", stats.connects);
stats.command_stats[KEYD_CMD_GET_ID]);
printf(" Get key by FP: %d\n",
stats.command_stats[KEYD_CMD_GET_FP]);
+ printf(" Get key by hash: %d\n",
+ stats.command_stats[KEYD_CMD_GET_SKSHASH]);
printf(" Store key: %d\n",
stats.command_stats[KEYD_CMD_STORE]);
printf(" Delete key: %d\n",
stats.command_stats[KEYD_CMD_DELETE]);
+ printf(" Update key: %d\n",
+ stats.command_stats[KEYD_CMD_UPDATE]);
printf(" Search key: %d\n",
stats.command_stats[KEYD_CMD_GET_TEXT]);
printf(" Get full keyid: %d\n",