diff options
| author | yangwei <[email protected]> | 2024-09-06 13:22:02 +0800 |
|---|---|---|
| committer | yangwei <[email protected]> | 2024-09-06 19:48:29 +0800 |
| commit | 442586ef52c5c6fb589651d9889e14cbfcdc1ba7 (patch) | |
| tree | 8246913ffabc62b06cd595b1cc7f395acc8cd86b /include | |
| parent | 9c12523c9d1e34705c59f76bc036017ab9993f73 (diff) | |
✨ feat(plugin register): remove ip_proto in parameter
Diffstat (limited to 'include')
| -rw-r--r-- | include/stellar/session.h | 10 | ||||
| -rw-r--r-- | include/stellar/stellar.h | 28 |
2 files changed, 23 insertions, 15 deletions
diff --git a/include/stellar/session.h b/include/stellar/session.h index e8cfbc1..a1aa684 100644 --- a/include/stellar/session.h +++ b/include/stellar/session.h @@ -9,6 +9,16 @@ extern "C" #include "stellar/packet.h" +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); + +#define TOPIC_TCP_STREAM "TCP_STREAM" //topic message: tcp_segment +#define TOPIC_CONTROL_PACKET "CONTROL_PACKET" //topic message: packet + +#define TOPIC_TCP "TCP" //topic message: session +#define TOPIC_UDP "UDP" //topic message: session + enum session_state { SESSION_STATE_INIT = 0, diff --git a/include/stellar/stellar.h b/include/stellar/stellar.h index 89420b3..e7a6409 100644 --- a/include/stellar/stellar.h +++ b/include/stellar/stellar.h @@ -9,34 +9,32 @@ extern "C" struct stellar; +/********************************************** + * PLUGIN SPEC API * + **********************************************/ + //return plugin_env typedef void *plugin_on_load_func(struct stellar *st); typedef void plugin_on_unload_func(void *plugin_env); -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); - -#define TOPIC_TCP_STREAM "TCP_STREAM" //topic message: tcp_segment -#define TOPIC_CONTROL_PACKET "CONTROL_PACKET" //topic message: packet - -#define TOPIC_TCP "TCP" //topic message: session -#define TOPIC_UDP "UDP" //topic message: session - - +/********************************************** + * PLUGIN EVENT API * + **********************************************/ 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, void *plugin_env); //return plugin_id -int stellar_plugin_register(struct stellar *st, unsigned char ip_protocol, plugin_on_packet_func on_packet_input, plugin_on_packet_func on_packet_output, void *plugin_env); - +int stellar_plugin_register(struct stellar *st, plugin_on_packet_func on_packet_input, plugin_on_packet_func on_packet_output, void *plugin_env); //return polling work result, 0: no work, 1: work typedef int plugin_on_polling_func(void *plugin_env); - //return polling plugin_id int stellar_polling_plugin_register(struct stellar *st, plugin_on_polling_func on_polling, void *plugin_env); +/********************************************** + * STELLAR DEV API * + **********************************************/ + void stellar_emit_datapath_telemetry(struct packet *pkt, const char * module, const char *str); int stellar_get_worker_thread_num(struct stellar *st); |
