3 Copyright (c) 2005 - 2006, Intel Corporation.<BR>
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 #ifndef __EFI_IP4_OUTPUT_H__
15 #define __EFI_IP4_OUTPUT_H__
18 The default callback function for system generated packet.
19 It will free the packet.
21 @param Ip4Instance The IP4 child that issued the transmission. It most
23 @param Packet The packet that transmitted.
24 @param IoStatus The result of the transmission, succeeded or failed.
25 @param LinkFlag Not used when transmission. check IP4_FRAME_CALLBACK
27 @param Context The context provided by us
32 IP4_PROTOCOL
*Ip4Instance
,
40 Transmit an IP4 packet. The packet comes either from the IP4
41 child's consumer (IpInstance != NULL) or the IP4 driver itself
42 (IpInstance == NULL). It will route the packet, fragment it,
43 then transmit all the fragments through some interface.
45 @param[in] IpSb The IP4 service instance to transmit the packet
46 @param[in] IpInstance The IP4 child that issues the transmission. It is
47 NULL if the packet is from the system.
48 @param[in] Packet The user data to send, excluding the IP header.
49 @param[in] Head The caller supplied header. The caller should set
50 the following header fields: Tos, TotalLen, Id, tl,
51 Fragment, Protocol, Src and Dst. All the fields are
52 in host byte order. This function will fill in the
53 Ver, HeadLen, Fragment, and checksum. The Fragment
54 only need to include the DF flag. Ip4Output will
55 compute the MF and offset for you.
56 @param[in] Option The original option to append to the IP headers
57 @param[in] OptLen The length of the option
58 @param[in] GateWay The next hop address to transmit packet to.
59 255.255.255.255 means broadcast.
60 @param[in] Callback The callback function to issue when transmission
62 @param[in] Context The opaque context for the callback
64 @retval EFI_NO_MAPPING There is no interface to the destination.
65 @retval EFI_NOT_FOUND There is no route to the destination
66 @retval EFI_SUCCESS The packet is successfully transmitted.
67 @retval Others Failed to transmit the packet.
73 IN IP4_PROTOCOL
*IpInstance OPTIONAL
,
79 IN IP4_FRAME_CALLBACK Callback
,
84 Cancel the Packet and all its fragments.
86 @param IpIf The interface from which the Packet is sent
87 @param Packet The Packet to cancel
88 @param IoStatus The status returns to the sender.
93 IN IP4_INTERFACE
*IpIf
,
95 IN EFI_STATUS IoStatus
99 Prepend an IP4 head to the Packet. It will copy the options and
100 build the IP4 header fields. Used for IP4 fragmentation.
102 @param Packet The packet to prepend IP4 header to
103 @param Head The caller supplied header. The caller should set
104 the following header fields: Tos, TotalLen, Id,
105 Fragment, Ttl, Protocol, Src and Dst. All the fields
106 are in host byte order. This function will fill in
107 the Ver, HeadLen, and checksum.
108 @param Option The orginal IP4 option to copy from
109 @param OptLen The length of the IP4 option
111 @retval EFI_BAD_BUFFER_SIZE There is no enought room in the head space of
113 @retval EFI_SUCCESS The IP4 header is successfully added to the packet.
118 IN OUT NET_BUF
*Packet
,
124 extern UINT16 mIp4Id
;