]> git.zerfleddert.de Git - proxmark3-svn/blame - client/emv/emvjson.h
fix 'hf iclass sim':
[proxmark3-svn] / client / emv / emvjson.h
CommitLineData
95b697f0
OM
1//-----------------------------------------------------------------------------
2// Copyright (C) 2018 Merlok
3//
4// This code is licensed to you under the terms of the GNU GPL, version 2 or,
5// at your option, any later version. See the LICENSE.txt file for the text of
6// the license.
7//-----------------------------------------------------------------------------
8// EMV json logic
9//-----------------------------------------------------------------------------
10#ifndef EMVJSON_H__
11#define EMVJSON_H__
12
13#include <jansson.h>
14#include "tlv.h"
15
16typedef struct {
17 tlv_tag_t Tag;
18 char *Name;
19} ApplicationDataElm;
20
21extern char* GetApplicationDataName(tlv_tag_t tag);
22
39cc1c87 23extern int JsonSaveJsonObject(json_t *root, char *path, json_t *value);
95b697f0 24extern int JsonSaveStr(json_t *root, char *path, char *value);
39cc1c87
OM
25extern int JsonSaveInt(json_t *root, char *path, int value);
26extern int JsonSaveBufAsHexCompact(json_t *elm, char *path, uint8_t *data, size_t datalen);
95b697f0
OM
27extern int JsonSaveBufAsHex(json_t *elm, char *path, uint8_t *data, size_t datalen);
28extern int JsonSaveHex(json_t *elm, char *path, uint64_t data, int datalen);
29
30extern int JsonSaveTLVValue(json_t *root, char *path, struct tlvdb *tlvdbelm);
31extern int JsonSaveTLVElm(json_t *elm, char *path, struct tlv *tlvelm, bool saveName, bool saveValue, bool saveAppDataLink);
32extern int JsonSaveTLVTreeElm(json_t *elm, char *path, struct tlvdb *tlvdbelm, bool saveName, bool saveValue, bool saveAppDataLink);
33
34extern int JsonSaveTLVTree(json_t *root, json_t *elm, char *path, struct tlvdb *tlvdbelm);
35
6b882a39 36extern int JsonLoadStr(json_t *root, char *path, char *value);
39cc1c87
OM
37extern int JsonLoadBufAsHex(json_t *elm, char *path, uint8_t *data, size_t maxbufferlen, size_t *datalen);
38
95b697f0
OM
39extern bool ParamLoadFromJson(struct tlvdb *tlv);
40
41#endif
Impressum, Datenschutz