EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index
Functions | Variables

MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c File Reference

#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_INTERFACEIp4SelectInterface (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

Detailed Description

Transmit the IP4 packet.

Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file Ip4Output.c.


Function Documentation

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 460 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.

Parameters:
[in]FrameThe frames hold by the low level interface
[in]ContextContext to the function, which is the packet.
Return values:
TRUEThis is the packet to cancel or its fragments.
FALSEThis is unrelated packet.

Definition at line 438 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.

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.

Definition at line 211 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.

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 orginal IP4 option to copy from
OptLenThe length of the IP4 option
Return values:
EFI_BAD_BUFFER_SIZEThere is no enought room in the head space of Packet.
EFI_SUCCESSThe IP4 header is successfully added to the packet.

Definition at line 39 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.

Parameters:
[in]IpSbThe IP4 service that wants to send the packets.
[in]DstThe destination of the packet
[in]SrcThe source of the packet
Returns:
NULL if no proper interface is found, otherwise the interface that can be used to send the system packet from.

Definition at line 105 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.

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 167 of file Ip4Output.c.


Variable Documentation

Definition at line 17 of file Ip4Output.c.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines