summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunzy <[email protected]>2024-08-27 11:02:31 +0800
committerJunzy <[email protected]>2024-08-27 11:02:31 +0800
commit4b7168f6bd18fac87b422e16d19efbb36fe30026 (patch)
treec722e64ac38b22e8cca586d056ef333d8c5b9c4c
parent919b90a2da9ff0188ef56805c757456d81b6f47c (diff)
update src and CMake: now make succ
-rw-r--r--CMakeLists.txt4
-rw-r--r--src/nat_format.cpp4
-rw-r--r--src/nat_format.h8
3 files changed, 10 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b6c5bb4..74ebebc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,8 +29,8 @@ else()
endif()
install(TARGETS ${lib_name} LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/plug/business/nat_format)
-install(FILES bin/${lib_name}.inf DESTINATION ${CMAKE_INSTALL_PREFIX}/plug/business/nat_format)
-install(FILES bin/${lib_name}.conf DESTINATION ${CMAKE_INSTALL_PREFIX}/conf)
+install(FILES bin/conf/${lib_name}.inf DESTINATION ${CMAKE_INSTALL_PREFIX}/plug/business/nat_format)
+install(FILES bin/conf/${lib_name}.conf DESTINATION ${CMAKE_INSTALL_PREFIX}/conf)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
include(Version)
diff --git a/src/nat_format.cpp b/src/nat_format.cpp
index 8593071..28d00ee 100644
--- a/src/nat_format.cpp
+++ b/src/nat_format.cpp
@@ -81,7 +81,7 @@ int nat_format_init(void) {
// 卸载函数
void nat_format_destroy(void) {
- free(nat_payload);
+ free(multicast_payload);
}
// 入口函数
@@ -104,7 +104,7 @@ char nat_format_entry(struct streaminfo *a_udp, void **pme, int thread_seq, void
// 提取udp流信息
char *udp_data = (char *)a_udp->pudpdetail->pdata;
- int32_t upd_data_len = a_udp->pudpdetail->datalen;
+ // int32_t upd_data_len = a_udp->pudpdetail->datalen;
unsigned short udp_port = a_udp->addr.tuple4_v4->source;
// 提取nat信息
diff --git a/src/nat_format.h b/src/nat_format.h
index da1519f..6452b99 100644
--- a/src/nat_format.h
+++ b/src/nat_format.h
@@ -16,9 +16,9 @@
struct nat_format_global_info {
u_int32_t batch_size;
char host_ip[64];
- u_int32_t host_port;
+ int32_t host_port;
char multicast_ip[64];
- u_int32_t multicast_port;
+ int32_t multicast_port;
int32_t hw_syslog_port;
int32_t hw_binary_port;
@@ -50,4 +50,8 @@ struct nat_payload {
char protocol = FORMAT_LOG_PROTOCOL_UDP;
};
+extern "C" int nat_format_init(void);
+extern "C" void nat_format_destroy(void);
+extern "C" char nat_format_entry(struct streaminfo *a_udp, void **pme, int thread_seq, void *a_packet);
+
#endif // NAT_FORMAT_H_