#pragma once

#ifdef __cplusplus
extern "C"
{
#endif

#include "packet_io.h"

void *marsio_io_new(const struct packet_io_config *cfg);
void marsio_io_free(void *handle);
int marsio_io_isbreak(void *handle);

int marsio_io_init(void *handle, uint16_t thr_idx);
uint16_t marsio_io_input(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
void marsio_io_output(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
void marsio_io_drop(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
uint16_t marsio_io_inject(void *handle, uint16_t thr_idx, struct packet *pkts, uint16_t nr_pkts);
void marsio_io_yield(void *handle, uint16_t thr_idx);
struct packet_io_stat *marsio_io_stat(void *handle, uint16_t thr_idx);

#ifdef __cplusplus
}
#endif
