summaryrefslogtreecommitdiff
path: root/src/osfp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/osfp.h')
-rw-r--r--src/osfp.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/osfp.h b/src/osfp.h
index bf01738..225f27c 100644
--- a/src/osfp.h
+++ b/src/osfp.h
@@ -33,6 +33,18 @@ struct osfp_db *osfp_db_new(const char *db_json_path);
void osfp_db_free(struct osfp_db *db);
/**
+ * @brief 通过 IP 头部和 TCP 头部识别操作系统。
+ *
+ * @param db 操作系统指纹库。
+ * @param l3_hdr 指向 IP 头部的指针。
+ * @param l4_hdr 指向 TCP 头部的指针。
+ * @param l4_hdr_len TCP 头部的长度(注意:包含TCP选项部分)。
+ * @param ip_version IP头版本号,4 或 6)。
+ * @return 指向操作系统识别结果的指针。
+ */
+struct osfp_result *osfp_ip_identify(struct osfp_db *db, unsigned char *l3_hdr, unsigned char *l4_hdr, unsigned int l4_hdr_len, unsigned int ip_version);
+
+/**
* @brief 通过 IPv4 头部和 TCP 头部识别操作系统。
*
* @param db 操作系统指纹库。
@@ -55,15 +67,6 @@ struct osfp_result *osfp_ipv4_identify(struct osfp_db *db, struct iphdr* l3_hdr,
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 格式的指纹识别操作系统。
- *
- * @param db 操作系统指纹库。
- * @param json_str 指纹字符串。
- * @return 指向操作系统识别结果的指针(注意:内存需要使用者释放)。
- */
-struct osfp_result *osfp_json_identify(struct osfp_db *db, const char *json_str);
-
-/**
* @brief 获取操作系统识别结果的操作系统名称。
*
* @param result 操作系统识别结果。