1
0

uv-win.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. /* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  2. *
  3. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4. * of this software and associated documentation files (the "Software"), to
  5. * deal in the Software without restriction, including without limitation the
  6. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  7. * sell copies of the Software, and to permit persons to whom the Software is
  8. * furnished to do so, subject to the following conditions:
  9. *
  10. * The above copyright notice and this permission notice shall be included in
  11. * all copies or substantial portions of the Software.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  18. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  19. * IN THE SOFTWARE.
  20. */
  21. #ifndef _WIN32_WINNT
  22. # define _WIN32_WINNT 0x0502
  23. #endif
  24. #if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED)
  25. typedef intptr_t ssize_t;
  26. # define _SSIZE_T_
  27. # define _SSIZE_T_DEFINED
  28. #endif
  29. #include <winsock2.h>
  30. #include <mswsock.h>
  31. #include <ws2tcpip.h>
  32. #include <windows.h>
  33. #include <process.h>
  34. #include <signal.h>
  35. #include <sys/stat.h>
  36. #if defined(_MSC_VER) && _MSC_VER < 1600
  37. # include "stdint-msvc2008.h"
  38. #else
  39. # include <stdint.h>
  40. #endif
  41. #include "tree.h"
  42. #define MAX_PIPENAME_LEN 256
  43. #ifndef S_IFLNK
  44. # define S_IFLNK 0xA000
  45. #endif
  46. /* Additional signals supported by uv_signal and or uv_kill. The CRT defines
  47. * the following signals already:
  48. *
  49. * #define SIGINT 2
  50. * #define SIGILL 4
  51. * #define SIGABRT_COMPAT 6
  52. * #define SIGFPE 8
  53. * #define SIGSEGV 11
  54. * #define SIGTERM 15
  55. * #define SIGBREAK 21
  56. * #define SIGABRT 22
  57. *
  58. * The additional signals have values that are common on other Unix
  59. * variants (Linux and Darwin)
  60. */
  61. #define SIGHUP 1
  62. #define SIGKILL 9
  63. #define SIGWINCH 28
  64. /* The CRT defines SIGABRT_COMPAT as 6, which equals SIGABRT on many */
  65. /* unix-like platforms. However MinGW doesn't define it, so we do. */
  66. #ifndef SIGABRT_COMPAT
  67. # define SIGABRT_COMPAT 6
  68. #endif
  69. /*
  70. * Guids and typedefs for winsock extension functions
  71. * Mingw32 doesn't have these :-(
  72. */
  73. #ifndef WSAID_ACCEPTEX
  74. # define WSAID_ACCEPTEX \
  75. {0xb5367df1, 0xcbac, 0x11cf, \
  76. {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}}
  77. # define WSAID_CONNECTEX \
  78. {0x25a207b9, 0xddf3, 0x4660, \
  79. {0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e}}
  80. # define WSAID_GETACCEPTEXSOCKADDRS \
  81. {0xb5367df2, 0xcbac, 0x11cf, \
  82. {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}}
  83. # define WSAID_DISCONNECTEX \
  84. {0x7fda2e11, 0x8630, 0x436f, \
  85. {0xa0, 0x31, 0xf5, 0x36, 0xa6, 0xee, 0xc1, 0x57}}
  86. # define WSAID_TRANSMITFILE \
  87. {0xb5367df0, 0xcbac, 0x11cf, \
  88. {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}}
  89. typedef BOOL PASCAL (*LPFN_ACCEPTEX)
  90. (SOCKET sListenSocket,
  91. SOCKET sAcceptSocket,
  92. PVOID lpOutputBuffer,
  93. DWORD dwReceiveDataLength,
  94. DWORD dwLocalAddressLength,
  95. DWORD dwRemoteAddressLength,
  96. LPDWORD lpdwBytesReceived,
  97. LPOVERLAPPED lpOverlapped);
  98. typedef BOOL PASCAL (*LPFN_CONNECTEX)
  99. (SOCKET s,
  100. const struct sockaddr* name,
  101. int namelen,
  102. PVOID lpSendBuffer,
  103. DWORD dwSendDataLength,
  104. LPDWORD lpdwBytesSent,
  105. LPOVERLAPPED lpOverlapped);
  106. typedef void PASCAL (*LPFN_GETACCEPTEXSOCKADDRS)
  107. (PVOID lpOutputBuffer,
  108. DWORD dwReceiveDataLength,
  109. DWORD dwLocalAddressLength,
  110. DWORD dwRemoteAddressLength,
  111. LPSOCKADDR* LocalSockaddr,
  112. LPINT LocalSockaddrLength,
  113. LPSOCKADDR* RemoteSockaddr,
  114. LPINT RemoteSockaddrLength);
  115. typedef BOOL PASCAL (*LPFN_DISCONNECTEX)
  116. (SOCKET hSocket,
  117. LPOVERLAPPED lpOverlapped,
  118. DWORD dwFlags,
  119. DWORD reserved);
  120. typedef BOOL PASCAL (*LPFN_TRANSMITFILE)
  121. (SOCKET hSocket,
  122. HANDLE hFile,
  123. DWORD nNumberOfBytesToWrite,
  124. DWORD nNumberOfBytesPerSend,
  125. LPOVERLAPPED lpOverlapped,
  126. LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers,
  127. DWORD dwFlags);
  128. typedef PVOID RTL_SRWLOCK;
  129. typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK;
  130. #endif
  131. typedef int (WSAAPI* LPFN_WSARECV)
  132. (SOCKET socket,
  133. LPWSABUF buffers,
  134. DWORD buffer_count,
  135. LPDWORD bytes,
  136. LPDWORD flags,
  137. LPWSAOVERLAPPED overlapped,
  138. LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine);
  139. typedef int (WSAAPI* LPFN_WSARECVFROM)
  140. (SOCKET socket,
  141. LPWSABUF buffers,
  142. DWORD buffer_count,
  143. LPDWORD bytes,
  144. LPDWORD flags,
  145. struct sockaddr* addr,
  146. LPINT addr_len,
  147. LPWSAOVERLAPPED overlapped,
  148. LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine);
  149. #ifndef _NTDEF_
  150. typedef LONG NTSTATUS;
  151. typedef NTSTATUS *PNTSTATUS;
  152. #endif
  153. #ifndef RTL_CONDITION_VARIABLE_INIT
  154. typedef PVOID CONDITION_VARIABLE, *PCONDITION_VARIABLE;
  155. #endif
  156. typedef struct _AFD_POLL_HANDLE_INFO {
  157. HANDLE Handle;
  158. ULONG Events;
  159. NTSTATUS Status;
  160. } AFD_POLL_HANDLE_INFO, *PAFD_POLL_HANDLE_INFO;
  161. typedef struct _AFD_POLL_INFO {
  162. LARGE_INTEGER Timeout;
  163. ULONG NumberOfHandles;
  164. ULONG Exclusive;
  165. AFD_POLL_HANDLE_INFO Handles[1];
  166. } AFD_POLL_INFO, *PAFD_POLL_INFO;
  167. #define UV_MSAFD_PROVIDER_COUNT 3
  168. /**
  169. * It should be possible to cast uv_buf_t[] to WSABUF[]
  170. * see http://msdn.microsoft.com/en-us/library/ms741542(v=vs.85).aspx
  171. */
  172. typedef struct uv_buf_t {
  173. ULONG len;
  174. char* base;
  175. } uv_buf_t;
  176. typedef int uv_file;
  177. typedef SOCKET uv_os_sock_t;
  178. typedef HANDLE uv_thread_t;
  179. typedef HANDLE uv_sem_t;
  180. typedef CRITICAL_SECTION uv_mutex_t;
  181. /* This condition variable implementation is based on the SetEvent solution
  182. * (section 3.2) at http://www.cs.wustl.edu/~schmidt/win32-cv-1.html
  183. * We could not use the SignalObjectAndWait solution (section 3.4) because
  184. * it want the 2nd argument (type uv_mutex_t) of uv_cond_wait() and
  185. * uv_cond_timedwait() to be HANDLEs, but we use CRITICAL_SECTIONs.
  186. */
  187. typedef union {
  188. CONDITION_VARIABLE cond_var;
  189. struct {
  190. unsigned int waiters_count;
  191. CRITICAL_SECTION waiters_count_lock;
  192. HANDLE signal_event;
  193. HANDLE broadcast_event;
  194. } fallback;
  195. } uv_cond_t;
  196. typedef union {
  197. /* srwlock_ has type SRWLOCK, but not all toolchains define this type in */
  198. /* windows.h. */
  199. SRWLOCK srwlock_;
  200. struct {
  201. uv_mutex_t read_mutex_;
  202. uv_mutex_t write_mutex_;
  203. unsigned int num_readers_;
  204. } fallback_;
  205. } uv_rwlock_t;
  206. typedef struct {
  207. unsigned int n;
  208. unsigned int count;
  209. uv_mutex_t mutex;
  210. uv_sem_t turnstile1;
  211. uv_sem_t turnstile2;
  212. } uv_barrier_t;
  213. typedef struct {
  214. DWORD tls_index;
  215. } uv_key_t;
  216. #define UV_ONCE_INIT { 0, NULL }
  217. typedef struct uv_once_s {
  218. unsigned char ran;
  219. HANDLE event;
  220. } uv_once_t;
  221. /* Platform-specific definitions for uv_spawn support. */
  222. typedef unsigned char uv_uid_t;
  223. typedef unsigned char uv_gid_t;
  224. /* Platform-specific definitions for uv_dlopen support. */
  225. #define UV_DYNAMIC FAR WINAPI
  226. typedef struct {
  227. HMODULE handle;
  228. char* errmsg;
  229. } uv_lib_t;
  230. RB_HEAD(uv_timer_tree_s, uv_timer_s);
  231. #define UV_LOOP_PRIVATE_FIELDS \
  232. /* The loop's I/O completion port */ \
  233. HANDLE iocp; \
  234. /* The current time according to the event loop. in msecs. */ \
  235. uint64_t time; \
  236. /* GetTickCount() result when the event loop time was last updated. */ \
  237. DWORD last_tick_count; \
  238. /* Tail of a single-linked circular queue of pending reqs. If the queue */ \
  239. /* is empty, tail_ is NULL. If there is only one item, */ \
  240. /* tail_->next_req == tail_ */ \
  241. uv_req_t* pending_reqs_tail; \
  242. /* Head of a single-linked list of closed handles */ \
  243. uv_handle_t* endgame_handles; \
  244. /* The head of the timers tree */ \
  245. struct uv_timer_tree_s timers; \
  246. /* Lists of active loop (prepare / check / idle) watchers */ \
  247. uv_prepare_t* prepare_handles; \
  248. uv_check_t* check_handles; \
  249. uv_idle_t* idle_handles; \
  250. /* This pointer will refer to the prepare/check/idle handle whose */ \
  251. /* callback is scheduled to be called next. This is needed to allow */ \
  252. /* safe removal from one of the lists above while that list being */ \
  253. /* iterated over. */ \
  254. uv_prepare_t* next_prepare_handle; \
  255. uv_check_t* next_check_handle; \
  256. uv_idle_t* next_idle_handle; \
  257. /* This handle holds the peer sockets for the fast variant of uv_poll_t */ \
  258. SOCKET poll_peer_sockets[UV_MSAFD_PROVIDER_COUNT]; \
  259. /* Counter to keep track of active tcp streams */ \
  260. unsigned int active_tcp_streams; \
  261. /* Counter to keep track of active udp streams */ \
  262. unsigned int active_udp_streams; \
  263. /* Counter to started timer */ \
  264. uint64_t timer_counter;
  265. #define UV_REQ_TYPE_PRIVATE \
  266. /* TODO: remove the req suffix */ \
  267. UV_ACCEPT, \
  268. UV_FS_EVENT_REQ, \
  269. UV_POLL_REQ, \
  270. UV_PROCESS_EXIT, \
  271. UV_READ, \
  272. UV_UDP_RECV, \
  273. UV_WAKEUP, \
  274. UV_SIGNAL_REQ,
  275. #define UV_REQ_PRIVATE_FIELDS \
  276. union { \
  277. /* Used by I/O operations */ \
  278. struct { \
  279. OVERLAPPED overlapped; \
  280. size_t queued_bytes; \
  281. }; \
  282. }; \
  283. struct uv_req_s* next_req;
  284. #define UV_WRITE_PRIVATE_FIELDS \
  285. int ipc_header; \
  286. uv_buf_t write_buffer; \
  287. HANDLE event_handle; \
  288. HANDLE wait_handle;
  289. #define UV_CONNECT_PRIVATE_FIELDS \
  290. /* empty */
  291. #define UV_SHUTDOWN_PRIVATE_FIELDS \
  292. /* empty */
  293. #define UV_UDP_SEND_PRIVATE_FIELDS \
  294. /* empty */
  295. #define UV_PRIVATE_REQ_TYPES \
  296. typedef struct uv_pipe_accept_s { \
  297. UV_REQ_FIELDS \
  298. HANDLE pipeHandle; \
  299. struct uv_pipe_accept_s* next_pending; \
  300. } uv_pipe_accept_t; \
  301. \
  302. typedef struct uv_tcp_accept_s { \
  303. UV_REQ_FIELDS \
  304. SOCKET accept_socket; \
  305. char accept_buffer[sizeof(struct sockaddr_storage) * 2 + 32]; \
  306. HANDLE event_handle; \
  307. HANDLE wait_handle; \
  308. struct uv_tcp_accept_s* next_pending; \
  309. } uv_tcp_accept_t; \
  310. \
  311. typedef struct uv_read_s { \
  312. UV_REQ_FIELDS \
  313. HANDLE event_handle; \
  314. HANDLE wait_handle; \
  315. } uv_read_t;
  316. #define uv_stream_connection_fields \
  317. unsigned int write_reqs_pending; \
  318. uv_shutdown_t* shutdown_req;
  319. #define uv_stream_server_fields \
  320. uv_connection_cb connection_cb;
  321. #define UV_STREAM_PRIVATE_FIELDS \
  322. unsigned int reqs_pending; \
  323. int activecnt; \
  324. uv_read_t read_req; \
  325. union { \
  326. struct { uv_stream_connection_fields }; \
  327. struct { uv_stream_server_fields }; \
  328. };
  329. #define uv_tcp_server_fields \
  330. uv_tcp_accept_t* accept_reqs; \
  331. unsigned int processed_accepts; \
  332. uv_tcp_accept_t* pending_accepts; \
  333. LPFN_ACCEPTEX func_acceptex;
  334. #define uv_tcp_connection_fields \
  335. uv_buf_t read_buffer; \
  336. LPFN_CONNECTEX func_connectex;
  337. #define UV_TCP_PRIVATE_FIELDS \
  338. SOCKET socket; \
  339. int bind_error; \
  340. union { \
  341. struct { uv_tcp_server_fields }; \
  342. struct { uv_tcp_connection_fields }; \
  343. };
  344. #define UV_UDP_PRIVATE_FIELDS \
  345. SOCKET socket; \
  346. unsigned int reqs_pending; \
  347. int activecnt; \
  348. uv_req_t recv_req; \
  349. uv_buf_t recv_buffer; \
  350. struct sockaddr_storage recv_from; \
  351. int recv_from_len; \
  352. uv_udp_recv_cb recv_cb; \
  353. uv_alloc_cb alloc_cb; \
  354. LPFN_WSARECV func_wsarecv; \
  355. LPFN_WSARECVFROM func_wsarecvfrom;
  356. #define uv_pipe_server_fields \
  357. int pending_instances; \
  358. uv_pipe_accept_t* accept_reqs; \
  359. uv_pipe_accept_t* pending_accepts;
  360. #define uv_pipe_connection_fields \
  361. uv_timer_t* eof_timer; \
  362. uv_write_t ipc_header_write_req; \
  363. int ipc_pid; \
  364. uint64_t remaining_ipc_rawdata_bytes; \
  365. unsigned char reserved[sizeof(void*)]; \
  366. struct { \
  367. WSAPROTOCOL_INFOW* socket_info; \
  368. int tcp_connection; \
  369. } pending_ipc_info; \
  370. uv_write_t* non_overlapped_writes_tail;
  371. #define UV_PIPE_PRIVATE_FIELDS \
  372. HANDLE handle; \
  373. WCHAR* name; \
  374. union { \
  375. struct { uv_pipe_server_fields }; \
  376. struct { uv_pipe_connection_fields }; \
  377. };
  378. /* TODO: put the parser states in an union - TTY handles are always */
  379. /* half-duplex so read-state can safely overlap write-state. */
  380. #define UV_TTY_PRIVATE_FIELDS \
  381. HANDLE handle; \
  382. union { \
  383. struct { \
  384. /* Used for readable TTY handles */ \
  385. HANDLE read_line_handle; \
  386. uv_buf_t read_line_buffer; \
  387. HANDLE read_raw_wait; \
  388. /* Fields used for translating win keystrokes into vt100 characters */ \
  389. char last_key[8]; \
  390. unsigned char last_key_offset; \
  391. unsigned char last_key_len; \
  392. WCHAR last_utf16_high_surrogate; \
  393. INPUT_RECORD last_input_record; \
  394. }; \
  395. struct { \
  396. /* Used for writable TTY handles */ \
  397. /* utf8-to-utf16 conversion state */ \
  398. unsigned int utf8_codepoint; \
  399. unsigned char utf8_bytes_left; \
  400. /* eol conversion state */ \
  401. unsigned char previous_eol; \
  402. /* ansi parser state */ \
  403. unsigned char ansi_parser_state; \
  404. unsigned char ansi_csi_argc; \
  405. unsigned short ansi_csi_argv[4]; \
  406. COORD saved_position; \
  407. WORD saved_attributes; \
  408. }; \
  409. };
  410. #define UV_POLL_PRIVATE_FIELDS \
  411. SOCKET socket; \
  412. /* Used in fast mode */ \
  413. SOCKET peer_socket; \
  414. AFD_POLL_INFO afd_poll_info_1; \
  415. AFD_POLL_INFO afd_poll_info_2; \
  416. /* Used in fast and slow mode. */ \
  417. uv_req_t poll_req_1; \
  418. uv_req_t poll_req_2; \
  419. unsigned char submitted_events_1; \
  420. unsigned char submitted_events_2; \
  421. unsigned char mask_events_1; \
  422. unsigned char mask_events_2; \
  423. unsigned char events;
  424. #define UV_TIMER_PRIVATE_FIELDS \
  425. RB_ENTRY(uv_timer_s) tree_entry; \
  426. uint64_t due; \
  427. uint64_t repeat; \
  428. uint64_t start_id; \
  429. uv_timer_cb timer_cb;
  430. #define UV_ASYNC_PRIVATE_FIELDS \
  431. struct uv_req_s async_req; \
  432. uv_async_cb async_cb; \
  433. /* char to avoid alignment issues */ \
  434. char volatile async_sent;
  435. #define UV_PREPARE_PRIVATE_FIELDS \
  436. uv_prepare_t* prepare_prev; \
  437. uv_prepare_t* prepare_next; \
  438. uv_prepare_cb prepare_cb;
  439. #define UV_CHECK_PRIVATE_FIELDS \
  440. uv_check_t* check_prev; \
  441. uv_check_t* check_next; \
  442. uv_check_cb check_cb;
  443. #define UV_IDLE_PRIVATE_FIELDS \
  444. uv_idle_t* idle_prev; \
  445. uv_idle_t* idle_next; \
  446. uv_idle_cb idle_cb;
  447. #define UV_HANDLE_PRIVATE_FIELDS \
  448. uv_handle_t* endgame_next; \
  449. unsigned int flags;
  450. #define UV_GETADDRINFO_PRIVATE_FIELDS \
  451. uv_getaddrinfo_cb getaddrinfo_cb; \
  452. void* alloc; \
  453. WCHAR* node; \
  454. WCHAR* service; \
  455. struct addrinfoW* hints; \
  456. struct addrinfoW* res; \
  457. int retcode;
  458. #define UV_PROCESS_PRIVATE_FIELDS \
  459. struct uv_process_exit_s { \
  460. UV_REQ_FIELDS \
  461. } exit_req; \
  462. BYTE* child_stdio_buffer; \
  463. int exit_signal; \
  464. HANDLE wait_handle; \
  465. HANDLE process_handle; \
  466. volatile char exit_cb_pending;
  467. #define UV_FS_PRIVATE_FIELDS \
  468. int flags; \
  469. DWORD sys_errno_; \
  470. union { \
  471. /* TODO: remove me in 0.9. */ \
  472. WCHAR* pathw; \
  473. int fd; \
  474. }; \
  475. union { \
  476. struct { \
  477. int mode; \
  478. WCHAR* new_pathw; \
  479. int file_flags; \
  480. int fd_out; \
  481. void* buf; \
  482. size_t length; \
  483. int64_t offset; \
  484. }; \
  485. struct { \
  486. double atime; \
  487. double mtime; \
  488. }; \
  489. };
  490. #define UV_WORK_PRIVATE_FIELDS \
  491. #define UV_FS_EVENT_PRIVATE_FIELDS \
  492. struct uv_fs_event_req_s { \
  493. UV_REQ_FIELDS \
  494. } req; \
  495. HANDLE dir_handle; \
  496. int req_pending; \
  497. uv_fs_event_cb cb; \
  498. WCHAR* filew; \
  499. WCHAR* short_filew; \
  500. WCHAR* dirw; \
  501. char* buffer;
  502. #define UV_SIGNAL_PRIVATE_FIELDS \
  503. RB_ENTRY(uv_signal_s) tree_entry; \
  504. struct uv_req_s signal_req; \
  505. unsigned long pending_signum;
  506. int uv_utf16_to_utf8(const WCHAR* utf16Buffer, size_t utf16Size,
  507. char* utf8Buffer, size_t utf8Size);
  508. int uv_utf8_to_utf16(const char* utf8Buffer, WCHAR* utf16Buffer,
  509. size_t utf16Size);
  510. #define UV_PLATFORM_HAS_IP6_LINK_LOCAL_ADDRESS