socket.h revision 15e9551616edacb30fe180f55fdb97c1a0f6aacb
/*
* Copyright (c) 1995 Danny Gasparovski.
*
* Please read the file COPYRIGHT for the
* terms and conditions of the copyright.
*/
/* MINE */
#ifndef _SLIRP_SOCKET_H_
#define _SLIRP_SOCKET_H_
#ifdef VBOX_WITH_SLIRP_MT
#include <iprt/semaphore.h>
#endif
#define SO_EXPIRE 240000
#define SO_EXPIREFAST 10000
/*
* Our socket structure
*/
struct socket
{
#if !defined(RT_OS_WINDOWS)
int s; /* The actual socket */
#else
union {
int s;
};
#endif
/* XXX union these with not-yet-used sbuf params */
* for non-blocking connect()'s, and
* PING reply's */
* so_mconn, for non-blocking connections */
int so_urgc;
int so_state; /* internal state flags SS_*, below */
int so_queued; /* Number of packets queued from this socket */
int so_nqueued; /* Number of packets queued in a row
* Used to determine when to "downgrade" a session
* from fastq to batchq */
#ifdef VBOX_WITH_SLIRP_MT
#endif
};
#ifdef VBOX_WITH_SLIRP_MT
# define SOCKET_LOCK(so) \
do { \
AssertReleaseRC(rc); \
} while (0)
# define SOCKET_UNLOCK(so) \
do { \
AssertReleaseRC(rc); \
} while (0)
# define SOCKET_LOCK_CREATE(so) \
do { \
AssertReleaseRC(rc); \
} while (0)
# define SOCKET_LOCK_DESTROY(so) \
do { \
AssertReleaseRC(rc); \
} while (0)
#else
# define SOCKET_LOCK(so) do {} while (0)
# define SOCKET_UNLOCK(so) do {} while (0)
# define SOCKET_LOCK_CREATE(so) do {} while (0)
# define SOCKET_LOCK_DESTROY(so) do {} while (0)
#endif
/*
* Socket state bits. (peer means the host on the Internet,
* local host means the host on the other end of the modem)
*/
/* #define SS_ISFDISCONNECTED 0x020*/ /* Socket has disconnected from peer, in 2MSL state */
/* #define SS_CTL 0x080 */
#if defined(DECLARE_IOVEC) && !defined(HAVE_READV)
struct iovec
{
char *iov_base;
};
#endif
#endif /* _SOCKET_H_ */