From 10fcd3a946a270fc6d111252b2de08dcd625a2b8 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Wed, 14 Feb 2018 11:12:45 +0100 Subject: Initial commit with support for OTP generation --- options.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 options.h (limited to 'options.h') diff --git a/options.h b/options.h new file mode 100644 index 0000000..828c680 --- /dev/null +++ b/options.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2018 Robin Krahl + * + * SPDX-License-Identifier: MIT + */ + +#ifndef NKOTP_OPTIONS_H +#define NKOTP_OPTIONS_H + +#include + +enum mode { + MODE_NONE, + MODE_GENERATE +}; + +enum algorithm { + ALGORITHM_DEFAULT, + ALGORITHM_HOTP, + ALGORITHM_TOTP +}; + +enum model { + MODEL_DEFAULT, + MODEL_AUTO, + MODEL_PRO, + MODEL_STORAGE +}; + +struct options { + enum algorithm alg; + char *cfg_file; + char model; + int slot; + enum mode mode; +}; + +static const size_t MAX_SLOT_HOTP = 3; +static const size_t MAX_SLOT_TOTP = 15; + +int parse_options(int argc, char **argv, struct options *options); +void free_options(struct options *options); + +#endif -- cgit v1.2.1