summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzhuzhenjun <[email protected]>2023-10-13 14:08:55 +0800
committerzhuzhenjun <[email protected]>2023-10-13 14:08:55 +0800
commite62ff39d812c972f2631c36124c81647da5511a0 (patch)
treecee4b40d2cae85c76cbd385cc08d9446103f12bc /src
parentcfaf003d4f32aa55d522e3f09dbd28aa020714a0 (diff)
api: MESA_osfp_xx -> osfp_xxv1.3.0
header: MESA_osfp.h -> osfp.h
Diffstat (limited to 'src')
-rw-r--r--src/osfp.c (renamed from src/MESA_osfp.c)20
-rw-r--r--src/osfp.h (renamed from src/MESA_osfp.h)16
-rw-r--r--src/osfp_common.c2
-rw-r--r--src/osfp_common.h2
-rw-r--r--src/osfp_fingerprint.c2
-rw-r--r--src/osfp_score_db.c2
-rw-r--r--src/osfp_score_db.h1
-rw-r--r--src/version.map2
8 files changed, 25 insertions, 22 deletions
diff --git a/src/MESA_osfp.c b/src/osfp.c
index f88cff8..e822436 100644
--- a/src/MESA_osfp.c
+++ b/src/osfp.c
@@ -1,6 +1,6 @@
#include "osfp_common.h"
-#include "MESA_osfp.h"
+#include "osfp.h"
#include "osfp_fingerprint.h"
#include "osfp_score_db.h"
#include "osfp_log.h"
@@ -70,7 +70,7 @@ exit:
return NULL;
}
-const char *MESA_osfp_result_os_name_get(struct osfp_result *result)
+const char *osfp_result_os_name_get(struct osfp_result *result)
{
enum osfp_os_class_id os_class;
@@ -86,7 +86,7 @@ const char *MESA_osfp_result_os_name_get(struct osfp_result *result)
return osfp_os_class_id_to_name(os_class);
}
-char *MESA_osfp_result_score_detail_export(struct osfp_result *result)
+char *osfp_result_score_detail_export(struct osfp_result *result)
{
int i;
char *result_str = NULL;
@@ -150,7 +150,7 @@ exit:
return result_str;
}
-void MESA_osfp_result_free(struct osfp_result *result)
+void osfp_result_free(struct osfp_result *result)
{
if (result) {
if (result->json_str) {
@@ -160,7 +160,7 @@ void MESA_osfp_result_free(struct osfp_result *result)
}
}
-struct osfp_result *MESA_osfp_ipv4_identify(struct osfp_db *db, struct iphdr* l3_hdr, struct tcphdr *l4_hdr, size_t l4_hdr_len)
+struct osfp_result *osfp_ipv4_identify(struct osfp_db *db, struct iphdr* l3_hdr, struct tcphdr *l4_hdr, size_t l4_hdr_len)
{
int ret = OSFP_EINVAL;
struct osfp_fingerprint fp;
@@ -203,7 +203,7 @@ exit:
return NULL;
}
-struct osfp_result *MESA_osfp_ipv6_identify(struct osfp_db *db, struct ip6_hdr* l3_hdr, struct tcphdr *l4_hdr, size_t l4_hdr_len)
+struct osfp_result *osfp_ipv6_identify(struct osfp_db *db, struct ip6_hdr* l3_hdr, struct tcphdr *l4_hdr, size_t l4_hdr_len)
{
int ret = OSFP_EINVAL;
struct osfp_fingerprint fp;
@@ -234,7 +234,7 @@ exit:
return NULL;
}
-struct osfp_result *MESA_osfp_json_identify(struct osfp_db *db, const char *json_str)
+struct osfp_result *osfp_json_identify(struct osfp_db *db, const char *json_str)
{
int ret = OSFP_EINVAL;
struct osfp_fingerprint fp;
@@ -265,7 +265,7 @@ exit:
return NULL;
}
-struct osfp_db *MESA_osfp_db_new(const char *db_json_file)
+struct osfp_db *osfp_db_new(const char *db_json_file)
{
int ret;
struct osfp_db *db;
@@ -299,12 +299,12 @@ struct osfp_db *MESA_osfp_db_new(const char *db_json_file)
return db;
exit:
if (db) {
- MESA_osfp_db_free(db);
+ osfp_db_free(db);
}
return NULL;
}
-void MESA_osfp_db_free(struct osfp_db *db)
+void osfp_db_free(struct osfp_db *db)
{
if (db) {
if (db->db_json_path) {
diff --git a/src/MESA_osfp.h b/src/osfp.h
index af62d8f..bf01738 100644
--- a/src/MESA_osfp.h
+++ b/src/osfp.h
@@ -23,14 +23,14 @@ struct osfp_db;
* @param db_json_path 操作系统指纹库 JSON 文件的路径。
* @return 指向新创建的操作系统指纹库的指针。
*/
-struct osfp_db *MESA_osfp_db_new(const char *db_json_path);
+struct osfp_db *osfp_db_new(const char *db_json_path);
/**
* @brief 释放操作系统指纹库占用的内存。
*
* @param db 指向要释放的操作系统指纹库的指针。
*/
-void MESA_osfp_db_free(struct osfp_db *db);
+void osfp_db_free(struct osfp_db *db);
/**
* @brief 通过 IPv4 头部和 TCP 头部识别操作系统。
@@ -41,7 +41,7 @@ void MESA_osfp_db_free(struct osfp_db *db);
* @param l4_hdr_len TCP 头部的长度(注意:包含TCP选项部分)。
* @return 指向操作系统识别结果的指针。
*/
-struct osfp_result *MESA_osfp_ipv4_identify(struct osfp_db *db, struct iphdr* l3_hdr, struct tcphdr *l4_hdr, size_t l4_hdr_len);
+struct osfp_result *osfp_ipv4_identify(struct osfp_db *db, struct iphdr* l3_hdr, struct tcphdr *l4_hdr, size_t l4_hdr_len);
/**
* @brief 通过 IPv6 头部和 TCP 头部识别操作系统。
@@ -52,7 +52,7 @@ struct osfp_result *MESA_osfp_ipv4_identify(struct osfp_db *db, struct iphdr* l3
* @param l4_hdr_len TCP 头部的长度(注意:包含TCP选项部分)。
* @return 指向操作系统识别结果的指针(注意:内存需要使用者释放)。
*/
-struct osfp_result *MESA_osfp_ipv6_identify(struct osfp_db *db, struct ip6_hdr* l3_hdr, struct tcphdr *l4_hdr, size_t l4_hdr_len);
+struct osfp_result *osfp_ipv6_identify(struct osfp_db *db, struct ip6_hdr* l3_hdr, struct tcphdr *l4_hdr, size_t l4_hdr_len);
/**
* @brief 通过 json 格式的指纹识别操作系统。
@@ -61,7 +61,7 @@ struct osfp_result *MESA_osfp_ipv6_identify(struct osfp_db *db, struct ip6_hdr*
* @param json_str 指纹字符串。
* @return 指向操作系统识别结果的指针(注意:内存需要使用者释放)。
*/
-struct osfp_result *MESA_osfp_json_identify(struct osfp_db *db, const char *json_str);
+struct osfp_result *osfp_json_identify(struct osfp_db *db, const char *json_str);
/**
* @brief 获取操作系统识别结果的操作系统名称。
@@ -69,7 +69,7 @@ struct osfp_result *MESA_osfp_json_identify(struct osfp_db *db, const char *json
* @param result 操作系统识别结果。
* @return 指向操作系统名称的常量字符指针(注意:这块内存将由osfp_result_free释放)。
*/
-const char *MESA_osfp_result_os_name_get(struct osfp_result *result);
+const char *osfp_result_os_name_get(struct osfp_result *result);
/**
* @brief 导出操作系统识别结果的得分详情。
@@ -77,14 +77,14 @@ const char *MESA_osfp_result_os_name_get(struct osfp_result *result);
* @param result 操作系统识别结果。
* @return 指向得分详情字符串的指针(注意:内存需要使用者释放)。
*/
-char *MESA_osfp_result_score_detail_export(struct osfp_result *result);
+char *osfp_result_score_detail_export(struct osfp_result *result);
/**
* @brief 释放操作系统识别结果占用的内存。
*
* @param result 操作系统识别结果。
*/
-void MESA_osfp_result_free(struct osfp_result *result);
+void osfp_result_free(struct osfp_result *result);
#ifdef __cplusplus
}
diff --git a/src/osfp_common.c b/src/osfp_common.c
index 968b07d..bf7680e 100644
--- a/src/osfp_common.c
+++ b/src/osfp_common.c
@@ -1,6 +1,6 @@
#include "osfp_common.h"
-#include "MESA_osfp.h"
+#include "osfp.h"
unsigned int osfp_profile_enable;
diff --git a/src/osfp_common.h b/src/osfp_common.h
index 1cc686b..810e7bc 100644
--- a/src/osfp_common.h
+++ b/src/osfp_common.h
@@ -21,6 +21,8 @@
#include "cJSON.h"
+#include "osfp.h"
+
static inline unsigned long long osfp_rdtsc(void)
{
union {
diff --git a/src/osfp_fingerprint.c b/src/osfp_fingerprint.c
index 52b180b..cc8a64b 100644
--- a/src/osfp_fingerprint.c
+++ b/src/osfp_fingerprint.c
@@ -1,6 +1,6 @@
#include "osfp_common.h"
-#include "MESA_osfp.h"
+#include "osfp.h"
#include "osfp_fingerprint.h"
#include "osfp_log.h"
diff --git a/src/osfp_score_db.c b/src/osfp_score_db.c
index bf6cd87..5e88e21 100644
--- a/src/osfp_score_db.c
+++ b/src/osfp_score_db.c
@@ -1,6 +1,6 @@
#include "osfp_common.h"
-#include "MESA_osfp.h"
+#include "osfp.h"
#include "osfp_fingerprint.h"
#include "osfp_score_db.h"
#include "osfp_log.h"
diff --git a/src/osfp_score_db.h b/src/osfp_score_db.h
index 4e38cc9..3ee9a84 100644
--- a/src/osfp_score_db.h
+++ b/src/osfp_score_db.h
@@ -1,6 +1,7 @@
#ifndef __OSFP_SCORE_DB_H__
#define __OSFP_SCORE_DB_H__
+#include "osfp.h"
#include "osfp_fingerprint.h"
#include "osfp_common.h"
diff --git a/src/version.map b/src/version.map
index 50bf794..317c75d 100644
--- a/src/version.map
+++ b/src/version.map
@@ -1,4 +1,4 @@
{
- global: MESA_osfp*;GIT_VERSION_*;
+ global: osfp*;GIT_VERSION_*;
local: *;
};