summaryrefslogtreecommitdiff
path: root/easytool/mifare_classic.h
blob: f04f32f498d742b9cdb310808a31cf8f35fa28a1 (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
#ifndef EASY_MFCL_H
#define EASY_MFCL_H

#include <stdint.h>

#define ABP_C1	0x04
#define ABP_C2	0x02
#define ABP_C3	0x01

struct acc_bits_parsed {
	uint8_t block[4];
};

void mfcl_parse_acc_bits(struct acc_bits_parsed *abp, uint8_t *acc_bits);

/* Mifare classic VALUE BLOCK */
struct mfcl_value_block {
	uint32_t value;		/* value in NTD */
	uint32_t value_inv;	/* bit-inverted copy of value in NTD */
	uint32_t value_backup;	/* backup copy of value in NTD */
	uint8_t addr[4];
} __attribute__ ((packed));

#endif
personal git repositories of Harald Welte. Your mileage may vary