summaryrefslogtreecommitdiff
path: root/example/osfp_example.c
diff options
context:
space:
mode:
authorzhuzhenjun <[email protected]>2023-10-12 15:05:58 +0800
committerzhuzhenjun <[email protected]>2023-10-12 15:36:31 +0800
commit8b8627b0d8e06cb2d1073b2e86741dad8c39d4f6 (patch)
treee41e8a5e70bc0d043f34b2a1651e026a15d54b4f /example/osfp_example.c
parent7e1849233b8640e6139143c99423bf71cca0b6b2 (diff)
symbol: set public symbols prefixv1.1.0rel-1.1
Diffstat (limited to 'example/osfp_example.c')
-rw-r--r--example/osfp_example.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/example/osfp_example.c b/example/osfp_example.c
index 2a53ac6..709ba4f 100644
--- a/example/osfp_example.c
+++ b/example/osfp_example.c
@@ -10,7 +10,7 @@
#include <pcap.h>
#include "osfp_common.h"
-#include "osfp.h"
+#include "MESA_osfp.h"
#include "osfp_log.h"
#include "osfp_fingerprint.h"
#include "osfp_score_db.h"
@@ -450,9 +450,9 @@ void example_detect(struct osfp_db *osfp_db, Packet *p)
osfp_profile_get_cycle(c1);
if (iph) {
- result = osfp_ipv4_identify(osfp_db, iph, tcph, tcph_len);
+ result = MESA_osfp_ipv4_identify(osfp_db, iph, tcph, tcph_len);
} else if (ip6h) {
- result = osfp_ipv6_identify(osfp_db, ip6h, tcph, tcph_len);
+ result = MESA_osfp_ipv6_identify(osfp_db, ip6h, tcph, tcph_len);
} else {
goto exit;
}
@@ -469,19 +469,19 @@ void example_detect(struct osfp_db *osfp_db, Packet *p)
result_os_count[result->likely_os_class]++;
- char *json = osfp_result_score_detail_export(result);
+ char *json = MESA_osfp_result_score_detail_export(result);
if (1) {
printf("Example ipv4 header detect: --------------------------\n");
printf("Connection info: %s:%d -> %s:%d\n", p->srcip, p->sp, p->dstip, p->dp);
- printf("Most likely os class: %s\n", osfp_result_os_name_get(result));
+ printf("Most likely os class: %s\n", MESA_osfp_result_os_name_get(result));
printf("Details:\n");
printf("%s\n", json);
}
exit:
if (result) {
- osfp_result_free(result);
+ MESA_osfp_result_free(result);
}
return;
}
@@ -670,7 +670,7 @@ int main(int argc, char *argv[])
osfp_profile_set(1);
- struct osfp_db *osfp_db = osfp_db_new(fp_file_path);
+ struct osfp_db *osfp_db = MESA_osfp_db_new(fp_file_path);
if (osfp_db == NULL) {
printf("could not create osfp context. fingerprints file: %s\n", fp_file_path);
exit(1);
@@ -686,7 +686,7 @@ int main(int argc, char *argv[])
}
// destroy osfp db
- osfp_db_free(osfp_db);
+ MESA_osfp_db_free(osfp_db);
return 0;
}