" (if FILE is -, send to stdout)\n"
"-iFILE read configuration from FILE.\n"
" (if FILE is -, read from stdin)\n"
-"-fformat set the data format for -s and -i (and for standard write to console\n"
-" valid values are json or legacy.\n"
+"-fformat set the data format for -s and -i valid values are ycfg or legacy.\n"
"-aXXX.. The AES secret key as a 32 (or 40 for OATH-HOTP/HMAC CHAL-RESP)\n"
" char hex value (not modhex)\n"
"-cXXX.. A 12 char hex value (not modhex) to use as access code for programming\n"
*outfname = optarg;
break;
case 'f':
- if(strcmp(optarg, "json") == 0) {
- *data_format = YKP_FORMAT_JSON;
+ if(strcmp(optarg, "ycfg") == 0) {
+ *data_format = YKP_FORMAT_YCFG;
} else if(strcmp(optarg, "legacy") == 0) {
*data_format = YKP_FORMAT_LEGACY;
} else {
- fprintf(stderr, "The only valid formats to -f is json and legacy.\n");
+ fprintf(stderr, "The only valid formats to -f is ycfg and legacy.\n");
*exit_code = 1;
return 0;
}
int ykp_export_config(const YKP_CONFIG *cfg, char *buf, size_t len,
int format) {
- if(format == YKP_FORMAT_JSON) {
+ if(format == YKP_FORMAT_YCFG) {
return ykp_json_export_cfg(cfg, buf, len);
} else if(format == YKP_FORMAT_LEGACY) {
return ykp_legacy_export_config(cfg, buf, len);
int ykp_import_config(const char *buf, size_t len, YKP_CONFIG *cfg,
int format) {
- if(format == YKP_FORMAT_JSON) {
+ if(format == YKP_FORMAT_YCFG) {
return ykp_json_import_cfg(buf, len, cfg);
} else if(format == YKP_FORMAT_LEGACY) {
ykp_errno = YKP_ENOTYETIMPL;
int ykp_import_config(const char *buf, size_t len, YKP_CONFIG *cfg, int format);
#define YKP_FORMAT_LEGACY 0x01
-#define YKP_FORMAT_JSON 0x02
+#define YKP_FORMAT_YCFG 0x02
extern int * _ykp_errno_location(void);
#define ykp_errno (*_ykp_errno_location())