🦄 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