move stellar/packet_manager.h into stellar/packet.h
This commit is contained in:
@@ -16,6 +16,9 @@ extern "C"
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/mpls.h>
|
||||
|
||||
#include "stellar/exdata.h"
|
||||
#include "stellar/module_manager.h"
|
||||
|
||||
struct packet;
|
||||
/******************************************************************************
|
||||
* layer
|
||||
@@ -188,6 +191,34 @@ uint16_t packet_get_payload_len(const struct packet *pkt);
|
||||
void packet_set_exdata(struct packet *pkt, int idx, void *ex_ptr);
|
||||
void *packet_get_exdata(struct packet *pkt, int idx);
|
||||
|
||||
/******************************************************************************
|
||||
* packet manager
|
||||
******************************************************************************/
|
||||
|
||||
enum packet_stage
|
||||
{
|
||||
PACKET_STAGE_PREROUTING,
|
||||
PACKET_STAGE_INPUT,
|
||||
PACKET_STAGE_FORWARD,
|
||||
PACKET_STAGE_OUTPUT,
|
||||
PACKET_STAGE_POSTROUTING,
|
||||
PACKET_STAGE_MAX,
|
||||
};
|
||||
|
||||
struct packet_manager;
|
||||
struct packet_manager *stellar_module_get_packet_manager(struct stellar_module_manager *mod_mgr);
|
||||
int packet_manager_new_packet_exdata_index(struct packet_manager *pkt_mgr, const char *name, exdata_free *func, void *arg);
|
||||
|
||||
typedef void on_packet_stage_callback(struct packet *pkt, enum packet_stage stage, void *arg);
|
||||
int packet_manager_subscribe(struct packet_manager *pkt_mgr, enum packet_stage stage, on_packet_stage_callback *cb, void *arg);
|
||||
|
||||
// if two modules claim the same packet at the same stage, the second 'claim' fails.
|
||||
// return 0 on success
|
||||
// return -1 on failure
|
||||
typedef void on_packet_claimed_callback(struct packet *pkt, void *arg);
|
||||
int packet_manager_claim_packet(struct packet_manager *pkt_mgr, uint16_t thread_id, struct packet *pkt, on_packet_claimed_callback cb, void *arg);
|
||||
void packet_manager_schedule_packet(struct packet_manager *pkt_mgr, uint16_t thread_id, struct packet *pkt, enum packet_stage stage);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user