rename packet_private.h to packet_internal.h

This commit is contained in:
luwenpeng
2024-09-19 16:10:59 +08:00
parent d9c3ac2448
commit bf8ba97165
38 changed files with 41 additions and 44 deletions

View File

@@ -10,7 +10,7 @@
#include "ip_reassembly.h" #include "ip_reassembly.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "packet_helper.h" #include "packet_helper.h"
#include "packet_private.h" #include "packet_internal.h"
#define IP_REASSEMBLE_DEBUG(format, ...) STELLAR_LOG_DEBUG(__thread_local_logger, "ip_reassembly", format, ##__VA_ARGS__) #define IP_REASSEMBLE_DEBUG(format, ...) STELLAR_LOG_DEBUG(__thread_local_logger, "ip_reassembly", format, ##__VA_ARGS__)
#define IP_REASSEMBLE_ERROR(format, ...) STELLAR_LOG_ERROR(__thread_local_logger, "ip_reassembly", format, ##__VA_ARGS__) #define IP_REASSEMBLE_ERROR(format, ...) STELLAR_LOG_ERROR(__thread_local_logger, "ip_reassembly", format, ##__VA_ARGS__)

View File

@@ -9,7 +9,7 @@ extern "C"
#include "packet_helper.h" #include "packet_helper.h"
#include "ip_reassembly.h" #include "ip_reassembly.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_dump.h" #include "packet_dump.h"
#include "packet_parser.h" #include "packet_parser.h"

View File

@@ -8,7 +8,7 @@
#include "marsio_io.h" #include "marsio_io.h"
#include "log_private.h" #include "log_private.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "packet_private.h" #include "packet_internal.h"
#define MARSIO_IO_LOG_ERROR(format, ...) STELLAR_LOG_ERROR(__thread_local_logger, "marsio", format, ##__VA_ARGS__) #define MARSIO_IO_LOG_ERROR(format, ...) STELLAR_LOG_ERROR(__thread_local_logger, "marsio", format, ##__VA_ARGS__)

View File

@@ -15,7 +15,7 @@
#include "pcap_io.h" #include "pcap_io.h"
#include "packet_dump.h" #include "packet_dump.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "packet_private.h" #include "packet_internal.h"
#define PCAP_IO_LOG_FATAL(format, ...) STELLAR_LOG_FATAL(__thread_local_logger, "pcap io", format, ##__VA_ARGS__) #define PCAP_IO_LOG_FATAL(format, ...) STELLAR_LOG_FATAL(__thread_local_logger, "pcap io", format, ##__VA_ARGS__)
#define PCAP_IO_LOG_ERROR(format, ...) STELLAR_LOG_ERROR(__thread_local_logger, "pcap io", format, ##__VA_ARGS__) #define PCAP_IO_LOG_ERROR(format, ...) STELLAR_LOG_ERROR(__thread_local_logger, "pcap io", format, ##__VA_ARGS__)

View File

@@ -4,7 +4,7 @@
#include "log_private.h" #include "log_private.h"
#include "packet_helper.h" #include "packet_helper.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "packet_private.h" #include "packet_internal.h"
#define PACKET_CRAFT_LOG_DEBUG(format, ...) STELLAR_LOG_DEBUG(__thread_local_logger, "packet craft", format, ##__VA_ARGS__) #define PACKET_CRAFT_LOG_DEBUG(format, ...) STELLAR_LOG_DEBUG(__thread_local_logger, "packet craft", format, ##__VA_ARGS__)
#define PACKET_CRAFT_LOG_ERROR(format, ...) STELLAR_LOG_ERROR(__thread_local_logger, "packet craft", format, ##__VA_ARGS__) #define PACKET_CRAFT_LOG_ERROR(format, ...) STELLAR_LOG_ERROR(__thread_local_logger, "packet craft", format, ##__VA_ARGS__)

View File

@@ -9,7 +9,7 @@
#include "packet_dump.h" #include "packet_dump.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "packet_helper.h" #include "packet_helper.h"
#include "packet_private.h" #include "packet_internal.h"
#define PACKET_DUMP_LOG_ERROR(format, ...) STELLAR_LOG_ERROR(__thread_local_logger, "packet dump", format, ##__VA_ARGS__) #define PACKET_DUMP_LOG_ERROR(format, ...) STELLAR_LOG_ERROR(__thread_local_logger, "packet dump", format, ##__VA_ARGS__)

View File

