summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzhuzhenjun <[email protected]>2023-10-12 10:30:55 +0800
committerzhuzhenjun <[email protected]>2023-10-12 14:48:10 +0800
commit7e1849233b8640e6139143c99423bf71cca0b6b2 (patch)
treeff19da0dd415c7b947154e938c5c3e86b80b3ffe /src
parentb7ee7242443f011c4188f94a750e4db3338473f7 (diff)
compile: migrate to cmake
ci: migrate to MESA ci template
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am23
-rw-r--r--src/osfp.h1
-rw-r--r--src/osfp_common.c2
-rw-r--r--src/osfp_common.h4
-rw-r--r--src/osfp_fingerprint.c2
-rw-r--r--src/osfp_fingerprint.h2
-rw-r--r--src/osfp_score_db.c3
-rw-r--r--src/osfp_score_db.h2
-rw-r--r--src/version.map4
9 files changed, 7 insertions, 36 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index 3590668..0000000
--- a/src/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-lib_LTLIBRARIES = libosfp.la
-
-libosfp_la_SOURCES = \
- utarray.h \
- uthash.h \
- utlist.h \
- utringbuffer.h \
- utstack.h \
- utstring.h \
- cJSON.h \
- cJSON.c \
- osfp_common.h \
- osfp_common.c \
- osfp.h \
- osfp.c \
- osfp_fingerprint.h \
- osfp_fingerprint.c \
- osfp_log.h \
- osfp_log.c \
- osfp_score_db.h \
- osfp_score_db.c
-
-pkginclude_HEADERS = osfp.h osfp_fingerprint.h osfp_score_db.h osfp_common.h
diff --git a/src/osfp.h b/src/osfp.h
index 1367815..bf01738 100644
--- a/src/osfp.h
+++ b/src/osfp.h
@@ -13,7 +13,6 @@ extern "C"
{
#endif
-enum osfp_os_class_id;
struct osfp_result_detail;
struct osfp_result;
struct osfp_db;
diff --git a/src/osfp_common.c b/src/osfp_common.c
index fa80b34..53139fa 100644
--- a/src/osfp_common.c
+++ b/src/osfp_common.c
@@ -4,7 +4,7 @@
unsigned int osfp_profile_enable;
-const char *os_class_name[OSFP_OS_CLASS_MAX] = {
+const char *osfp_os_class_name[OSFP_OS_CLASS_MAX] = {
OSFP_OS_CLASS_NAME_UNKNOWN,
OSFP_OS_CLASS_NAME_WINDOWS,
OSFP_OS_CLASS_NAME_LINUX,
diff --git a/src/osfp_common.h b/src/osfp_common.h
index 3b25ba1..4e75873 100644
--- a/src/osfp_common.h
+++ b/src/osfp_common.h
@@ -197,10 +197,10 @@ struct osfp_db {
enum osfp_os_class_id osfp_os_class_name_to_id(char *name);
-extern const char *os_class_name[OSFP_OS_CLASS_MAX];
+extern const char *osfp_os_class_name[OSFP_OS_CLASS_MAX];
static inline const char *osfp_os_class_id_to_name(enum osfp_os_class_id os_class)
{
- return os_class_name[os_class];
+ return osfp_os_class_name[os_class];
}
#endif
diff --git a/src/osfp_fingerprint.c b/src/osfp_fingerprint.c
index 6d4cc01..cc8a64b 100644
--- a/src/osfp_fingerprint.c
+++ b/src/osfp_fingerprint.c
@@ -464,7 +464,6 @@ exit:
return -1;
}
-#ifdef UNITTEST
int test_osfp_fingerprinting_ipv4(void)
{
int ret;
@@ -583,4 +582,3 @@ int test_osfp_fingerprinting_tcp_option(void)
exit:
return ret;
}
-#endif
diff --git a/src/osfp_fingerprint.h b/src/osfp_fingerprint.h
index 0584329..00806ae 100644
--- a/src/osfp_fingerprint.h
+++ b/src/osfp_fingerprint.h
@@ -69,9 +69,7 @@ int osfp_fingerprint_from_json(struct osfp_fingerprint *fp, char *json_str);
int osfp_fingerprint_to_json_buf(struct osfp_fingerprint *fp, char *strbuf, unsigned int buf_len, unsigned int format);
int osfp_fingerprinting(unsigned char *iph, unsigned char *tcph, unsigned int tcph_len, struct osfp_fingerprint *fp, unsigned int ip_version);
-#ifdef UNITTEST
int test_osfp_fingerprinting_ipv4(void);
int test_osfp_fingerprinting_ipv6(void);
int test_osfp_fingerprinting_tcp_option(void);
#endif
-#endif
diff --git a/src/osfp_score_db.c b/src/osfp_score_db.c
index 76b0ba6..5e88e21 100644
--- a/src/osfp_score_db.c
+++ b/src/osfp_score_db.c
@@ -547,7 +547,6 @@ void osfp_score_db_destroy(struct osfp_score_db *score_db)
}
}
-#ifdef UNITTEST
int test_osfp_score_db(void)
{
int ret, i;
@@ -618,5 +617,3 @@ int test_osfp_score_db(void)
exit:
return -1;
}
-
-#endif
diff --git a/src/osfp_score_db.h b/src/osfp_score_db.h
index 8e4439f..3ee9a84 100644
--- a/src/osfp_score_db.h
+++ b/src/osfp_score_db.h
@@ -38,8 +38,6 @@ int osfp_score_db_score(struct osfp_score_db *score_db, unsigned int flags, stru
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
diff --git a/src/version.map b/src/version.map
new file mode 100644
index 0000000..317c75d
--- /dev/null
+++ b/src/version.map
@@ -0,0 +1,4 @@
+{
+ global: osfp*;GIT_VERSION_*;
+ local: *;
+};