summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2024-08-21 12:02:56 +0800
committerluwenpeng <[email protected]>2024-08-21 18:18:13 +0800
commitb9d663780035d74dd2b4288d4702f3e7dde0d775 (patch)
tree5a5a6e5e7271398389861037cc76fc1d6c677c0f /include
parenta0fb57e84314ea019a0cf88dcbc430998e8b40c2 (diff)
refactor: move tcp_segment API from packet.h to stellar.h
Diffstat (limited to 'include')
-rw-r--r--include/stellar/packet.h4
-rw-r--r--include/stellar/stellar.h8
2 files changed, 6 insertions, 6 deletions
diff --git a/include/stellar/packet.h b/include/stellar/packet.h
index d3132df..bf3c54a 100644
--- a/include/stellar/packet.h
+++ b/include/stellar/packet.h
@@ -47,10 +47,6 @@ struct packet *packet_build_tcp(const struct packet *origin_pkt, uint32_t tcp_se
struct packet *packet_build_udp(const struct packet *origin_pkt, const char *udp_payload, uint16_t udp_payload_len);
struct packet *packet_build_l3(const struct packet *origin_pkt, uint8_t ip_proto, const char *l3_payload, uint16_t l3_payload_len);
-struct tcp_segment;
-const char *tcp_segment_get_data(const struct tcp_segment *seg);
-uint16_t tcp_segment_get_len(const struct tcp_segment *seg);
-
#ifdef __cplusplus
}
#endif
diff --git a/include/stellar/stellar.h b/include/stellar/stellar.h
index ed204dc..efd542f 100644
--- a/include/stellar/stellar.h
+++ b/include/stellar/stellar.h
@@ -32,10 +32,14 @@ int stellar_session_plugin_register(struct stellar *st,
void stellar_session_plugin_dettach_current_session(struct session *sess);
+// TOPIC_TCP_STREAM return msg need convert to (const struct tcp_segment *)
+struct tcp_segment;
+const char *tcp_segment_get_data(const struct tcp_segment *seg);
+uint16_t tcp_segment_get_len(const struct tcp_segment *seg);
-
+// TOPIC_UDP or TOPIC_TCP return msg need convert to (const struct packet *)
struct packet;
-typedef void plugin_on_packet_func(struct packet *pkt, unsigned char ip_protocol, void *plugin_env);
+typedef void plugin_on_packet_func(struct packet *pkt, unsigned char ip_protocol, void *plugin_env);
//return packet plugin_id
int stellar_packet_plugin_register(struct stellar *st, unsigned char ip_protocol, plugin_on_packet_func on_packet, void *plugin_env);