]>
Commit | Line | Data |
---|---|---|
83cbd279 | 1 | /** @file\r |
2 | \r | |
3e8c18da | 3 | Copyright (c) 2005 - 2006, Intel Corporation.<BR>\r |
83cbd279 | 4 | All rights reserved. This program and the accompanying materials\r |
5 | are licensed and made available under the terms and conditions of the BSD License\r | |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
83cbd279 | 12 | **/\r |
13 | \r | |
14 | #ifndef __EFI_IP4_OUTPUT_H__\r | |
15 | #define __EFI_IP4_OUTPUT_H__\r | |
16 | \r | |
2ff29212 | 17 | /**\r |
18 | The default callback function for system generated packet.\r | |
19 | It will free the packet.\r | |
20 | \r | |
21 | @param Ip4Instance The IP4 child that issued the transmission. It most\r | |
22 | like is NULL.\r | |
23 | @param Packet The packet that transmitted.\r | |
24 | @param IoStatus The result of the transmission, succeeded or failed.\r | |
25 | @param LinkFlag Not used when transmission. check IP4_FRAME_CALLBACK\r | |
26 | for reference.\r | |
27 | @param Context The context provided by us\r | |
28 | \r | |
2ff29212 | 29 | **/\r |
83cbd279 | 30 | VOID\r |
31 | Ip4SysPacketSent (\r | |
32 | IP4_PROTOCOL *Ip4Instance,\r | |
33 | NET_BUF *Packet,\r | |
34 | EFI_STATUS IoStatus,\r | |
2ff29212 | 35 | UINT32 LinkFlag,\r |
83cbd279 | 36 | VOID *Context\r |
37 | );\r | |
38 | \r | |
2ff29212 | 39 | /**\r |
40 | Transmit an IP4 packet. The packet comes either from the IP4\r | |
41 | child's consumer (IpInstance != NULL) or the IP4 driver itself\r | |
42 | (IpInstance == NULL). It will route the packet, fragment it,\r | |
43 | then transmit all the fragments through some interface.\r | |
44 | \r | |
3e8c18da | 45 | @param[in] IpSb The IP4 service instance to transmit the packet\r |
46 | @param[in] IpInstance The IP4 child that issues the transmission. It is\r | |
2ff29212 | 47 | NULL if the packet is from the system.\r |
3e8c18da | 48 | @param[in] Packet The user data to send, excluding the IP header.\r |
49 | @param[in] Head The caller supplied header. The caller should set\r | |
2ff29212 | 50 | the following header fields: Tos, TotalLen, Id, tl,\r |
51 | Fragment, Protocol, Src and Dst. All the fields are\r | |
52 | in host byte order. This function will fill in the\r | |
53 | Ver, HeadLen, Fragment, and checksum. The Fragment\r | |
54 | only need to include the DF flag. Ip4Output will\r | |
55 | compute the MF and offset for you.\r | |
3e8c18da | 56 | @param[in] Option The original option to append to the IP headers\r |
57 | @param[in] OptLen The length of the option\r | |
58 | @param[in] GateWay The next hop address to transmit packet to.\r | |
2ff29212 | 59 | 255.255.255.255 means broadcast.\r |
3e8c18da | 60 | @param[in] Callback The callback function to issue when transmission\r |
2ff29212 | 61 | completed.\r |
3e8c18da | 62 | @param[in] Context The opaque context for the callback\r |
2ff29212 | 63 | \r |
64 | @retval EFI_NO_MAPPING There is no interface to the destination.\r | |
65 | @retval EFI_NOT_FOUND There is no route to the destination\r | |
66 | @retval EFI_SUCCESS The packet is successfully transmitted.\r | |
67 | @retval Others Failed to transmit the packet.\r | |
68 | \r | |
69 | **/\r | |
83cbd279 | 70 | EFI_STATUS\r |
71 | Ip4Output (\r | |
72 | IN IP4_SERVICE *IpSb,\r | |
24af132f | 73 | IN IP4_PROTOCOL *IpInstance OPTIONAL,\r |
2ff29212 | 74 | IN NET_BUF *Packet,\r |
83cbd279 | 75 | IN IP4_HEAD *Head,\r |
76 | IN UINT8 *Option,\r | |
77 | IN UINT32 OptLen,\r | |
78 | IN IP4_ADDR GateWay,\r | |
79 | IN IP4_FRAME_CALLBACK Callback,\r | |
80 | IN VOID *Context\r | |
81 | );\r | |
82 | \r | |
2ff29212 | 83 | /**\r |
84 | Cancel the Packet and all its fragments.\r | |
85 | \r | |
86 | @param IpIf The interface from which the Packet is sent\r | |
87 | @param Packet The Packet to cancel\r | |
88 | @param IoStatus The status returns to the sender.\r | |
89 | \r | |
2ff29212 | 90 | **/\r |
83cbd279 | 91 | VOID\r |
92 | Ip4CancelPacket (\r | |
2ff29212 | 93 | IN IP4_INTERFACE *IpIf,\r |
94 | IN NET_BUF *Packet,\r | |
95 | IN EFI_STATUS IoStatus\r | |
83cbd279 | 96 | );\r |
97 | \r | |
98 | extern UINT16 mIp4Id;\r | |
99 | #endif\r |