| 1 |
#ifndef _IPEXPORT_H |
| 2 |
#define _IPEXPORT_H |
| 3 |
#if __GNUC__ >=3 |
| 4 |
#pragma GCC system_header |
| 5 |
#endif |
| 6 |
|
| 7 |
#ifdef __cplusplus |
| 8 |
extern "C" { |
| 9 |
#endif |
| 10 |
#ifndef ANY_SIZE |
| 11 |
#define ANY_SIZE 1 |
| 12 |
#endif |
| 13 |
#define MAX_ADAPTER_NAME 128 |
| 14 |
/* IP STATUS flags */ |
| 15 |
#define IP_STATUS_BASE 11000 |
| 16 |
#define IP_SUCCESS 0 |
| 17 |
#define IP_BUF_TOO_SMALL (IP_STATUS_BASE + 1) |
| 18 |
#define IP_DEST_NET_UNREACHABLE (IP_STATUS_BASE + 2) |
| 19 |
#define IP_DEST_HOST_UNREACHABLE (IP_STATUS_BASE + 3) |
| 20 |
#define IP_DEST_PROT_UNREACHABLE (IP_STATUS_BASE + 4) |
| 21 |
#define IP_DEST_PORT_UNREACHABLE (IP_STATUS_BASE + 5) |
| 22 |
#define IP_NO_RESOURCES (IP_STATUS_BASE + 6) |
| 23 |
#define IP_BAD_OPTION (IP_STATUS_BASE + 7) |
| 24 |
#define IP_HW_ERROR (IP_STATUS_BASE + 8) |
| 25 |
#define IP_PACKET_TOO_BIG (IP_STATUS_BASE + 9) |
| 26 |
#define IP_REQ_TIMED_OUT (IP_STATUS_BASE + 10) |
| 27 |
#define IP_BAD_REQ (IP_STATUS_BASE + 11) |
| 28 |
#define IP_BAD_ROUTE (IP_STATUS_BASE + 12) |
| 29 |
#define IP_TTL_EXPIRED_TRANSIT (IP_STATUS_BASE + 13) |
| 30 |
#define IP_TTL_EXPIRED_REASSEM (IP_STATUS_BASE + 14) |
| 31 |
#define IP_PARAM_PROBLEM (IP_STATUS_BASE + 15) |
| 32 |
#define IP_SOURCE_QUENCH (IP_STATUS_BASE + 16) |
| 33 |
#define IP_OPTION_TOO_BIG (IP_STATUS_BASE + 17) |
| 34 |
#define IP_BAD_DESTINATION (IP_STATUS_BASE + 18) |
| 35 |
#define IP_ADDR_DELETED (IP_STATUS_BASE + 19) |
| 36 |
#define IP_SPEC_MTU_CHANGE (IP_STATUS_BASE + 20) |
| 37 |
#define IP_MTU_CHANGE (IP_STATUS_BASE + 21) |
| 38 |
#define IP_UNLOAD (IP_STATUS_BASE + 22) |
| 39 |
#define IP_GENERAL_FAILURE (IP_STATUS_BASE + 50) |
| 40 |
#define MAX_IP_STATUS IP_GENERAL_FAILURE |
| 41 |
#define IP_PENDING (IP_STATUS_BASE + 255) |
| 42 |
/* IP header Flags values */ |
| 43 |
#define IP_FLAG_DF 0x2 |
| 44 |
/* IP Option types */ |
| 45 |
#define IP_OPT_EOL 0 |
| 46 |
#define IP_OPT_NOP 1 |
| 47 |
#define IP_OPT_SECURITY 0x82 |
| 48 |
#define IP_OPT_LSRR 0x83 |
| 49 |
#define IP_OPT_SSRR 0x89 |
| 50 |
#define IP_OPT_RR 0x7 |
| 51 |
#define IP_OPT_TS 0x44 |
| 52 |
#define IP_OPT_SID 0x88 |
| 53 |
#define IP_OPT_ROUTER_ALERT 0x94 |
| 54 |
#define MAX_OPT_SIZE 40 |
| 55 |
|
| 56 |
typedef unsigned long IPAddr, IPMask, IP_STATUS; |
| 57 |
typedef struct ip_option_information { |
| 58 |
unsigned char Ttl; |
| 59 |
unsigned char Tos; |
| 60 |
unsigned char Flags; |
| 61 |
unsigned char OptionsSize; |
| 62 |
unsigned char* OptionsData; |
| 63 |
}IP_OPTION_INFORMATION, *PIP_OPTION_INFORMATION; |
| 64 |
typedef struct icmp_echo_reply { |
| 65 |
IPAddr Address; |
| 66 |
unsigned long Status; |
| 67 |
unsigned long RoundTripTime; |
| 68 |
unsigned short DataSize; |
| 69 |
unsigned short Reserved; |
| 70 |
void* Data; |
| 71 |
struct ip_option_information Options; |
| 72 |
} ICMP_ECHO_REPLY, *PICMP_ECHO_REPLY; |
| 73 |
typedef struct { |
| 74 |
ULONG Index; |
| 75 |
WCHAR Name[MAX_ADAPTER_NAME]; |
| 76 |
} IP_ADAPTER_INDEX_MAP, *PIP_ADAPTER_INDEX_MAP; |
| 77 |
typedef struct { |
| 78 |
LONG NumAdapters; |
| 79 |
IP_ADAPTER_INDEX_MAP Adapter[ANY_SIZE]; |
| 80 |
} IP_INTERFACE_INFO, *PIP_INTERFACE_INFO; |
| 81 |
typedef struct _IP_UNIDIRECTIONAL_ADAPTER_ADDRESS { |
| 82 |
ULONG NumAdapters; |
| 83 |
IPAddr Address[1]; |
| 84 |
} IP_UNIDIRECTIONAL_ADAPTER_ADDRESS, *PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS; |
| 85 |
#ifdef __cplusplus |
| 86 |
} |
| 87 |
#endif |
| 88 |
#endif /* _IPEXPORT_H */ |