TianoCore EDK2 master
Loading...
Searching...
No Matches
Ip4Output.h File Reference

Go to the source code of this file.

Functions

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)
 
VOID Ip4CancelPacket (IN IP4_INTERFACE *IpIf, IN NET_BUF *Packet, IN EFI_STATUS IoStatus)
 
EFI_STATUS Ip4PrependHead (IN OUT NET_BUF *Packet, IN IP4_HEAD *Head, IN UINT8 *Option, IN UINT32 OptLen)
 

Variables

UINT16 mIp4Id
 

Detailed Description

Copyright (c) 2005 - 2006, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Ip4Output.h.

Function Documentation

◆ Ip4CancelPacket()

VOID Ip4CancelPacket ( IN IP4_INTERFACE IpIf,
IN NET_BUF Packet,
IN EFI_STATUS  IoStatus 
)

Cancel the Packet and all its fragments.

Parameters
IpIfThe interface from which the Packet is sent
PacketThe Packet to cancel
IoStatusThe status returns to the sender.

Definition at line 467 of file Ip4Output.c.

◆ Ip4Output()

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.

Parameters
[in]IpSbThe IP4 service instance to transmit the packet
[in]IpInstanceThe IP4 child that issues the transmission. It is NULL if the packet is from the system.
[in]PacketThe user data to send, excluding the IP header.
[in]HeadThe 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]OptionThe original option to append to the IP headers
[in]OptLenThe length of the option
[in]GateWayThe next hop address to transmit packet to. 255.255.255.255 means broadcast.
[in]CallbackThe callback function to issue when transmission completed.
[in]ContextThe opaque context for the callback
Return values
EFI_NO_MAPPINGThere is no interface to the destination.
EFI_NOT_FOUNDThere is no route to the destination
EFI_SUCCESSThe packet is successfully transmitted.
OthersFailed to transmit the packet.

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.

Parameters
[in]IpSbThe IP4 service instance to transmit the packet
[in]IpInstanceThe IP4 child that issues the transmission. It is NULL if the packet is from the system.
[in]PacketThe user data to send, excluding the IP header.
[in]HeadThe 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]OptionThe original option to append to the IP headers
[in]OptLenThe length of the option
[in]GateWayThe next hop address to transmit packet to. 255.255.255.255 means broadcast.
[in]CallbackThe callback function to issue when transmission completed.
[in]ContextThe opaque context for the callback
Return values
EFI_NO_MAPPINGThere is no interface to the destination.
EFI_NOT_FOUNDThere is no route to the destination
EFI_SUCCESSThe packet is successfully transmitted.
EFI_BAD_BUFFER_SIZEThe 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.)
OthersFailed to transmit the packet.

Definition at line 205 of file Ip4Output.c.

◆ Ip4PrependHead()

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.

Parameters
PacketThe packet to prepend IP4 header to
HeadThe 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.
OptionThe original IP4 option to copy from
OptLenThe length of the IP4 option
Return values
EFI_BAD_BUFFER_SIZEThere is no enough room in the head space of Packet.
EFI_SUCCESSThe IP4 header is successfully added to the packet.

Definition at line 32 of file Ip4Output.c.

◆ Ip4SysPacketSent()

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.

Parameters
Ip4InstanceThe IP4 child that issued the transmission. It most like is NULL.
PacketThe packet that transmitted.
IoStatusThe result of the transmission, succeeded or failed.
LinkFlagNot used when transmission. check IP4_FRAME_CALLBACK for reference.
ContextThe context provided by us

Definition at line 158 of file Ip4Output.c.

Variable Documentation

◆ mIp4Id

UINT16 mIp4Id
extern

Definition at line 11 of file Ip4Output.c.