🦄 refactor(register_node with module): last para from arg to module

This commit is contained in:
yangwei
2024-11-26 15:31:51 +08:00
parent 9895e93214
commit 1b55f09ba7
5 changed files with 57 additions and 49 deletions

View File

@@ -211,11 +211,11 @@ struct packet_manager;
struct packet_manager *module_to_packet_manager(struct module *mod);
int packet_manager_new_packet_exdata_index(struct packet_manager *pkt_mgr, const char *name, exdata_free *func, void *arg);
typedef void on_packet_callback(struct packet *pkt, void *arg);
typedef void on_packet_callback(struct packet *pkt, struct module *mod);
int packet_manager_register_node(struct packet_manager *pkt_mgr, const char *name, enum packet_stage stage,
uint64_t interested_tag_key_bits,
uint64_t interested_tag_val_bits,
on_packet_callback *cb, void *arg);
on_packet_callback *cb, struct module *mod);
// if two modules claim the same packet at the same stage, the second 'claim' fails.
// return 0 on success
// return -1 on failure

View File

@@ -146,8 +146,8 @@ int session_manager_new_session_exdata_index(struct session_manager *sess_mgr, c
struct session *session_manager_lookup_session_by_packet(struct session_manager *sess_mgr, uint16_t thread_id, const struct packet *pkt);
struct session *session_manager_lookup_session_by_id(struct session_manager *sess_mgr, uint16_t thread_id, uint64_t sess_id);
void session_manager_on_packet_forward(struct packet *pkt, void *args);
void session_manager_on_packet_output(struct packet *pkt, void *args);
void session_manager_on_packet_forward(struct packet *pkt, struct module *mod);
void session_manager_on_packet_output(struct packet *pkt, struct module *mod);
struct module *session_manager_on_init(struct module_manager *mod_mgr);
void session_manager_on_exit(struct module_manager *mod_mgr, struct module *mod);