@@ -1,6 +1,6 @@
#include "dablooms.h" #include "dablooms.h"
#include "packet_filter.h" #include "packet_filter.h"
#include "packet_private.h" #include "packet_internal.h"
struct packet_key struct packet_key
{ {

View File

@@ -2,7 +2,7 @@
#include "utils.h" #include "utils.h"
#include "stellar/mq.h" #include "stellar/mq.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_manager_private.h" #include "packet_manager_private.h"
#define PACKET_MANAGER_LOG_ERROR(format, ...) STELLAR_LOG_ERROR(__thread_local_logger, "packet manager", format, ##__VA_ARGS__) #define PACKET_MANAGER_LOG_ERROR(format, ...) STELLAR_LOG_ERROR(__thread_local_logger, "packet manager", format, ##__VA_ARGS__)

View File

@@ -6,7 +6,7 @@
#include "log_private.h" #include "log_private.h"
#include "packet_helper.h" #include "packet_helper.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#define PACKET_PARSE_LOG_DEBUG(format, ...) // STELLAR_LOG_DEBUG(__thread_local_logger, "packet parse", format, ##__VA_ARGS__) #define PACKET_PARSE_LOG_DEBUG(format, ...) // STELLAR_LOG_DEBUG(__thread_local_logger, "packet parse", format, ##__VA_ARGS__)

View File

@@ -4,7 +4,7 @@
#include "uthash.h" #include "uthash.h"
#include "log_private.h" #include "log_private.h"
#include "packet_helper.h" #include "packet_helper.h"
#include "packet_private.h" #include "packet_internal.h"
#define PACKET_LOG_ERROR(format, ...) STELLAR_LOG_ERROR(__thread_local_logger, "packet", format, ##__VA_ARGS__) #define PACKET_LOG_ERROR(format, ...) STELLAR_LOG_ERROR(__thread_local_logger, "packet", format, ##__VA_ARGS__)

View File

@@ -3,7 +3,7 @@
#include "checksum.h" #include "checksum.h"
#include "packet_helper.h" #include "packet_helper.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_dump.h" #include "packet_dump.h"
#include "packet_parser.h" #include "packet_parser.h"

View File

@@ -1,7 +1,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tuple.h" #include "tuple.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "packet_filter.h" #include "packet_filter.h"

View File

@@ -1,6 +1,6 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
/****************************************************************************** /******************************************************************************

View File

@@ -1,7 +1,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "packet_dump.h" #include "packet_dump.h"

View File

@@ -2,7 +2,7 @@
#include "stellar/mq.h" #include "stellar/mq.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_manager_private.h" #include "packet_manager_private.h"
/****************************************************************************** /******************************************************************************

View File

@@ -2,7 +2,7 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include "tuple.h" #include "tuple.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "packet_dump.h" #include "packet_dump.h"

View File

@@ -1,7 +1,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "packet_helper.h" #include "packet_helper.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "packet_dump.h" #include "packet_dump.h"

View File

@@ -10,7 +10,7 @@ extern "C"
#include "tuple.h" #include "tuple.h"
#include "uthash.h" #include "uthash.h"
#include "timeout.h" #include "timeout.h"
#include "packet_private.h" #include "packet_internal.h"
#include "stellar/session.h" #include "stellar/session.h"
#include "tcp_reassembly.h" #include "tcp_reassembly.h"

View File

@@ -1,7 +1,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tuple.h" #include "tuple.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "session_private.h" #include "session_private.h"
#include "default_config.h" #include "default_config.h"

View File

@@ -1,6 +1,6 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "session_private.h" #include "session_private.h"
#include "default_config.h" #include "default_config.h"

View File

@@ -1,7 +1,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "utils.h" #include "utils.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "session_private.h" #include "session_private.h"
#include "default_config.h" #include "default_config.h"

View File

@@ -1,7 +1,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "utils.h" #include "utils.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "session_private.h" #include "session_private.h"
#include "default_config.h" #include "default_config.h"

View File

@@ -1,7 +1,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "session_private.h" #include "session_private.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "default_config.h" #include "default_config.h"
#include "test_packets.h" #include "test_packets.h"

View File

@@ -1,6 +1,6 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "session_private.h" #include "session_private.h"
#include "default_config.h" #include "default_config.h"

View File

@@ -2,7 +2,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tuple.h" #include "tuple.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "session_private.h" #include "session_private.h"
#include "default_config.h" #include "default_config.h"

View File

@@ -2,7 +2,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tuple.h" #include "tuple.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "session_private.h" #include "session_private.h"
#include "default_config.h" #include "default_config.h"

View File

@@ -2,7 +2,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tuple.h" #include "tuple.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "session_private.h" #include "session_private.h"
#include "default_config.h" #include "default_config.h"

View File

@@ -2,7 +2,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tuple.h" #include "tuple.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "session_private.h" #include "session_private.h"
#include "default_config.h" #include "default_config.h"

View File

@@ -2,7 +2,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tuple.h" #include "tuple.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "session_private.h" #include "session_private.h"
#include "default_config.h" #include "default_config.h"

View File

@@ -2,7 +2,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tuple.h" #include "tuple.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "session_private.h" #include "session_private.h"
#include "default_config.h" #include "default_config.h"

View File

@@ -2,7 +2,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tuple.h" #include "tuple.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "session_private.h" #include "session_private.h"
#include "default_config.h" #include "default_config.h"

View File

@@ -1,7 +1,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tuple.h" #include "tuple.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "session_private.h" #include "session_private.h"
#include "default_config.h" #include "default_config.h"

View File

@@ -1,7 +1,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tuple.h" #include "tuple.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "session_private.h" #include "session_private.h"
#include "default_config.h" #include "default_config.h"

View File

@@ -1,7 +1,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tuple.h" #include "tuple.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "session_private.h" #include "session_private.h"
#include "default_config.h" #include "default_config.h"

View File

@@ -1,7 +1,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tuple.h" #include "tuple.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "session_private.h" #include "session_private.h"
#include "default_config.h" #include "default_config.h"

View File

@@ -15,12 +15,10 @@
#include "packet_io.h" #include "packet_io.h"
#include "log_private.h" #include "log_private.h"
#include "stellar_stat.h" #include "stellar_stat.h"
#include "packet_private.h" #include "packet_internal.h"
#include "session_private.h" #include "session_private.h"
#include "session_manager.h" #include "session_manager.h"
#define CORE_LOG_FATAL(format, ...) STELLAR_LOG_FATAL(__thread_local_logger, "core", format, ##__VA_ARGS__) #define CORE_LOG_FATAL(format, ...) STELLAR_LOG_FATAL(__thread_local_logger, "core", format, ##__VA_ARGS__)
#define CORE_LOG_ERROR(format, ...) STELLAR_LOG_ERROR(__thread_local_logger, "core", format, ##__VA_ARGS__) #define CORE_LOG_ERROR(format, ...) STELLAR_LOG_ERROR(__thread_local_logger, "core", format, ##__VA_ARGS__)
#define CORE_LOG_DEBUG(format, ...) STELLAR_LOG_DEBUG(__thread_local_logger, "core", format, ##__VA_ARGS__) #define CORE_LOG_DEBUG(format, ...) STELLAR_LOG_DEBUG(__thread_local_logger, "core", format, ##__VA_ARGS__)
@@ -113,7 +111,7 @@ static inline void clean_session(struct session_manager *sess_mgr, uint64_t now_
for (uint64_t j = 0; j < nr_sess_cleaned; j++) for (uint64_t j = 0; j < nr_sess_cleaned; j++)
{ {
sess = cleaned_sess[j]; sess = cleaned_sess[j];
//session_exdata_runtime_free(session_get_user_data(sess)); // session_exdata_runtime_free(session_get_user_data(sess));
session_manager_free_session(sess_mgr, sess); session_manager_free_session(sess_mgr, sess);
} }
} }
@@ -212,8 +210,8 @@ static void *worker_thread(void *arg)
{ {
goto fast_path; goto fast_path;
} }
//struct exdata_runtime *per_sess_exdata=session_exdata_runtime_new(st); // struct exdata_runtime *per_sess_exdata=session_exdata_runtime_new(st);
//session_set_user_data(sess, per_sess_exdata); // session_set_user_data(sess, per_sess_exdata);
} }
else else
{ {
@@ -452,7 +450,7 @@ struct stellar *stellar_new(const char *stellar_cfg_file, const char *plugin_cfg
CORE_LOG_ERROR("unable to create stellar stat"); CORE_LOG_ERROR("unable to create stellar stat");
goto error_out; goto error_out;
} }
runtime->mq_schema=mq_schema_new(); runtime->mq_schema = mq_schema_new();
runtime->mod_mgr = stellar_module_manager_new(plugin_cfg_file, config->pkt_io_cfg->nr_worker_thread, runtime->mq_schema); runtime->mod_mgr = stellar_module_manager_new(plugin_cfg_file, config->pkt_io_cfg->nr_worker_thread, runtime->mq_schema);
if (runtime->mod_mgr == NULL) if (runtime->mod_mgr == NULL)
{ {
@@ -570,7 +568,6 @@ void stellar_reload_log_level(struct stellar *st)
* Stellar Utility Function * Stellar Utility Function
******************************************************************************/ ******************************************************************************/
// only send user build packet, can't send packet which come from network // only send user build packet, can't send packet which come from network
void stellar_send_build_packet(struct stellar *st, struct packet *pkt) void stellar_send_build_packet(struct stellar *st, struct packet *pkt)
{ {

View File

@@ -2,7 +2,7 @@
#include <pcap/pcap.h> #include <pcap/pcap.h>
#include "packet_helper.h" #include "packet_helper.h"
#include "packet_private.h" #include "packet_internal.h"
#include "packet_parser.h" #include "packet_parser.h"
#include "packet_dump.h" #include "packet_dump.h"