triton-windows 3.5.0.post21__cp314-cp314-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of triton-windows might be problematic. Click here for more details.

Files changed (217) hide show
  1. triton/_C/libtriton.pyd +0 -0
  2. triton/__init__.py +82 -0
  3. triton/_filecheck.py +97 -0
  4. triton/_internal_testing.py +255 -0
  5. triton/_utils.py +126 -0
  6. triton/backends/__init__.py +47 -0
  7. triton/backends/amd/__init__.py +0 -0
  8. triton/backends/amd/compiler.py +461 -0
  9. triton/backends/amd/driver.c +283 -0
  10. triton/backends/amd/driver.py +724 -0
  11. triton/backends/amd/lib/asanrtl.bc +0 -0
  12. triton/backends/amd/lib/ockl.bc +0 -0
  13. triton/backends/amd/lib/ocml.bc +0 -0
  14. triton/backends/compiler.py +90 -0
  15. triton/backends/driver.py +66 -0
  16. triton/backends/nvidia/__init__.py +0 -0
  17. triton/backends/nvidia/bin/ptxas.exe +0 -0
  18. triton/backends/nvidia/compiler.py +533 -0
  19. triton/backends/nvidia/driver.c +517 -0
  20. triton/backends/nvidia/driver.py +799 -0
  21. triton/backends/nvidia/include/cuda.h +26280 -0
  22. triton/backends/nvidia/lib/libdevice.10.bc +0 -0
  23. triton/backends/nvidia/lib/x64/cuda.lib +0 -0
  24. triton/compiler/__init__.py +7 -0
  25. triton/compiler/code_generator.py +1614 -0
  26. triton/compiler/compiler.py +509 -0
  27. triton/compiler/errors.py +51 -0
  28. triton/compiler/make_launcher.py +0 -0
  29. triton/errors.py +5 -0
  30. triton/experimental/__init__.py +0 -0
  31. triton/experimental/gluon/__init__.py +5 -0
  32. triton/experimental/gluon/_compiler.py +0 -0
  33. triton/experimental/gluon/_runtime.py +102 -0
  34. triton/experimental/gluon/language/__init__.py +119 -0
  35. triton/experimental/gluon/language/_core.py +490 -0
  36. triton/experimental/gluon/language/_layouts.py +583 -0
  37. triton/experimental/gluon/language/_math.py +20 -0
  38. triton/experimental/gluon/language/_semantic.py +380 -0
  39. triton/experimental/gluon/language/_standard.py +80 -0
  40. triton/experimental/gluon/language/amd/__init__.py +4 -0
  41. triton/experimental/gluon/language/amd/_layouts.py +96 -0
  42. triton/experimental/gluon/language/amd/cdna3/__init__.py +100 -0
  43. triton/experimental/gluon/language/amd/cdna4/__init__.py +48 -0
  44. triton/experimental/gluon/language/amd/cdna4/async_copy.py +151 -0
  45. triton/experimental/gluon/language/extra/__init__.py +3 -0
  46. triton/experimental/gluon/language/nvidia/__init__.py +4 -0
  47. triton/experimental/gluon/language/nvidia/ampere/__init__.py +3 -0
  48. triton/experimental/gluon/language/nvidia/ampere/async_copy.py +74 -0
  49. triton/experimental/gluon/language/nvidia/ampere/mbarrier.py +80 -0
  50. triton/experimental/gluon/language/nvidia/blackwell/__init__.py +387 -0
  51. triton/experimental/gluon/language/nvidia/blackwell/tma.py +52 -0
  52. triton/experimental/gluon/language/nvidia/hopper/__init__.py +132 -0
  53. triton/experimental/gluon/language/nvidia/hopper/mbarrier.py +34 -0
  54. triton/experimental/gluon/language/nvidia/hopper/tma.py +97 -0
  55. triton/experimental/gluon/nvidia/__init__.py +4 -0
  56. triton/experimental/gluon/nvidia/blackwell.py +3 -0
  57. triton/experimental/gluon/nvidia/hopper.py +45 -0
  58. triton/knobs.py +546 -0
  59. triton/language/__init__.py +342 -0
  60. triton/language/core.py +3405 -0
  61. triton/language/extra/__init__.py +26 -0
  62. triton/language/extra/cuda/__init__.py +16 -0
  63. triton/language/extra/cuda/gdc.py +42 -0
  64. triton/language/extra/cuda/libdevice.py +1629 -0
  65. triton/language/extra/cuda/utils.py +109 -0
  66. triton/language/extra/hip/__init__.py +5 -0
  67. triton/language/extra/hip/libdevice.py +491 -0
  68. triton/language/extra/hip/utils.py +35 -0
  69. triton/language/extra/libdevice.py +790 -0
  70. triton/language/math.py +249 -0
  71. triton/language/random.py +218 -0
  72. triton/language/semantic.py +1939 -0
  73. triton/language/standard.py +534 -0
  74. triton/language/target_info.py +54 -0
  75. triton/runtime/__init__.py +23 -0
  76. triton/runtime/_allocation.py +44 -0
  77. triton/runtime/_async_compile.py +55 -0
  78. triton/runtime/autotuner.py +476 -0
  79. triton/runtime/build.py +168 -0
  80. triton/runtime/cache.py +317 -0
  81. triton/runtime/driver.py +38 -0
  82. triton/runtime/errors.py +36 -0
  83. triton/runtime/interpreter.py +1414 -0
  84. triton/runtime/jit.py +1107 -0
  85. triton/runtime/tcc/include/_mingw.h +168 -0
  86. triton/runtime/tcc/include/assert.h +62 -0
  87. triton/runtime/tcc/include/conio.h +409 -0
  88. triton/runtime/tcc/include/ctype.h +281 -0
  89. triton/runtime/tcc/include/dir.h +31 -0
  90. triton/runtime/tcc/include/direct.h +68 -0
  91. triton/runtime/tcc/include/dirent.h +135 -0
  92. triton/runtime/tcc/include/dos.h +55 -0
  93. triton/runtime/tcc/include/errno.h +75 -0
  94. triton/runtime/tcc/include/excpt.h +123 -0
  95. triton/runtime/tcc/include/fcntl.h +52 -0
  96. triton/runtime/tcc/include/fenv.h +108 -0
  97. triton/runtime/tcc/include/float.h +75 -0
  98. triton/runtime/tcc/include/inttypes.h +297 -0
  99. triton/runtime/tcc/include/io.h +418 -0
  100. triton/runtime/tcc/include/iso646.h +36 -0
  101. triton/runtime/tcc/include/limits.h +116 -0
  102. triton/runtime/tcc/include/locale.h +91 -0
  103. triton/runtime/tcc/include/malloc.h +181 -0
  104. triton/runtime/tcc/include/math.h +497 -0
  105. triton/runtime/tcc/include/mem.h +13 -0
  106. triton/runtime/tcc/include/memory.h +40 -0
  107. triton/runtime/tcc/include/process.h +176 -0
  108. triton/runtime/tcc/include/sec_api/conio_s.h +42 -0
  109. triton/runtime/tcc/include/sec_api/crtdbg_s.h +19 -0
  110. triton/runtime/tcc/include/sec_api/io_s.h +33 -0
  111. triton/runtime/tcc/include/sec_api/mbstring_s.h +52 -0
  112. triton/runtime/tcc/include/sec_api/search_s.h +25 -0
  113. triton/runtime/tcc/include/sec_api/stdio_s.h +145 -0
  114. triton/runtime/tcc/include/sec_api/stdlib_s.h +67 -0
  115. triton/runtime/tcc/include/sec_api/stralign_s.h +30 -0
  116. triton/runtime/tcc/include/sec_api/string_s.h +41 -0
  117. triton/runtime/tcc/include/sec_api/sys/timeb_s.h +34 -0
  118. triton/runtime/tcc/include/sec_api/tchar_s.h +266 -0
  119. triton/runtime/tcc/include/sec_api/time_s.h +61 -0
  120. triton/runtime/tcc/include/sec_api/wchar_s.h +128 -0
  121. triton/runtime/tcc/include/setjmp.h +160 -0
  122. triton/runtime/tcc/include/share.h +28 -0
  123. triton/runtime/tcc/include/signal.h +63 -0
  124. triton/runtime/tcc/include/stdalign.h +16 -0
  125. triton/runtime/tcc/include/stdarg.h +14 -0
  126. triton/runtime/tcc/include/stdatomic.h +171 -0
  127. triton/runtime/tcc/include/stdbool.h +11 -0
  128. triton/runtime/tcc/include/stddef.h +42 -0
  129. triton/runtime/tcc/include/stdint.h +212 -0
  130. triton/runtime/tcc/include/stdio.h +429 -0
  131. triton/runtime/tcc/include/stdlib.h +591 -0
  132. triton/runtime/tcc/include/stdnoreturn.h +7 -0
  133. triton/runtime/tcc/include/string.h +164 -0
  134. triton/runtime/tcc/include/sys/fcntl.h +13 -0
  135. triton/runtime/tcc/include/sys/file.h +14 -0
  136. triton/runtime/tcc/include/sys/locking.h +30 -0
  137. triton/runtime/tcc/include/sys/stat.h +290 -0
  138. triton/runtime/tcc/include/sys/time.h +69 -0
  139. triton/runtime/tcc/include/sys/timeb.h +133 -0
  140. triton/runtime/tcc/include/sys/types.h +123 -0
  141. triton/runtime/tcc/include/sys/unistd.h +14 -0
  142. triton/runtime/tcc/include/sys/utime.h +146 -0
  143. triton/runtime/tcc/include/tcc/tcc_libm.h +618 -0
  144. triton/runtime/tcc/include/tccdefs.h +342 -0
  145. triton/runtime/tcc/include/tcclib.h +80 -0
  146. triton/runtime/tcc/include/tchar.h +1102 -0
  147. triton/runtime/tcc/include/tgmath.h +89 -0
  148. triton/runtime/tcc/include/time.h +287 -0
  149. triton/runtime/tcc/include/uchar.h +33 -0
  150. triton/runtime/tcc/include/unistd.h +1 -0
  151. triton/runtime/tcc/include/vadefs.h +11 -0
  152. triton/runtime/tcc/include/values.h +4 -0
  153. triton/runtime/tcc/include/varargs.h +12 -0
  154. triton/runtime/tcc/include/wchar.h +873 -0
  155. triton/runtime/tcc/include/wctype.h +172 -0
  156. triton/runtime/tcc/include/winapi/basetsd.h +149 -0
  157. triton/runtime/tcc/include/winapi/basetyps.h +85 -0
  158. triton/runtime/tcc/include/winapi/guiddef.h +156 -0
  159. triton/runtime/tcc/include/winapi/poppack.h +8 -0
  160. triton/runtime/tcc/include/winapi/pshpack1.h +8 -0
  161. triton/runtime/tcc/include/winapi/pshpack2.h +8 -0
  162. triton/runtime/tcc/include/winapi/pshpack4.h +8 -0
  163. triton/runtime/tcc/include/winapi/pshpack8.h +8 -0
  164. triton/runtime/tcc/include/winapi/qos.h +72 -0
  165. triton/runtime/tcc/include/winapi/shellapi.h +59 -0
  166. triton/runtime/tcc/include/winapi/winbase.h +2958 -0
  167. triton/runtime/tcc/include/winapi/wincon.h +309 -0
  168. triton/runtime/tcc/include/winapi/windef.h +293 -0
  169. triton/runtime/tcc/include/winapi/windows.h +127 -0
  170. triton/runtime/tcc/include/winapi/winerror.h +3166 -0
  171. triton/runtime/tcc/include/winapi/wingdi.h +4080 -0
  172. triton/runtime/tcc/include/winapi/winnls.h +778 -0
  173. triton/runtime/tcc/include/winapi/winnt.h +5837 -0
  174. triton/runtime/tcc/include/winapi/winreg.h +272 -0
  175. triton/runtime/tcc/include/winapi/winsock2.h +1474 -0
  176. triton/runtime/tcc/include/winapi/winuser.h +5651 -0
  177. triton/runtime/tcc/include/winapi/winver.h +160 -0
  178. triton/runtime/tcc/include/winapi/ws2ipdef.h +21 -0
  179. triton/runtime/tcc/include/winapi/ws2tcpip.h +391 -0
  180. triton/runtime/tcc/lib/cuda.def +697 -0
  181. triton/runtime/tcc/lib/gdi32.def +337 -0
  182. triton/runtime/tcc/lib/kernel32.def +770 -0
  183. triton/runtime/tcc/lib/libtcc1.a +0 -0
  184. triton/runtime/tcc/lib/msvcrt.def +1399 -0
  185. triton/runtime/tcc/lib/python3.def +810 -0
  186. triton/runtime/tcc/lib/python310.def +1610 -0
  187. triton/runtime/tcc/lib/python311.def +1633 -0
  188. triton/runtime/tcc/lib/python312.def +1703 -0
  189. triton/runtime/tcc/lib/python313.def +1651 -0
  190. triton/runtime/tcc/lib/python313t.def +1656 -0
  191. triton/runtime/tcc/lib/python314.def +1800 -0
  192. triton/runtime/tcc/lib/python314t.def +1809 -0
  193. triton/runtime/tcc/lib/python39.def +1644 -0
  194. triton/runtime/tcc/lib/python3t.def +905 -0
  195. triton/runtime/tcc/lib/user32.def +658 -0
  196. triton/runtime/tcc/libtcc.dll +0 -0
  197. triton/runtime/tcc/tcc.exe +0 -0
  198. triton/testing.py +543 -0
  199. triton/tools/__init__.py +0 -0
  200. triton/tools/build_extern.py +365 -0
  201. triton/tools/compile.py +210 -0
  202. triton/tools/disasm.py +143 -0
  203. triton/tools/extra/cuda/compile.c +70 -0
  204. triton/tools/extra/cuda/compile.h +14 -0
  205. triton/tools/extra/hip/compile.cpp +66 -0
  206. triton/tools/extra/hip/compile.h +13 -0
  207. triton/tools/link.py +322 -0
  208. triton/tools/mxfp.py +301 -0
  209. triton/tools/ragged_tma.py +92 -0
  210. triton/tools/tensor_descriptor.py +34 -0
  211. triton/windows_utils.py +405 -0
  212. triton_windows-3.5.0.post21.dist-info/METADATA +46 -0
  213. triton_windows-3.5.0.post21.dist-info/RECORD +217 -0
  214. triton_windows-3.5.0.post21.dist-info/WHEEL +5 -0
  215. triton_windows-3.5.0.post21.dist-info/entry_points.txt +3 -0
  216. triton_windows-3.5.0.post21.dist-info/licenses/LICENSE +23 -0
  217. triton_windows-3.5.0.post21.dist-info/top_level.txt +1 -0
