TianoCore EDK2 master
|
#include "Ip4Impl.h"
Go to the source code of this file.
Functions | |
EFI_STATUS | Ip4PrependHead (IN OUT NET_BUF *Packet, IN IP4_HEAD *Head, IN UINT8 *Option, IN UINT32 OptLen) |
IP4_INTERFACE * | Ip4SelectInterface (IN IP4_SERVICE *IpSb, IN IP4_ADDR Dst, IN IP4_ADDR Src) |
VOID | Ip4SysPacketSent (IP4_PROTOCOL *Ip4Instance, NET_BUF *Packet, EFI_STATUS IoStatus, UINT32 LinkFlag, VOID *Context) |
EFI_STATUS | Ip4Output (IN IP4_SERVICE *IpSb, IN IP4_PROTOCOL *IpInstance OPTIONAL, IN NET_BUF *Packet, IN IP4_HEAD *Head, IN UINT8 *Option, IN UINT32 OptLen, IN IP4_ADDR GateWay, IN IP4_FRAME_CALLBACK Callback, IN VOID *Context) |
BOOLEAN | Ip4CancelPacketFragments (IN IP4_LINK_TX_TOKEN *Frame, IN VOID *Context) |
VOID | Ip4CancelPacket (IN IP4_INTERFACE *IpIf, IN NET_BUF *Packet, IN EFI_STATUS IoStatus) |
Variables | |
UINT16 | mIp4Id |
Transmit the IP4 packet.
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Ip4Output.c.
VOID Ip4CancelPacket | ( | IN IP4_INTERFACE * | IpIf, |
IN NET_BUF * | Packet, | ||
IN EFI_STATUS | IoStatus | ||
) |
Cancel the Packet and all its fragments.
IpIf | The interface from which the Packet is sent |
Packet | The Packet to cancel |
IoStatus | The status returns to the sender. |
Definition at line 467 of file Ip4Output.c.
BOOLEAN Ip4CancelPacketFragments | ( | IN IP4_LINK_TX_TOKEN * | Frame, |
IN VOID * | Context | ||
) |
The filter function to find a packet and all its fragments. The packet's fragments have their Context set to the packet.
[in] | Frame | The frames hold by the low level interface |
[in] | Context | Context to the function, which is the packet. |
TRUE | This is the packet to cancel or its fragments. |
FALSE | This is unrelated packet. |
Definition at line 446 of file Ip4Output.c.
EFI_STATUS Ip4Output | ( | IN IP4_SERVICE * | IpSb, |
IN IP4_PROTOCOL *IpInstance | OPTIONAL, | ||
IN NET_BUF * | Packet, | ||
IN IP4_HEAD * | Head, | ||
IN UINT8 * | Option, | ||
IN UINT32 | OptLen, | ||
IN IP4_ADDR | GateWay, | ||
IN IP4_FRAME_CALLBACK | Callback, | ||
IN VOID * | Context | ||
) |
Transmit an IP4 packet. The packet comes either from the IP4 child's consumer (IpInstance != NULL) or the IP4 driver itself (IpInstance == NULL). It will route the packet, fragment it, then transmit all the fragments through some interface.
[in] | IpSb | The IP4 service instance to transmit the packet |
[in] | IpInstance | The IP4 child that issues the transmission. It is NULL if the packet is from the system. |
[in] | Packet | The user data to send, excluding the IP header. |
[in] | Head | The caller supplied header. The caller should set the following header fields: Tos, TotalLen, Id, tl, Fragment, Protocol, Src and Dst. All the fields are in host byte order. This function will fill in the Ver, HeadLen, Fragment, and checksum. The Fragment only need to include the DF flag. Ip4Output will compute the MF and offset for you. |
[in] | Option | The original option to append to the IP headers |
[in] | OptLen | The length of the option |
[in] | GateWay | The next hop address to transmit packet to. 255.255.255.255 means broadcast. |
[in] | Callback | The callback function to issue when transmission completed. |
[in] | Context | The opaque context for the callback |
EFI_NO_MAPPING | There is no interface to the destination. |
EFI_NOT_FOUND | There is no route to the destination |
EFI_SUCCESS | The packet is successfully transmitted. |
EFI_BAD_BUFFER_SIZE | The length of the IPv4 header + option length + total data length is greater than MTU (or greater than the maximum packet size if Token.Packet.TxData. OverrideData.DoNotFragment is TRUE.) |
Others | Failed to transmit the packet. |
Definition at line 205 of file Ip4Output.c.
EFI_STATUS Ip4PrependHead | ( | IN OUT NET_BUF * | Packet, |
IN IP4_HEAD * | Head, | ||
IN UINT8 * | Option, | ||
IN UINT32 | OptLen | ||
) |
Prepend an IP4 head to the Packet. It will copy the options and build the IP4 header fields. Used for IP4 fragmentation.
Packet | The packet to prepend IP4 header to |
Head | The caller supplied header. The caller should set the following header fields: Tos, TotalLen, Id, Fragment, Ttl, Protocol, Src and Dst. All the fields are in host byte order. This function will fill in the Ver, HeadLen, and checksum. |
Option | The original IP4 option to copy from |
OptLen | The length of the IP4 option |
EFI_BAD_BUFFER_SIZE | There is no enough room in the head space of Packet. |
EFI_SUCCESS | The IP4 header is successfully added to the packet. |
Definition at line 32 of file Ip4Output.c.
IP4_INTERFACE * Ip4SelectInterface | ( | IN IP4_SERVICE * | IpSb, |
IN IP4_ADDR | Dst, | ||
IN IP4_ADDR | Src | ||
) |
Select an interface to send the packet generated in the IP4 driver itself, that is, not by the requests of IP4 child's consumer. Such packets include the ICMP echo replies, and other ICMP error packets.
[in] | IpSb | The IP4 service that wants to send the packets. |
[in] | Dst | The destination of the packet |
[in] | Src | The source of the packet |
Definition at line 97 of file Ip4Output.c.
VOID Ip4SysPacketSent | ( | IP4_PROTOCOL * | Ip4Instance, |
NET_BUF * | Packet, | ||
EFI_STATUS | IoStatus, | ||
UINT32 | LinkFlag, | ||
VOID * | Context | ||
) |
The default callback function for system generated packet. It will free the packet.
Ip4Instance | The IP4 child that issued the transmission. It most like is NULL. |
Packet | The packet that transmitted. |
IoStatus | The result of the transmission, succeeded or failed. |
LinkFlag | Not used when transmission. check IP4_FRAME_CALLBACK for reference. |
Context | The context provided by us |
Definition at line 158 of file Ip4Output.c.
UINT16 mIp4Id |
Definition at line 11 of file Ip4Output.c.