
#define SCM_RIGHTS	0x01
#define SOL_SOCKET	1
#define SOMAXCONN	128
#define SOL_RAW	255

struct linger
{
  int l_onoff;
  int l_linger;
}
 ;
struct cmsghdr
{
  size_t cmsg_len;
  int cmsg_level;
  int cmsg_type;
}
 ;
struct iovec
{
  void *iov_base;
  size_t iov_len;
}
 ;

typedef unsigned short sa_family_t;
typedef unsigned int socklen_t;

struct sockaddr
{
  sa_family_t sa_family;
  char sa_data[14];
}
 ;
struct sockaddr_storage
{
  sa_family_t ss_family;
  __ss_aligntype __ss_align;
  char __ss_padding[(128 - (2 * sizeof (__ss_aligntype)))];
}
 ;

struct msghdr
{
  void *msg_name;
  int msg_namelen;
  struct iovec *msg_iov;
  size_t msg_iovlen;
  void *msg_control;
  size_t msg_controllen;
  unsigned int msg_flags;
}
 ;
#define AF_UNSPEC	0
#define AF_UNIX	1
#define AF_INET6	10
#define AF_INET	2

#define PF_INET	AF_INET
#define PF_INET6	AF_INET6
#define PF_UNIX	AF_UNIX
#define PF_UNSPEC	AF_UNSPEC

#define SOCK_STREAM	1
#define SOCK_PACKET	10
#define SOCK_DGRAM	2
#define SOCK_RAW	3
#define SOCK_RDM	4
#define SOCK_SEQPACKET	5

#define SO_DEBUG	1
#define SO_OOBINLINE	10
#define SO_NO_CHECK	11
#define SO_PRIORITY	12
#define SO_LINGER	13
#define SO_REUSEADDR	2
#define SO_TYPE	3
#define SO_ACCEPTCONN	30
#define SO_ERROR	4
#define SO_DONTROUTE	5
#define SO_BROADCAST	6
#define SO_SNDBUF	7
#define SO_RCVBUF	8
#define SO_KEEPALIVE	9

#define SIOCGIFCONF	0x8912
#define SIOCGIFFLAGS	0x8913
#define SIOCGIFADDR	0x8915
#define SIOCGIFNETMASK	0x891b

#define SHUT_RD	0
#define SHUT_WR	1
#define SHUT_RDWR	2
#define MSG_DONTROUTE	4

#define MSG_WAITALL	0x100
#define MSG_TRUNC	0x20
#define MSG_EOR	0x80
#define MSG_OOB	1
#define MSG_PEEK	2
#define MSG_CTRUNC	8
