#ifndef __OSFP_SCORE_DB_H__ #define __OSFP_SCORE_DB_H__ #include "osfp.h" #include "osfp_fingerprint.h" struct osfp_os_class_score { unsigned int scores[OSFP_OS_CLASS_MAX]; }; struct osfp_field_score_db { unsigned int enabled; unsigned int type; unsigned int entry_count; void *data; void *(*create)(void); void (*destroy)(void *); int (*add)(void *data, struct osfp_os_class_score *, void *, unsigned int); struct osfp_os_class_score *(*match)(void *, void *, unsigned int); }; struct osfp_score_db { unsigned int entry_count; unsigned int perfect_score; unsigned int os_class_entry_count[OSFP_OS_CLASS_MAX]; struct osfp_field_score_db field_score_dbs[OSFP_FIELD_MAX]; }; char *osfp_score_db_read_file(char *fp_file); void osfp_score_db_debug_print(struct osfp_score_db *score_db); int osfp_score_db_load(struct osfp_score_db *score_db, char *fp_file); int osfp_score_db_score(struct osfp_score_db *score_db, unsigned int flags, struct osfp_fingerprint *fp, struct osfp_os_class_score *result_score); struct osfp_score_db *osfp_score_db_create(void); void osfp_score_db_destroy(struct osfp_score_db *score_db); #ifdef UNITTEST int test_osfp_score_db(void); #endif #endif