]>
Commit | Line | Data |
---|---|---|
bdb140d7 | 1 | /** @file\r |
bdb140d7 | 2 | This file defines the EFI IPv6 (Internet Protocol version 6)\r |
3 | Protocol interface. It is split into the following three main\r | |
4 | sections:\r | |
5 | - EFI IPv6 Service Binding Protocol\r | |
6 | - EFI IPv6 Variable\r | |
7 | - EFI IPv6 Protocol\r | |
8 | The EFI IPv6 Protocol provides basic network IPv6 packet I/O services,\r | |
9 | which includes support for Neighbor Discovery Protocol (ND), Multicast\r | |
10 | Listener Discovery Protocol (MLD), and a subset of the Internet Control\r | |
11 | Message Protocol (ICMPv6).\r | |
bdb140d7 | 12 | \r |
9df063a0 HT |
13 | Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r |
14 | This program and the accompanying materials\r | |
bce46f7e | 15 | are licensed and made available under the terms and conditions of the BSD License\r |
16 | which accompanies this distribution. The full text of the license may be found at\r | |
17 | http://opensource.org/licenses/bsd-license.php\r | |
5899caf0 | 18 | \r |
bce46f7e | 19 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
20 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
21 | \r | |
22 | @par Revision Reference:\r | |
23 | This Protocol is introduced in UEFI Specification 2.2\r | |
bdb140d7 | 24 | \r |
25 | **/\r | |
26 | \r | |
27 | #ifndef __EFI_IP6_PROTOCOL_H__\r | |
28 | #define __EFI_IP6_PROTOCOL_H__\r | |
29 | \r | |
30 | #include <Protocol/ManagedNetwork.h>\r | |
31 | \r | |
32 | \r | |
33 | #define EFI_IP6_SERVICE_BINDING_PROTOCOL_GUID \\r | |
34 | { \\r | |
35 | 0xec835dd3, 0xfe0f, 0x617b, {0xa6, 0x21, 0xb3, 0x50, 0xc3, 0xe1, 0x33, 0x88 } \\r | |
36 | }\r | |
37 | \r | |
38 | #define EFI_IP6_PROTOCOL_GUID \\r | |
39 | { \\r | |
40 | 0x2c8759d5, 0x5c2d, 0x66ef, {0x92, 0x5f, 0xb6, 0x6c, 0x10, 0x19, 0x57, 0xe2 } \\r | |
41 | }\r | |
42 | \r | |
43 | typedef struct _EFI_IP6_PROTOCOL EFI_IP6_PROTOCOL;\r | |
44 | \r | |
abbfadd7 | 45 | ///\r |
bce46f7e | 46 | /// EFI_IP6_ADDRESS_PAIR\r |
abbfadd7 | 47 | ///\r |
bce46f7e | 48 | typedef struct{\r |
abbfadd7 | 49 | ///\r |
50 | /// The EFI IPv6 Protocol instance handle that is using this address/prefix pair.\r | |
51 | ///\r | |
52 | EFI_HANDLE InstanceHandle;\r | |
53 | ///\r | |
54 | /// IPv6 address in network byte order.\r | |
55 | ///\r | |
56 | EFI_IPv6_ADDRESS Ip6Address;\r | |
57 | ///\r | |
58 | /// The length of the prefix associated with the Ip6Address.\r | |
59 | ///\r | |
60 | UINT8 PrefixLength;\r | |
bce46f7e | 61 | } EFI_IP6_ADDRESS_PAIR;\r |
abbfadd7 | 62 | \r |
63 | ///\r | |
64 | /// EFI_IP6_VARIABLE_DATA\r | |
65 | ///\r | |
66 | typedef struct {\r | |
67 | ///\r | |
68 | /// The handle of the driver that creates this entry.\r | |
69 | ///\r | |
70 | EFI_HANDLE DriverHandle;\r | |
71 | ///\r | |
72 | /// The number of IPv6 address pairs that follow this data structure.\r | |
73 | ///\r | |
74 | UINT32 AddressCount;\r | |
75 | ///\r | |
76 | /// List of IPv6 address pairs that are currently in use.\r | |
77 | ///\r | |
78 | EFI_IP6_ADDRESS_PAIR AddressPairs[1];\r | |
79 | } EFI_IP6_VARIABLE_DATA;\r | |
80 | \r | |
bdb140d7 | 81 | ///\r |
82 | /// ICMPv6 type definitions for error messages\r | |
83 | ///\r | |
84 | ///@{\r | |
85 | #define ICMP_V6_DEST_UNREACHABLE 0x1\r | |
86 | #define ICMP_V6_PACKET_TOO_BIG 0x2\r | |
87 | #define ICMP_V6_TIME_EXCEEDED 0x3\r | |
88 | #define ICMP_V6_PARAMETER_PROBLEM 0x4\r | |
89 | ///@}\r | |
90 | \r | |
91 | ///\r | |
92 | /// ICMPv6 type definition for informational messages\r | |
93 | ///\r | |
94 | ///@{\r | |
95 | #define ICMP_V6_ECHO_REQUEST 0x80\r | |
96 | #define ICMP_V6_ECHO_REPLY 0x81\r | |
97 | #define ICMP_V6_LISTENER_QUERY 0x82\r | |
98 | #define ICMP_V6_LISTENER_REPORT 0x83\r | |
99 | #define ICMP_V6_LISTENER_DONE 0x84\r | |
100 | #define ICMP_V6_ROUTER_SOLICIT 0x85\r | |
101 | #define ICMP_V6_ROUTER_ADVERTISE 0x86\r | |
102 | #define ICMP_V6_NEIGHBOR_SOLICIT 0x87\r | |
103 | #define ICMP_V6_NEIGHBOR_ADVERTISE 0x88\r | |
104 | #define ICMP_V6_REDIRECT 0x89\r | |
105 | #define ICMP_V6_LISTENER_REPORT_2 0x8F\r | |
106 | ///@}\r | |
107 | \r | |
108 | ///\r | |
109 | /// ICMPv6 code definitions for ICMP_V6_DEST_UNREACHABLE\r | |
110 | ///\r | |
111 | ///@{\r | |
112 | #define ICMP_V6_NO_ROUTE_TO_DEST 0x0\r | |
113 | #define ICMP_V6_COMM_PROHIBITED 0x1\r | |
114 | #define ICMP_V6_BEYOND_SCOPE 0x2\r | |
bce46f7e | 115 | #define ICMP_V6_ADDR_UNREACHABLE 0x3\r |
bdb140d7 | 116 | #define ICMP_V6_PORT_UNREACHABLE 0x4\r |
117 | #define ICMP_V6_SOURCE_ADDR_FAILED 0x5\r | |
118 | #define ICMP_V6_ROUTE_REJECTED 0x6\r | |
119 | ///@}\r | |
bce46f7e | 120 | \r |
bdb140d7 | 121 | ///\r |
122 | /// ICMPv6 code definitions for ICMP_V6_TIME_EXCEEDED\r | |
123 | ///\r | |
124 | ///@{\r | |
125 | #define ICMP_V6_TIMEOUT_HOP_LIMIT 0x0\r | |
126 | #define ICMP_V6_TIMEOUT_REASSEMBLE 0x1\r | |
127 | ///@}\r | |
bce46f7e | 128 | \r |
bdb140d7 | 129 | ///\r |
130 | /// ICMPv6 code definitions for ICMP_V6_PARAMETER_PROBLEM\r | |
131 | ///\r | |
132 | ///@{\r | |
133 | #define ICMP_V6_ERRONEOUS_HEADER 0x0\r | |
134 | #define ICMP_V6_UNRECOGNIZE_NEXT_HDR 0x1\r | |
135 | #define ICMP_V6_UNRECOGNIZE_OPTION 0x2\r | |
136 | ///@}\r | |
137 | \r | |
138 | ///\r | |
139 | /// EFI_IP6_CONFIG_DATA\r | |
140 | /// is used to report and change IPv6 session parameters.\r | |
141 | ///\r | |
142 | typedef struct {\r | |
bce46f7e | 143 | ///\r |
144 | /// For the IPv6 packet to send and receive, this is the default value\r | |
145 | /// of the 'Next Header' field in the last IPv6 extension header or in\r | |
146 | /// the IPv6 header if there are no extension headers. Ignored when\r | |
bdb140d7 | 147 | /// AcceptPromiscuous is TRUE.\r |
bce46f7e | 148 | ///\r |
bdb140d7 | 149 | UINT8 DefaultProtocol;\r |
bce46f7e | 150 | ///\r |
151 | /// Set to TRUE to receive all IPv6 packets that get through the\r | |
152 | /// receive filters.\r | |
153 | /// Set to FALSE to receive only the DefaultProtocol IPv6\r | |
154 | /// packets that get through the receive filters. Ignored when\r | |
bdb140d7 | 155 | /// AcceptPromiscuous is TRUE.\r |
bce46f7e | 156 | ///\r |
bdb140d7 | 157 | BOOLEAN AcceptAnyProtocol;\r |
bce46f7e | 158 | ///\r |
159 | /// Set to TRUE to receive ICMP error report packets. Ignored when\r | |
bdb140d7 | 160 | /// AcceptPromiscuous or AcceptAnyProtocol is TRUE.\r |
bce46f7e | 161 | ///\r |
bdb140d7 | 162 | BOOLEAN AcceptIcmpErrors;\r |
bce46f7e | 163 | ///\r |
164 | /// Set to TRUE to receive all IPv6 packets that are sent to any\r | |
165 | /// hardware address or any protocol address. Set to FALSE to stop\r | |
bdb140d7 | 166 | /// receiving all promiscuous IPv6 packets.\r |
bce46f7e | 167 | ///\r |
bdb140d7 | 168 | BOOLEAN AcceptPromiscuous;\r |
bce46f7e | 169 | ///\r |
170 | /// The destination address of the packets that will be transmitted.\r | |
bdb140d7 | 171 | /// Ignored if it is unspecified.\r |
bce46f7e | 172 | ///\r |
bdb140d7 | 173 | EFI_IPv6_ADDRESS DestinationAddress;\r |
bce46f7e | 174 | ///\r |
175 | /// The station IPv6 address that will be assigned to this EFI IPv6\r | |
176 | /// Protocol instance. This field can be set and changed only when\r | |
177 | /// the EFI IPv6 driver is transitioning from the stopped to the started\r | |
178 | /// states. If the StationAddress is specified, the EFI IPv6 Protocol\r | |
179 | /// driver will deliver only incoming IPv6 packets whose destination\r | |
180 | /// matches this IPv6 address exactly. The StationAddress is required\r | |
181 | /// to be one of currently configured IPv6 addresses. An address\r | |
182 | /// containing all zeroes is also accepted as a special case. Under this\r | |
183 | /// situation, the IPv6 driver is responsible for binding a source\r | |
184 | /// address to this EFI IPv6 protocol instance according to the source\r | |
185 | /// address selection algorithm. Only incoming packets destined to\r | |
186 | /// the selected address will be delivered to the user. And the\r | |
187 | /// selected station address can be retrieved through later\r | |
188 | /// GetModeData() call. If no address is available for selecting,\r | |
189 | /// EFI_NO_MAPPING will be returned, and the station address will\r | |
190 | /// only be successfully bound to this EFI IPv6 protocol instance\r | |
bdb140d7 | 191 | /// after IP6ModeData.IsConfigured changed to TRUE.\r |
bce46f7e | 192 | ///\r |
193 | EFI_IPv6_ADDRESS StationAddress;\r | |
194 | ///\r | |
195 | /// TrafficClass field in transmitted IPv6 packets. Default value\r | |
bdb140d7 | 196 | /// is zero.\r |
bce46f7e | 197 | ///\r |
bdb140d7 | 198 | UINT8 TrafficClass;\r |
bce46f7e | 199 | ///\r |
200 | /// HopLimit field in transmitted IPv6 packets.\r | |
201 | ///\r | |
bdb140d7 | 202 | UINT8 HopLimit;\r |
bce46f7e | 203 | ///\r |
204 | /// FlowLabel field in transmitted IPv6 packets. Default value is\r | |
bdb140d7 | 205 | /// zero.\r |
bce46f7e | 206 | ///\r |
bdb140d7 | 207 | UINT32 FlowLabel;\r |
bce46f7e | 208 | ///\r |
209 | /// The timer timeout value (number of microseconds) for the\r | |
210 | /// receive timeout event to be associated with each assembled\r | |
bdb140d7 | 211 | /// packet. Zero means do not drop assembled packets.\r |
bce46f7e | 212 | ///\r |
bdb140d7 | 213 | UINT32 ReceiveTimeout;\r |
bce46f7e | 214 | ///\r |
215 | /// The timer timeout value (number of microseconds) for the\r | |
216 | /// transmit timeout event to be associated with each outgoing\r | |
bdb140d7 | 217 | /// packet. Zero means do not drop outgoing packets.\r |
bce46f7e | 218 | ///\r |
bdb140d7 | 219 | UINT32 TransmitTimeout;\r |
220 | } EFI_IP6_CONFIG_DATA;\r | |
221 | \r | |
222 | ///\r | |
223 | /// EFI_IP6_ADDRESS_INFO\r | |
224 | ///\r | |
225 | typedef struct {\r | |
226 | EFI_IPv6_ADDRESS Address; ///< The IPv6 address.\r | |
bce46f7e | 227 | UINT8 PrefixLength; ///< The length of the prefix associated with the Address.\r |
bdb140d7 | 228 | } EFI_IP6_ADDRESS_INFO;\r |
229 | \r | |
230 | ///\r | |
231 | /// EFI_IP6_ROUTE_TABLE\r | |
232 | /// is the entry structure that is used in routing tables\r | |
bce46f7e | 233 | ///\r |
bdb140d7 | 234 | typedef struct {\r |
235 | ///\r | |
bce46f7e | 236 | /// The IPv6 address of the gateway to be used as the next hop for\r |
237 | /// packets to this prefix. If the IPv6 address is all zeros, then the\r | |
bdb140d7 | 238 | /// prefix is on-link.\r |
239 | ///\r | |
bce46f7e | 240 | EFI_IPv6_ADDRESS Gateway;\r |
bdb140d7 | 241 | ///\r |
242 | /// The destination prefix to be routed.\r | |
243 | ///\r | |
bce46f7e | 244 | EFI_IPv6_ADDRESS Destination;\r |
bdb140d7 | 245 | ///\r |
246 | /// The length of the prefix associated with the Destination.\r | |
247 | ///\r | |
248 | UINT8 PrefixLength;\r | |
249 | } EFI_IP6_ROUTE_TABLE;\r | |
250 | \r | |
251 | ///\r | |
252 | /// EFI_IP6_NEIGHBOR_STATE\r | |
253 | ///\r | |
254 | typedef enum {\r | |
255 | ///\r | |
bce46f7e | 256 | /// Address resolution is being performed on this entry. Specially,\r |
257 | /// Neighbor Solicitation has been sent to the solicited-node\r | |
258 | /// multicast address of the target, but corresponding Neighbor\r | |
bdb140d7 | 259 | /// Advertisement has not been received.\r |
260 | ///\r | |
bce46f7e | 261 | EfiNeighborInComplete,\r |
bdb140d7 | 262 | ///\r |
bce46f7e | 263 | /// Positive confirmation was received that the forward path to the\r |
bdb140d7 | 264 | /// neighbor was functioning properly.\r |
265 | ///\r | |
266 | EfiNeighborReachable,\r | |
267 | ///\r | |
bce46f7e | 268 | ///Reachable Time has elapsed since the last positive confirmation\r |
269 | ///was received. In this state, the forward path to the neighbor was\r | |
bdb140d7 | 270 | ///functioning properly.\r |
271 | ///\r | |
272 | EfiNeighborStale,\r | |
273 | ///\r | |
bce46f7e | 274 | /// This state is an optimization that gives upper-layer protocols\r |
bdb140d7 | 275 | /// additional time to provide reachability confirmation.\r |
276 | ///\r | |
277 | EfiNeighborDelay,\r | |
278 | ///\r | |
bce46f7e | 279 | /// A reachability confirmation is actively sought by retransmitting\r |
280 | /// Neighbor Solicitations every RetransTimer milliseconds until a\r | |
bdb140d7 | 281 | /// reachability confirmation is received.\r |
282 | ///\r | |
283 | EfiNeighborProbe\r | |
284 | } EFI_IP6_NEIGHBOR_STATE;\r | |
285 | \r | |
286 | ///\r | |
287 | /// EFI_IP6_NEIGHBOR_CACHE\r | |
bce46f7e | 288 | /// is the entry structure that is used in neighbor cache. It records a set\r |
289 | /// of entries about individual neighbors to which traffic has been sent recently.\r | |
bdb140d7 | 290 | ///\r |
291 | typedef struct {\r | |
292 | EFI_IPv6_ADDRESS Neighbor; ///< The on-link unicast/anycast IP address of the neighbor.\r | |
bce46f7e | 293 | EFI_MAC_ADDRESS LinkAddress; ///< Link-layer address of the neighbor.\r |
294 | EFI_IP6_NEIGHBOR_STATE State; ///< State of this neighbor cache entry.\r | |
bdb140d7 | 295 | } EFI_IP6_NEIGHBOR_CACHE;\r |
296 | \r | |
297 | ///\r | |
298 | /// EFI_IP6_ICMP_TYPE\r | |
bce46f7e | 299 | /// is used to describe those ICMP messages that are supported by this EFI\r |
bdb140d7 | 300 | /// IPv6 Protocol driver.\r |
301 | ///\r | |
302 | typedef struct {\r | |
303 | UINT8 Type; ///< The type of ICMP message.\r | |
304 | UINT8 Code; ///< The code of the ICMP message.\r | |
bce46f7e | 305 | } EFI_IP6_ICMP_TYPE;\r |
bdb140d7 | 306 | \r |
307 | ///\r | |
308 | /// EFI_IP6_MODE_DATA\r | |
309 | ///\r | |
bce46f7e | 310 | typedef struct {\r |
bdb140d7 | 311 | ///\r |
bce46f7e | 312 | /// Set to TRUE after this EFI IPv6 Protocol instance is started.\r |
313 | /// All other fields in this structure are undefined until this field is TRUE.\r | |
bdb140d7 | 314 | /// Set to FALSE when the EFI IPv6 Protocol instance is stopped.\r |
bce46f7e | 315 | ///\r |
bdb140d7 | 316 | BOOLEAN IsStarted;\r |
317 | ///\r | |
318 | /// The maximum packet size, in bytes, of the packet which the upper layer driver could feed.\r | |
319 | ///\r | |
320 | UINT32 MaxPacketSize;\r | |
bce46f7e | 321 | ///\r |
bdb140d7 | 322 | /// Current configuration settings. Undefined until IsStarted is TRUE.\r |
323 | ///\r | |
324 | EFI_IP6_CONFIG_DATA ConfigData;\r | |
bce46f7e | 325 | ///\r |
326 | /// Set to TRUE when the EFI IPv6 Protocol instance is configured.\r | |
327 | /// The instance is configured when it has a station address and\r | |
328 | /// corresponding prefix length.\r | |
bdb140d7 | 329 | /// Set to FALSE when the EFI IPv6 Protocol instance is not configured.\r |
330 | ///\r | |
331 | BOOLEAN IsConfigured;\r | |
bce46f7e | 332 | ///\r |
333 | /// Number of configured IPv6 addresses on this interface.\r | |
bdb140d7 | 334 | ///\r |
335 | UINT32 AddressCount;\r | |
bce46f7e | 336 | ///\r |
337 | /// List of currently configured IPv6 addresses and corresponding\r | |
338 | /// prefix lengths assigned to this interface. It is caller's\r | |
bdb140d7 | 339 | /// responsibility to free this buffer.\r |
bce46f7e | 340 | ///\r |
bdb140d7 | 341 | EFI_IP6_ADDRESS_INFO *AddressList;\r |
bce46f7e | 342 | ///\r |
343 | /// Number of joined multicast groups. Undefined until\r | |
bdb140d7 | 344 | /// IsConfigured is TRUE.\r |
345 | ///\r | |
346 | UINT32 GroupCount;\r | |
bce46f7e | 347 | ///\r |
348 | /// List of joined multicast group addresses. It is caller's\r | |
349 | /// responsibility to free this buffer. Undefined until\r | |
bdb140d7 | 350 | /// IsConfigured is TRUE.\r |
351 | ///\r | |
352 | EFI_IPv6_ADDRESS *GroupTable;\r | |
bce46f7e | 353 | ///\r |
354 | /// Number of entries in the routing table. Undefined until\r | |
bdb140d7 | 355 | /// IsConfigured is TRUE.\r |
356 | ///\r | |
357 | UINT32 RouteCount;\r | |
bce46f7e | 358 | ///\r |
bdb140d7 | 359 | /// Routing table entries. It is caller's responsibility to free this buffer.\r |
360 | ///\r | |
361 | EFI_IP6_ROUTE_TABLE *RouteTable;\r | |
362 | ///\r | |
bce46f7e | 363 | /// Number of entries in the neighbor cache. Undefined until\r |
bdb140d7 | 364 | /// IsConfigured is TRUE.\r |
365 | ///\r | |
366 | UINT32 NeighborCount;\r | |
bdb140d7 | 367 | ///\r |
bce46f7e | 368 | /// Neighbor cache entries. It is caller's responsibility to free this\r |
369 | /// buffer. Undefined until IsConfigured is TRUE.\r | |
370 | ///\r | |
371 | EFI_IP6_NEIGHBOR_CACHE *NeighborCache;\r | |
372 | ///\r | |
373 | /// Number of entries in the prefix table. Undefined until\r | |
bdb140d7 | 374 | /// IsConfigured is TRUE.\r |
375 | ///\r | |
376 | UINT32 PrefixCount;\r | |
bce46f7e | 377 | ///\r |
378 | /// On-link Prefix table entries. It is caller's responsibility to free this\r | |
379 | /// buffer. Undefined until IsConfigured is TRUE.\r | |
bdb140d7 | 380 | ///\r |
381 | EFI_IP6_ADDRESS_INFO *PrefixTable;\r | |
bce46f7e | 382 | ///\r |
bdb140d7 | 383 | /// Number of entries in the supported ICMP types list.\r |
384 | ///\r | |
385 | UINT32 IcmpTypeCount;\r | |
bce46f7e | 386 | ///\r |
387 | /// Array of ICMP types and codes that are supported by this EFI\r | |
388 | /// IPv6 Protocol driver. It is caller's responsibility to free this\r | |
bdb140d7 | 389 | /// buffer.\r |
390 | ///\r | |
391 | EFI_IP6_ICMP_TYPE *IcmpTypeList;\r | |
392 | } EFI_IP6_MODE_DATA;\r | |
393 | \r | |
394 | ///\r | |
395 | /// EFI_IP6_HEADER\r | |
396 | /// The fields in the IPv6 header structure are defined in the Internet\r | |
397 | /// Protocol version6 specification.\r | |
398 | ///\r | |
399 | #pragma pack(1)\r | |
400 | typedef struct _EFI_IP6_HEADER {\r | |
401 | UINT8 TrafficClassH:4;\r | |
402 | UINT8 Version:4;\r | |
403 | UINT8 FlowLabelH:4;\r | |
bce46f7e | 404 | UINT8 TrafficClassL:4;\r |
bdb140d7 | 405 | UINT16 FlowLabelL;\r |
406 | UINT16 PayloadLength;\r | |
407 | UINT8 NextHeader;\r | |
408 | UINT8 HopLimit;\r | |
409 | EFI_IPv6_ADDRESS SourceAddress;\r | |
410 | EFI_IPv6_ADDRESS DestinationAddress;\r | |
411 | } EFI_IP6_HEADER;\r | |
9591f383 | 412 | #pragma pack()\r |
bdb140d7 | 413 | \r |
414 | ///\r | |
415 | /// EFI_IP6_FRAGMENT_DATA\r | |
bce46f7e | 416 | /// describes the location and length of the IPv6 packet\r |
bdb140d7 | 417 | /// fragment to transmit or that has been received.\r |
418 | ///\r | |
419 | typedef struct _EFI_IP6_FRAGMENT_DATA {\r | |
420 | UINT32 FragmentLength; ///< Length of fragment data. This field may not be set to zero.\r | |
421 | VOID *FragmentBuffer; ///< Pointer to fragment data. This field may not be set to NULL.\r | |
422 | } EFI_IP6_FRAGMENT_DATA;\r | |
423 | \r | |
424 | ///\r | |
425 | /// EFI_IP6_RECEIVE_DATA\r | |
426 | ///\r | |
427 | typedef struct _EFI_IP6_RECEIVE_DATA {\r | |
bce46f7e | 428 | ///\r |
429 | /// Time when the EFI IPv6 Protocol driver accepted the packet.\r | |
bdb140d7 | 430 | /// Ignored if it is zero.\r |
bce46f7e | 431 | ///\r |
bdb140d7 | 432 | EFI_TIME TimeStamp;\r |
bce46f7e | 433 | ///\r |
434 | /// After this event is signaled, the receive data structure is released\r | |
bdb140d7 | 435 | /// and must not be referenced.\r |
bce46f7e | 436 | ///\r |
bdb140d7 | 437 | EFI_EVENT RecycleSignal;\r |
438 | ///\r | |
bce46f7e | 439 | ///Length of the IPv6 packet headers, including both the IPv6\r |
440 | ///header and any extension headers.\r | |
bdb140d7 | 441 | ///\r |
442 | UINT32 HeaderLength;\r | |
bce46f7e | 443 | ///\r |
444 | /// Pointer to the IPv6 packet header. If the IPv6 packet was\r | |
445 | /// fragmented, this argument is a pointer to the header in the first\r | |
446 | /// fragment.\r | |
447 | ///\r | |
bdb140d7 | 448 | EFI_IP6_HEADER *Header;\r |
bce46f7e | 449 | ///\r |
450 | /// Sum of the lengths of IPv6 packet buffers in FragmentTable. May\r | |
bdb140d7 | 451 | /// be zero.\r |
bce46f7e | 452 | ///\r |
bdb140d7 | 453 | UINT32 DataLength;\r |
bce46f7e | 454 | ///\r |
bdb140d7 | 455 | /// Number of IPv6 payload fragments. May be zero.\r |
bce46f7e | 456 | ///\r |
bdb140d7 | 457 | UINT32 FragmentCount;\r |
bce46f7e | 458 | ///\r |
bdb140d7 | 459 | /// Array of payload fragment lengths and buffer pointers.\r |
bce46f7e | 460 | ///\r |
bdb140d7 | 461 | EFI_IP6_FRAGMENT_DATA FragmentTable[1];\r |
462 | } EFI_IP6_RECEIVE_DATA;\r | |
463 | \r | |
464 | ///\r | |
465 | /// EFI_IP6_OVERRIDE_DATA\r | |
bce46f7e | 466 | /// The information and flags in the override data structure will override\r |
467 | /// default parameters or settings for one Transmit() function call.\r | |
bdb140d7 | 468 | ///\r |
469 | typedef struct _EFI_IP6_OVERRIDE_DATA {\r | |
470 | UINT8 Protocol; ///< Protocol type override.\r | |
471 | UINT8 HopLimit; ///< Hop-Limit override.\r | |
472 | UINT32 FlowLabel; ///< Flow-Label override.\r | |
473 | } EFI_IP6_OVERRIDE_DATA;\r | |
bce46f7e | 474 | \r |
bdb140d7 | 475 | ///\r |
bce46f7e | 476 | /// EFI_IP6_TRANSMIT_DATA\r |
bdb140d7 | 477 | ///\r |
bce46f7e | 478 | typedef struct _EFI_IP6_TRANSMIT_DATA {\r |
479 | ///\r | |
480 | /// The destination IPv6 address. If it is unspecified,\r | |
bdb140d7 | 481 | /// ConfigData.DestinationAddress will be used instead.\r |
bce46f7e | 482 | ///\r |
bdb140d7 | 483 | EFI_IPv6_ADDRESS DestinationAddress;\r |
bce46f7e | 484 | ///\r |
bdb140d7 | 485 | /// If not NULL, the IPv6 transmission control override data.\r |
bce46f7e | 486 | ///\r |
bdb140d7 | 487 | EFI_IP6_OVERRIDE_DATA *OverrideData;\r |
bce46f7e | 488 | ///\r |
489 | /// Total length in byte of the IPv6 extension headers specified in\r | |
bdb140d7 | 490 | /// ExtHdrs.\r |
bce46f7e | 491 | ///\r |
bdb140d7 | 492 | UINT32 ExtHdrsLength;\r |
bce46f7e | 493 | ///\r |
494 | /// Pointer to the IPv6 extension headers. The IP layer will append\r | |
495 | /// the required extension headers if they are not specified by\r | |
bdb140d7 | 496 | /// ExtHdrs. Ignored if ExtHdrsLength is zero.\r |
bce46f7e | 497 | ///\r |
bdb140d7 | 498 | VOID *ExtHdrs;\r |
bce46f7e | 499 | ///\r |
500 | /// The protocol of first extension header in ExtHdrs. Ignored if\r | |
bdb140d7 | 501 | /// ExtHdrsLength is zero.\r |
bce46f7e | 502 | ///\r |
bdb140d7 | 503 | UINT8 NextHeader;\r |
bce46f7e | 504 | ///\r |
bdb140d7 | 505 | /// Total length in bytes of the FragmentTable data to transmit.\r |
bce46f7e | 506 | ///\r |
bdb140d7 | 507 | UINT32 DataLength;\r |
bce46f7e | 508 | ///\r |
bdb140d7 | 509 | /// Number of entries in the fragment data table.\r |
bce46f7e | 510 | ///\r |
bdb140d7 | 511 | UINT32 FragmentCount;\r |
bce46f7e | 512 | ///\r |
bdb140d7 | 513 | /// Start of the fragment data table.\r |
bce46f7e | 514 | ///\r |
bdb140d7 | 515 | EFI_IP6_FRAGMENT_DATA FragmentTable[1];\r |
516 | } EFI_IP6_TRANSMIT_DATA;\r | |
517 | \r | |
518 | ///\r | |
519 | /// EFI_IP6_COMPLETION_TOKEN\r | |
520 | /// structures are used for both transmit and receive operations.\r | |
521 | ///\r | |
522 | typedef struct {\r | |
523 | ///\r | |
bce46f7e | 524 | /// This Event will be signaled after the Status field is updated by\r |
bdb140d7 | 525 | /// the EFI IPv6 Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.\r |
526 | ///\r | |
527 | EFI_EVENT Event;\r | |
528 | ///\r | |
529 | /// Will be set to one of the following values:\r | |
bce46f7e | 530 | /// - EFI_SUCCESS: The receive or transmit completed\r |
bdb140d7 | 531 | /// successfully.\r |
532 | /// - EFI_ABORTED: The receive or transmit was aborted\r | |
533 | /// - EFI_TIMEOUT: The transmit timeout expired.\r | |
534 | /// - EFI_ICMP_ERROR: An ICMP error packet was received.\r | |
bce46f7e | 535 | /// - EFI_DEVICE_ERROR: An unexpected system or network\r |
bdb140d7 | 536 | /// error occurred.\r |
bce46f7e | 537 | /// - EFI_SECURITY_VIOLATION: The transmit or receive was\r |
bdb140d7 | 538 | /// failed because of an IPsec policy check.\r |
c5c3e7e2 | 539 | /// - EFI_NO_MEDIA: There was a media error.\r |
bdb140d7 | 540 | ///\r |
541 | EFI_STATUS Status;\r | |
542 | union {\r | |
543 | ///\r | |
544 | /// When the Token is used for receiving, RxData is a pointer to the EFI_IP6_RECEIVE_DATA.\r | |
545 | ///\r | |
546 | EFI_IP6_RECEIVE_DATA *RxData;\r | |
547 | ///\r | |
548 | /// When the Token is used for transmitting, TxData is a pointer to the EFI_IP6_TRANSMIT_DATA.\r | |
549 | ///\r | |
550 | EFI_IP6_TRANSMIT_DATA *TxData;\r | |
551 | } Packet;\r | |
552 | } EFI_IP6_COMPLETION_TOKEN;\r | |
553 | \r | |
554 | /**\r | |
555 | Gets the current operational settings for this instance of the EFI IPv6 Protocol driver.\r | |
bce46f7e | 556 | \r |
557 | The GetModeData() function returns the current operational mode data for this driver instance.\r | |
558 | The data fields in EFI_IP6_MODE_DATA are read only. This function is used optionally to\r | |
bdb140d7 | 559 | retrieve the operational mode data of underlying networks or drivers..\r |
560 | \r | |
561 | @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.\r | |
562 | @param[out] Ip6ModeData Pointer to the EFI IPv6 Protocol mode data structure.\r | |
563 | @param[out] MnpConfigData Pointer to the managed network configuration data structure.\r | |
564 | @param[out] SnpModeData Pointer to the simple network mode data structure.\r | |
bce46f7e | 565 | \r |
bdb140d7 | 566 | @retval EFI_SUCCESS The operation completed successfully.\r |
567 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
568 | @retval EFI_OUT_OF_RESOURCES The required mode data could not be allocated.\r | |
569 | \r | |
570 | **/\r | |
bce46f7e | 571 | typedef\r |
bdb140d7 | 572 | EFI_STATUS\r |
5e6f3ee2 | 573 | (EFIAPI *EFI_IP6_GET_MODE_DATA)(\r |
bdb140d7 | 574 | IN EFI_IP6_PROTOCOL *This,\r |
575 | OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL,\r | |
576 | OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,\r | |
577 | OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL\r | |
578 | );\r | |
579 | \r | |
580 | /**\r | |
581 | Assigns an IPv6 address and subnet mask to this EFI IPv6 Protocol driver instance.\r | |
bce46f7e | 582 | \r |
583 | The Configure() function is used to set, change, or reset the operational parameters and filter\r | |
584 | settings for this EFI IPv6 Protocol instance. Until these parameters have been set, no network traffic\r | |
585 | can be sent or received by this instance. Once the parameters have been reset (by calling this\r | |
586 | function with Ip6ConfigData set to NULL), no more traffic can be sent or received until these\r | |
587 | parameters have been set again. Each EFI IPv6 Protocol instance can be started and stopped\r | |
588 | independently of each other by enabling or disabling their receive filter settings with the\r | |
bdb140d7 | 589 | Configure() function.\r |
bce46f7e | 590 | \r |
591 | If Ip6ConfigData.StationAddress is a valid non-zero IPv6 unicast address, it is required\r | |
592 | to be one of the currently configured IPv6 addresses list in the EFI IPv6 drivers, or else\r | |
593 | EFI_INVALID_PARAMETER will be returned. If Ip6ConfigData.StationAddress is\r | |
594 | unspecified, the IPv6 driver will bind a source address according to the source address selection\r | |
595 | algorithm. Clients could frequently call GetModeData() to check get currently configured IPv6\r | |
596 | address list in the EFI IPv6 driver. If both Ip6ConfigData.StationAddress and\r | |
597 | Ip6ConfigData.Destination are unspecified, when transmitting the packet afterwards, the\r | |
bdb140d7 | 598 | source address filled in each outgoing IPv6 packet is decided based on the destination of this packet. .\r |
bce46f7e | 599 | \r |
600 | If operational parameters are reset or changed, any pending transmit and receive requests will be\r | |
601 | cancelled. Their completion token status will be set to EFI_ABORTED and their events will be\r | |
bdb140d7 | 602 | signaled.\r |
603 | \r | |
604 | @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.\r | |
605 | @param[in] Ip6ConfigData Pointer to the EFI IPv6 Protocol configuration data structure.\r | |
bce46f7e | 606 | \r |
bdb140d7 | 607 | @retval EFI_SUCCESS The driver instance was successfully opened.\r |
608 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
609 | - This is NULL.\r | |
bce46f7e | 610 | - Ip6ConfigData.StationAddress is neither zero nor\r |
bdb140d7 | 611 | a unicast IPv6 address.\r |
bce46f7e | 612 | - Ip6ConfigData.StationAddress is neither zero nor\r |
bdb140d7 | 613 | one of the configured IP addresses in the EFI IPv6 driver.\r |
bce46f7e | 614 | - Ip6ConfigData.DefaultProtocol is illegal.\r |
bdb140d7 | 615 | @retval EFI_OUT_OF_RESOURCES The EFI IPv6 Protocol driver instance data could not be allocated.\r |
bce46f7e | 616 | @retval EFI_NO_MAPPING The IPv6 driver was responsible for choosing a source address for\r |
617 | this instance, but no source address was available for use.\r | |
618 | @retval EFI_ALREADY_STARTED The interface is already open and must be stopped before the IPv6\r | |
bdb140d7 | 619 | address or prefix length can be changed.\r |
bce46f7e | 620 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI IPv6\r |
bdb140d7 | 621 | Protocol driver instance is not opened.\r |
bce46f7e | 622 | @retval EFI_UNSUPPORTED Default protocol specified through\r |
bdb140d7 | 623 | Ip6ConfigData.DefaulProtocol isn't supported.\r |
624 | \r | |
625 | **/\r | |
bce46f7e | 626 | typedef\r |
bdb140d7 | 627 | EFI_STATUS\r |
5e6f3ee2 | 628 | (EFIAPI *EFI_IP6_CONFIGURE)(\r |
bdb140d7 | 629 | IN EFI_IP6_PROTOCOL *This,\r |
630 | IN EFI_IP6_CONFIG_DATA *Ip6ConfigData OPTIONAL\r | |
631 | );\r | |
632 | \r | |
633 | /**\r | |
634 | Joins and leaves multicast groups.\r | |
bce46f7e | 635 | \r |
636 | The Groups() function is used to join and leave multicast group sessions. Joining a group will\r | |
637 | enable reception of matching multicast packets. Leaving a group will disable reception of matching\r | |
bdb140d7 | 638 | multicast packets. Source-Specific Multicast isn't required to be supported.\r |
bce46f7e | 639 | \r |
bdb140d7 | 640 | If JoinFlag is FALSE and GroupAddress is NULL, all joined groups will be left.\r |
641 | \r | |
642 | @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.\r | |
643 | @param[in] JoinFlag Set to TRUE to join the multicast group session and FALSE to leave.\r | |
644 | @param[in] GroupAddress Pointer to the IPv6 multicast address.\r | |
bce46f7e | 645 | \r |
bdb140d7 | 646 | @retval EFI_SUCCESS The operation completed successfully.\r |
647 | @retval EFI_INVALID_PARAMETER One or more of the following is TRUE:\r | |
648 | - This is NULL.\r | |
649 | - JoinFlag is TRUE and GroupAddress is NULL.\r | |
650 | - GroupAddress is not NULL and *GroupAddress is\r | |
bce46f7e | 651 | not a multicast IPv6 address.\r |
652 | - GroupAddress is not NULL and *GroupAddress is in the\r | |
bdb140d7 | 653 | range of SSM destination address.\r |
654 | @retval EFI_NOT_STARTED This instance has not been started.\r | |
655 | @retval EFI_OUT_OF_RESOURCES System resources could not be allocated.\r | |
656 | @retval EFI_UNSUPPORTED This EFI IPv6 Protocol implementation does not support multicast groups.\r | |
657 | @retval EFI_ALREADY_STARTED The group address is already in the group table (when\r | |
658 | JoinFlag is TRUE).\r | |
659 | @retval EFI_NOT_FOUND The group address is not in the group table (when JoinFlag is FALSE).\r | |
660 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
661 | \r | |
662 | **/\r | |
bce46f7e | 663 | typedef\r |
bdb140d7 | 664 | EFI_STATUS\r |
5e6f3ee2 | 665 | (EFIAPI *EFI_IP6_GROUPS)(\r |
bdb140d7 | 666 | IN EFI_IP6_PROTOCOL *This,\r |
667 | IN BOOLEAN JoinFlag,\r | |
668 | IN EFI_IPv6_ADDRESS *GroupAddress OPTIONAL\r | |
669 | );\r | |
670 | \r | |
671 | /**\r | |
672 | Adds and deletes routing table entries.\r | |
673 | \r | |
674 | The Routes() function adds a route to or deletes a route from the routing table.\r | |
bce46f7e | 675 | \r |
676 | Routes are determined by comparing the leftmost PrefixLength bits of Destination with\r | |
bdb140d7 | 677 | the destination IPv6 address arithmetically. The gateway address must be on the same subnet as the\r |
678 | configured station address.\r | |
bce46f7e | 679 | \r |
680 | The default route is added with Destination and PrefixLegth both set to all zeros. The\r | |
bdb140d7 | 681 | default route matches all destination IPv6 addresses that do not match any other routes.\r |
682 | \r | |
683 | All EFI IPv6 Protocol instances share a routing table.\r | |
bce46f7e | 684 | \r |
bdb140d7 | 685 | @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.\r |
bce46f7e | 686 | @param[in] DeleteRoute Set to TRUE to delete this route from the routing table. Set to\r |
687 | FALSE to add this route to the routing table. Destination,\r | |
688 | PrefixLength and Gateway are used as the key to each\r | |
bdb140d7 | 689 | route entry.\r |
690 | @param[in] Destination The address prefix of the subnet that needs to be routed.\r | |
bce46f7e | 691 | @param[in] PrefixLength The prefix length of Destination. Ignored if Destination\r |
bdb140d7 | 692 | is NULL.\r |
693 | @param[in] GatewayAddress The unicast gateway IPv6 address for this route.\r | |
694 | \r | |
695 | @retval EFI_SUCCESS The operation completed successfully.\r | |
696 | @retval EFI_NOT_STARTED The driver instance has not been started.\r | |
697 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
698 | - This is NULL.\r | |
bce46f7e | 699 | - When DeleteRoute is TRUE, both Destination and\r |
bdb140d7 | 700 | GatewayAddress are NULL.\r |
bce46f7e | 701 | - When DeleteRoute is FALSE, either Destination or\r |
bdb140d7 | 702 | GatewayAddress is NULL.\r |
703 | - *GatewayAddress is not a valid unicast IPv6 address.\r | |
bce46f7e | 704 | - *GatewayAddress is one of the local configured IPv6\r |
bdb140d7 | 705 | addresses.\r |
706 | @retval EFI_OUT_OF_RESOURCES Could not add the entry to the routing table.\r | |
707 | @retval EFI_NOT_FOUND This route is not in the routing table (when DeleteRoute is TRUE).\r | |
708 | @retval EFI_ACCESS_DENIED The route is already defined in the routing table (when\r | |
709 | DeleteRoute is FALSE).\r | |
bce46f7e | 710 | \r |
bdb140d7 | 711 | **/\r |
bce46f7e | 712 | typedef\r |
bdb140d7 | 713 | EFI_STATUS\r |
5e6f3ee2 | 714 | (EFIAPI *EFI_IP6_ROUTES)(\r |
bdb140d7 | 715 | IN EFI_IP6_PROTOCOL *This,\r |
716 | IN BOOLEAN DeleteRoute,\r | |
5e6f3ee2 | 717 | IN EFI_IPv6_ADDRESS *Destination OPTIONAL,\r |
bdb140d7 | 718 | IN UINT8 PrefixLength,\r |
bce46f7e | 719 | IN EFI_IPv6_ADDRESS *GatewayAddress OPTIONAL\r |
bdb140d7 | 720 | );\r |
721 | \r | |
722 | /**\r | |
723 | Add or delete Neighbor cache entries.\r | |
724 | \r | |
bce46f7e | 725 | The Neighbors() function is used to add, update, or delete an entry from neighbor cache.\r |
726 | IPv6 neighbor cache entries are typically inserted and updated by the network protocol driver as\r | |
727 | network traffic is processed. Most neighbor cache entries will time out and be deleted if the network\r | |
728 | traffic stops. Neighbor cache entries that were inserted by Neighbors() may be static (will not\r | |
bdb140d7 | 729 | timeout) or dynamic (will time out).\r |
bce46f7e | 730 | \r |
731 | The implementation should follow the neighbor cache timeout mechanism which is defined in\r | |
732 | RFC4861. The default neighbor cache timeout value should be tuned for the expected network\r | |
bdb140d7 | 733 | environment\r |
734 | \r | |
735 | @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.\r | |
bce46f7e | 736 | @param[in] DeleteFlag Set to TRUE to delete the specified cache entry, set to FALSE to\r |
737 | add (or update, if it already exists and Override is TRUE) the\r | |
738 | specified cache entry. TargetIp6Address is used as the key\r | |
bdb140d7 | 739 | to find the requested cache entry.\r |
740 | @param[in] TargetIp6Address Pointer to Target IPv6 address.\r | |
bce46f7e | 741 | @param[in] TargetLinkAddress Pointer to link-layer address of the target. Ignored if NULL.\r |
742 | @param[in] Timeout Time in 100-ns units that this entry will remain in the neighbor\r | |
743 | cache, it will be deleted after Timeout. A value of zero means that\r | |
744 | the entry is permanent. A non-zero value means that the entry is\r | |
745 | dynamic.\r | |
746 | @param[in] Override If TRUE, the cached link-layer address of the matching entry will\r | |
747 | be overridden and updated; if FALSE, EFI_ACCESS_DENIED\r | |
bdb140d7 | 748 | will be returned if a corresponding cache entry already existed.\r |
749 | \r | |
750 | @retval EFI_SUCCESS The data has been queued for transmission.\r | |
751 | @retval EFI_NOT_STARTED This instance has not been started.\r | |
752 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
753 | - This is NULL.\r | |
754 | - TargetIpAddress is NULL.\r | |
755 | - *TargetLinkAddress is invalid when not NULL.\r | |
756 | - *TargetIpAddress is not a valid unicast IPv6 address.\r | |
bce46f7e | 757 | - *TargetIpAddress is one of the local configured IPv6\r |
bdb140d7 | 758 | addresses.\r |
759 | @retval EFI_OUT_OF_RESOURCES Could not add the entry to the neighbor cache.\r | |
bce46f7e | 760 | @retval EFI_NOT_FOUND This entry is not in the neighbor cache (when DeleteFlag is\r |
761 | TRUE or when DeleteFlag is FALSE while\r | |
bdb140d7 | 762 | TargetLinkAddress is NULL.).\r |
bce46f7e | 763 | @retval EFI_ACCESS_DENIED The to-be-added entry is already defined in the neighbor cache,\r |
764 | and that entry is tagged as un-overridden (when DeleteFlag\r | |
bdb140d7 | 765 | is FALSE).\r |
766 | \r | |
767 | **/\r | |
bce46f7e | 768 | typedef\r |
bdb140d7 | 769 | EFI_STATUS\r |
5e6f3ee2 | 770 | (EFIAPI *EFI_IP6_NEIGHBORS)(\r |
bdb140d7 | 771 | IN EFI_IP6_PROTOCOL *This,\r |
772 | IN BOOLEAN DeleteFlag,\r | |
773 | IN EFI_IPv6_ADDRESS *TargetIp6Address,\r | |
774 | IN EFI_MAC_ADDRESS *TargetLinkAddress,\r | |
775 | IN UINT32 Timeout,\r | |
776 | IN BOOLEAN Override\r | |
777 | );\r | |
778 | \r | |
779 | /**\r | |
780 | Places outgoing data packets into the transmit queue.\r | |
781 | \r | |
782 | The Transmit() function places a sending request in the transmit queue of this\r | |
783 | EFI IPv6 Protocol instance. Whenever the packet in the token is sent out or some\r | |
784 | errors occur, the event in the token will be signaled and the status is updated.\r | |
785 | \r | |
786 | @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.\r | |
787 | @param[in] Token Pointer to the transmit token.\r | |
788 | \r | |
789 | @retval EFI_SUCCESS The data has been queued for transmission.\r | |
790 | @retval EFI_NOT_STARTED This instance has not been started.\r | |
bce46f7e | 791 | @retval EFI_NO_MAPPING The IPv6 driver was responsible for choosing a source address for\r |
bdb140d7 | 792 | this transmission, but no source address was available for use.\r |
793 | @retval EFI_INVALID_PARAMETER One or more of the following is TRUE:\r | |
794 | - This is NULL.\r | |
795 | - Token is NULL.\r | |
796 | - Token.Event is NULL.\r | |
797 | - Token.Packet.TxData is NULL.\r | |
798 | - Token.Packet.ExtHdrsLength is not zero and Token.Packet.ExtHdrs is NULL.\r | |
799 | - Token.Packet.FragmentCount is zero.\r | |
800 | - One or more of the Token.Packet.TxData.FragmentTable[].FragmentLength fields is zero.\r | |
801 | - One or more of the Token.Packet.TxData.FragmentTable[].FragmentBuffer fields is NULL.\r | |
802 | - Token.Packet.TxData.DataLength is zero or not equal to the sum of fragment lengths.\r | |
bce46f7e | 803 | - Token.Packet.TxData.DestinationAddress is non-zero when DestinationAddress is configured as\r |
bdb140d7 | 804 | non-zero when doing Configure() for this EFI IPv6 protocol instance.\r |
bce46f7e | 805 | - Token.Packet.TxData.DestinationAddress is unspecified when DestinationAddress is unspecified\r |
bdb140d7 | 806 | when doing Configure() for this EFI IPv6 protocol instance.\r |
807 | @retval EFI_ACCESS_DENIED The transmit completion token with the same Token.Event\r | |
808 | was already in the transmit queue.\r | |
809 | @retval EFI_NOT_READY The completion token could not be queued because the transmit\r | |
bce46f7e | 810 | queue is full.\r |
bdb140d7 | 811 | @retval EFI_NOT_FOUND Not route is found to destination address.\r |
812 | @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data.\r | |
813 | @retval EFI_BUFFER_TOO_SMALL Token.Packet.TxData.TotalDataLength is too\r | |
814 | short to transmit.\r | |
bce46f7e | 815 | @retval EFI_BAD_BUFFER_SIZE If Token.Packet.TxData.DataLength is beyond the\r |
bdb140d7 | 816 | maximum that which can be described through the Fragment Offset\r |
817 | field in Fragment header when performing fragmentation.\r | |
818 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
819 | \r | |
820 | **/\r | |
bce46f7e | 821 | typedef\r |
bdb140d7 | 822 | EFI_STATUS\r |
5e6f3ee2 | 823 | (EFIAPI *EFI_IP6_TRANSMIT)(\r |
bdb140d7 | 824 | IN EFI_IP6_PROTOCOL *This,\r |
825 | IN EFI_IP6_COMPLETION_TOKEN *Token\r | |
826 | );\r | |
827 | \r | |
828 | /**\r | |
829 | Places a receiving request into the receiving queue.\r | |
bce46f7e | 830 | \r |
bdb140d7 | 831 | The Receive() function places a completion token into the receive packet queue.\r |
832 | This function is always asynchronous.\r | |
bce46f7e | 833 | \r |
bdb140d7 | 834 | The Token.Event field in the completion token must be filled in by the caller\r |
835 | and cannot be NULL. When the receive operation completes, the EFI IPv6 Protocol\r | |
836 | driver updates the Token.Status and Token.Packet.RxData fields and the Token.Event\r | |
837 | is signaled.\r | |
838 | \r | |
839 | @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.\r | |
ea6898b9 | 840 | @param[in] Token Pointer to a token that is associated with the receive data descriptor.\r |
bce46f7e | 841 | \r |
bdb140d7 | 842 | @retval EFI_SUCCESS The receive completion token was cached.\r |
843 | @retval EFI_NOT_STARTED This EFI IPv6 Protocol instance has not been started.\r | |
bce46f7e | 844 | @retval EFI_NO_MAPPING When IP6 driver responsible for binding source address to this instance,\r |
bdb140d7 | 845 | while no source address is available for use.\r |
846 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
847 | - This is NULL.\r | |
848 | - Token is NULL.\r | |
849 | - Token.Event is NULL.\r | |
850 | @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of system\r | |
851 | resources (usually memory).\r | |
852 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
853 | The EFI IPv6 Protocol instance has been reset to startup defaults.\r | |
854 | @retval EFI_ACCESS_DENIED The receive completion token with the same Token.Event was already\r | |
855 | in the receive queue.\r | |
856 | @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.\r | |
bce46f7e | 857 | \r |
858 | **/\r | |
859 | typedef\r | |
860 | EFI_STATUS\r | |
861 | (EFIAPI *EFI_IP6_RECEIVE)(\r | |
bdb140d7 | 862 | IN EFI_IP6_PROTOCOL *This,\r |
863 | IN EFI_IP6_COMPLETION_TOKEN *Token\r | |
864 | );\r | |
865 | \r | |
866 | /**\r | |
867 | Abort an asynchronous transmit or receive request.\r | |
bce46f7e | 868 | \r |
bdb140d7 | 869 | The Cancel() function is used to abort a pending transmit or receive request.\r |
870 | If the token is in the transmit or receive request queues, after calling this\r | |
871 | function, Token->Status will be set to EFI_ABORTED and then Token->Event will\r | |
872 | be signaled. If the token is not in one of the queues, which usually means the\r | |
873 | asynchronous operation has completed, this function will not signal the token\r | |
874 | and EFI_NOT_FOUND is returned.\r | |
875 | \r | |
876 | @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.\r | |
877 | @param[in] Token Pointer to a token that has been issued by\r | |
878 | EFI_IP6_PROTOCOL.Transmit() or\r | |
879 | EFI_IP6_PROTOCOL.Receive(). If NULL, all pending\r | |
880 | tokens are aborted. Type EFI_IP6_COMPLETION_TOKEN is\r | |
881 | defined in EFI_IP6_PROTOCOL.Transmit().\r | |
bce46f7e | 882 | \r |
bdb140d7 | 883 | @retval EFI_SUCCESS The asynchronous I/O request was aborted and\r |
884 | Token->Event was signaled. When Token is NULL, all\r | |
885 | pending requests were aborted and their events were signaled.\r | |
886 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
887 | @retval EFI_NOT_STARTED This instance has not been started.\r | |
888 | @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was\r | |
889 | not found in the transmit or receive queue. It has either completed\r | |
890 | or was not issued by Transmit() and Receive().\r | |
891 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
bce46f7e | 892 | \r |
893 | **/\r | |
894 | typedef\r | |
895 | EFI_STATUS\r | |
896 | (EFIAPI *EFI_IP6_CANCEL)(\r | |
bdb140d7 | 897 | IN EFI_IP6_PROTOCOL *This,\r |
898 | IN EFI_IP6_COMPLETION_TOKEN *Token OPTIONAL\r | |
899 | );\r | |
900 | \r | |
901 | /**\r | |
902 | Polls for incoming data packets and processes outgoing data packets.\r | |
bce46f7e | 903 | \r |
bdb140d7 | 904 | The Poll() function polls for incoming data packets and processes outgoing data\r |
905 | packets. Network drivers and applications can call the EFI_IP6_PROTOCOL.Poll()\r | |
906 | function to increase the rate that data packets are moved between the communications\r | |
907 | device and the transmit and receive queues.\r | |
bce46f7e | 908 | \r |
bdb140d7 | 909 | In some systems the periodic timer event may not poll the underlying communications\r |
910 | device fast enough to transmit and/or receive all data packets without missing\r | |
911 | incoming packets or dropping outgoing packets. Drivers and applications that are\r | |
912 | experiencing packet loss should try calling the EFI_IP6_PROTOCOL.Poll() function\r | |
913 | more often.\r | |
914 | \r | |
915 | @param[in] This Pointer to the EFI_IP6_PROTOCOL instance.\r | |
916 | \r | |
917 | @retval EFI_SUCCESS Incoming or outgoing data was processed.\r | |
918 | @retval EFI_NOT_STARTED This EFI IPv6 Protocol instance has not been started.\r | |
919 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
920 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
921 | @retval EFI_NOT_READY No incoming or outgoing data is processed.\r | |
922 | @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.\r | |
923 | Consider increasing the polling rate.\r | |
924 | \r | |
925 | **/\r | |
bce46f7e | 926 | typedef\r |
bdb140d7 | 927 | EFI_STATUS\r |
5e6f3ee2 | 928 | (EFIAPI *EFI_IP6_POLL)(\r |
bdb140d7 | 929 | IN EFI_IP6_PROTOCOL *This\r |
930 | );\r | |
931 | \r | |
932 | ///\r | |
933 | /// The EFI IPv6 Protocol implements a simple packet-oriented interface that can be\r | |
934 | /// used by drivers, daemons, and applications to transmit and receive network packets.\r | |
935 | ///\r | |
5e6f3ee2 | 936 | struct _EFI_IP6_PROTOCOL {\r |
bdb140d7 | 937 | EFI_IP6_GET_MODE_DATA GetModeData;\r |
938 | EFI_IP6_CONFIGURE Configure;\r | |
939 | EFI_IP6_GROUPS Groups;\r | |
940 | EFI_IP6_ROUTES Routes;\r | |
941 | EFI_IP6_NEIGHBORS Neighbors;\r | |
942 | EFI_IP6_TRANSMIT Transmit;\r | |
943 | EFI_IP6_RECEIVE Receive;\r | |
944 | EFI_IP6_CANCEL Cancel;\r | |
945 | EFI_IP6_POLL Poll;\r | |
5e6f3ee2 | 946 | };\r |
bdb140d7 | 947 | \r |
948 | extern EFI_GUID gEfiIp6ServiceBindingProtocolGuid;\r | |
949 | extern EFI_GUID gEfiIp6ProtocolGuid;\r | |
950 | \r | |
951 | #endif\r |