This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
stellar-stellar/src/packet_io/packet_io_marsio.h

39 lines
1.2 KiB
C

#ifndef _PACKET_IO_MARSIO_H
#define _PACKET_IO_MARSIO_H
#ifdef __cpluscplus
extern "C"
{
#endif
#include "packet.h"
struct packet_io_marsio_options
{
char app_symbol[64];
char dev_symbol[64];
uint8_t nr_threads;
uint16_t cpu_mask[MAX_THREAD_NUM];
};
struct packet_io_marsio;
struct packet_io_marsio *packet_io_marsio_new(struct packet_io_marsio_options *opts);
void packet_io_marsio_free(struct packet_io_marsio *handle);
struct packet_io_stat *packet_io_marsio_get_stat(struct packet_io_marsio *handle);
// return 0: success
// return -1: failed
int packet_io_marsio_init(struct packet_io_marsio *handle, uint16_t thread_id);
// return number of packets received
int packet_io_marsio_ingress(struct packet_io_marsio *handle, uint16_t thread_id, struct packet *pkts, int nr_pkts);
void packet_io_marsio_egress(struct packet_io_marsio *handle, uint16_t thread_id, struct packet *pkts, int nr_pkts);
void packet_io_marsio_drop(struct packet_io_marsio *handle, uint16_t thread_id, struct packet *pkts, int nr_pkts);
void packet_io_marsio_inject(struct packet_io_marsio *handle, uint16_t thread_id, struct packet *pkts, int nr_pkts);
#ifdef __cpluscplus
}
#endif
#endif