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