blob: 828c6809a793b50d5473e6264ea9795289d8f7c5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
|