2001-03-06 05:29:24 +08:00
|
|
|
/* asm/socket.h
|
|
|
|
|
|
|
|
This file is part of Cygwin.
|
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
2000-02-18 03:38:33 +08:00
|
|
|
#ifndef _ASM_SOCKET_H
|
|
|
|
#define _ASM_SOCKET_H
|
|
|
|
|
|
|
|
#include <cygwin/if.h>
|
|
|
|
|
|
|
|
#define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */
|
|
|
|
#define IOC_VOID 0x20000000 /* no parameters */
|
|
|
|
#define IOC_OUT 0x40000000 /* copy out parameters */
|
|
|
|
#define IOC_IN 0x80000000 /* copy in parameters */
|
|
|
|
|
|
|
|
#define _IO(x,y) (IOC_VOID|(x<<8)|y)
|
|
|
|
#define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
|
|
|
|
#define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
|
|
|
|
|
2016-03-24 21:03:40 +08:00
|
|
|
#define SIOCATMARK _IOR('s', 7, long) /* at oob mark? */
|
|
|
|
#define FIONREAD _IOR('f', 127, long) /* get # bytes to read */
|
2018-02-23 20:33:23 +08:00
|
|
|
#define SIOCINQ FIONREAD
|
2016-03-24 22:32:33 +08:00
|
|
|
/* Compatible with termios.h */
|
|
|
|
#define FIONBIO 0x8004667e /* set/clear non-blocking i/o */
|
2016-03-24 21:03:40 +08:00
|
|
|
#define FIOASYNC _IOW('f', 125, long) /* set/clear async i/o */
|
|
|
|
#define SIOCSHIWAT _IOW('s', 0, long) /* set high watermark */
|
|
|
|
#define SIOCGHIWAT _IOR('s', 1, long) /* get high watermark */
|
|
|
|
#define SIOCSLOWAT _IOW('s', 2, long) /* set low watermark */
|
|
|
|
#define SIOCGLOWAT _IOR('s', 3, long) /* get low watermark */
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
/* Needed for if queries */
|
2001-02-08 06:50:50 +08:00
|
|
|
#define SIOCGIFCONF _IOW('s', 100, struct ifconf) /* get if list */
|
|
|
|
#define SIOCGIFFLAGS _IOW('s', 101, struct ifreq) /* Get if flags */
|
|
|
|
#define SIOCGIFADDR _IOW('s', 102, struct ifreq) /* Get if addr */
|
2000-02-18 03:38:33 +08:00
|
|
|
#define SIOCGIFBRDADDR _IOW('s', 103, struct ifreq) /* Get if broadcastaddr */
|
|
|
|
#define SIOCGIFNETMASK _IOW('s', 104, struct ifreq) /* Get if netmask */
|
2001-02-08 06:50:50 +08:00
|
|
|
#define SIOCGIFHWADDR _IOW('s', 105, struct ifreq) /* Get hw addr */
|
|
|
|
#define SIOCGIFMETRIC _IOW('s', 106, struct ifreq) /* get metric */
|
|
|
|
#define SIOCGIFMTU _IOW('s', 107, struct ifreq) /* get MTU size */
|
2007-01-16 20:01:36 +08:00
|
|
|
#define SIOCGIFINDEX _IOW('s', 108, struct ifreq) /* get if index */
|
2007-01-17 21:43:47 +08:00
|
|
|
#define SIOGIFINDEX SIOCGIFINDEX /* backward compatibility w/ Linux typo. */
|
2007-01-22 06:54:05 +08:00
|
|
|
#define SIOCGIFFRNDLYNAM _IOW('s', 109, struct ifreq) /* get friendly if name */
|
2007-06-15 00:02:32 +08:00
|
|
|
#define SIOCGIFDSTADDR _IOW('s', 110, struct ifreq) /* Get if dstaddr */
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
#define SOL_SOCKET 0xffff /* options for socket level */
|
|
|
|
|
|
|
|
#define SO_DEBUG 0x0001 /* turn on debugging info recording */
|
|
|
|
#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
|
|
|
|
#define SO_REUSEADDR 0x0004 /* allow local address reuse */
|
|
|
|
#define SO_KEEPALIVE 0x0008 /* keep connections alive */
|
|
|
|
#define SO_DONTROUTE 0x0010 /* just use interface addresses */
|
|
|
|
#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
|
|
|
|
#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
|
|
|
|
#define SO_LINGER 0x0080 /* linger on close if data present */
|
|
|
|
#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
|
2016-03-24 21:03:40 +08:00
|
|
|
#define SO_DONTLINGER (unsigned int)(~SO_LINGER)
|
2005-02-24 01:39:46 +08:00
|
|
|
#define SO_PEERCRED 0x0200 /* same as getpeereid */
|
2018-02-24 04:00:17 +08:00
|
|
|
#define SO_PASSCRED 0x0400 /* enable receiving of credentials */
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2000-10-28 13:41:44 +08:00
|
|
|
/*
|
|
|
|
* Additional options.
|
|
|
|
*/
|
|
|
|
#define SO_SNDBUF 0x1001 /* send buffer size */
|
|
|
|
#define SO_RCVBUF 0x1002 /* receive buffer size */
|
|
|
|
#define SO_SNDLOWAT 0x1003 /* send low-water mark */
|
|
|
|
#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
|
|
|
|
#define SO_SNDTIMEO 0x1005 /* send timeout */
|
|
|
|
#define SO_RCVTIMEO 0x1006 /* receive timeout */
|
|
|
|
#define SO_ERROR 0x1007 /* get error status and clear */
|
|
|
|
#define SO_TYPE 0x1008 /* get socket type */
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
#endif /* _ASM_SOCKET_H */
|
|
|
|
|