]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/Ip6Dxe/Ip6Output.h
NetworkPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / NetworkPkg / Ip6Dxe / Ip6Output.h
CommitLineData
a3bcde70
HT
1/** @file\r
2 The internal functions and routines to transmit the IP6 packet.\r
3\r
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
5\r
ecf98fbc 6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
a3bcde70
HT
7\r
8**/\r
9\r
10#ifndef __EFI_IP6_OUTPUT_H__\r
11#define __EFI_IP6_OUTPUT_H__\r
12\r
13extern UINT32 mIp6Id;\r
14\r
15/**\r
16 Output all the available source addresses to the list entry head SourceList. The\r
17 number of source addresses are also returned.\r
18\r
19 @param[in] IpSb Points to a IP6 service binding instance.\r
20 @param[in] Destination The IPv6 destination address.\r
21 @param[out] Source The selected IPv6 source address according to\r
22 the Destination.\r
23\r
24 @retval EFI_SUCCESS The source addresses were copied to the list entry\r
25 head SourceList.\r
26 @retval EFI_NO_MAPPING The IPv6 stack is not auto configured.\r
27\r
28**/\r
29EFI_STATUS\r
30Ip6SelectSourceAddress (\r
31 IN IP6_SERVICE *IpSb,\r
32 IN EFI_IPv6_ADDRESS *Destination,\r
33 OUT EFI_IPv6_ADDRESS *Source\r
34 );\r
35\r
36/**\r
37 The default callback function for system generated packet.\r
38 It will free the packet.\r
39\r
40 @param[in] Packet The packet that transmitted.\r
41 @param[in] IoStatus The result of the transmission: succeeded or failed.\r
42 @param[in] LinkFlag Not used when transmission. Check IP6_FRAME_CALLBACK\r
43 for reference.\r
44 @param[in] Context The context provided by us.\r
45\r
46**/\r
47VOID\r
48Ip6SysPacketSent (\r
49 NET_BUF *Packet,\r
50 EFI_STATUS IoStatus,\r
51 UINT32 LinkFlag,\r
52 VOID *Context\r
53 );\r
54\r
55/**\r
56 Transmit an IP6 packet. The packet comes either from the IP6\r
57 child's consumer (IpInstance != NULL) or the IP6 driver itself\r
58 (IpInstance == NULL). It will route the packet, fragment it,\r
59 then transmit all the fragments through an interface.\r
60\r
61 @param[in] IpSb The IP6 service instance to transmit the packet.\r
62 @param[in] Interface The IP6 interface to transmit the packet. Ignored\r
63 if NULL.\r
64 @param[in] IpInstance The IP6 child that issues the transmission. It is\r
65 NULL if the packet is from the system.\r
66 @param[in] Packet The user data to send, excluding the IP header.\r
67 @param[in] Head The caller supplied header. The caller should set\r
68 the following header fields: NextHeader, HopLimit,\r
69 Src, Dest, FlowLabel, PayloadLength. This function\r
70 will fill in the Ver, TrafficClass.\r
71 @param[in] ExtHdrs The extension headers to append to the IPv6 basic\r
72 header.\r
73 @param[in] ExtHdrsLen The length of the extension headers.\r
74 @param[in] Callback The callback function to issue when transmission\r
75 completed.\r
76 @param[in] Context The opaque context for the callback.\r
77\r
78 @retval EFI_INVALID_PARAMETER Any input parameter or the packet is invalid.\r
79 @retval EFI_NO_MAPPING There is no interface to the destination.\r
80 @retval EFI_NOT_FOUND There is no route to the destination.\r
81 @retval EFI_SUCCESS The packet successfully transmitted.\r
82 @retval EFI_OUT_OF_RESOURCES Failed to finish the operation due to lack of\r
83 resources.\r
84 @retval Others Failed to transmit the packet.\r
85\r
86**/\r
87EFI_STATUS\r
88Ip6Output (\r
89 IN IP6_SERVICE *IpSb,\r
90 IN IP6_INTERFACE *Interface OPTIONAL,\r
91 IN IP6_PROTOCOL *IpInstance OPTIONAL,\r
92 IN NET_BUF *Packet,\r
93 IN EFI_IP6_HEADER *Head,\r
94 IN UINT8 *ExtHdrs,\r
95 IN UINT32 ExtHdrsLen,\r
96 IN IP6_FRAME_CALLBACK Callback,\r
97 IN VOID *Context\r
98 );\r
99\r
100/**\r
101 Remove all the frames on the interface that pass the FrameToCancel,\r
102 either queued on ARP queues, or that have already been delivered to\r
103 MNP and not yet recycled.\r
104\r
105 @param[in] Interface Interface to remove the frames from.\r
106 @param[in] IoStatus The transmit status returned to the frames' callback.\r
107 @param[in] FrameToCancel Function to select the frame to cancel; NULL to select all.\r
108 @param[in] Context Opaque parameters passed to FrameToCancel. Ignored if\r
109 FrameToCancel is NULL.\r
110\r
111**/\r
112VOID\r
113Ip6CancelFrames (\r
114 IN IP6_INTERFACE *Interface,\r
115 IN EFI_STATUS IoStatus,\r
116 IN IP6_FRAME_TO_CANCEL FrameToCancel OPTIONAL,\r
117 IN VOID *Context OPTIONAL\r
118 );\r
119\r
120/**\r
121 Cancel the Packet and all its fragments.\r
122\r
123 @param[in] IpIf The interface from which the Packet is sent.\r
124 @param[in] Packet The Packet to cancel.\r
125 @param[in] IoStatus The status returns to the sender.\r
126\r
127**/\r
128VOID\r
129Ip6CancelPacket (\r
130 IN IP6_INTERFACE *IpIf,\r
131 IN NET_BUF *Packet,\r
132 IN EFI_STATUS IoStatus\r
133 );\r
134\r
135#endif\r