winapi_ui_automation/um/
ipexport.rs1use shared::basetsd::ULONG64;
10use shared::in6addr::in6_addr;
11use shared::ntdef::{INT, PUCHAR, PVOID, UCHAR, ULONG, USHORT, WCHAR};
12pub const MAX_ADAPTER_NAME: usize = 128;
13pub const MAX_OPT_SIZE: usize = 40;
14pub type IPAddr = ULONG;
15pub type IPMask = ULONG;
16pub type IP_STATUS = ULONG;
17pub type IPv6Addr = in6_addr;
18STRUCT!{struct IP_OPTION_INFORMATION {
19 Ttl: UCHAR,
20 Tos: UCHAR,
21 Flags: UCHAR,
22 OptionsSize: UCHAR,
23 OptionsData: PUCHAR,
24}}
25pub type PIP_OPTION_INFORMATION = *mut IP_OPTION_INFORMATION;
26#[cfg(target_arch = "x86_64")]
27STRUCT!{struct IP_OPTION_INFORMATION32 {
28 Ttl: UCHAR,
29 Tos: UCHAR,
30 Flags: UCHAR,
31 OptionsSize: UCHAR,
32 OptionsData: u32, }}
34#[cfg(target_arch = "x86_64")]
35pub type PIP_OPTION_INFORMATION32 = *mut IP_OPTION_INFORMATION32;
36STRUCT!{struct ICMP_ECHO_REPLY {
37 Address: IPAddr,
38 Status: ULONG,
39 RoundTripTime: ULONG,
40 DataSize: USHORT,
41 Reserved: USHORT,
42 Data: PVOID,
43 Options: IP_OPTION_INFORMATION,
44}}
45pub type PICMP_ECHO_REPLY = *mut ICMP_ECHO_REPLY;
46#[cfg(target_arch = "x86_64")]
47STRUCT!{struct ICMP_ECHO_REPLY32 {
48 Address: IPAddr,
49 Status: ULONG,
50 RoundTripTime: ULONG,
51 DataSize: USHORT,
52 Reserved: USHORT,
53 Data: u32, Options: IP_OPTION_INFORMATION32,
55}}
56#[cfg(target_arch = "x86_64")]
57pub type PICMP_ECHO_REPLY32 = *mut ICMP_ECHO_REPLY32;
58STRUCT!{#[repr(packed)] struct IPV6_ADDRESS_EX {
59 sin6_port: USHORT,
60 sin6_flowinfo: ULONG,
61 sin6_addr: [USHORT; 8],
62 sin6_scope_id: ULONG,
63}}
64pub type PIPV6_ADDRESS_EX = *mut IPV6_ADDRESS_EX;
65STRUCT!{struct ICMPV6_ECHO_REPLY_LH {
67 Address: IPV6_ADDRESS_EX,
68 Status: ULONG,
69 RoundTripTime: INT,
70}}
71pub type PICMPV6_ECHO_REPLY_LH = *mut ICMPV6_ECHO_REPLY_LH;
72pub type ICMPV6_ECHO_REPLY = ICMPV6_ECHO_REPLY_LH;
73pub type PICMPV6_ECHO_REPLY = *mut ICMPV6_ECHO_REPLY;
74STRUCT!{struct ARP_SEND_REPLY {
76 DestAddress: IPAddr,
77 SrcAddress: IPAddr,
78}}
79pub type PARP_SEND_REPLY = *mut ARP_SEND_REPLY;
80STRUCT!{struct TCP_RESERVE_PORT_RANGE {
81 UpperRange: USHORT,
82 LowerRange: USHORT,
83}}
84pub type PTCP_RESERVE_PORT_RANGE = *mut TCP_RESERVE_PORT_RANGE;
85STRUCT!{struct IP_ADAPTER_INDEX_MAP {
86 Index: ULONG,
87 Name: [WCHAR; MAX_ADAPTER_NAME],
88}}
89pub type PIP_ADAPTER_INDEX_MAP = *mut IP_ADAPTER_INDEX_MAP;
90STRUCT!{struct IP_INTERFACE_INFO {
91 NumAdapters: ULONG,
92 Adapter: [IP_ADAPTER_INDEX_MAP; 1],
93}}
94pub type PIP_INTERFACE_INFO = *mut IP_INTERFACE_INFO;
95STRUCT!{struct IP_UNIDIRECTIONAL_ADAPTER_ADDRESS {
96 NumAdapters: ULONG,
97 Address: [IPAddr; 1],
98}}
99pub type PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS = *mut IP_UNIDIRECTIONAL_ADAPTER_ADDRESS;
100STRUCT!{struct IP_ADAPTER_ORDER_MAP {
101 NumAdapters: ULONG,
102 AdapterOrder: [ULONG; 1],
103}}
104pub type PIP_ADAPTER_ORDER_MAP = *mut IP_ADAPTER_ORDER_MAP;
105STRUCT!{struct IP_MCAST_COUNTER_INFO {
106 InMcastOctets: ULONG64,
107 OutMcastOctets: ULONG64,
108 InMcastPkts: ULONG64,
109 OutMcastPkts: ULONG64,
110}}
111pub type PIP_MCAST_COUNTER_INFO = *mut IP_MCAST_COUNTER_INFO;
112pub const IP_STATUS_BASE: IP_STATUS = 11000;
114pub const IP_SUCCESS: IP_STATUS = 0;
115pub const IP_BUF_TOO_SMALL: IP_STATUS = IP_STATUS_BASE + 1;
116pub const IP_DEST_NET_UNREACHABLE: IP_STATUS = IP_STATUS_BASE + 2;
117pub const IP_DEST_HOST_UNREACHABLE: IP_STATUS = IP_STATUS_BASE + 3;
118pub const IP_DEST_PROT_UNREACHABLE: IP_STATUS = IP_STATUS_BASE + 4;
119pub const IP_DEST_PORT_UNREACHABLE: IP_STATUS = IP_STATUS_BASE + 5;
120pub const IP_NO_RESOURCES: IP_STATUS = IP_STATUS_BASE + 6;
121pub const IP_BAD_OPTION: IP_STATUS = IP_STATUS_BASE + 7;
122pub const IP_HW_ERROR: IP_STATUS = IP_STATUS_BASE + 8;
123pub const IP_PACKET_TOO_BIG: IP_STATUS = IP_STATUS_BASE + 9;
124pub const IP_REQ_TIMED_OUT: IP_STATUS = IP_STATUS_BASE + 10;
125pub const IP_BAD_REQ: IP_STATUS = IP_STATUS_BASE + 11;
126pub const IP_BAD_ROUTE: IP_STATUS = IP_STATUS_BASE + 12;
127pub const IP_TTL_EXPIRED_TRANSIT: IP_STATUS = IP_STATUS_BASE + 13;
128pub const IP_TTL_EXPIRED_REASSEM: IP_STATUS = IP_STATUS_BASE + 14;
129pub const IP_PARAM_PROBLEM: IP_STATUS = IP_STATUS_BASE + 15;
130pub const IP_SOURCE_QUENCH: IP_STATUS = IP_STATUS_BASE + 16;
131pub const IP_OPTION_TOO_BIG: IP_STATUS = IP_STATUS_BASE + 17;
132pub const IP_BAD_DESTINATION: IP_STATUS = IP_STATUS_BASE + 18;
133pub const IP_DEST_NO_ROUTE: IP_STATUS = IP_STATUS_BASE + 2;
134pub const IP_DEST_ADDR_UNREACHABLE: IP_STATUS = IP_STATUS_BASE + 3;
135pub const IP_DEST_PROHIBITED: IP_STATUS = IP_STATUS_BASE + 4;
136pub const IP_HOP_LIMIT_EXCEEDED: IP_STATUS = IP_STATUS_BASE + 13;
137pub const IP_REASSEMBLY_TIME_EXCEEDED: IP_STATUS = IP_STATUS_BASE + 14;
138pub const IP_PARAMETER_PROBLEM: IP_STATUS = IP_STATUS_BASE + 15;
139pub const IP_DEST_UNREACHABLE: IP_STATUS = IP_STATUS_BASE + 40;
140pub const IP_TIME_EXCEEDED: IP_STATUS = IP_STATUS_BASE + 41;
141pub const IP_BAD_HEADER: IP_STATUS = IP_STATUS_BASE + 42;
142pub const IP_UNRECOGNIZED_NEXT_HEADER: IP_STATUS = IP_STATUS_BASE + 43;
143pub const IP_ICMP_ERROR: IP_STATUS = IP_STATUS_BASE + 44;
144pub const IP_DEST_SCOPE_MISMATCH: IP_STATUS = IP_STATUS_BASE + 45;
145pub const IP_ADDR_DELETED: IP_STATUS = IP_STATUS_BASE + 19;
146pub const IP_SPEC_MTU_CHANGE: IP_STATUS = IP_STATUS_BASE + 20;
147pub const IP_MTU_CHANGE: IP_STATUS = IP_STATUS_BASE + 21;
148pub const IP_UNLOAD: IP_STATUS = IP_STATUS_BASE + 22;
149pub const IP_ADDR_ADDED: IP_STATUS = IP_STATUS_BASE + 23;
150pub const IP_MEDIA_CONNECT: IP_STATUS = IP_STATUS_BASE + 24;
151pub const IP_MEDIA_DISCONNECT: IP_STATUS = IP_STATUS_BASE + 25;
152pub const IP_BIND_ADAPTER: IP_STATUS = IP_STATUS_BASE + 26;
153pub const IP_UNBIND_ADAPTER: IP_STATUS = IP_STATUS_BASE + 27;
154pub const IP_DEVICE_DOES_NOT_EXIST: IP_STATUS = IP_STATUS_BASE + 28;
155pub const IP_DUPLICATE_ADDRESS: IP_STATUS = IP_STATUS_BASE + 29;
156pub const IP_INTERFACE_METRIC_CHANGE: IP_STATUS = IP_STATUS_BASE + 30;
157pub const IP_RECONFIG_SECFLTR: IP_STATUS = IP_STATUS_BASE + 31;
158pub const IP_NEGOTIATING_IPSEC: IP_STATUS = IP_STATUS_BASE + 32;
159pub const IP_INTERFACE_WOL_CAPABILITY_CHANGE: IP_STATUS = IP_STATUS_BASE + 33;
160pub const IP_DUPLICATE_IPADD: IP_STATUS = IP_STATUS_BASE + 34;
161pub const IP_GENERAL_FAILURE: IP_STATUS = IP_STATUS_BASE + 50;
162pub const MAX_IP_STATUS: IP_STATUS = IP_GENERAL_FAILURE;
163pub const IP_PENDING: IP_STATUS = IP_STATUS_BASE + 255;
164pub const IP_FLAG_REVERSE: UCHAR = 0x1;
165pub const IP_FLAG_DF: UCHAR = 0x2;
166pub const IP_OPT_EOL: u8 = 0;
167pub const IP_OPT_NOP: u8 = 1;
168pub const IP_OPT_SECURITY: u8 = 0x82;
169pub const IP_OPT_LSRR: u8 = 0x83;
170pub const IP_OPT_SSRR: u8 = 0x89;
171pub const IP_OPT_RR: u8 = 0x7;
172pub const IP_OPT_TS: u8 = 0x44;
173pub const IP_OPT_SID: u8 = 0x88;
174pub const IP_OPT_ROUTER_ALERT: u8 = 0x94;