Home | History | Annotate | Download | only in include
      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 #ifndef _MSTCPIP_
      7 #define _MSTCPIP_
      8 
      9 #include <_mingw_unicode.h>
     10 
     11 struct tcp_keepalive {
     12   u_long onoff;
     13   u_long keepalivetime;
     14   u_long keepaliveinterval;
     15 };
     16 
     17 #define SIO_RCVALL _WSAIOW(IOC_VENDOR,1)
     18 #define SIO_RCVALL_MCAST _WSAIOW(IOC_VENDOR,2)
     19 #define SIO_RCVALL_IGMPMCAST _WSAIOW(IOC_VENDOR,3)
     20 #define SIO_KEEPALIVE_VALS _WSAIOW(IOC_VENDOR,4)
     21 #define SIO_ABSORB_RTRALERT _WSAIOW(IOC_VENDOR,5)
     22 #define SIO_UCAST_IF _WSAIOW(IOC_VENDOR,6)
     23 #define SIO_LIMIT_BROADCASTS _WSAIOW(IOC_VENDOR,7)
     24 #define SIO_INDEX_BIND _WSAIOW(IOC_VENDOR,8)
     25 #define SIO_INDEX_MCASTIF _WSAIOW(IOC_VENDOR,9)
     26 #define SIO_INDEX_ADD_MCAST _WSAIOW(IOC_VENDOR,10)
     27 #define SIO_INDEX_DEL_MCAST _WSAIOW(IOC_VENDOR,11)
     28 
     29 #define RCVALL_OFF 0
     30 #define RCVALL_ON 1
     31 #define RCVALL_SOCKETLEVELONLY 2
     32 
     33 #if (_WIN32_WINNT >= 0x0502)
     34 #define SOCKET_SETTINGS_GUARANTEE_ENCRYPTION 0x00000001
     35 #define SOCKET_SETTINGS_ALLOW_INSECURE 0x00000002
     36 
     37 typedef enum _SOCKET_SECURITY_PROTOCOL {
     38   SOCKET_SECURITY_PROTOCOL_DEFAULT,
     39   SOCKET_SECURITY_PROTOCOL_IPSEC,
     40 #if NTDDI_VERSION >= NTDDI_WIN7
     41   SOCKET_SECURITY_PROTOCOL_IPSEC2,
     42 #endif
     43   SOCKET_SECURITY_PROTOCOL_INVALID
     44 } SOCKET_SECURITY_PROTOCOL;
     45 
     46 #define SOCKET_SETTINGS_GUARANTEE_ENCRYPTION  0x1
     47 #define SOCKET_SETTINGS_ALLOW_INSECURE  0x2
     48 
     49 typedef enum _SOCKET_USAGE_TYPE {
     50   SYSTEM_CRITICAL_SOCKET   = 1
     51 } SOCKET_USAGE_TYPE;
     52 
     53 typedef struct _SOCKET_PEER_TARGET_NAME {
     54   SOCKET_SECURITY_PROTOCOL SecurityProtocol;
     55   SOCKADDR_STORAGE         PeerAddress;
     56   ULONG                    PeerTargetNameStringLen;
     57   wchar_t                  AllStrings[];
     58 } SOCKET_PEER_TARGET_NAME;
     59 
     60 #define SOCKET_INFO_CONNECTION_SECURED		0x00000001
     61 #define SOCKET_INFO_CONNECTION_ENCRYPTED	0x00000002
     62 #define SOCKET_INFO_CONNECTION_IMPERSONATED	0x00000004
     63 
     64 typedef struct _SOCKET_SECURITY_QUERY_INFO {
     65   SOCKET_SECURITY_PROTOCOL SecurityProtocol;
     66   ULONG                    Flags;
     67   UINT64                   PeerApplicationAccessTokenHandle;
     68   UINT64                   PeerMachineAccessTokenHandle;
     69 } SOCKET_SECURITY_QUERY_INFO;
     70 
     71 typedef struct _SOCKET_SECURITY_QUERY_TEMPLATE {
     72   SOCKET_SECURITY_PROTOCOL SecurityProtocol;
     73   SOCKADDR_STORAGE         PeerAddress;
     74   ULONG                    PeerTokenAccessMask;
     75 } SOCKET_SECURITY_QUERY_TEMPLATE;
     76 
     77 typedef struct _SOCKET_SECURITY_SETTINGS {
     78   SOCKET_SECURITY_PROTOCOL SecurityProtocol;
     79   ULONG                    SecurityFlags;
     80 } SOCKET_SECURITY_SETTINGS;
     81 
     82 #define SOCKET_SETTINGS_IPSEC_SKIP_FILTER_INSTANTIATION 0x00000001
     83 
     84 typedef struct _SOCKET_SECURITY_SETTINGS_IPSEC {
     85   SOCKET_SECURITY_PROTOCOL SecurityProtocol;
     86   ULONG                    SecurityFlags;
     87   ULONG                    IpsecFlags;
     88   GUID                     AuthipMMPolicyKey;
     89   GUID                     AuthipQMPolicyKey;
     90   GUID                     Reserved;
     91   UINT64                   Reserved2;
     92   ULONG                    UserNameStringLen;
     93   ULONG                    DomainNameStringLen;
     94   ULONG                    PasswordStringLen;
     95   wchar_t                  AllStrings[];
     96 } SOCKET_SECURITY_SETTINGS_IPSEC;
     97 
     98 #define RtlIpv6AddressToString __MINGW_NAME_AW(RtlIpv6AddressToString)
     99 #define RtlIpv6AddressToStringEx __MINGW_NAME_AW(RtlIpv6AddressToStringEx)
    100 
    101 LPSTR NTAPI RtlIpv6AddressToStringA(const IN6_ADDR *Addr, LPSTR S);
    102 LPWSTR NTAPI RtlIpv6AddressToStringW(const IN6_ADDR *Addr, LPWSTR S);
    103 
    104 LONG NTAPI RtlIpv6AddressToStringExA(const IN6_ADDR *Address, ULONG ScopeId, USHORT Port, LPSTR AddressString, PULONG AddressStringLength);
    105 LONG NTAPI RtlIpv6AddressToStringExW(const IN6_ADDR *Address, ULONG ScopeId, USHORT Port, LPWSTR AddressString, PULONG AddressStringLength);
    106 
    107 #define RtlIpv4AddressToString __MINGW_NAME_AW(RtlIpv4AddressToString)
    108 LPSTR NTAPI RtlIpv4AddressToStringA(const IN_ADDR *Addr, LPSTR S);
    109 LPWSTR NTAPI RtlIpv4AddressToStringW(const IN_ADDR *Addr, LPWSTR S);
    110 
    111 #define RtlIpv4AddressToStringEx __MINGW_NAME_AW(RtlIpv4AddressToStringEx)
    112 LONG NTAPI RtlIpv4AddressToStringExA(const IN_ADDR *Address, USHORT Port, LPSTR AddressString, PULONG AddressStringLength);
    113 LONG NTAPI RtlIpv4AddressToStringExW(const IN_ADDR *Address, USHORT Port, LPWSTR AddressString, PULONG AddressStringLength);
    114 
    115 #define RtlIpv4StringToAddress __MINGW_NAME_AW(RtlIpv4StringToAddress)
    116 LONG NTAPI RtlIpv4StringToAddressA(PCSTR S, BOOLEAN Strict, LPSTR *Terminator, IN_ADDR *Addr);
    117 LONG NTAPI RtlIpv4StringToAddressW(PCWSTR S, BOOLEAN Strict, LPWSTR *Terminator, IN_ADDR *Addr);
    118 
    119 #define RtlIpv4StringToAddressEx __MINGW_NAME_AW(RtlIpv4StringToAddressEx)
    120 LONG NTAPI RtlIpv4StringToAddressExA(PCSTR AddressString, BOOLEAN Strict, IN_ADDR *Address, PUSHORT Port);
    121 LONG NTAPI RtlIpv4StringToAddressExW(PCWSTR AddressString, BOOLEAN Strict, IN_ADDR *Address, PUSHORT Port);
    122 
    123 #define RtlIpv6StringToAddressEx __MINGW_NAME_AW(RtlIpv6StringToAddressEx)
    124 LONG NTAPI RtlIpv6StringToAddressExA(PCSTR AddressString, IN6_ADDR *Address, PULONG ScopeId, PUSHORT Port);
    125 LONG NTAPI RtlIpv6StringToAddressExW(PCWSTR AddressString, IN6_ADDR *Address, PULONG ScopeId, PUSHORT Port);
    126 
    127 #endif /*(_WIN32_WINNT >= 0x0502)*/
    128 
    129 #endif /* _MSTCPIP_ */
    130 
    131