libslirp.h revision 59fb438c3c215322ce57691167171fc1e5ef59b1
#ifndef _LIBSLIRP_H
#define _LIBSLIRP_H
#ifdef RT_OS_WINDOWS
# include <winsock2.h>
# ifdef __cplusplus
extern "C" {
# endif
# ifdef __cplusplus
}
# endif
#else
# ifdef RT_OS_OS2 /* temporary workaround, see ticket #127 */
# endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
void slirp_term(PNATState);
void slirp_link_up(PNATState);
void slirp_link_down(PNATState);
/* you must provide the following functions: */
int slirp_can_output(void * pvUser);
int guest_port);
#if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)
/**
* This event is for
* - slirp_input
* - slirp_link_up
* - slirp_link_down
* - wakeup
*
* The event index should be smaller than VBOX_SOCKET_EVENT_INDEX to ensure
* that we can detect if that event was set (WSAWaitForMultipleEvents()
* returns the index of the first active event).
*/
#define VBOX_WAKEUP_EVENT_INDEX 0
/*
*/
#define VBOX_SOCKET_EVENT_INDEX 1
#ifdef VBOX_WITH_SLIRP_ICMP
/*
* ICMP handle state change
*/
#define VBOX_ICMP_EVENT_INDEX 2
/*
* The number of events for WSAWaitForMultipleEvents().
*/
#define VBOX_EVENT_COUNT 3
#else
/*
* The number of events for WSAWaitForMultipleEvents().
*/
#define VBOX_EVENT_COUNT 2
#endif
#endif
/*
* Return the timeout.
*/
#ifdef __cplusplus
}
#endif
#endif