ReactOS 0.4.15-dev-8344-g0574987
mstcpip.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7#ifndef ASSERT
8#define MSTCPIP_ASSERT_UNDEFINED
9#define ASSERT(exp) ((VOID) 0)
10#endif
11
12#ifdef _MSC_VER
13#define MSTCPIP_INLINE __inline
14#else
15#define MSTCPIP_INLINE static inline
16#endif
17
18#include <nldef.h>
19
24};
25
26#define SIO_RCVALL _WSAIOW(IOC_VENDOR,1)
27#define SIO_RCVALL_MCAST _WSAIOW(IOC_VENDOR,2)
28#define SIO_RCVALL_IGMPMCAST _WSAIOW(IOC_VENDOR,3)
29#define SIO_KEEPALIVE_VALS _WSAIOW(IOC_VENDOR,4)
30#define SIO_ABSORB_RTRALERT _WSAIOW(IOC_VENDOR,5)
31#define SIO_UCAST_IF _WSAIOW(IOC_VENDOR,6)
32#define SIO_LIMIT_BROADCASTS _WSAIOW(IOC_VENDOR,7)
33#define SIO_INDEX_BIND _WSAIOW(IOC_VENDOR,8)
34#define SIO_INDEX_MCASTIF _WSAIOW(IOC_VENDOR,9)
35#define SIO_INDEX_ADD_MCAST _WSAIOW(IOC_VENDOR,10)
36#define SIO_INDEX_DEL_MCAST _WSAIOW(IOC_VENDOR,11)
37#define SIO_RCVALL_MCAST_IF _WSAIOW(IOC_VENDOR,13)
38#define SIO_RCVALL_IF _WSAIOW(IOC_VENDOR,14)
39
40typedef enum {
46
47#define RCVALL_MAX RCVALL_IPLEVEL
48
49typedef struct {
53
54#if (NTDDI_VERSION >= NTDDI_WIN7)
55DEFINE_GUID(SOCKET_DEFAULT2_QM_POLICY, 0xaec2ef9c, 0x3a4d, 0x4d3e, 0x88, 0x42, 0x23, 0x99, 0x42, 0xe3, 0x9a, 0x47);
56#endif
57
58#define SIO_ACQUIRE_PORT_RESERVATION _WSAIOW(IOC_VENDOR, 100)
59#define SIO_RELEASE_PORT_RESERVATION _WSAIOW(IOC_VENDOR, 101)
60#define SIO_ASSOCIATE_PORT_RESERVATION _WSAIOW(IOC_VENDOR, 102)
61
62typedef struct _INET_PORT_RANGE {
67
68typedef struct {
71
72#define INVALID_PORT_RESERVATION_TOKEN ((ULONG64)0)
73
74typedef struct {
75#ifdef __cplusplus
76 INET_PORT_RESERVATION Reservation;
78#else
81#endif
83
84typedef struct {
88
89#ifdef _WS2DEF_
90
91#if (NTDDI_VERSION >= NTDDI_VISTA)
92
93#define _SECURE_SOCKET_TYPES_DEFINED_
94
95#define SIO_SET_SECURITY _WSAIOW(IOC_VENDOR, 200)
96#define SIO_QUERY_SECURITY _WSAIORW(IOC_VENDOR, 201)
97#define SIO_SET_PEER_TARGET_NAME _WSAIOW(IOC_VENDOR, 202)
98#define SIO_DELETE_PEER_TARGET_NAME _WSAIOW(IOC_VENDOR, 203)
99
100#define SIO_SOCKET_USAGE_NOTIFICATION _WSAIOW(IOC_VENDOR, 204)
101
102typedef enum _SOCKET_USAGE_TYPE {
103 SYSTEM_CRITICAL_SOCKET = 1
104}SOCKET_USAGE_TYPE;
105
106typedef enum _SOCKET_SECURITY_PROTOCOL {
107 SOCKET_SECURITY_PROTOCOL_DEFAULT,
108 SOCKET_SECURITY_PROTOCOL_IPSEC,
109#if (NTDDI_VERSION >= NTDDI_WIN7)
110 SOCKET_SECURITY_PROTOCOL_IPSEC2,
111#endif
112 SOCKET_SECURITY_PROTOCOL_INVALID
113} SOCKET_SECURITY_PROTOCOL;
114
115#define SOCKET_SETTINGS_GUARANTEE_ENCRYPTION 0x1
116#define SOCKET_SETTINGS_ALLOW_INSECURE 0x2
117
118typedef struct _SOCKET_SECURITY_SETTINGS {
119 SOCKET_SECURITY_PROTOCOL SecurityProtocol;
120 ULONG SecurityFlags;
121} SOCKET_SECURITY_SETTINGS;
122
123#define SOCKET_SETTINGS_IPSEC_SKIP_FILTER_INSTANTIATION 0x1
124
125#if (NTDDI_VERSION >= NTDDI_WIN7)
126
127#define SOCKET_SETTINGS_IPSEC_OPTIONAL_PEER_NAME_VERIFICATION 0x2
128#define SOCKET_SETTINGS_IPSEC_ALLOW_FIRST_INBOUND_PKT_UNENCRYPTED 0x4
129#define SOCKET_SETTINGS_IPSEC_PEER_NAME_IS_RAW_FORMAT 0x8
130
131#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
132
133typedef struct _SOCKET_SECURITY_SETTINGS_IPSEC {
134 SOCKET_SECURITY_PROTOCOL SecurityProtocol;
135 ULONG SecurityFlags;
136 ULONG IpsecFlags;
137 GUID AuthipMMPolicyKey;
138 GUID AuthipQMPolicyKey;
141 ULONG UserNameStringLen;
142 ULONG DomainNameStringLen;
143 ULONG PasswordStringLen;
144 wchar_t AllStrings[0];
145} SOCKET_SECURITY_SETTINGS_IPSEC;
146
147typedef struct _SOCKET_PEER_TARGET_NAME {
148 SOCKET_SECURITY_PROTOCOL SecurityProtocol;
149 SOCKADDR_STORAGE PeerAddress;
150 ULONG PeerTargetNameStringLen;
151 wchar_t AllStrings[0];
152} SOCKET_PEER_TARGET_NAME;
153
154typedef struct _SOCKET_SECURITY_QUERY_TEMPLATE {
155 SOCKET_SECURITY_PROTOCOL SecurityProtocol;
156 SOCKADDR_STORAGE PeerAddress;
157 ULONG PeerTokenAccessMask;
158} SOCKET_SECURITY_QUERY_TEMPLATE;
159
160#if (NTDDI_VERSION >= NTDDI_WIN7)
161
162#define SOCKET_QUERY_IPSEC2_ABORT_CONNECTION_ON_FIELD_CHANGE 0x1
163
164#define SOCKET_QUERY_IPSEC2_FIELD_MASK_MM_SA_ID 0x1
165#define SOCKET_QUERY_IPSEC2_FIELD_MASK_QM_SA_ID 0x2
166
167typedef struct _SOCKET_SECURITY_QUERY_TEMPLATE_IPSEC2 {
168 SOCKET_SECURITY_PROTOCOL SecurityProtocol;
169 SOCKADDR_STORAGE PeerAddress;
170 ULONG PeerTokenAccessMask;
171 ULONG Flags;
172 ULONG FieldMask;
173} SOCKET_SECURITY_QUERY_TEMPLATE_IPSEC2;
174
175#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
176
177#define SOCKET_INFO_CONNECTION_SECURED 0x1
178#define SOCKET_INFO_CONNECTION_ENCRYPTED 0x2
179#define SOCKET_INFO_CONNECTION_IMPERSONATED 0x4
180
181typedef struct _SOCKET_SECURITY_QUERY_INFO {
182 SOCKET_SECURITY_PROTOCOL SecurityProtocol;
183 ULONG Flags;
184 UINT64 PeerApplicationAccessTokenHandle;
185 UINT64 PeerMachineAccessTokenHandle;
186} SOCKET_SECURITY_QUERY_INFO;
187
188#if (NTDDI_VERSION >= NTDDI_WIN7)
189typedef struct _SOCKET_SECURITY_QUERY_INFO_IPSEC2 {
190 SOCKET_SECURITY_PROTOCOL SecurityProtocol;
191 ULONG Flags;
192 UINT64 PeerApplicationAccessTokenHandle;
193 UINT64 PeerMachineAccessTokenHandle;
194 UINT64 MmSaId;
195 UINT64 QmSaId;
196 UINT32 NegotiationWinerr;
197 GUID SaLookupContext;
198} SOCKET_SECURITY_QUERY_INFO_IPSEC2;
199#endif
200
201#define SIO_QUERY_WFP_ALE_ENDPOINT_HANDLE _WSAIOR(IOC_VENDOR, 205)
202#define SIO_QUERY_RSS_SCALABILITY_INFO _WSAIOR(IOC_VENDOR, 210)
203
204typedef struct _RSS_SCALABILITY_INFO {
205 BOOLEAN RssEnabled;
206} RSS_SCALABILITY_INFO, *PRSS_SCALABILITY_INFO;
207
208#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
209
210#define IN4_CLASSA(i) (((LONG)(i) & 0x00000080) == 0)
211#define IN4_CLASSB(i) (((LONG)(i) & 0x000000c0) == 0x00000080)
212#define IN4_CLASSC(i) (((LONG)(i) & 0x000000e0) == 0x000000c0)
213#define IN4_CLASSD(i) (((LONG)(i) & 0x000000f0) == 0x000000e0)
214#define IN4_MULTICAST(i) IN4_CLASSD(i)
215
216#define IN4ADDR_ANY INADDR_ANY
217#define IN4ADDR_LOOPBACK 0x0100007f
218#define IN4ADDR_BROADCAST INADDR_BROADCAST
219#define IN4ADDR_NONE INADDR_NONE
220#define IN4ADDR_ANY_INIT { 0 }
221#define IN4ADDR_LOOPBACK_INIT { 0x7f, 0, 0, 1 }
222#define IN4ADDR_BROADCAST_INIT { 0xff, 0xff, 0xff, 0xff }
223#define IN4ADDR_ALLNODESONLINK_INIT { 0xe0, 0, 0, 1 }
224#define IN4ADDR_ALLROUTERSONLINK_INIT { 0xe0, 0, 0, 2 }
225#define IN4ADDR_ALLIGMPV3ROUTERSONLINK_INIT { 0xe0, 0, 0, 0x16 }
226#define IN4ADDR_ALLTEREDONODESONLINK_INIT { 0xe0, 0, 0, 0xfd }
227#define IN4ADDR_LINKLOCALPREFIX_INIT { 0xa9, 0xfe, }
228#define IN4ADDR_MULTICASTPREFIX_INIT { 0xe0, }
229
230#define IN4ADDR_LOOPBACKPREFIX_LENGTH 8
231#define IN4ADDR_LINKLOCALPREFIX_LENGTH 16
232#define IN4ADDR_MULTICASTPREFIX_LENGTH 4
233
234#if (NTDDI_VERSION >= NTDDI_WIN2KSP1)
235
238IN4_ADDR_EQUAL(
241{
242 return (BOOLEAN)(a->s_addr == b->s_addr);
243}
244
247IN4_UNALIGNED_ADDR_EQUAL(
250{
251 return (BOOLEAN)(a->s_addr == b->s_addr);
252}
253
256IN4_IS_ADDR_UNSPECIFIED(
258{
259 return (BOOLEAN)(a->s_addr == IN4ADDR_ANY);
260}
261
264IN4_IS_UNALIGNED_ADDR_UNSPECIFIED(
266{
267 return (BOOLEAN)(a->s_addr == IN4ADDR_ANY);
268}
269
272IN4_IS_ADDR_LOOPBACK(
274{
275 return (BOOLEAN)(*((PUCHAR) a) == 0x7f);
276}
277
280IN4_IS_UNALIGNED_ADDR_LOOPBACK(
282{
283 return (BOOLEAN)(*((PUCHAR) a) == 0x7f);
284}
285
288IN4_IS_ADDR_BROADCAST(
290{
291 return (BOOLEAN)(a->s_addr == IN4ADDR_BROADCAST);
292}
293
296IN4_IS_UNALIGNED_ADDR_BROADCAST(
298{
299 return (BOOLEAN)(a->s_addr == IN4ADDR_BROADCAST);
300}
301
304IN4_IS_ADDR_MULTICAST(
306{
307 return (BOOLEAN)IN4_MULTICAST(a->s_addr);
308}
309
312IN4_IS_UNALIGNED_ADDR_MULTICAST(
314{
315 return (BOOLEAN)IN4_MULTICAST(a->s_addr);
316}
317
320IN4_IS_ADDR_LINKLOCAL(
322{
323 return (BOOLEAN)((a->s_addr & 0xffff) == 0xfea9);
324}
325
328IN4_IS_UNALIGNED_ADDR_LINKLOCAL(
330{
331 return (BOOLEAN)((a->s_addr & 0xffff) == 0xfea9); // 169.254/16
332}
333
336IN4_IS_ADDR_SITELOCAL(
338{
340 return FALSE;
341}
342#define IN4_IS_UNALIGNED_ADDR_SITELOCAL IN4_IS_ADDR_SITELOCAL
343
346IN4_IS_ADDR_RFC1918(
348{
349 return (BOOLEAN)(((a->s_addr & 0x00ff) == 0x0a) ||
350 ((a->s_addr & 0xf0ff) == 0x10ac) ||
351 ((a->s_addr & 0xffff) == 0xa8c0));
352}
353
356IN4_IS_UNALIGNED_ADDR_RFC1918(
358{
359 IN_ADDR Ipv4Address = *a;
360 return IN4_IS_ADDR_RFC1918(&Ipv4Address);
361}
362
365IN4_IS_ADDR_MC_LINKLOCAL(
367{
368 return (BOOLEAN)((a->s_addr & 0xffffff) == 0xe0);
369}
370
373IN4_IS_ADDR_MC_ADMINLOCAL(
375{
376 return (BOOLEAN)((a->s_addr & 0xffff) == 0xffef);
377}
378
381IN4_IS_ADDR_MC_SITELOCAL(
383{
384 return (BOOLEAN)((a->s_addr & 0xff) == 0xef) &&
385 !IN4_IS_ADDR_MC_ADMINLOCAL(a);
386}
387
389VOID
390IN4ADDR_SETSOCKADDR(
394{
395 a->sin_family = AF_INET;
396 a->sin_port = port;
397 a->sin_addr = *addr;
398 memset(a->sin_zero, 0, sizeof(a->sin_zero));
399}
400
402VOID
403IN4ADDR_SETANY(
405{
406 a->sin_family = AF_INET;
407 a->sin_port = 0;
408 a->sin_addr.s_addr = IN4ADDR_ANY;
409 memset(a->sin_zero, 0, sizeof(a->sin_zero));
410}
411
413VOID
414IN4ADDR_SETLOOPBACK(
416{
417 a->sin_family = AF_INET;
418 a->sin_port = 0;
419 a->sin_addr.s_addr = IN4ADDR_LOOPBACK;
420 memset(a->sin_zero, 0, sizeof(a->sin_zero));
421}
422
425IN4ADDR_ISANY(
427{
428 ASSERT(a->sin_family == AF_INET);
429 return IN4_IS_ADDR_UNSPECIFIED(&a->sin_addr);
430}
431
434IN4ADDR_ISLOOPBACK(
436{
437 ASSERT(a->sin_family == AF_INET);
438 return IN4_IS_ADDR_LOOPBACK(&a->sin_addr);
439}
440
443IN4ADDR_SCOPE_ID(
445{
446 SCOPE_ID UnspecifiedScopeId = {{{0}}};
448 return UnspecifiedScopeId;
449}
450
453IN4ADDR_ISEQUAL(
456{
457 ASSERT(a->sin_family == AF_INET);
458 return (BOOLEAN)(IN4ADDR_SCOPE_ID(a).Value == IN4ADDR_SCOPE_ID(b).Value &&
459 IN4_ADDR_EQUAL(&a->sin_addr, &b->sin_addr));
460}
461
464IN4ADDR_ISUNSPECIFIED(
466{
467 ASSERT(a->sin_family == AF_INET);
468 return (BOOLEAN)(IN4ADDR_SCOPE_ID(a).Value == 0 &&
469 IN4_IS_ADDR_UNSPECIFIED(&a->sin_addr));
470}
471
472#define INET_IS_ALIGNED(Pointer, Type) \
473 (((ULONG_PTR)Pointer & (TYPE_ALIGNMENT(Type)-1)) == 0)
474
477Ipv4UnicastAddressScope(
479{
480 IN_ADDR Ipv4Address;
481
482 if (!INET_IS_ALIGNED(Address, IN_ADDR)) {
483 Ipv4Address = *(CONST IN_ADDR UNALIGNED *)Address;
484 Address = (CONST UCHAR *) &Ipv4Address;
485 }
486 if (IN4_IS_ADDR_LINKLOCAL((PIN_ADDR) Address) ||
487 IN4_IS_ADDR_LOOPBACK((PIN_ADDR) Address)) {
488 return ScopeLevelLink;
489 }
490 return ScopeLevelGlobal;
491}
492
495Ipv4MulticastAddressScope(
497{
498 IN_ADDR Ipv4Address;
499
500 if (!INET_IS_ALIGNED(Address, IN_ADDR)) {
501 Ipv4Address = *(CONST IN_ADDR UNALIGNED *)Address;
502 Address = (CONST UCHAR *) &Ipv4Address;
503 }
504 if (IN4_IS_ADDR_MC_LINKLOCAL((PIN_ADDR) Address)) {
505 return ScopeLevelLink;
506 } else if (IN4_IS_ADDR_MC_ADMINLOCAL((PIN_ADDR) Address)) {
507 return ScopeLevelAdmin;
508 } else if (IN4_IS_ADDR_MC_SITELOCAL((PIN_ADDR) Address)) {
509 return ScopeLevelSite;
510 } else {
511 return ScopeLevelGlobal;
512 }
513}
514
517Ipv4AddressScope(
519{
520 CONST IN_ADDR Ipv4Address = *(CONST IN_ADDR UNALIGNED *)Address;
521
522 if (IN4_IS_ADDR_BROADCAST(&Ipv4Address)) {
523 return ScopeLevelLink;
524 } else if (IN4_IS_ADDR_MULTICAST(&Ipv4Address)) {
525 return Ipv4MulticastAddressScope((UCHAR *) &Ipv4Address);
526 } else {
527 return Ipv4UnicastAddressScope((UCHAR *) &Ipv4Address);
528 }
529}
530
533Ipv4AddressType(
535{
536 IN_ADDR Ipv4Address = *(CONST IN_ADDR UNALIGNED *) Address;
537
538 if (IN4_IS_ADDR_MULTICAST(&Ipv4Address)) {
539 return NlatMulticast;
540 }
541 if (IN4_IS_ADDR_BROADCAST(&Ipv4Address)) {
542 return NlatBroadcast;
543 }
544 if (IN4_IS_ADDR_UNSPECIFIED(&Ipv4Address)) {
545 return NlatUnspecified;
546 }
547 if (((Ipv4Address.s_addr & 0x000000ff) == 0) ||
548 ((Ipv4Address.s_addr & 0x000000f0) == 240)) {
549 return NlatInvalid;
550 }
551 return NlatUnicast;
552}
553
555VOID
556IN4_UNCANONICALIZE_SCOPE_ID(
558 _Inout_ SCOPE_ID *ScopeId)
559{
560 SCOPE_LEVEL ScopeLevel = Ipv4AddressScope((CONST UCHAR *)Address);
561
562 if ((IN4_IS_ADDR_LOOPBACK(Address)) || (ScopeLevel == ScopeLevelGlobal)) {
563 ScopeId->Value = 0;
564 }
565 if ((SCOPE_LEVEL)ScopeId->Level == ScopeLevel) {
566 ScopeId->Level = 0;
567 }
568}
569
572IN4_IS_ADDR_6TO4ELIGIBLE(
574{
575 return (BOOLEAN)((Ipv4AddressType((CONST UCHAR *) a) == NlatUnicast) &&
576 !(IN4_IS_ADDR_LOOPBACK(a) ||
577 IN4_IS_ADDR_LINKLOCAL(a) ||
578 IN4_IS_ADDR_SITELOCAL(a) ||
579 IN4_IS_ADDR_RFC1918(a)));
580}
581
584IN4_IS_UNALIGNED_ADDR_6TO4ELIGIBLE(
586{
587 IN_ADDR Ipv4Address = *a;
588 return IN4_IS_ADDR_6TO4ELIGIBLE(&Ipv4Address);
589}
590
591#endif /* (NTDDI_VERSION >= NTDDI_WIN2KSP1) */
592
593#endif /* _WS2DEF_ */
594
595#ifdef _WS2IPDEF_
596
599IN6_PREFIX_EQUAL(
602 _In_ UINT8 len)
603{
604 UINT8 Bytes = len / 8;
605 UINT8 Bits = len % 8;
606 UINT8 Mask = 0xff << (8 - Bits);
607
608 ASSERT(len <= (sizeof(IN6_ADDR) * 8));
609 return (BOOLEAN) (((memcmp(a, b, Bytes)) == 0) && ((Bits == 0) ||
610 ((a->s6_bytes[Bytes] | Mask) == (b->s6_bytes[Bytes] | Mask))));
611}
612
615IN6_IS_ADDR_ALLNODESONNODE(
617{
619}
620
623IN6_IS_ADDR_ALLNODESONLINK(
625{
627}
628
631IN6_IS_ADDR_ALLROUTERSONLINK(
633{
635}
636
639IN6_IS_ADDR_SOLICITEDNODE(
641{
642 return IN6_PREFIX_EQUAL(a, &in6addr_solicitednodemulticastprefix,
644}
645
648IN6_IS_ADDR_ISATAP(
650{
651 return (BOOLEAN)(((a->s6_words[4] & 0xfffd) == 0x0000) &&
652 (a->s6_words[5] == 0xfe5e));
653}
654
657IN6_IS_ADDR_6TO4(
659{
661 return (BOOLEAN)(a->s6_words[0] == in6addr_6to4prefix.s6_words[0]);
662}
663
666IN6_IS_ADDR_TEREDO(
668{
670 return (BOOLEAN)
671 (((a->s6_words[0] == in6addr_teredoprefix.s6_words[0]) &&
672 (a->s6_words[1] == in6addr_teredoprefix.s6_words[1])) ||
673 ((a->s6_words[0] == in6addr_teredoprefix_old.s6_words[0]) &&
674 (a->s6_words[1] == in6addr_teredoprefix_old.s6_words[1])));
675}
676
679IN6ADDR_ISV4MAPPED(
681{
682 ASSERT(a->sin6_family == AF_INET6);
683 return IN6_IS_ADDR_V4MAPPED(&a->sin6_addr);
684}
685
688IN6ADDR_ISISATAP(
690{
691 ASSERT(a->sin6_family == AF_INET6);
692 return IN6_IS_ADDR_ISATAP(&a->sin6_addr);
693}
694
697IN6ADDR_IS6TO4(
699{
700 ASSERT(a->sin6_family == AF_INET6);
701 return IN6_IS_ADDR_6TO4(&a->sin6_addr);
702}
703
706IN6ADDR_ISTEREDO(
708{
709 ASSERT(a->sin6_family == AF_INET6);
710 return IN6_IS_ADDR_TEREDO(&a->sin6_addr);
711}
712
715IN6_GET_ADDR_V4MAPPED(
716 _In_ CONST IN6_ADDR *Ipv6Address)
717{
718 return (CONST UCHAR *) (Ipv6Address->s6_words + 6);
719}
720
723IN6_GET_ADDR_V4COMPAT(
724 _In_ CONST IN6_ADDR *Ipv6Address)
725{
726 return (CONST UCHAR *) (Ipv6Address->s6_words + 6);
727}
728
731IN6_EXTRACT_V4ADDR_FROM_ISATAP(
732 _In_ CONST IN6_ADDR *Ipv6Address)
733{
734 return (CONST UCHAR *) (Ipv6Address->s6_words + 6);
735}
736
739IN6_EXTRACT_V4ADDR_FROM_6TO4(
740 _In_ CONST IN6_ADDR *Ipv6Address)
741{
742 return (CONST UCHAR *) (Ipv6Address->s6_words + 1);
743}
744
746VOID
747IN6_SET_ADDR_V4MAPPED(
748 _Out_ PIN6_ADDR a6,
750{
752 a6->s6_bytes[12] = ((CONST UCHAR *) a4)[0];
753 a6->s6_bytes[13] = ((CONST UCHAR *) a4)[1];
754 a6->s6_bytes[14] = ((CONST UCHAR *) a4)[2];
755 a6->s6_bytes[15] = ((CONST UCHAR *) a4)[3];
756}
757
759VOID
760IN6_SET_ADDR_V4COMPAT(
761 _Out_ PIN6_ADDR a6,
763{
764 *a6 = in6addr_any;
765 a6->s6_bytes[12] = ((CONST UCHAR *) a4)[0];
766 a6->s6_bytes[13] = ((CONST UCHAR *) a4)[1];
767 a6->s6_bytes[14] = ((CONST UCHAR *) a4)[2];
768 a6->s6_bytes[15] = ((CONST UCHAR *) a4)[3];
769}
770
772VOID
773IN6_SET_ADDR_SOLICITEDNODE(
774 _Out_ PIN6_ADDR Multicast,
775 _In_ CONST IN6_ADDR *Unicast)
776{
778 Multicast->s6_bytes[13] = Unicast->s6_bytes[13];
779 Multicast->s6_bytes[14] = Unicast->s6_bytes[14];
780 Multicast->s6_bytes[15] = Unicast->s6_bytes[15];
781}
782
784VOID
785IN6_SET_ISATAP_IDENTIFIER(
786 _Inout_ IN6_ADDR *Ipv6Address,
787 _In_ CONST IN_ADDR *Ipv4Address)
788{
789 if (IN4_IS_ADDR_6TO4ELIGIBLE(Ipv4Address)) {
790 Ipv6Address->s6_words[4] = 0x0002;
791 } else {
792 Ipv6Address->s6_words[4] = 0x0000;
793 }
794 Ipv6Address->s6_words[5] = 0xFE5E;
795 *((UNALIGNED IN_ADDR *) (Ipv6Address->s6_words + 6)) = *Ipv4Address;
796}
797
799VOID
800IN6_SET_6TO4_PREFIX(
801 _Inout_ IN6_ADDR *Ipv6Address,
802 _In_ CONST IN_ADDR *Ipv4Address)
803{
804 Ipv6Address->s6_words[0] = 0x0220;
805 *((UNALIGNED IN_ADDR *) (Ipv6Address->s6_words + 1)) = *Ipv4Address;
806 Ipv6Address->s6_words[3] = 0x0000;
807}
808
811Ipv6UnicastAddressScope(
813{
814 IN6_ADDR Ipv6Address;
815
816 if (!INET_IS_ALIGNED(Address, IN6_ADDR)) {
817 Ipv6Address = *(CONST IN6_ADDR UNALIGNED *)Address;
818 Address = (CONST UCHAR *) &Ipv6Address;
819 }
822 return ScopeLevelLink;
824 return ScopeLevelSite;
825 } else {
826 return ScopeLevelGlobal;
827 }
828}
829
832IN6_MULTICAST_SCOPE(
834{
835 PIN6_ADDR Ipv6Address = (PIN6_ADDR) Address;
836 return (SCOPE_LEVEL)(Ipv6Address->s6_bytes[1] & 0xf);
837}
838
841Ipv6AddressScope(
843{
845 return IN6_MULTICAST_SCOPE(Address);
846 } else {
847 return Ipv6UnicastAddressScope(Address);
848 }
849}
850
853Ipv6AddressType(
855{
856 CONST IN6_ADDR *Ipv6Address = (CONST IN6_ADDR *) Address;
857 CONST UCHAR *Ipv4Address;
858
859 if (IN6_IS_ADDR_MULTICAST(Ipv6Address)) {
860 return NlatMulticast;
861 }
862 if (IN6_IS_ADDR_UNSPECIFIED(Ipv6Address)) {
863 return NlatUnspecified;
864 }
865 if (IN6_IS_ADDR_ISATAP(Ipv6Address) || IN6_IS_ADDR_V4COMPAT(Ipv6Address) ||
866 IN6_IS_ADDR_V4MAPPED(Ipv6Address) || IN6_IS_ADDR_V4TRANSLATED(Ipv6Address)) {
867 Ipv4Address = IN6_EXTRACT_V4ADDR_FROM_ISATAP(Ipv6Address);
868 } else if (IN6_IS_ADDR_6TO4(Ipv6Address)) {
869 Ipv4Address = IN6_EXTRACT_V4ADDR_FROM_6TO4(Ipv6Address);
870 } else {
871 return NlatUnicast;
872 }
873 if (Ipv4AddressType(Ipv4Address) != NlatUnicast) {
874 return NlatInvalid;
875 }
876 return NlatUnicast;
877}
878
880VOID
881IN6_UNCANONICALIZE_SCOPE_ID(
883 _Inout_ SCOPE_ID *ScopeId)
884{
885 SCOPE_LEVEL ScopeLevel = Ipv6AddressScope((CONST UCHAR *)Address);
886
887 if ((IN6_IS_ADDR_LOOPBACK(Address)) || (ScopeLevel == ScopeLevelGlobal)) {
888 ScopeId->Value = 0;
889 }
890 if ((SCOPE_LEVEL)ScopeId->Level == ScopeLevel) {
891 ScopeId->Level = 0;
892 }
893}
894
895#if (NTDDI_VERSION >= NTDDI_VISTA)
896
898VOID
899IN6ADDR_SETSOCKADDR(
902 _In_ SCOPE_ID scope,
904{
905 a->sin6_family = AF_INET6;
906 a->sin6_port = port;
907 a->sin6_flowinfo = 0;
908 RtlCopyMemory(&a->sin6_addr, addr, sizeof(IN6_ADDR));
909 a->sin6_scope_struct = scope;
910 IN6_UNCANONICALIZE_SCOPE_ID(&a->sin6_addr, &a->sin6_scope_struct);
911}
912
914VOID
915IN6ADDR_SETV4MAPPED(
918 _In_ SCOPE_ID scope,
920{
921 a6->sin6_family = AF_INET6;
922 a6->sin6_port = port;
923 a6->sin6_flowinfo = 0;
924 IN6_SET_ADDR_V4MAPPED(&a6->sin6_addr, a4);
925 a6->sin6_scope_struct = scope;
926 IN4_UNCANONICALIZE_SCOPE_ID(a4, &a6->sin6_scope_struct);
927}
928
929#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
930
933INET_ADDR_EQUAL(
935 _In_ CONST VOID* a,
936 _In_ CONST VOID* b)
937{
938 if (af == AF_INET6) {
940 } else {
941 ASSERT(af == AF_INET);
942 return IN4_ADDR_EQUAL((CONST IN_ADDR*)a, (CONST IN_ADDR*)b);
943 }
944}
945
948INET_UNALIGNED_ADDR_EQUAL(
950 _In_ CONST VOID* a,
951 _In_ CONST VOID* b)
952{
953 if (af == AF_INET6) {
955 } else {
956 ASSERT(af == AF_INET);
957 return IN4_UNALIGNED_ADDR_EQUAL((CONST IN_ADDR*)a, (CONST IN_ADDR*)b);
958 }
959}
960
963INET_IS_ADDR_UNSPECIFIED(
965 _In_ CONST VOID* a)
966{
967 if (af == AF_INET6) {
969 } else {
970 ASSERT(af == AF_INET);
971 return IN4_IS_ADDR_UNSPECIFIED((CONST IN_ADDR*)a);
972 }
973}
974
977INET_IS_UNALIGNED_ADDR_UNSPECIFIED(
979 _In_ CONST VOID* a)
980{
981 if (af == AF_INET6) {
983 } else {
984 ASSERT(af == AF_INET);
985 return IN4_IS_UNALIGNED_ADDR_UNSPECIFIED((CONST IN_ADDR UNALIGNED*)a);
986 }
987}
988
991INET_IS_ADDR_LOOPBACK(
993 _In_ CONST VOID* a)
994{
995 if (af == AF_INET6) {
997 } else {
998 ASSERT(af == AF_INET);
999 return IN4_IS_ADDR_LOOPBACK((CONST IN_ADDR*)a);
1000 }
1001}
1002
1004BOOLEAN
1005INET_IS_ADDR_BROADCAST(
1007 _In_ CONST VOID* a)
1008{
1009 if (af == AF_INET6) {
1010 return FALSE;
1011 } else {
1012 ASSERT(af == AF_INET);
1013 return IN4_IS_ADDR_BROADCAST((CONST IN_ADDR*)a);
1014 }
1015}
1016
1018BOOLEAN
1019INET_IS_ADDR_MULTICAST(
1021 _In_ CONST VOID* a)
1022{
1023 if (af == AF_INET6) {
1025 } else {
1026 ASSERT(af == AF_INET);
1027 return IN4_IS_ADDR_MULTICAST((CONST IN_ADDR*)a);
1028 }
1029}
1030
1032CONST UCHAR*
1033INET_ADDR_UNSPECIFIED(
1035{
1036 if (af == AF_INET6) {
1037 return (CONST UCHAR*)&in6addr_any;
1038 } else {
1039 ASSERT(af == AF_INET);
1040 return (CONST UCHAR*)&in4addr_any;
1041 }
1042}
1043
1045VOID
1046INET_SET_ADDRESS(
1050{
1051 if (Family == AF_INET6) {
1052 *((PIN6_ADDR)Address) = *((PIN6_ADDR)Value);
1053 } else {
1054 ASSERT(Family == AF_INET);
1055 *((PIN_ADDR)Address) = *((PIN_ADDR)Value);
1056 }
1057}
1058
1060SIZE_T
1061INET_ADDR_LENGTH(
1063{
1064 if (af == AF_INET6) {
1065 return sizeof(IN6_ADDR);
1066 } else {
1067 ASSERT(af == AF_INET);
1068 return sizeof(IN_ADDR);
1069 }
1070}
1071
1073SIZE_T
1074INET_SOCKADDR_LENGTH(
1076{
1077 if (af == AF_INET6) {
1078 return sizeof(SOCKADDR_IN6);
1079 } else {
1080 ASSERT(af == AF_INET);
1081 return sizeof(SOCKADDR_IN);
1082 }
1083}
1084
1085#if (NTDDI_VERSION >= NTDDI_VISTA)
1087VOID
1088INETADDR_SETSOCKADDR(
1092 _In_ SCOPE_ID scope,
1094{
1095 if (af == AF_INET6) {
1096 IN6ADDR_SETSOCKADDR((PSOCKADDR_IN6) a, (CONST IN6_ADDR *) addr, scope, port);
1097 } else {
1098 CONST IN_ADDR addr4 = *((IN_ADDR UNALIGNED *) addr);
1099 ASSERT(af == AF_INET);
1100 IN4ADDR_SETSOCKADDR((PSOCKADDR_IN) a, (CONST IN_ADDR *) &addr4, port);
1101 }
1102}
1103#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
1104
1106VOID
1107INETADDR_SETANY(
1109{
1110 if (a->sa_family == AF_INET6) {
1112 } else {
1113 ASSERT(a->sa_family == AF_INET);
1114 IN4ADDR_SETANY((PSOCKADDR_IN)a);
1115 }
1116}
1117
1119VOID
1120INETADDR_SETLOOPBACK(
1122{
1123 if (a->sa_family == AF_INET6) {
1125 } else {
1126 ASSERT(a->sa_family == AF_INET);
1127 IN4ADDR_SETLOOPBACK((PSOCKADDR_IN)a);
1128 }
1129}
1130
1132BOOLEAN
1133INETADDR_ISANY(
1135{
1136 if (a->sa_family == AF_INET6) {
1138 } else {
1139 ASSERT(a->sa_family == AF_INET);
1140 return IN4ADDR_ISANY((CONST SOCKADDR_IN*)a);
1141 }
1142}
1143
1145BOOLEAN
1146INETADDR_ISLOOPBACK(
1148{
1149 if (a->sa_family == AF_INET6) {
1151 } else {
1152 ASSERT(a->sa_family == AF_INET);
1153 return IN4ADDR_ISLOOPBACK((CONST SOCKADDR_IN*)a);
1154 }
1155}
1156
1158BOOLEAN
1159INETADDR_ISV4MAPPED(
1161{
1162 if (a->sa_family == AF_INET6) {
1163 return IN6ADDR_ISV4MAPPED((CONST SOCKADDR_IN6*)a);
1164 } else {
1165 return FALSE;
1166 }
1167}
1168
1170BOOLEAN
1171NL_ADDR_EQUAL(
1174 _In_ CONST UCHAR* aa,
1176 _In_ CONST UCHAR* ab)
1177{
1178 return (BOOLEAN)((sa.Value == sb.Value) && INET_ADDR_EQUAL(af, aa, ab));
1179}
1180
1182BOOLEAN
1183NL_IS_ADDR_UNSPECIFIED(
1185 _In_ SCOPE_ID s,
1186 _In_ CONST UCHAR* a)
1187{
1188 return (BOOLEAN)((s.Value == 0) && INET_IS_ADDR_UNSPECIFIED(af, a));
1189}
1190
1192BOOLEAN
1193INETADDR_ISEQUAL(
1196{
1197 if (a->sa_family == AF_INET6) {
1198 return (BOOLEAN) (b->sa_family == AF_INET6 &&
1200 } else {
1201 ASSERT(a->sa_family == AF_INET);
1202 return (BOOLEAN) (b->sa_family == AF_INET &&
1203 IN4ADDR_ISEQUAL((CONST SOCKADDR_IN*)a, (CONST SOCKADDR_IN*)b));
1204 }
1205}
1206
1208BOOLEAN
1209INETADDR_ISUNSPECIFIED(
1211{
1212 if (a->sa_family == AF_INET6) {
1214 } else {
1215 ASSERT(a->sa_family == AF_INET);
1216 return IN4ADDR_ISUNSPECIFIED((CONST SOCKADDR_IN*)a);
1217 }
1218}
1219
1220#if (NTDDI_VERSION >= NTDDI_VISTA)
1223INETADDR_SCOPE_ID(
1225{
1226 if (a->sa_family == AF_INET6) {
1227 return ((CONST SOCKADDR_IN6*)a)->sin6_scope_struct;
1228 } else {
1229 ASSERT(a->sa_family == AF_INET);
1230 return IN4ADDR_SCOPE_ID((CONST SOCKADDR_IN*)a);
1231 }
1232}
1233#endif
1234
1236USHORT
1237INETADDR_PORT(
1239{
1240 if (a->sa_family == AF_INET6) {
1241 return ((CONST SOCKADDR_IN6*)a)->sin6_port;
1242 } else {
1243 ASSERT(a->sa_family == AF_INET);
1244 return ((CONST SOCKADDR_IN*)a)->sin_port;
1245 }
1246}
1247
1249PUCHAR
1250INETADDR_ADDRESS(
1252{
1253 if (a->sa_family == AF_INET6) {
1254 return (PUCHAR)&((PSOCKADDR_IN6)a)->sin6_addr;
1255 } else {
1256 ASSERT(a->sa_family == AF_INET);
1257 return (PUCHAR)&((PSOCKADDR_IN)a)->sin_addr;
1258 }
1259}
1260
1262VOID
1263INETADDR_SET_PORT(
1266{
1267 SS_PORT(a) = Port;
1268}
1269
1271VOID
1272INETADDR_SET_ADDRESS(
1275{
1276 if (a->sa_family == AF_INET6) {
1277 ((PSOCKADDR_IN6)a)->sin6_addr = *((CONST IN6_ADDR*)Address);
1278 } else {
1279 ASSERT(a->sa_family == AF_INET);
1280 ((PSOCKADDR_IN)a)->sin_addr = *((CONST IN_ADDR*)Address);
1281 }
1282}
1283
1285VOID
1286INET_UNCANONICALIZE_SCOPE_ID(
1289 _Inout_ SCOPE_ID *ScopeId)
1290{
1291 if (AddressFamily == AF_INET6) {
1292 IN6_UNCANONICALIZE_SCOPE_ID((CONST IN6_ADDR*) Address, ScopeId);
1293 } else {
1294 IN4_UNCANONICALIZE_SCOPE_ID((CONST IN_ADDR*) Address, ScopeId);
1295 }
1296}
1297
1298#endif /* _WS2IPDEF_ */
1299
1300#ifndef __IP2STRING__
1301#define __IP2STRING__
1302
1303#if (NTDDI_VERSION >= NTDDI_VISTA)
1304
1305#ifdef _WS2DEF_
1306
1308PSTR
1309NTAPI
1311 _In_ const struct in_addr *Addr,
1312 _Out_writes_(16) PSTR S);
1313
1315LONG
1316NTAPI
1318 _In_ const struct in_addr *Address,
1320 _Out_writes_to_(*AddressStringLength, *AddressStringLength) PSTR AddressString,
1321 _Inout_ PULONG AddressStringLength);
1322
1324PWSTR
1325NTAPI
1327 _In_ const struct in_addr *Addr,
1328 _Out_writes_(16) PWSTR S);
1329
1331LONG
1332NTAPI
1334 _In_ const struct in_addr *Address,
1336 _Out_writes_to_(*AddressStringLength, *AddressStringLength) PWSTR AddressString,
1337 _Inout_ PULONG AddressStringLength);
1338
1340LONG
1341NTAPI
1344 _In_ BOOLEAN Strict,
1345 _Out_ PCSTR *Terminator,
1346 _Out_ struct in_addr *Addr);
1347
1349LONG
1350NTAPI
1352 _In_ PCSTR AddressString,
1353 _In_ BOOLEAN Strict,
1354 _Out_ struct in_addr *Address,
1356
1358LONG
1359NTAPI
1362 _In_ BOOLEAN Strict,
1363 _Out_ PCWSTR *Terminator,
1364 _Out_ struct in_addr *Addr);
1365
1367LONG
1368NTAPI
1370 _In_ PCWSTR AddressString,
1371 _In_ BOOLEAN Strict,
1372 _Out_ struct in_addr *Address,
1374
1375#ifdef UNICODE
1376#define RtlIpv4AddressToString RtlIpv4AddressToStringW
1377#define RtlIpv4StringToAddress RtlIpv4StringToAddressW
1378#define RtlIpv4AddressToStringEx RtlIpv4AddressToStringExW
1379#define RtlIpv4StringToAddressEx RtlIpv4StringToAddressExW
1380#else
1381#define RtlIpv4AddressToString RtlIpv4AddressToStringA
1382#define RtlIpv4StringToAddress RtlIpv4StringToAddressA
1383#define RtlIpv4AddressToStringEx RtlIpv4AddressToStringExA
1384#define RtlIpv4StringToAddressEx RtlIpv4StringToAddressExA
1385#endif
1386
1387#endif /* _WS2DEF_ */
1388
1389#ifdef _WS2IPDEF_
1390
1392PSTR
1393NTAPI
1395 _In_ const struct in6_addr *Addr,
1396 _Out_writes_(46) PSTR S);
1397
1399LONG
1400NTAPI
1402 _In_ const struct in6_addr *Address,
1403 _In_ ULONG ScopeId,
1405 _Out_writes_to_(*AddressStringLength, *AddressStringLength) PSTR AddressString,
1406 _Inout_ PULONG AddressStringLength);
1407
1409PWSTR
1410NTAPI
1412 _In_ const struct in6_addr *Addr,
1413 _Out_writes_(46) PWSTR S);
1414
1416LONG
1417NTAPI
1419 _In_ const struct in6_addr *Address,
1420 _In_ ULONG ScopeId,
1422 _Out_writes_to_(*AddressStringLength, *AddressStringLength) PWSTR AddressString,
1423 _Inout_ PULONG AddressStringLength);
1424
1426LONG
1427NTAPI
1429 _In_ PCSTR S,
1430 _Out_ PCSTR *Terminator,
1431 _Out_ struct in6_addr *Addr);
1432
1434LONG
1435NTAPI
1437 _In_ PCSTR AddressString,
1438 _Out_ struct in6_addr *Address,
1439 _Out_ PULONG ScopeId,
1441
1443LONG
1444NTAPI
1446 _In_ PCWSTR S,
1447 _Out_ PCWSTR *Terminator,
1448 _Out_ struct in6_addr *Addr);
1449
1451LONG
1452NTAPI
1454 _In_ PCWSTR AddressString,
1455 _Out_ struct in6_addr *Address,
1456 _Out_ PULONG ScopeId,
1458
1459#ifdef UNICODE
1460#define RtlIpv6AddressToString RtlIpv6AddressToStringW
1461#define RtlIpv6StringToAddress RtlIpv6StringToAddressW
1462#define RtlIpv6StringToAddressEx RtlIpv6StringToAddressExW
1463#define RtlIpv6AddressToStringEx RtlIpv6AddressToStringExW
1464#else
1465#define RtlIpv6AddressToString RtlIpv6AddressToStringA
1466#define RtlIpv6StringToAddress RtlIpv6StringToAddressA
1467#define RtlIpv6StringToAddressEx RtlIpv6StringToAddressExA
1468#define RtlIpv6AddressToStringEx RtlIpv6AddressToStringExA
1469#endif
1470
1471#endif /* __WS2IPDEF__ */
1472
1473#ifdef _WS2DEF_
1474
1475union _DL_EUI48;
1476typedef union _DL_EUI48 DL_EUI48, *PDL_EUI48;
1477
1479PSTR
1480NTAPI
1481RtlEthernetAddressToStringA(
1482 _In_ const DL_EUI48 *Addr,
1483 _Out_writes_(18) PSTR S);
1484
1486PWSTR
1487NTAPI
1488RtlEthernetAddressToStringW(
1489 _In_ const DL_EUI48 *Addr,
1490 _Out_writes_(18) PWSTR S);
1491
1493LONG
1494NTAPI
1495RtlEthernetStringToAddressA(
1496 _In_ PCSTR S,
1497 _Out_ PCSTR *Terminator,
1498 _Out_ DL_EUI48 *Addr);
1499
1501LONG
1502NTAPI
1503RtlEthernetStringToAddressW(
1504 _In_ PCWSTR S,
1505 _Out_ LPCWSTR *Terminator,
1506 _Out_ DL_EUI48 *Addr);
1507
1508#ifdef UNICODE
1509#define RtlEthernetAddressToString RtlEthernetAddressToStringW
1510#define RtlEthernetStringToAddress RtlEthernetStringToAddressW
1511#else
1512#define RtlEthernetAddressToString RtlEthernetAddressToStringA
1513#define RtlEthernetStringToAddress RtlEthernetStringToAddressA
1514#endif
1515
1516#endif /* _WS2DEF_ */
1517
1518#endif /* (NTDDI >= NTDDI_VISTA) */
1519
1520#endif /* __IP2STRING__ */
1521
1522#ifdef __cplusplus
1523}
1524#endif
unsigned char BOOLEAN
unsigned long long UINT64
unsigned char UINT8
unsigned int UINT32
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
@ Reserved2
Definition: bcd.h:202
#define NTSYSAPI
Definition: ntoskrnl.h:12
#define UNALIGNED
Definition: crtdefs.h:144
#define FALSE
Definition: types.h:117
USHORT port
Definition: uri.c:228
superblock * sb
Definition: btrfs.c:4261
#define AF_INET
Definition: tcpip.h:117
unsigned int Mask
Definition: fpcontrol.c:82
GLdouble s
Definition: gl.h:2039
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLenum const GLvoid * addr
Definition: glext.h:9621
GLenum GLsizei len
Definition: glext.h:6722
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
CPPORT Port[4]
Definition: headless.c:35
struct in6_addr IN6_ADDR
struct in6_addr * PIN6_ADDR
struct in_addr IN_ADDR
struct in_addr * PIN_ADDR
#define C_ASSERT(e)
Definition: intsafe.h:73
#define a
Definition: ke_i.h:78
_In_ UINT Bytes
Definition: mmcopy.h:9
unsigned __int64 ULONG64
Definition: imports.h:198
UCHAR ab[sizeof("Hello World!") -1]
Definition: fdi.c:106
static const struct update_accum a4
Definition: msg.c:2285
#define _Inout_
Definition: ms_sal.h:378
#define _Out_writes_(size)
Definition: ms_sal.h:348
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
#define _Out_writes_to_(size, count)
Definition: ms_sal.h:355
#define ASSERT(exp)
Definition: mstcpip.h:9
struct _INET_PORT_RANGE * PINET_PORT_RANGE
RCVALL_VALUE
Definition: mstcpip.h:40
@ RCVALL_SOCKETLEVELONLY
Definition: mstcpip.h:43
@ RCVALL_OFF
Definition: mstcpip.h:41
@ RCVALL_IPLEVEL
Definition: mstcpip.h:44
@ RCVALL_ON
Definition: mstcpip.h:42
enum RCVALL_VALUE * PRCVALL_VALUE
struct _INET_PORT_RANGE * PINET_PORT_RESERVATION
Definition: mstcpip.h:66
struct INET_PORT_RESERVATION_INSTANCE * PINET_PORT_RESERVATION_INSTANCE
struct _INET_PORT_RANGE INET_PORT_RANGE
struct INET_PORT_RESERVATION_TOKEN * PINET_PORT_RESERVATION_TOKEN
#define MSTCPIP_INLINE
Definition: mstcpip.h:15
struct INET_PORT_RESERVATION_INFORMATION * PINET_PORT_RESERVATION_INFORMATION
struct RCVALL_IF * PRCVALL_IF
IN PCO_ADDRESS_FAMILY AddressFamily
Definition: ndis.h:1906
NTSYSAPI NTSTATUS NTAPI RtlIpv6StringToAddressW(_In_ PCWSTR String, _Out_ PCWSTR *Terminator, _Out_ struct in6_addr *Addr)
Definition: network.c:806
NTSYSAPI NTSTATUS NTAPI RtlIpv6StringToAddressExW(_In_ PCWSTR AddressString, _Out_ struct in6_addr *Address, _Out_ PULONG ScopeId, _Out_ PUSHORT Port)
Definition: network.c:954
NTSYSAPI NTSTATUS NTAPI RtlIpv6AddressToStringExW(_In_ const struct in6_addr *Address, _In_ ULONG ScopeId, _In_ USHORT Port, _Out_writes_to_(*AddressStringLength, *AddressStringLength) PWCHAR AddressString, _Inout_ PULONG AddressStringLength)
Definition: network.c:669
NTSTATUS NTAPI RtlIpv4AddressToStringExW(_In_ const struct in_addr *Address, _In_ USHORT Port, _Out_writes_to_(*AddressStringLength, *AddressStringLength) PWCHAR AddressString, _Inout_ PULONG AddressStringLength)
Definition: network.c:288
NTSYSAPI NTSTATUS NTAPI RtlIpv4StringToAddressExA(_In_ PCSTR AddressString, _In_ BOOLEAN Strict, _Out_ struct in_addr *Address, _Out_ PUSHORT Port)
Definition: network.c:375
NTSYSAPI NTSTATUS NTAPI RtlIpv4AddressToStringExA(_In_ const struct in_addr *Address, _In_ USHORT Port, _Out_writes_to_(*AddressStringLength, *AddressStringLength) PCHAR AddressString, _Inout_ PULONG AddressStringLength)
Definition: network.c:206
NTSYSAPI NTSTATUS NTAPI RtlIpv6AddressToStringExA(_In_ const struct in6_addr *Address, _In_ ULONG ScopeId, _In_ USHORT Port, _Out_writes_to_(*AddressStringLength, *AddressStringLength) PSTR AddressString, _Inout_ PULONG AddressStringLength)
Definition: network.c:530
NTSYSAPI PSTR NTAPI RtlIpv6AddressToStringA(_In_ const struct in6_addr *Addr, _Out_writes_(46) PSTR S)
NTSYSAPI NTSTATUS NTAPI RtlIpv6StringToAddressExA(_In_ PCSTR AddressString, _Out_ struct in6_addr *Address, _Out_ PULONG ScopeId, _Out_ PUSHORT Port)
Definition: network.c:777
NTSYSAPI PWSTR NTAPI RtlIpv4AddressToStringW(_In_ const struct in_addr *Addr, _Out_writes_(16) PWCHAR S)
NTSYSAPI NTSTATUS NTAPI RtlIpv4StringToAddressA(_In_ PCSTR String, _In_ BOOLEAN Strict, _Out_ PCSTR *Terminator, _Out_ struct in_addr *Addr)
Definition: network.c:338
NTSYSAPI NTSTATUS NTAPI RtlIpv6StringToAddressA(_In_ PCSTR String, _Out_ PCSTR *Terminator, _Out_ struct in6_addr *Addr)
Definition: network.c:745
NTSYSAPI NTSTATUS NTAPI RtlIpv4StringToAddressW(_In_ PCWSTR String, _In_ BOOLEAN Strict, _Out_ PCWSTR *Terminator, _Out_ struct in_addr *Addr)
Definition: network.c:405
NTSYSAPI NTSTATUS NTAPI RtlIpv4StringToAddressExW(_In_ PCWSTR AddressString, _In_ BOOLEAN Strict, _Out_ struct in_addr *Address, _Out_ PUSHORT Port)
Definition: network.c:450
NTSYSAPI PWSTR NTAPI RtlIpv6AddressToStringW(_In_ const struct in6_addr *Addr, _Out_writes_(46) PWSTR S)
NL_ADDRESS_TYPE
Definition: nldef.h:90
@ NlatBroadcast
Definition: nldef.h:95
@ NlatUnicast
Definition: nldef.h:92
@ NlatUnspecified
Definition: nldef.h:91
@ NlatMulticast
Definition: nldef.h:94
@ NlatInvalid
Definition: nldef.h:96
#define RTL_BITS_OF(sizeOfArg)
Definition: ntbasedef.h:668
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define CONST
Definition: pedump.c:81
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
static WCHAR Address[46]
Definition: ping.c:68
static int Family
Definition: ping.c:62
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
Definition: guiddef.h:68
#define memset(x, y, z)
Definition: compat.h:39
RCVALL_VALUE Mode
Definition: mstcpip.h:50
ULONG Interface
Definition: mstcpip.h:51
Definition: movable.cpp:9
USHORT StartPort
Definition: mstcpip.h:63
USHORT NumberOfPorts
Definition: mstcpip.h:64
Definition: tcpip.h:126
u32_t s_addr
Definition: inet.h:45
ULONG keepalivetime
Definition: mstcpip.h:22
ULONG onoff
Definition: mstcpip.h:21
ULONG keepaliveinterval
Definition: mstcpip.h:23
NTSYSAPI PSTR NTAPI RtlIpv4AddressToStringA(_In_ const struct in_addr *Addr, _Out_writes_(16) PSTR S)
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t * PULONG
Definition: typedefs.h:59
char * PSTR
Definition: typedefs.h:51
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define NTAPI
Definition: typedefs.h:36
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint16_t * PUSHORT
Definition: typedefs.h:56
const char * PCSTR
Definition: typedefs.h:52
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
struct sockaddr_in SOCKADDR_IN
Definition: winsock.h:487
struct sockaddr_in * PSOCKADDR_IN
Definition: winsock.h:488
#define AF_INET6
Definition: winsock.h:369
SCOPE_LEVEL
Definition: ws2def.h:478
@ ScopeLevelLink
Definition: ws2def.h:480
@ ScopeLevelSite
Definition: ws2def.h:483
@ ScopeLevelGlobal
Definition: ws2def.h:485
@ ScopeLevelAdmin
Definition: ws2def.h:482
USHORT ADDRESS_FAMILY
Definition: ws2def.h:25
WS2TCPIP_INLINE VOID IN6ADDR_SETLOOPBACK(PSOCKADDR_IN6 a)
Definition: ws2ipdef.h:479
CONST IN6_ADDR in6addr_allnodesonlink
WS2TCPIP_INLINE BOOLEAN IN6_IS_ADDR_V4MAPPED(CONST IN6_ADDR *a)
Definition: ws2ipdef.h:385
CONST IN6_ADDR in6addr_allnodesonnode
CONST IN_ADDR in4addr_any
CONST IN6_ADDR in6addr_teredoprefix
WS2TCPIP_INLINE BOOLEAN IN6ADDR_ISANY(CONST SOCKADDR_IN6 *a)
Definition: ws2ipdef.h:489
WS2TCPIP_INLINE BOOLEAN IN6ADDR_ISUNSPECIFIED(CONST SOCKADDR_IN6 *a)
Definition: ws2ipdef.h:511
WS2TCPIP_INLINE BOOLEAN IN6_IS_ADDR_MULTICAST(CONST IN6_ADDR *a)
Definition: ws2ipdef.h:324
CONST IN6_ADDR in6addr_teredoprefix_old
SOCKADDR_IN6_LH * PSOCKADDR_IN6
Definition: ws2ipdef.h:200
CONST IN6_ADDR in6addr_any
CONST IN6_ADDR in6addr_6to4prefix
WS2TCPIP_INLINE VOID IN6ADDR_SETANY(PSOCKADDR_IN6 a)
Definition: ws2ipdef.h:469
WS2TCPIP_INLINE BOOLEAN IN6_IS_ADDR_LOOPBACK(CONST IN6_ADDR *a)
Definition: ws2ipdef.h:311
WS2TCPIP_INLINE BOOLEAN IN6_ADDR_EQUAL(CONST IN6_ADDR *x, CONST IN6_ADDR *y)
Definition: ws2ipdef.h:285
#define IN6ADDR_TEREDOPREFIX_LENGTH
Definition: ws2ipdef.h:252
WS2TCPIP_INLINE BOOLEAN IN6_IS_ADDR_V4COMPAT(CONST IN6_ADDR *a)
Definition: ws2ipdef.h:396
WS2TCPIP_INLINE BOOLEAN IN6ADDR_ISEQUAL(CONST SOCKADDR_IN6 *a, CONST SOCKADDR_IN6 *b)
Definition: ws2ipdef.h:503
WS2TCPIP_INLINE BOOLEAN IN6_IS_ADDR_V4TRANSLATED(CONST IN6_ADDR *a)
Definition: ws2ipdef.h:410
#define IN6ADDR_6TO4PREFIX_LENGTH
Definition: ws2ipdef.h:251
WS2TCPIP_INLINE BOOLEAN IN6_IS_ADDR_UNSPECIFIED(CONST IN6_ADDR *a)
Definition: ws2ipdef.h:298
WS2TCPIP_INLINE BOOLEAN IN6_IS_ADDR_SITELOCAL(CONST IN6_ADDR *a)
Definition: ws2ipdef.h:371
WS2TCPIP_INLINE BOOLEAN IN6ADDR_ISLOOPBACK(CONST SOCKADDR_IN6 *a)
Definition: ws2ipdef.h:496
#define SS_PORT(ssp)
Definition: ws2ipdef.h:60
CONST IN6_ADDR in6addr_allroutersonlink
CONST IN6_ADDR in6addr_v4mappedprefix
#define IN6ADDR_SOLICITEDNODEMULTICASTPREFIX_LENGTH
Definition: ws2ipdef.h:249
CONST IN6_ADDR in6addr_solicitednodemulticastprefix
WS2TCPIP_INLINE BOOLEAN IN6_IS_ADDR_LINKLOCAL(CONST IN6_ADDR *a)
Definition: ws2ipdef.h:364
SOCKADDR_IN6_LH SOCKADDR_IN6
Definition: ws2ipdef.h:199
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
unsigned char UCHAR
Definition: xmlstorage.h:181
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185