#ifndef LIBSLIRP_H #define LIBSLIRP_H #include #include #include #ifdef _WIN32 #include #include #else #include #include #endif #ifdef __cplusplus extern "C" { #endif typedef struct Slirp Slirp; enum { SLIRP_POLL_IN = 1 << 0, SLIRP_POLL_OUT = 1 << 1, SLIRP_POLL_PRI = 1 << 2, SLIRP_POLL_ERR = 1 << 3, SLIRP_POLL_HUP = 1 << 4, }; typedef ssize_t (*SlirpReadCb)(void *buf, size_t len, void *opaque); typedef ssize_t (*SlirpWriteCb)(const void *buf, size_t len, void *opaque); typedef void (*SlirpTimerCb)(void *opaque); typedef int (*SlirpAddPollCb)(int fd, int events, void *opaque); typedef int (*SlirpGetREventsCb)(int idx, void *opaque); /* * Callbacks from slirp */ typedef struct SlirpCb { /* * Send an ethernet frame to the guest network. The opaque * parameter is the one given to slirp_init(). The function * doesn't need to send all the data and may return