diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2018-02-14 11:12:45 +0100 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2018-02-14 11:14:30 +0100 |
commit | 10fcd3a946a270fc6d111252b2de08dcd625a2b8 (patch) | |
tree | 32f874025493ee14563a02dc9c767b3f9e3739b8 /options.h | |
download | nkotp-10fcd3a946a270fc6d111252b2de08dcd625a2b8.tar.gz nkotp-10fcd3a946a270fc6d111252b2de08dcd625a2b8.tar.bz2 |
Diffstat (limited to 'options.h')
-rw-r--r-- | options.h | 44 |
1 files changed, 44 insertions, 0 deletions
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 <robin.krahl@ireas.org> + * + * SPDX-License-Identifier: MIT + */ + +#ifndef NKOTP_OPTIONS_H +#define NKOTP_OPTIONS_H + +#include <stddef.h> + +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 |