This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhuzhenjun-libosfp/src/MESA_osfp.h

93 lines
2.8 KiB
C
Raw Normal View History

2023-09-27 11:45:26 +08:00
#ifndef __OSFP_H__
#define __OSFP_H__
#include <stddef.h>
2023-10-10 17:14:34 +08:00
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip6.h>
#include <netinet/tcp.h>
2023-09-27 11:45:26 +08:00
#include <linux/if_ether.h>
2023-10-10 17:14:34 +08:00
#ifdef __cplusplus
extern "C"
{
#endif
2023-09-27 11:45:26 +08:00
2023-10-10 17:14:34 +08:00
struct osfp_result_detail;
struct osfp_result;
struct osfp_db;
2023-09-27 11:45:26 +08:00
2023-10-09 15:23:31 +08:00
/**
* @brief
*
* @param db_json_path JSON
* @return
*/
2023-10-12 15:05:58 +08:00
struct osfp_db *MESA_osfp_db_new(const char *db_json_path);
2023-10-09 15:23:31 +08:00
/**
* @brief
*
* @param db
*/
2023-10-12 15:05:58 +08:00
void MESA_osfp_db_free(struct osfp_db *db);
2023-09-27 11:45:26 +08:00
2023-10-09 15:23:31 +08:00
/**
* @brief IPv4 TCP
*
* @param db
* @param l3_hdr IPv4
* @param l4_hdr TCP
* @param l4_hdr_len TCP TCP选项部分
* @return
*/
2023-10-12 15:05:58 +08:00
struct osfp_result *MESA_osfp_ipv4_identify(struct osfp_db *db, struct iphdr* l3_hdr, struct tcphdr *l4_hdr, size_t l4_hdr_len);
2023-10-09 15:23:31 +08:00
/**
* @brief IPv6 TCP
*
* @param db
* @param l3_hdr IPv6
* @param l4_hdr TCP
* @param l4_hdr_len TCP TCP选项部分
* @return 使
*/
2023-10-12 15:05:58 +08:00
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);
2023-09-27 11:45:26 +08:00
2023-10-09 15:23:31 +08:00
/**
* @brief json
*
* @param db
* @param json_str
* @return 使
*/
2023-10-12 15:05:58 +08:00
struct osfp_result *MESA_osfp_json_identify(struct osfp_db *db, const char *json_str);
2023-10-09 15:23:31 +08:00
/**
* @brief
*
* @param result
* @return osfp_result_free释放
*/
2023-10-12 15:05:58 +08:00
const char *MESA_osfp_result_os_name_get(struct osfp_result *result);
2023-10-09 15:23:31 +08:00
/**
* @brief
*
* @param result
* @return 使
*/
2023-10-12 15:05:58 +08:00
char *MESA_osfp_result_score_detail_export(struct osfp_result *result);
2023-10-09 15:23:31 +08:00
/**
* @brief
*
* @param result
*/
2023-10-12 15:05:58 +08:00
void MESA_osfp_result_free(struct osfp_result *result);
2023-09-27 11:45:26 +08:00
2023-10-10 17:14:34 +08:00
#ifdef __cplusplus
}
#endif
2023-09-27 11:45:26 +08:00
#endif