You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. LICENSE
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. /*
  15. Package:
  16. MiFare Classic Universal toolKit (MFCUK)
  17. Package version:
  18. 0.1
  19. Filename:
  20. mfcuk_finger.h
  21. Description:
  22. MFCUK fingerprinting and specific data-decoding functionality.
  23. License:
  24. GPL2, Copyright (C) 2009, Andrei Costin
  25. * @file mfcuk_finger.h
  26. * @brief MFCUK fingerprinting and specific data-decoding functionality.
  27. */
  28. #ifndef _MFCUK_FINGER_H_
  29. #define _MFCUK_FINGER_H_
  30. #include <stdio.h>
  31. #include <stdlib.h>
  32. #include <string.h>
  33. #include "mfcuk_mifare.h"
  34. // Wrapping an ugly template into an externally pleasant name. To implement proper template later.
  35. typedef struct _mfcuk_finger_template_ {
  36. mifare_classic_tag mask;
  37. mifare_classic_tag values;
  38. } mfcuk_finger_template;
  39. // Function type definition, to be used for custom decoders/comparators
  40. typedef int (*mfcuk_finger_comparator)(mifare_classic_tag *dump, mfcuk_finger_template *tmpl, float *score);
  41. typedef int (*mfcuk_finger_decoder)(mifare_classic_tag *dump);
  42. // Naive implementation of a self-contained fingerprint database entry
  43. typedef struct _mfcuk_finger_tmpl_entry_ {
  44. const char *tmpl_filename;
  45. const char *tmpl_name;
  46. mfcuk_finger_comparator tmpl_comparison_func;
  47. mfcuk_finger_decoder tmpl_decoder_func;
  48. mfcuk_finger_template *tmpl_data;
  49. } mfcuk_finger_tmpl_entry;
  50. int mfcuk_finger_default_comparator(mifare_classic_tag *dump, mfcuk_finger_template *tmpl, float *score);
  51. int mfcuk_finger_default_decoder(mifare_classic_tag *dump);
  52. int mfcuk_finger_skgt_decoder(mifare_classic_tag *dump);
  53. // "Housekeeping" functions
  54. int mfcuk_finger_load(void);
  55. int mfcuk_finger_unload(void);
  56. #endif