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