@@ -0,0 +1,160 @@
1
+ /**
2
+ * This file has no copyright assigned and is placed in the Public Domain.
3
+ * This file is part of the w64 mingw-runtime package.
4
+ * No warranty is given; refer to the file DISCLAIMER within this package.
5
+ */
6
+ #ifndef VER_H
7
+ #define VER_H
8
+
9
+ #ifdef __cplusplus
10
+ extern "C" {
11
+ #endif
12
+
13
+ #define VS_FILE_INFO RT_VERSION
14
+ #define VS_VERSION_INFO 1
15
+ #define VS_USER_DEFINED 100
16
+
17
+ #define VS_FFI_SIGNATURE 0xFEEF04BDL
18
+ #define VS_FFI_STRUCVERSION 0x00010000L
19
+ #define VS_FFI_FILEFLAGSMASK 0x0000003FL
20
+
21
+ #define VS_FF_DEBUG 0x00000001L
22
+ #define VS_FF_PRERELEASE 0x00000002L
23
+ #define VS_FF_PATCHED 0x00000004L
24
+ #define VS_FF_PRIVATEBUILD 0x00000008L
25
+ #define VS_FF_INFOINFERRED 0x00000010L
26
+ #define VS_FF_SPECIALBUILD 0x00000020L
27
+
28
+ #define VOS_UNKNOWN 0x00000000L
29
+ #define VOS_DOS 0x00010000L
30
+ #define VOS_OS216 0x00020000L
31
+ #define VOS_OS232 0x00030000L
32
+ #define VOS_NT 0x00040000L
33
+ #define VOS_WINCE 0x00050000L
34
+
35
+ #define VOS__BASE 0x00000000L
36
+ #define VOS__WINDOWS16 0x00000001L
37
+ #define VOS__PM16 0x00000002L
38
+ #define VOS__PM32 0x00000003L
39
+ #define VOS__WINDOWS32 0x00000004L
40
+
41
+ #define VOS_DOS_WINDOWS16 0x00010001L
42
+ #define VOS_DOS_WINDOWS32 0x00010004L
43
+ #define VOS_OS216_PM16 0x00020002L
44
+ #define VOS_OS232_PM32 0x00030003L
45
+ #define VOS_NT_WINDOWS32 0x00040004L
46
+
47
+ #define VFT_UNKNOWN 0x00000000L
48
+ #define VFT_APP 0x00000001L
49
+ #define VFT_DLL 0x00000002L
50
+ #define VFT_DRV 0x00000003L
51
+ #define VFT_FONT 0x00000004L
52
+ #define VFT_VXD 0x00000005L
53
+ #define VFT_STATIC_LIB 0x00000007L
54
+
55
+ #define VFT2_UNKNOWN 0x00000000L
56
+ #define VFT2_DRV_PRINTER 0x00000001L
57
+ #define VFT2_DRV_KEYBOARD 0x00000002L
58
+ #define VFT2_DRV_LANGUAGE 0x00000003L
59
+ #define VFT2_DRV_DISPLAY 0x00000004L
60
+ #define VFT2_DRV_MOUSE 0x00000005L
61
+ #define VFT2_DRV_NETWORK 0x00000006L
62
+ #define VFT2_DRV_SYSTEM 0x00000007L
63
+ #define VFT2_DRV_INSTALLABLE 0x00000008L
64
+ #define VFT2_DRV_SOUND 0x00000009L
65
+ #define VFT2_DRV_COMM 0x0000000AL
66
+ #define VFT2_DRV_INPUTMETHOD 0x0000000BL
67
+ #define VFT2_DRV_VERSIONED_PRINTER 0x0000000CL
68
+
69
+ #define VFT2_FONT_RASTER 0x00000001L
70
+ #define VFT2_FONT_VECTOR 0x00000002L
71
+ #define VFT2_FONT_TRUETYPE 0x00000003L
72
+
73
+ #define VFFF_ISSHAREDFILE 0x0001
74
+
75
+ #define VFF_CURNEDEST 0x0001
76
+ #define VFF_FILEINUSE 0x0002
77
+ #define VFF_BUFFTOOSMALL 0x0004
78
+
79
+ #define VIFF_FORCEINSTALL 0x0001
80
+ #define VIFF_DONTDELETEOLD 0x0002
81
+
82
+ #define VIF_TEMPFILE 0x00000001L
83
+ #define VIF_MISMATCH 0x00000002L
84
+ #define VIF_SRCOLD 0x00000004L
85
+
86
+ #define VIF_DIFFLANG 0x00000008L
87
+ #define VIF_DIFFCODEPG 0x00000010L
88
+ #define VIF_DIFFTYPE 0x00000020L
89
+
90
+ #define VIF_WRITEPROT 0x00000040L
91
+ #define VIF_FILEINUSE 0x00000080L
92
+ #define VIF_OUTOFSPACE 0x00000100L
93
+ #define VIF_ACCESSVIOLATION 0x00000200L
94
+ #define VIF_SHARINGVIOLATION 0x00000400L
95
+ #define VIF_CANNOTCREATE 0x00000800L
96
+ #define VIF_CANNOTDELETE 0x00001000L
97
+ #define VIF_CANNOTRENAME 0x00002000L
98
+ #define VIF_CANNOTDELETECUR 0x00004000L
99
+ #define VIF_OUTOFMEMORY 0x00008000L
100
+
101
+ #define VIF_CANNOTREADSRC 0x00010000L
102
+ #define VIF_CANNOTREADDST 0x00020000L
103
+
104
+ #define VIF_BUFFTOOSMALL 0x00040000L
105
+ #define VIF_CANNOTLOADLZ32 0x00080000L
106
+ #define VIF_CANNOTLOADCABINET 0x00100000L
107
+
108
+ #ifndef RC_INVOKED
109
+
110
+ typedef struct tagVS_FIXEDFILEINFO
111
+ {
112
+ DWORD dwSignature;
113
+ DWORD dwStrucVersion;
114
+ DWORD dwFileVersionMS;
115
+ DWORD dwFileVersionLS;
116
+ DWORD dwProductVersionMS;
117
+ DWORD dwProductVersionLS;
118
+ DWORD dwFileFlagsMask;
119
+ DWORD dwFileFlags;
120
+ DWORD dwFileOS;
121
+ DWORD dwFileType;
122
+ DWORD dwFileSubtype;
123
+ DWORD dwFileDateMS;
124
+ DWORD dwFileDateLS;
125
+ } VS_FIXEDFILEINFO;
126
+
127
+ #ifdef UNICODE
128
+ #define VerFindFile VerFindFileW
129
+ #define VerInstallFile VerInstallFileW
130
+ #define GetFileVersionInfoSize GetFileVersionInfoSizeW
131
+ #define GetFileVersionInfo GetFileVersionInfoW
132
+ #define VerLanguageName VerLanguageNameW
133
+ #define VerQueryValue VerQueryValueW
134
+ #else
135
+ #define VerFindFile VerFindFileA
136
+ #define VerInstallFile VerInstallFileA
137
+ #define GetFileVersionInfoSize GetFileVersionInfoSizeA
138
+ #define GetFileVersionInfo GetFileVersionInfoA
139
+ #define VerLanguageName VerLanguageNameA
140
+ #define VerQueryValue VerQueryValueA
141
+ #endif
142
+
143
+ DWORD WINAPI VerFindFileA(DWORD uFlags,LPSTR szFileName,LPSTR szWinDir,LPSTR szAppDir,LPSTR szCurDir,PUINT lpuCurDirLen,LPSTR szDestDir,PUINT lpuDestDirLen);
144
+ DWORD WINAPI VerFindFileW(DWORD uFlags,LPWSTR szFileName,LPWSTR szWinDir,LPWSTR szAppDir,LPWSTR szCurDir,PUINT lpuCurDirLen,LPWSTR szDestDir,PUINT lpuDestDirLen);
145
+ DWORD WINAPI VerInstallFileA(DWORD uFlags,LPSTR szSrcFileName,LPSTR szDestFileName,LPSTR szSrcDir,LPSTR szDestDir,LPSTR szCurDir,LPSTR szTmpFile,PUINT lpuTmpFileLen);
146
+ DWORD WINAPI VerInstallFileW(DWORD uFlags,LPWSTR szSrcFileName,LPWSTR szDestFileName,LPWSTR szSrcDir,LPWSTR szDestDir,LPWSTR szCurDir,LPWSTR szTmpFile,PUINT lpuTmpFileLen);
147
+ DWORD WINAPI GetFileVersionInfoSizeA(LPCSTR lptstrFilename,LPDWORD lpdwHandle);
148
+ DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR lptstrFilename,LPDWORD lpdwHandle);
149
+ WINBOOL WINAPI GetFileVersionInfoA(LPCSTR lptstrFilename,DWORD dwHandle,DWORD dwLen,LPVOID lpData);
150
+ WINBOOL WINAPI GetFileVersionInfoW(LPCWSTR lptstrFilename,DWORD dwHandle,DWORD dwLen,LPVOID lpData);
151
+ DWORD WINAPI VerLanguageNameA(DWORD wLang,LPSTR szLang,DWORD nSize);
152
+ DWORD WINAPI VerLanguageNameW(DWORD wLang,LPWSTR szLang,DWORD nSize);
153
+ WINBOOL WINAPI VerQueryValueA(const LPVOID pBlock,LPSTR lpSubBlock,LPVOID *lplpBuffer,PUINT puLen);
154
+ WINBOOL WINAPI VerQueryValueW(const LPVOID pBlock,LPWSTR lpSubBlock,LPVOID *lplpBuffer,PUINT puLen);
155
+ #endif
156
+
157
+ #ifdef __cplusplus
158
+ }
159
+ #endif
160
+ #endif
@@ -0,0 +1,21 @@
1
+ #ifndef _WS2IPDEF_H
2
+ #define _WS2IPDEF_H
3
+
4
+ #if __GNUC__ >=3
5
+ #pragma GCC system_header
6
+ #endif
7
+
8
+ #include <winsock2.h>
9
+
10
+ struct ip_mreq {
11
+ struct in_addr imr_multiaddr;
12
+ struct in_addr imr_interface;
13
+ };
14
+
15
+ struct ip_mreq_source {
16
+ struct in_addr imr_multiaddr;
17
+ struct in_addr imr_sourceaddr;
18
+ struct in_addr imr_interface;
19
+ };
20
+
21
+ #endif
@@ -0,0 +1,391 @@
1
+ /**
2
+ * This file has no copyright assigned and is placed in the Public Domain.
3
+ * This file is part of the w64 mingw-runtime package.
4
+ * No warranty is given; refer to the file DISCLAIMER within this package.
5
+ */
6
+ #ifndef _WS2TCPIP_H
7
+ #define _WS2TCPIP_H
8
+
9
+ #if __GNUC__ >=3
10
+ #pragma GCC system_header
11
+ #endif
12
+
13
+ #include <ws2ipdef.h>
14
+
15
+ struct ip_msfilter {
16
+ struct in_addr imsf_multiaddr;
17
+ struct in_addr imsf_interface;
18
+ u_long imsf_fmode;
19
+ u_long imsf_numsrc;
20
+ struct in_addr imsf_slist[1];
21
+ };
22
+
23
+ #define IP_MSFILTER_SIZE(numsrc) (sizeof(struct ip_msfilter)-sizeof(struct in_addr) + (numsrc)*sizeof(struct in_addr))
24
+
25
+ #define MCAST_INCLUDE 0
26
+ #define MCAST_EXCLUDE 1
27
+
28
+ #define SIO_GET_INTERFACE_LIST _IOR('t',127,u_long)
29
+
30
+ #define SIO_GET_INTERFACE_LIST_EX _IOR('t',126,u_long)
31
+ #define SIO_SET_MULTICAST_FILTER _IOW('t',125,u_long)
32
+ #define SIO_GET_MULTICAST_FILTER _IOW('t',124 | IOC_IN,u_long)
33
+
34
+ #define IP_OPTIONS 1
35
+ #define IP_HDRINCL 2
36
+ #define IP_TOS 3
37
+ #define IP_TTL 4
38
+ #define IP_MULTICAST_IF 9
39
+ #define IP_MULTICAST_TTL 10
40
+ #define IP_MULTICAST_LOOP 11
41
+ #define IP_ADD_MEMBERSHIP 12
42
+ #define IP_DROP_MEMBERSHIP 13
43
+ #define IP_DONTFRAGMENT 14
44
+ #define IP_ADD_SOURCE_MEMBERSHIP 15
45
+ #define IP_DROP_SOURCE_MEMBERSHIP 16
46
+ #define IP_BLOCK_SOURCE 17
47
+ #define IP_UNBLOCK_SOURCE 18
48
+ #define IP_PKTINFO 19
49
+ #define IP_RECEIVE_BROADCAST 22
50
+
51
+ #define IPV6_HDRINCL 2
52
+ #define IPV6_UNICAST_HOPS 4
53
+ #define IPV6_MULTICAST_IF 9
54
+ #define IPV6_MULTICAST_HOPS 10
55
+ #define IPV6_MULTICAST_LOOP 11
56
+ #define IPV6_ADD_MEMBERSHIP 12
57
+ #define IPV6_DROP_MEMBERSHIP 13
58
+ #define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP
59
+ #define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP
60
+ #define IPV6_PKTINFO 19
61
+ #define IPV6_HOPLIMIT 21
62
+ #define IPV6_PROTECTION_LEVEL 23
63
+
64
+ #define PROTECTION_LEVEL_UNRESTRICTED 10
65
+ #define PROTECTION_LEVEL_DEFAULT 20
66
+ #define PROTECTION_LEVEL_RESTRICTED 30
67
+
68
+ #define UDP_NOCHECKSUM 1
69
+ #define UDP_CHECKSUM_COVERAGE 20
70
+
71
+ #define TCP_EXPEDITED_1122 0x0002
72
+
73
+ #ifndef s6_addr
74
+
75
+ struct in6_addr {
76
+ __MINGW_EXTENSION union {
77
+ u_char Byte[16];
78
+ u_short Word[8];
79
+ } u;
80
+ };
81
+
82
+ #define in_addr6 in6_addr
83
+
84
+ #define _S6_un u
85
+ #define _S6_u8 Byte
86
+ #define s6_addr _S6_un._S6_u8
87
+
88
+ #define s6_bytes u.Byte
89
+ #define s6_words u.Word
90
+ #endif
91
+
92
+ typedef struct ipv6_mreq {
93
+ struct in6_addr ipv6mr_multiaddr;
94
+ unsigned int ipv6mr_interface;
95
+ } IPV6_MREQ;
96
+
97
+ struct sockaddr_in6_old {
98
+ short sin6_family;
99
+ u_short sin6_port;
100
+ u_long sin6_flowinfo;
101
+ struct in6_addr sin6_addr;
102
+ };
103
+
104
+ struct sockaddr_in6 {
105
+ short sin6_family;
106
+ u_short sin6_port;
107
+ u_long sin6_flowinfo;
108
+ struct in6_addr sin6_addr;
109
+ u_long sin6_scope_id;
110
+ };
111
+
112
+ typedef struct in6_addr IN6_ADDR;
113
+ typedef struct in6_addr *PIN6_ADDR;
114
+ typedef struct in6_addr *LPIN6_ADDR;
115
+
116
+ typedef struct sockaddr_in6 SOCKADDR_IN6;
117
+ typedef struct sockaddr_in6 *PSOCKADDR_IN6;
118
+ typedef struct sockaddr_in6 *LPSOCKADDR_IN6;
119
+
120
+ #define SS_PORT(ssp) (((struct sockaddr_in*)(ssp))->sin_port)
121
+
122
+ #define IN6ADDR_ANY_INIT { 0 }
123
+ #define IN6ADDR_LOOPBACK_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }
124
+
125
+ #ifdef __cplusplus
126
+ extern "C" {
127
+ #endif
128
+
129
+ extern const struct in6_addr in6addr_any;
130
+ extern const struct in6_addr in6addr_loopback;
131
+
132
+ #ifdef __cplusplus
133
+ }
134
+ #endif
135
+
136
+ #define WS2TCPIP_INLINE __CRT_INLINE
137
+
138
+ int IN6_ADDR_EQUAL(const struct in6_addr *,const struct in6_addr *);
139
+ int IN6_IS_ADDR_UNSPECIFIED(const struct in6_addr *);
140
+ int IN6_IS_ADDR_LOOPBACK(const struct in6_addr *);
141
+ int IN6_IS_ADDR_MULTICAST(const struct in6_addr *);
142
+ int IN6_IS_ADDR_LINKLOCAL(const struct in6_addr *);
143
+ int IN6_IS_ADDR_SITELOCAL(const struct in6_addr *);
144
+ int IN6_IS_ADDR_V4MAPPED(const struct in6_addr *);
145
+ int IN6_IS_ADDR_V4COMPAT(const struct in6_addr *);
146
+ int IN6_IS_ADDR_MC_NODELOCAL(const struct in6_addr *);
147
+ int IN6_IS_ADDR_MC_LINKLOCAL(const struct in6_addr *);
148
+ int IN6_IS_ADDR_MC_SITELOCAL(const struct in6_addr *);
149
+ int IN6_IS_ADDR_MC_ORGLOCAL(const struct in6_addr *);
150
+ int IN6_IS_ADDR_MC_GLOBAL(const struct in6_addr *);
151
+ int IN6ADDR_ISANY(const struct sockaddr_in6 *);
152
+ int IN6ADDR_ISLOOPBACK(const struct sockaddr_in6 *);
153
+ void IN6_SET_ADDR_UNSPECIFIED(struct in6_addr *);
154
+ void IN6_SET_ADDR_LOOPBACK(struct in6_addr *);
155
+ void IN6ADDR_SETANY(struct sockaddr_in6 *);
156
+ void IN6ADDR_SETLOOPBACK(struct sockaddr_in6 *);
157
+
158
+ #ifndef __CRT__NO_INLINE
159
+ WS2TCPIP_INLINE int IN6_ADDR_EQUAL(const struct in6_addr *a,const struct in6_addr *b) { return (memcmp(a,b,sizeof(struct in6_addr))==0); }
160
+ WS2TCPIP_INLINE int IN6_IS_ADDR_UNSPECIFIED(const struct in6_addr *a) { return ((a->s6_words[0]==0) && (a->s6_words[1]==0) && (a->s6_words[2]==0) && (a->s6_words[3]==0) && (a->s6_words[4]==0) && (a->s6_words[5]==0) && (a->s6_words[6]==0) && (a->s6_words[7]==0)); }
161
+ WS2TCPIP_INLINE int IN6_IS_ADDR_LOOPBACK(const struct in6_addr *a) { return ((a->s6_words[0]==0) && (a->s6_words[1]==0) && (a->s6_words[2]==0) && (a->s6_words[3]==0) && (a->s6_words[4]==0) && (a->s6_words[5]==0) && (a->s6_words[6]==0) && (a->s6_words[7]==0x0100)); }
162
+ WS2TCPIP_INLINE int IN6_IS_ADDR_MULTICAST(const struct in6_addr *a) { return (a->s6_bytes[0]==0xff); }
163
+ WS2TCPIP_INLINE int IN6_IS_ADDR_LINKLOCAL(const struct in6_addr *a) { return ((a->s6_bytes[0]==0xfe) && ((a->s6_bytes[1] & 0xc0)==0x80)); }
164
+ WS2TCPIP_INLINE int IN6_IS_ADDR_SITELOCAL(const struct in6_addr *a) { return ((a->s6_bytes[0]==0xfe) && ((a->s6_bytes[1] & 0xc0)==0xc0)); }
165
+ WS2TCPIP_INLINE int IN6_IS_ADDR_V4MAPPED(const struct in6_addr *a) { return ((a->s6_words[0]==0) && (a->s6_words[1]==0) && (a->s6_words[2]==0) && (a->s6_words[3]==0) && (a->s6_words[4]==0) && (a->s6_words[5]==0xffff)); }
166
+ WS2TCPIP_INLINE int IN6_IS_ADDR_V4COMPAT(const struct in6_addr *a) { return ((a->s6_words[0]==0) && (a->s6_words[1]==0) && (a->s6_words[2]==0) && (a->s6_words[3]==0) && (a->s6_words[4]==0) && (a->s6_words[5]==0) && !((a->s6_words[6]==0) && (a->s6_addr[14]==0) && ((a->s6_addr[15]==0) || (a->s6_addr[15]==1)))); }
167
+ WS2TCPIP_INLINE int IN6_IS_ADDR_MC_NODELOCAL(const struct in6_addr *a) { return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_bytes[1] & 0xf)==1); }
168
+ WS2TCPIP_INLINE int IN6_IS_ADDR_MC_LINKLOCAL(const struct in6_addr *a) { return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_bytes[1] & 0xf)==2); }
169
+ WS2TCPIP_INLINE int IN6_IS_ADDR_MC_SITELOCAL(const struct in6_addr *a) { return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_bytes[1] & 0xf)==5); }
170
+ WS2TCPIP_INLINE int IN6_IS_ADDR_MC_ORGLOCAL(const struct in6_addr *a) { return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_bytes[1] & 0xf)==8); }
171
+ WS2TCPIP_INLINE int IN6_IS_ADDR_MC_GLOBAL(const struct in6_addr *a) { return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_bytes[1] & 0xf)==0xe); }
172
+ WS2TCPIP_INLINE int IN6ADDR_ISANY(const struct sockaddr_in6 *a) { return ((a->sin6_family==AF_INET6) && IN6_IS_ADDR_UNSPECIFIED(&a->sin6_addr)); }
173
+ WS2TCPIP_INLINE int IN6ADDR_ISLOOPBACK(const struct sockaddr_in6 *a) { return ((a->sin6_family==AF_INET6) && IN6_IS_ADDR_LOOPBACK(&a->sin6_addr)); }
174
+ WS2TCPIP_INLINE void IN6_SET_ADDR_UNSPECIFIED(struct in6_addr *a) { memset(a->s6_bytes,0,sizeof(struct in6_addr)); }
175
+ WS2TCPIP_INLINE void IN6_SET_ADDR_LOOPBACK(struct in6_addr *a) {
176
+ memset(a->s6_bytes,0,sizeof(struct in6_addr));
177
+ a->s6_bytes[15] = 1;
178
+ }
179
+ WS2TCPIP_INLINE void IN6ADDR_SETANY(struct sockaddr_in6 *a) {
180
+ a->sin6_family = AF_INET6;
181
+ a->sin6_port = 0;
182
+ a->sin6_flowinfo = 0;
183
+ IN6_SET_ADDR_UNSPECIFIED(&a->sin6_addr);
184
+ a->sin6_scope_id = 0;
185
+ }
186
+ WS2TCPIP_INLINE void IN6ADDR_SETLOOPBACK(struct sockaddr_in6 *a) {
187
+ a->sin6_family = AF_INET6;
188
+ a->sin6_port = 0;
189
+ a->sin6_flowinfo = 0;
190
+ IN6_SET_ADDR_LOOPBACK(&a->sin6_addr);
191
+ a->sin6_scope_id = 0;
192
+ }
193
+ #endif /* !__CRT__NO_INLINE */
194
+
195
+ typedef union sockaddr_gen {
196
+ struct sockaddr Address;
197
+ struct sockaddr_in AddressIn;
198
+ struct sockaddr_in6_old AddressIn6;
199
+ } sockaddr_gen;
200
+
201
+ typedef struct _INTERFACE_INFO {
202
+ u_long iiFlags;
203
+ sockaddr_gen iiAddress;
204
+ sockaddr_gen iiBroadcastAddress;
205
+ sockaddr_gen iiNetmask;
206
+ } INTERFACE_INFO,*LPINTERFACE_INFO;
207
+
208
+ typedef struct _INTERFACE_INFO_EX {
209
+ u_long iiFlags;
210
+ SOCKET_ADDRESS iiAddress;
211
+ SOCKET_ADDRESS iiBroadcastAddress;
212
+ SOCKET_ADDRESS iiNetmask;
213
+ } INTERFACE_INFO_EX,*LPINTERFACE_INFO_EX;
214
+
215
+ #define IFF_UP 0x00000001
216
+ #define IFF_BROADCAST 0x00000002
217
+ #define IFF_LOOPBACK 0x00000004
218
+ #define IFF_POINTTOPOINT 0x00000008
219
+ #define IFF_MULTICAST 0x00000010
220
+
221
+ typedef struct in_pktinfo {
222
+ IN_ADDR ipi_addr;
223
+ UINT ipi_ifindex;
224
+ } IN_PKTINFO;
225
+
226
+ C_ASSERT(sizeof(IN_PKTINFO)==8);
227
+
228
+ typedef struct in6_pktinfo {
229
+ IN6_ADDR ipi6_addr;
230
+ UINT ipi6_ifindex;
231
+ } IN6_PKTINFO;
232
+
233
+ C_ASSERT(sizeof(IN6_PKTINFO)==20);
234
+
235
+ #define EAI_AGAIN WSATRY_AGAIN
236
+ #define EAI_BADFLAGS WSAEINVAL
237
+ #define EAI_FAIL WSANO_RECOVERY
238
+ #define EAI_FAMILY WSAEAFNOSUPPORT
239
+ #define EAI_MEMORY WSA_NOT_ENOUGH_MEMORY
240
+
241
+ #define EAI_NONAME WSAHOST_NOT_FOUND
242
+ #define EAI_SERVICE WSATYPE_NOT_FOUND
243
+ #define EAI_SOCKTYPE WSAESOCKTNOSUPPORT
244
+
245
+ #define EAI_NODATA EAI_NONAME
246
+
247
+ typedef struct addrinfo {
248
+ int ai_flags;
249
+ int ai_family;
250
+ int ai_socktype;
251
+ int ai_protocol;
252
+ size_t ai_addrlen;
253
+ char *ai_canonname;
254
+ struct sockaddr *ai_addr;
255
+ struct addrinfo *ai_next;
256
+ } ADDRINFOA,*PADDRINFOA;
257
+
258
+ typedef struct addrinfoW {
259
+ int ai_flags;
260
+ int ai_family;
261
+ int ai_socktype;
262
+ int ai_protocol;
263
+ size_t ai_addrlen;
264
+ PWSTR ai_canonname;
265
+ struct sockaddr *ai_addr;
266
+ struct addrinfoW *ai_next;
267
+ } ADDRINFOW,*PADDRINFOW;
268
+
269
+ #ifdef UNICODE
270
+ typedef ADDRINFOW ADDRINFOT,*PADDRINFOT;
271
+ #else
272
+ typedef ADDRINFOA ADDRINFOT,*PADDRINFOT;
273
+ #endif
274
+
275
+ typedef ADDRINFOA ADDRINFO,*LPADDRINFO;
276
+
277
+ #define AI_PASSIVE 0x1
278
+ #define AI_CANONNAME 0x2
279
+ #define AI_NUMERICHOST 0x4
280
+
281
+ #ifdef __cplusplus
282
+ extern "C" {
283
+ #endif
284
+
285
+ #ifdef UNICODE
286
+ #define GetAddrInfo GetAddrInfoW
287
+ #else
288
+ #define GetAddrInfo GetAddrInfoA
289
+ #endif
290
+
291
+ WINSOCK_API_LINKAGE int WSAAPI getaddrinfo(const char *nodename,const char *servname,const struct addrinfo *hints,struct addrinfo **res);
292
+ WINSOCK_API_LINKAGE int WSAAPI GetAddrInfoW(PCWSTR pNodeName,PCWSTR pServiceName,const ADDRINFOW *pHints,PADDRINFOW *ppResult);
293
+
294
+ #define GetAddrInfoA getaddrinfo
295
+
296
+ #if INCL_WINSOCK_API_TYPEDEFS
297
+ typedef int (WSAAPI *LPFN_GETADDRINFO)(const char *nodename,const char *servname,const struct addrinfo *hints,struct addrinfo **res);
298
+ typedef int (WSAAPI *LPFN_GETADDRINFOW)(PCWSTR pNodeName,PCWSTR pServiceName,const ADDRINFOW *pHints,PADDRINFOW *ppResult);
299
+
300
+ #define LPFN_GETADDRINFOA LPFN_GETADDRINFO
301
+
302
+ #ifdef UNICODE
303
+ #define LPFN_GETADDRINFOT LPFN_GETADDRINFOW
304
+ #else
305
+ #define LPFN_GETADDRINFOT LPFN_GETADDRINFOA
306
+ #endif
307
+ #endif
308
+
309
+ #ifdef UNICODE
310
+ #define FreeAddrInfo FreeAddrInfoW
311
+ #else
312
+ #define FreeAddrInfo FreeAddrInfoA
313
+ #endif
314
+
315
+ WINSOCK_API_LINKAGE void WSAAPI freeaddrinfo(LPADDRINFO pAddrInfo);
316
+ WINSOCK_API_LINKAGE void WSAAPI FreeAddrInfoW(PADDRINFOW pAddrInfo);
317
+
318
+ #define FreeAddrInfoA freeaddrinfo
319
+
320
+ #if INCL_WINSOCK_API_TYPEDEFS
321
+ typedef void (WSAAPI *LPFN_FREEADDRINFO)(struct addrinfo *ai);
322
+ typedef void (WSAAPI *LPFN_FREEADDRINFOW)(PADDRINFOW pAddrInfo);
323
+
324
+ #define LPFN_FREEADDRINFOA LPFN_FREEADDRINFO
325
+
326
+ #ifdef UNICODE
327
+ #define LPFN_FREEADDRINFOT LPFN_FREEADDRINFOW
328
+ #else
329
+ #define LPFN_FREEADDRINFOT LPFN_FREEADDRINFOA
330
+ #endif
331
+ #endif
332
+
333
+ #pragma push_macro("socklen_t")
334
+ #undef socklen_t
335
+
336
+ typedef int socklen_t;
337
+
338
+ #ifdef UNICODE
339
+ #define GetNameInfo GetNameInfoW
340
+ #else
341
+ #define GetNameInfo GetNameInfoA
342
+ #endif
343
+
344
+ WINSOCK_API_LINKAGE int WSAAPI getnameinfo(const struct sockaddr *sa,socklen_t salen,char *host,DWORD hostlen,char *serv,DWORD servlen,int flags);
345
+ WINSOCK_API_LINKAGE INT WSAAPI GetNameInfoW(const SOCKADDR *pSockaddr,socklen_t SockaddrLength,PWCHAR pNodeBuffer,DWORD NodeBufferSize,PWCHAR pServiceBuffer,DWORD ServiceBufferSize,INT Flags);
346
+
347
+ #define GetNameInfoA getnameinfo
348
+
349
+ #if INCL_WINSOCK_API_TYPEDEFS
350
+ typedef int (WSAAPI *LPFN_GETNAMEINFO)(const struct sockaddr *sa,socklen_t salen,char *host,DWORD hostlen,char *serv,DWORD servlen,int flags);
351
+ typedef INT (WSAAPI *LPFN_GETNAMEINFOW)(const SOCKADDR *pSockaddr,socklen_t SockaddrLength,PWCHAR pNodeBuffer,DWORD NodeBufferSize,PWCHAR pServiceBuffer,DWORD ServiceBufferSize,INT Flags);
352
+
353
+ #define LPFN_GETNAMEINFOA LPFN_GETNAMEINFO
354
+
355
+ #ifdef UNICODE
356
+ #define LPFN_GETNAMEINFOT LPFN_GETNAMEINFOW
357
+ #else
358
+ #define LPFN_GETNAMEINFOT LPFN_GETNAMEINFOA
359
+ #endif
360
+ #endif
361
+
362
+ #pragma pop_macro("socklen_t")
363
+
364
+ #ifdef UNICODE
365
+ #define gai_strerror gai_strerrorW
366
+ #else
367
+ #define gai_strerror gai_strerrorA
368
+ #endif
369
+
370
+ #define GAI_STRERROR_BUFFER_SIZE 1024
371
+
372
+ char *gai_strerrorA (int);
373
+ WCHAR *gai_strerrorW(int);
374
+
375
+ #define NI_MAXHOST 1025
376
+ #define NI_MAXSERV 32
377
+
378
+ #define INET_ADDRSTRLEN 22
379
+ #define INET6_ADDRSTRLEN 65
380
+
381
+ #define NI_NOFQDN 0x01
382
+ #define NI_NUMERICHOST 0x02
383
+ #define NI_NAMEREQD 0x04
384
+ #define NI_NUMERICSERV 0x08
385
+ #define NI_DGRAM 0x10
386
+
387
+ #ifdef __cplusplus
388
+ }
389
+ #endif
390
+
391
+ #endif