triton-windows 3.3.1.post19__cp311-cp311-win_amd64.whl → 3.5.0.post21__cp311-cp311-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 (225) hide show
  1. triton/_C/libtriton.pyd +0 -0
  2. triton/__init__.py +11 -2
  3. triton/_filecheck.py +97 -0
  4. triton/_internal_testing.py +95 -18
  5. triton/_utils.py +112 -21
  6. triton/backends/__init__.py +20 -23
  7. triton/backends/amd/__init__.py +0 -0
  8. triton/backends/amd/compiler.py +161 -119
  9. triton/backends/amd/driver.c +118 -46
  10. triton/backends/amd/driver.py +274 -96
  11. triton/backends/compiler.py +7 -21
  12. triton/backends/driver.py +13 -0
  13. triton/backends/nvidia/bin/ptxas.exe +0 -0
  14. triton/backends/nvidia/compiler.py +163 -106
  15. triton/backends/nvidia/driver.c +166 -101
  16. triton/backends/nvidia/driver.py +384 -202
  17. triton/compiler/__init__.py +5 -2
  18. triton/compiler/code_generator.py +439 -231
  19. triton/compiler/compiler.py +152 -84
  20. triton/experimental/__init__.py +0 -0
  21. triton/experimental/gluon/__init__.py +5 -0
  22. triton/experimental/gluon/_compiler.py +0 -0
  23. triton/experimental/gluon/_runtime.py +102 -0
  24. triton/experimental/gluon/language/__init__.py +119 -0
  25. triton/experimental/gluon/language/_core.py +490 -0
  26. triton/experimental/gluon/language/_layouts.py +583 -0
  27. triton/experimental/gluon/language/_math.py +20 -0
  28. triton/experimental/gluon/language/_semantic.py +380 -0
  29. triton/experimental/gluon/language/_standard.py +80 -0
  30. triton/experimental/gluon/language/amd/__init__.py +4 -0
  31. triton/experimental/gluon/language/amd/_layouts.py +96 -0
  32. triton/experimental/gluon/language/amd/cdna3/__init__.py +100 -0
  33. triton/experimental/gluon/language/amd/cdna4/__init__.py +48 -0
  34. triton/experimental/gluon/language/amd/cdna4/async_copy.py +151 -0
  35. triton/experimental/gluon/language/extra/__init__.py +3 -0
  36. triton/experimental/gluon/language/nvidia/__init__.py +4 -0
  37. triton/experimental/gluon/language/nvidia/ampere/__init__.py +3 -0
  38. triton/experimental/gluon/language/nvidia/ampere/async_copy.py +74 -0
  39. triton/experimental/gluon/language/nvidia/ampere/mbarrier.py +80 -0
  40. triton/experimental/gluon/language/nvidia/blackwell/__init__.py +387 -0
  41. triton/experimental/gluon/language/nvidia/blackwell/tma.py +52 -0
  42. triton/experimental/gluon/language/nvidia/hopper/__init__.py +132 -0
  43. triton/experimental/gluon/language/nvidia/hopper/mbarrier.py +34 -0
  44. triton/experimental/gluon/language/nvidia/hopper/tma.py +97 -0
  45. triton/experimental/gluon/nvidia/__init__.py +4 -0
  46. triton/experimental/gluon/nvidia/blackwell.py +3 -0
  47. triton/experimental/gluon/nvidia/hopper.py +45 -0
  48. triton/knobs.py +546 -0
  49. triton/language/__init__.py +50 -19
  50. triton/language/core.py +909 -572
  51. triton/language/extra/cuda/__init__.py +10 -7
  52. triton/language/extra/cuda/gdc.py +42 -0
  53. triton/language/extra/cuda/libdevice.py +394 -394
  54. triton/language/extra/cuda/utils.py +21 -21
  55. triton/language/extra/hip/__init__.py +3 -1
  56. triton/language/extra/hip/libdevice.py +120 -104
  57. triton/language/extra/hip/utils.py +35 -0
  58. triton/language/extra/libdevice.py +4 -0
  59. triton/language/math.py +65 -66
  60. triton/language/random.py +12 -2
  61. triton/language/semantic.py +1757 -1768
  62. triton/language/standard.py +127 -62
  63. triton/language/target_info.py +54 -0
  64. triton/runtime/_allocation.py +15 -3
  65. triton/runtime/_async_compile.py +55 -0
  66. triton/runtime/autotuner.py +117 -60
  67. triton/runtime/build.py +83 -17
  68. triton/runtime/cache.py +61 -47
  69. triton/runtime/driver.py +25 -47
  70. triton/runtime/interpreter.py +95 -50
  71. triton/runtime/jit.py +445 -248
  72. triton/runtime/tcc/include/_mingw.h +8 -10
  73. triton/runtime/tcc/include/assert.h +5 -0
  74. triton/runtime/tcc/include/errno.h +1 -1
  75. triton/runtime/tcc/include/float.h +21 -3
  76. triton/runtime/tcc/include/iso646.h +36 -0
  77. triton/runtime/tcc/include/limits.h +5 -0
  78. triton/runtime/tcc/include/malloc.h +2 -2
  79. triton/runtime/tcc/include/math.h +21 -261
  80. triton/runtime/tcc/include/stdalign.h +16 -0
  81. triton/runtime/tcc/include/stdarg.h +5 -70
  82. triton/runtime/tcc/include/stdatomic.h +171 -0
  83. triton/runtime/tcc/include/stddef.h +7 -19
  84. triton/runtime/tcc/include/stdlib.h +15 -4
  85. triton/runtime/tcc/include/stdnoreturn.h +7 -0
  86. triton/runtime/tcc/include/sys/stat.h +2 -2
  87. triton/runtime/tcc/include/sys/types.h +5 -0
  88. triton/runtime/tcc/include/tcc/tcc_libm.h +444 -27
  89. triton/runtime/tcc/include/tccdefs.h +342 -0
  90. triton/runtime/tcc/include/tgmath.h +89 -0
  91. triton/runtime/tcc/include/uchar.h +33 -0
  92. triton/runtime/tcc/include/unistd.h +1 -0
  93. triton/runtime/tcc/include/winapi/qos.h +72 -0
  94. triton/runtime/tcc/include/winapi/shellapi.h +59 -0
  95. triton/runtime/tcc/include/winapi/winbase.h +9 -2
  96. triton/runtime/tcc/include/winapi/wincon.h +8 -0
  97. triton/runtime/tcc/include/winapi/windows.h +1 -1
  98. triton/runtime/tcc/include/winapi/winnls.h +778 -0
  99. triton/runtime/tcc/include/winapi/winnt.h +9 -7
  100. triton/runtime/tcc/include/winapi/winsock2.h +1474 -0
  101. triton/runtime/tcc/include/winapi/ws2ipdef.h +21 -0
  102. triton/runtime/tcc/include/winapi/ws2tcpip.h +391 -0
  103. triton/runtime/tcc/lib/libtcc1.a +0 -0
  104. triton/runtime/tcc/lib/python314.def +1800 -0
  105. triton/runtime/tcc/lib/python314t.def +1809 -0
  106. triton/runtime/tcc/libtcc.dll +0 -0
  107. triton/runtime/tcc/tcc.exe +0 -0
  108. triton/testing.py +16 -12
  109. triton/tools/compile.py +62 -14
  110. triton/tools/disasm.py +3 -4
  111. triton/tools/extra/cuda/compile.c +1 -0
  112. triton/tools/extra/hip/compile.cpp +66 -0
  113. triton/tools/extra/hip/compile.h +13 -0
  114. triton/tools/ragged_tma.py +92 -0
  115. triton/tools/tensor_descriptor.py +34 -0
  116. triton/windows_utils.py +52 -81
  117. {triton_windows-3.3.1.post19.dist-info → triton_windows-3.5.0.post21.dist-info}/METADATA +8 -4
  118. triton_windows-3.5.0.post21.dist-info/RECORD +217 -0
  119. triton_windows-3.5.0.post21.dist-info/entry_points.txt +3 -0
  120. triton_windows-3.5.0.post21.dist-info/licenses/LICENSE +23 -0
  121. triton_windows-3.5.0.post21.dist-info/top_level.txt +1 -0
  122. triton/backends/amd/include/hip/amd_detail/amd_channel_descriptor.h +0 -358
  123. triton/backends/amd/include/hip/amd_detail/amd_device_functions.h +0 -1010
  124. triton/backends/amd/include/hip/amd_detail/amd_hip_atomic.h +0 -1638
  125. triton/backends/amd/include/hip/amd_detail/amd_hip_bf16.h +0 -1814
  126. triton/backends/amd/include/hip/amd_detail/amd_hip_bfloat16.h +0 -293
  127. triton/backends/amd/include/hip/amd_detail/amd_hip_common.h +0 -32
  128. triton/backends/amd/include/hip/amd_detail/amd_hip_complex.h +0 -174
  129. triton/backends/amd/include/hip/amd_detail/amd_hip_cooperative_groups.h +0 -835
  130. triton/backends/amd/include/hip/amd_detail/amd_hip_fp16.h +0 -1809
  131. triton/backends/amd/include/hip/amd_detail/amd_hip_fp8.h +0 -1391
  132. triton/backends/amd/include/hip/amd_detail/amd_hip_gl_interop.h +0 -108
  133. triton/backends/amd/include/hip/amd_detail/amd_hip_math_constants.h +0 -124
  134. triton/backends/amd/include/hip/amd_detail/amd_hip_runtime.h +0 -405
  135. triton/backends/amd/include/hip/amd_detail/amd_hip_runtime_pt_api.h +0 -196
  136. triton/backends/amd/include/hip/amd_detail/amd_hip_unsafe_atomics.h +0 -565
  137. triton/backends/amd/include/hip/amd_detail/amd_hip_vector_types.h +0 -2226
  138. triton/backends/amd/include/hip/amd_detail/amd_math_functions.h +0 -104
  139. triton/backends/amd/include/hip/amd_detail/amd_surface_functions.h +0 -244
  140. triton/backends/amd/include/hip/amd_detail/amd_warp_functions.h +0 -538
  141. triton/backends/amd/include/hip/amd_detail/amd_warp_sync_functions.h +0 -288
  142. triton/backends/amd/include/hip/amd_detail/concepts.hpp +0 -30
  143. triton/backends/amd/include/hip/amd_detail/device_library_decls.h +0 -133
  144. triton/backends/amd/include/hip/amd_detail/functional_grid_launch.hpp +0 -218
  145. triton/backends/amd/include/hip/amd_detail/grid_launch.h +0 -67
  146. triton/backends/amd/include/hip/amd_detail/grid_launch.hpp +0 -50
  147. triton/backends/amd/include/hip/amd_detail/grid_launch_GGL.hpp +0 -26
  148. triton/backends/amd/include/hip/amd_detail/helpers.hpp +0 -137
  149. triton/backends/amd/include/hip/amd_detail/hip_api_trace.hpp +0 -1446
  150. triton/backends/amd/include/hip/amd_detail/hip_assert.h +0 -101
  151. triton/backends/amd/include/hip/amd_detail/hip_cooperative_groups_helper.h +0 -242
  152. triton/backends/amd/include/hip/amd_detail/hip_fp16_gcc.h +0 -254
  153. triton/backends/amd/include/hip/amd_detail/hip_fp16_math_fwd.h +0 -96
  154. triton/backends/amd/include/hip/amd_detail/hip_ldg.h +0 -100
  155. triton/backends/amd/include/hip/amd_detail/hip_prof_str.h +0 -10570
  156. triton/backends/amd/include/hip/amd_detail/hip_runtime_prof.h +0 -78
  157. triton/backends/amd/include/hip/amd_detail/host_defines.h +0 -184
  158. triton/backends/amd/include/hip/amd_detail/hsa_helpers.hpp +0 -102
  159. triton/backends/amd/include/hip/amd_detail/macro_based_grid_launch.hpp +0 -798
  160. triton/backends/amd/include/hip/amd_detail/math_fwd.h +0 -698
  161. triton/backends/amd/include/hip/amd_detail/ockl_image.h +0 -177
  162. triton/backends/amd/include/hip/amd_detail/program_state.hpp +0 -107
  163. triton/backends/amd/include/hip/amd_detail/texture_fetch_functions.h +0 -491
  164. triton/backends/amd/include/hip/amd_detail/texture_indirect_functions.h +0 -478
  165. triton/backends/amd/include/hip/channel_descriptor.h +0 -39
  166. triton/backends/amd/include/hip/device_functions.h +0 -38
  167. triton/backends/amd/include/hip/driver_types.h +0 -468
  168. triton/backends/amd/include/hip/hip_bf16.h +0 -36
  169. triton/backends/amd/include/hip/hip_bfloat16.h +0 -44
  170. triton/backends/amd/include/hip/hip_common.h +0 -100
  171. triton/backends/amd/include/hip/hip_complex.h +0 -38
  172. triton/backends/amd/include/hip/hip_cooperative_groups.h +0 -46
  173. triton/backends/amd/include/hip/hip_deprecated.h +0 -95
  174. triton/backends/amd/include/hip/hip_ext.h +0 -161
  175. triton/backends/amd/include/hip/hip_fp16.h +0 -36
  176. triton/backends/amd/include/hip/hip_fp8.h +0 -33
  177. triton/backends/amd/include/hip/hip_gl_interop.h +0 -32
  178. triton/backends/amd/include/hip/hip_hcc.h +0 -24
  179. triton/backends/amd/include/hip/hip_math_constants.h +0 -36
  180. triton/backends/amd/include/hip/hip_profile.h +0 -27
  181. triton/backends/amd/include/hip/hip_runtime.h +0 -75
  182. triton/backends/amd/include/hip/hip_runtime_api.h +0 -9261
  183. triton/backends/amd/include/hip/hip_texture_types.h +0 -29
  184. triton/backends/amd/include/hip/hip_vector_types.h +0 -41
  185. triton/backends/amd/include/hip/hip_version.h +0 -17
  186. triton/backends/amd/include/hip/hiprtc.h +0 -421
  187. triton/backends/amd/include/hip/library_types.h +0 -78
  188. triton/backends/amd/include/hip/math_functions.h +0 -42
  189. triton/backends/amd/include/hip/surface_types.h +0 -63
  190. triton/backends/amd/include/hip/texture_types.h +0 -194
  191. triton/backends/amd/include/hsa/Brig.h +0 -1131
  192. triton/backends/amd/include/hsa/amd_hsa_common.h +0 -91
  193. triton/backends/amd/include/hsa/amd_hsa_elf.h +0 -462
  194. triton/backends/amd/include/hsa/amd_hsa_kernel_code.h +0 -269
  195. triton/backends/amd/include/hsa/amd_hsa_queue.h +0 -109
  196. triton/backends/amd/include/hsa/amd_hsa_signal.h +0 -80
  197. triton/backends/amd/include/hsa/hsa.h +0 -5738
  198. triton/backends/amd/include/hsa/hsa_amd_tool.h +0 -91
  199. triton/backends/amd/include/hsa/hsa_api_trace.h +0 -579
  200. triton/backends/amd/include/hsa/hsa_api_trace_version.h +0 -68
  201. triton/backends/amd/include/hsa/hsa_ext_amd.h +0 -3146
  202. triton/backends/amd/include/hsa/hsa_ext_finalize.h +0 -531
  203. triton/backends/amd/include/hsa/hsa_ext_image.h +0 -1454
  204. triton/backends/amd/include/hsa/hsa_ven_amd_aqlprofile.h +0 -488
  205. triton/backends/amd/include/hsa/hsa_ven_amd_loader.h +0 -667
  206. triton/backends/amd/include/hsa/hsa_ven_amd_pc_sampling.h +0 -416
  207. triton/backends/amd/include/roctracer/ext/prof_protocol.h +0 -107
  208. triton/backends/amd/include/roctracer/hip_ostream_ops.h +0 -4515
  209. triton/backends/amd/include/roctracer/hsa_ostream_ops.h +0 -1727
  210. triton/backends/amd/include/roctracer/hsa_prof_str.h +0 -3059
  211. triton/backends/amd/include/roctracer/roctracer.h +0 -779
  212. triton/backends/amd/include/roctracer/roctracer_ext.h +0 -81
  213. triton/backends/amd/include/roctracer/roctracer_hcc.h +0 -24
  214. triton/backends/amd/include/roctracer/roctracer_hip.h +0 -37
  215. triton/backends/amd/include/roctracer/roctracer_hsa.h +0 -112
  216. triton/backends/amd/include/roctracer/roctracer_plugin.h +0 -137
  217. triton/backends/amd/include/roctracer/roctracer_roctx.h +0 -67
  218. triton/backends/amd/include/roctracer/roctx.h +0 -229
  219. triton/language/_utils.py +0 -21
  220. triton/language/extra/cuda/_experimental_tma.py +0 -106
  221. triton/runtime/tcc/lib/libtcc1-64.a +0 -0
  222. triton/tools/experimental_descriptor.py +0 -32
  223. triton_windows-3.3.1.post19.dist-info/RECORD +0 -260
  224. triton_windows-3.3.1.post19.dist-info/top_level.txt +0 -14
  225. {triton_windows-3.3.1.post19.dist-info → triton_windows-3.5.0.post21.dist-info}/WHEEL +0 -0
@@ -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
Binary file