]>
Commit | Line | Data |
---|---|---|
83cbd279 | 1 | /** @file\r |
2 | \r | |
3 | Copyright (c) 2005 - 2006, Intel Corporation\r | |
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 | |
12 | Module Name:\r | |
13 | \r | |
14 | Ip4Output.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | \r | |
19 | **/\r | |
20 | \r | |
21 | #ifndef __EFI_IP4_OUTPUT_H__\r | |
22 | #define __EFI_IP4_OUTPUT_H__\r | |
23 | \r | |
2ff29212 | 24 | /**\r |
25 | The default callback function for system generated packet.\r | |
26 | It will free the packet.\r | |
27 | \r | |
28 | @param Ip4Instance The IP4 child that issued the transmission. It most\r | |
29 | like is NULL.\r | |
30 | @param Packet The packet that transmitted.\r | |
31 | @param IoStatus The result of the transmission, succeeded or failed.\r | |
32 | @param LinkFlag Not used when transmission. check IP4_FRAME_CALLBACK\r | |
33 | for reference.\r | |
34 | @param Context The context provided by us\r | |
35 | \r | |
36 | @return None\r | |
37 | \r | |
38 | **/\r | |
83cbd279 | 39 | VOID\r |
40 | Ip4SysPacketSent (\r | |
41 | IP4_PROTOCOL *Ip4Instance,\r | |
42 | NET_BUF *Packet,\r | |
43 | EFI_STATUS IoStatus,\r | |
2ff29212 | 44 | UINT32 LinkFlag,\r |
83cbd279 | 45 | VOID *Context\r |
46 | );\r | |
47 | \r | |
2ff29212 | 48 | /**\r |
49 | Transmit an IP4 packet. The packet comes either from the IP4\r | |
50 | child's consumer (IpInstance != NULL) or the IP4 driver itself\r | |
51 | (IpInstance == NULL). It will route the packet, fragment it,\r | |
52 | then transmit all the fragments through some interface.\r | |
53 | \r | |
54 | @param IpSb The IP4 service instance to transmit the packet\r | |
55 | @param IpInstance The IP4 child that issues the transmission. It is\r | |
56 | NULL if the packet is from the system.\r | |
57 | @param Packet The user data to send, excluding the IP header.\r | |
58 | @param Head The caller supplied header. The caller should set\r | |
59 | the following header fields: Tos, TotalLen, Id, tl,\r | |
60 | Fragment, Protocol, Src and Dst. All the fields are\r | |
61 | in host byte order. This function will fill in the\r | |
62 | Ver, HeadLen, Fragment, and checksum. The Fragment\r | |
63 | only need to include the DF flag. Ip4Output will\r | |
64 | compute the MF and offset for you.\r | |
65 | @param Option The original option to append to the IP headers\r | |
66 | @param OptLen The length of the option\r | |
67 | @param GateWay The next hop address to transmit packet to.\r | |
68 | 255.255.255.255 means broadcast.\r | |
69 | @param Callback The callback function to issue when transmission\r | |
70 | completed.\r | |
71 | @param Context The opaque context for the callback\r | |
72 | \r | |
73 | @retval EFI_NO_MAPPING There is no interface to the destination.\r | |
74 | @retval EFI_NOT_FOUND There is no route to the destination\r | |
75 | @retval EFI_SUCCESS The packet is successfully transmitted.\r | |
76 | @retval Others Failed to transmit the packet.\r | |
77 | \r | |
78 | **/\r | |
83cbd279 | 79 | EFI_STATUS\r |
80 | Ip4Output (\r | |
81 | IN IP4_SERVICE *IpSb,\r | |
2ff29212 | 82 | IN IP4_PROTOCOL *IpInstance, OPTIONAL\r |
83 | IN NET_BUF *Packet,\r | |
83cbd279 | 84 | IN IP4_HEAD *Head,\r |
85 | IN UINT8 *Option,\r | |
86 | IN UINT32 OptLen,\r | |
87 | IN IP4_ADDR GateWay,\r | |
88 | IN IP4_FRAME_CALLBACK Callback,\r | |
89 | IN VOID *Context\r | |
90 | );\r | |
91 | \r | |
2ff29212 | 92 | /**\r |
93 | Cancel the Packet and all its fragments.\r | |
94 | \r | |
95 | @param IpIf The interface from which the Packet is sent\r | |
96 | @param Packet The Packet to cancel\r | |
97 | @param IoStatus The status returns to the sender.\r | |
98 | \r | |
99 | @return None\r | |
100 | \r | |
101 | **/\r | |
83cbd279 | 102 | VOID\r |
103 | Ip4CancelPacket (\r | |
2ff29212 | 104 | IN IP4_INTERFACE *IpIf,\r |
105 | IN NET_BUF *Packet,\r | |
106 | IN EFI_STATUS IoStatus\r | |
83cbd279 | 107 | );\r |
108 | \r | |
109 | extern UINT16 mIp4Id;\r | |
110 | #endif\r |