2005-06-28 23:31:38 +00:00
|
|
|
/*
|
|
|
|
* Defines the types and macros used by the ICMP API, see icmpapi.h.
|
|
|
|
*
|
|
|
|
* Copyright (C) 1999 Francois Gouget
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2015-11-30 20:08:57 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-06-28 23:31:38 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_IPEXPORT_H
|
|
|
|
#define __WINE_IPEXPORT_H
|
|
|
|
|
2015-11-30 20:08:57 +00:00
|
|
|
#include <in6addr.h>
|
|
|
|
#include <inaddr.h>
|
|
|
|
|
|
|
|
typedef ULONG IPAddr;
|
|
|
|
typedef ULONG IPMask;
|
|
|
|
typedef ULONG IP_STATUS;
|
2005-06-28 23:31:38 +00:00
|
|
|
|
2019-11-18 17:54:03 +00:00
|
|
|
typedef struct ip_option_information
|
2005-06-28 23:31:38 +00:00
|
|
|
{
|
|
|
|
unsigned char Ttl;
|
|
|
|
unsigned char Tos;
|
|
|
|
unsigned char Flags;
|
|
|
|
unsigned char OptionsSize;
|
|
|
|
unsigned char* OptionsData;
|
2019-11-18 17:54:03 +00:00
|
|
|
} IP_OPTION_INFORMATION, *PIP_OPTION_INFORMATION;
|
2005-06-28 23:31:38 +00:00
|
|
|
|
2018-01-04 17:29:11 +00:00
|
|
|
#if defined(_WIN64)
|
|
|
|
|
|
|
|
struct ip_option_information32
|
|
|
|
{
|
|
|
|
unsigned char Ttl;
|
|
|
|
unsigned char Tos;
|
|
|
|
unsigned char Flags;
|
|
|
|
unsigned char OptionsSize;
|
|
|
|
unsigned char* POINTER_32 OptionsData;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WIN64
|
|
|
|
|
2005-06-28 23:31:38 +00:00
|
|
|
#define IP_FLAG_DF 0x2
|
|
|
|
|
|
|
|
#define IP_OPT_EOL 0
|
|
|
|
#define IP_OPT_NOP 1
|
2005-05-08 17:44:37 +00:00
|
|
|
#define IP_OPT_SECURITY 0x82
|
2005-06-28 23:31:38 +00:00
|
|
|
#define IP_OPT_LSRR 0x83
|
|
|
|
#define IP_OPT_SSRR 0x89
|
|
|
|
#define IP_OPT_RR 0x7
|
|
|
|
#define IP_OPT_TS 0x44
|
|
|
|
#define IP_OPT_SID 0x88
|
|
|
|
|
2005-05-08 17:44:37 +00:00
|
|
|
#define MAX_OPT_SIZE 40
|
|
|
|
|
2005-06-28 23:31:38 +00:00
|
|
|
|
2019-11-18 17:54:03 +00:00
|
|
|
typedef struct icmp_echo_request
|
2005-06-28 23:31:38 +00:00
|
|
|
{
|
2019-11-18 17:54:03 +00:00
|
|
|
IPAddr Address;
|
|
|
|
UINT32 Timeout;
|
|
|
|
UINT16 DataOffset;
|
|
|
|
UINT16 DataSize;
|
|
|
|
UINT8 HasOptions;
|
|
|
|
UINT8 Ttl;
|
|
|
|
UINT8 Tos;
|
|
|
|
UINT8 Flags;
|
|
|
|
UINT16 OptionsOffset;
|
|
|
|
UINT8 OptionsSize;
|
|
|
|
UINT8 Padding;
|
|
|
|
} ICMP_ECHO_REQUEST, *PICMP_ECHO_REQUEST;
|
|
|
|
|
|
|
|
typedef struct icmp_echo_reply
|
|
|
|
{
|
|
|
|
IPAddr Address;
|
|
|
|
UINT32 Status;
|
|
|
|
UINT32 RoundTripTime;
|
|
|
|
UINT16 DataSize;
|
|
|
|
UINT16 Reserved;
|
|
|
|
PVOID Data;
|
|
|
|
IP_OPTION_INFORMATION Options;
|
|
|
|
} ICMP_ECHO_REPLY, *PICMP_ECHO_REPLY;
|
2005-06-28 23:31:38 +00:00
|
|
|
|
2018-01-04 18:15:06 +00:00
|
|
|
#ifdef _WIN64
|
2018-01-04 17:21:16 +00:00
|
|
|
struct icmp_echo_reply32
|
|
|
|
{
|
|
|
|
IPAddr Address;
|
|
|
|
ULONG Status;
|
|
|
|
ULONG RoundTripTime;
|
|
|
|
unsigned short DataSize;
|
|
|
|
unsigned short Reserved;
|
|
|
|
void* POINTER_32 Data;
|
2018-01-04 17:29:11 +00:00
|
|
|
struct ip_option_information32 Options;
|
2018-01-04 17:21:16 +00:00
|
|
|
};
|
|
|
|
|
2018-01-04 17:29:11 +00:00
|
|
|
typedef struct ip_option_information32 IP_OPTION_INFORMATION32, *PIP_OPTION_INFORMATION32;
|
|
|
|
|
2018-01-04 17:21:16 +00:00
|
|
|
typedef struct icmp_echo_reply32 ICMP_ECHO_REPLY32, *PICMP_ECHO_REPLY32;
|
|
|
|
#endif
|
|
|
|
|
2005-06-28 23:31:38 +00:00
|
|
|
|
|
|
|
#define IP_STATUS_BASE 11000
|
|
|
|
|
|
|
|
#define IP_SUCCESS 0
|
|
|
|
#define IP_BUF_TOO_SMALL (IP_STATUS_BASE + 1)
|
|
|
|
#define IP_DEST_NET_UNREACHABLE (IP_STATUS_BASE + 2)
|
|
|
|
#define IP_DEST_HOST_UNREACHABLE (IP_STATUS_BASE + 3)
|
|
|
|
#define IP_DEST_PROT_UNREACHABLE (IP_STATUS_BASE + 4)
|
|
|
|
#define IP_DEST_PORT_UNREACHABLE (IP_STATUS_BASE + 5)
|
|
|
|
#define IP_NO_RESOURCES (IP_STATUS_BASE + 6)
|
|
|
|
#define IP_BAD_OPTION (IP_STATUS_BASE + 7)
|
|
|
|
#define IP_HW_ERROR (IP_STATUS_BASE + 8)
|
|
|
|
#define IP_PACKET_TOO_BIG (IP_STATUS_BASE + 9)
|
|
|
|
#define IP_REQ_TIMED_OUT (IP_STATUS_BASE + 10)
|
|
|
|
#define IP_BAD_REQ (IP_STATUS_BASE + 11)
|
|
|
|
#define IP_BAD_ROUTE (IP_STATUS_BASE + 12)
|
|
|
|
#define IP_TTL_EXPIRED_TRANSIT (IP_STATUS_BASE + 13)
|
|
|
|
#define IP_TTL_EXPIRED_REASSEM (IP_STATUS_BASE + 14)
|
|
|
|
#define IP_PARAM_PROBLEM (IP_STATUS_BASE + 15)
|
|
|
|
#define IP_SOURCE_QUENCH (IP_STATUS_BASE + 16)
|
|
|
|
#define IP_OPTION_TOO_BIG (IP_STATUS_BASE + 17)
|
|
|
|
#define IP_BAD_DESTINATION (IP_STATUS_BASE + 18)
|
|
|
|
|
|
|
|
#define IP_ADDR_DELETED (IP_STATUS_BASE + 19)
|
|
|
|
#define IP_SPEC_MTU_CHANGE (IP_STATUS_BASE + 20)
|
|
|
|
#define IP_MTU_CHANGE (IP_STATUS_BASE + 21)
|
|
|
|
#define IP_UNLOAD (IP_STATUS_BASE + 22)
|
|
|
|
|
|
|
|
#define IP_GENERAL_FAILURE (IP_STATUS_BASE + 50)
|
|
|
|
#define MAX_IP_STATUS IP_GENERAL_FAILURE
|
|
|
|
#define IP_PENDING (IP_STATUS_BASE + 255)
|
|
|
|
|
|
|
|
|
|
|
|
#define MAX_ADAPTER_NAME 128
|
|
|
|
|
|
|
|
typedef struct _IP_ADAPTER_INDEX_MAP {
|
2005-05-08 17:44:37 +00:00
|
|
|
ULONG Index;
|
2005-06-28 23:31:38 +00:00
|
|
|
WCHAR Name[MAX_ADAPTER_NAME];
|
2005-05-08 17:44:37 +00:00
|
|
|
} IP_ADAPTER_INDEX_MAP, *PIP_ADAPTER_INDEX_MAP;
|
2005-06-28 23:31:38 +00:00
|
|
|
|
|
|
|
typedef struct _IP_INTERFACE_INFO {
|
|
|
|
LONG NumAdapters;
|
|
|
|
IP_ADAPTER_INDEX_MAP Adapter[1];
|
|
|
|
} IP_INTERFACE_INFO,*PIP_INTERFACE_INFO;
|
|
|
|
|
2005-05-08 17:44:37 +00:00
|
|
|
typedef struct _IP_UNIDIRECTIONAL_ADAPTER_ADDRESS {
|
2005-06-28 23:31:38 +00:00
|
|
|
ULONG NumAdapters;
|
2005-05-08 17:44:37 +00:00
|
|
|
IPAddr Address[1];
|
|
|
|
} IP_UNIDIRECTIONAL_ADAPTER_ADDRESS, *PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS;
|
2005-06-28 23:31:38 +00:00
|
|
|
|
2015-11-30 20:08:57 +00:00
|
|
|
/* ReactOS */
|
|
|
|
|
2005-06-28 23:31:38 +00:00
|
|
|
typedef struct _IP_ADAPTER_ORDER_MAP {
|
2015-11-30 20:08:57 +00:00
|
|
|
ULONG NumAdapters;
|
|
|
|
ULONG AdapterOrder[1];
|
2005-06-28 23:31:38 +00:00
|
|
|
} IP_ADAPTER_ORDER_MAP, *PIP_ADAPTER_ORDER_MAP;
|
|
|
|
|
2015-11-30 20:08:57 +00:00
|
|
|
#if (NTDDI_VERSION >= NTDDI_WINXP)
|
|
|
|
|
|
|
|
#include <pshpack1.h>
|
|
|
|
typedef struct _IPV6_ADDRESS_EX {
|
|
|
|
USHORT sin6_port;
|
|
|
|
ULONG sin6_flowinfo;
|
|
|
|
USHORT sin6_addr[8];
|
|
|
|
ULONG sin6_scope_id;
|
|
|
|
} IPV6_ADDRESS_EX, *PIPV6_ADDRESS_EX;
|
|
|
|
#include <poppack.h>
|
|
|
|
|
2019-11-18 17:54:03 +00:00
|
|
|
typedef struct _ICMPV6_ECHO_REQUEST
|
|
|
|
{
|
|
|
|
IPV6_ADDRESS_EX DestinationAddress;
|
|
|
|
IPV6_ADDRESS_EX SourceAddress;
|
|
|
|
UINT32 Timeout;
|
|
|
|
UINT16 Unknown1;
|
|
|
|
UINT16 Ttl; // XXX: These seem unnecessarily large.
|
|
|
|
UINT32 Flags; // Is something else in the struct?
|
|
|
|
} ICMPV6_ECHO_REQUEST, *PICMPV6_ECHO_REQUEST;
|
|
|
|
|
2015-11-30 20:08:57 +00:00
|
|
|
typedef struct icmpv6_echo_reply_lh {
|
|
|
|
IPV6_ADDRESS_EX Address;
|
|
|
|
ULONG Status;
|
|
|
|
unsigned int RoundTripTime;
|
|
|
|
} ICMPV6_ECHO_REPLY_LH, *PICMPV6_ECHO_REPLY_LH;
|
|
|
|
|
|
|
|
typedef ICMPV6_ECHO_REPLY_LH ICMPV6_ECHO_REPLY;
|
|
|
|
typedef ICMPV6_ECHO_REPLY_LH *PICMPV6_ECHO_REPLY;
|
|
|
|
|
|
|
|
#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
|
|
|
|
|
2005-06-28 23:31:38 +00:00
|
|
|
#endif /* __WINE_IPEXPORT_H */
|