2007-09-30 05:08:02 +02:00
|
|
|
/** @file
|
2020-02-07 02:07:52 +01:00
|
|
|
Ip4 internal functions and type definitions.
|
2018-06-27 15:08:52 +02:00
|
|
|
|
2018-01-11 08:28:41 +01:00
|
|
|
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
|
2015-08-31 09:44:12 +02:00
|
|
|
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
|
|
|
|
|
2019-04-04 01:05:13 +02:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
2007-09-30 05:08:02 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef __EFI_IP4_IMPL_H__
|
|
|
|
#define __EFI_IP4_IMPL_H__
|
|
|
|
|
2009-02-09 03:59:07 +01:00
|
|
|
#include <Uefi.h>
|
2007-07-30 04:37:10 +02:00
|
|
|
|
2009-11-11 08:06:27 +01:00
|
|
|
#include <Protocol/IpSec.h>
|
2008-03-11 18:33:53 +01:00
|
|
|
#include <Protocol/Ip4.h>
|
2015-07-07 10:19:55 +02:00
|
|
|
#include <Protocol/Ip4Config2.h>
|
2007-07-30 04:37:10 +02:00
|
|
|
#include <Protocol/Arp.h>
|
|
|
|
#include <Protocol/ManagedNetwork.h>
|
2015-07-07 10:19:55 +02:00
|
|
|
#include <Protocol/Dhcp4.h>
|
|
|
|
#include <Protocol/HiiConfigRouting.h>
|
|
|
|
#include <Protocol/HiiConfigAccess.h>
|
2007-07-30 04:37:10 +02:00
|
|
|
|
2016-06-22 04:25:00 +02:00
|
|
|
#include <IndustryStandard/Dhcp.h>
|
|
|
|
|
2007-07-30 04:37:10 +02:00
|
|
|
#include <Library/DebugLib.h>
|
|
|
|
#include <Library/UefiRuntimeServicesTableLib.h>
|
|
|
|
#include <Library/UefiDriverEntryPoint.h>
|
|
|
|
#include <Library/UefiBootServicesTableLib.h>
|
|
|
|
#include <Library/BaseLib.h>
|
2007-09-30 05:08:02 +02:00
|
|
|
#include <Library/UefiLib.h>
|
|
|
|
#include <Library/NetLib.h>
|
|
|
|
#include <Library/BaseMemoryLib.h>
|
|
|
|
#include <Library/MemoryAllocationLib.h>
|
2009-07-12 00:51:51 +02:00
|
|
|
#include <Library/DpcLib.h>
|
2012-12-13 07:47:06 +01:00
|
|
|
#include <Library/PrintLib.h>
|
2015-07-07 10:19:55 +02:00
|
|
|
#include <Library/DevicePathLib.h>
|
|
|
|
#include <Library/HiiLib.h>
|
|
|
|
#include <Library/UefiHiiServicesLib.h>
|
2007-09-30 05:08:02 +02:00
|
|
|
|
|
|
|
#include "Ip4Common.h"
|
|
|
|
#include "Ip4Driver.h"
|
|
|
|
#include "Ip4If.h"
|
|
|
|
#include "Ip4Icmp.h"
|
|
|
|
#include "Ip4Option.h"
|
|
|
|
#include "Ip4Igmp.h"
|
|
|
|
#include "Ip4Route.h"
|
|
|
|
#include "Ip4Input.h"
|
|
|
|
#include "Ip4Output.h"
|
2015-07-07 10:19:55 +02:00
|
|
|
#include "Ip4Config2Impl.h"
|
|
|
|
#include "Ip4Config2Nv.h"
|
|
|
|
#include "Ip4NvData.h"
|
2007-09-30 05:08:02 +02:00
|
|
|
|
2009-11-04 09:18:34 +01:00
|
|
|
#define IP4_PROTOCOL_SIGNATURE SIGNATURE_32 ('I', 'P', '4', 'P')
|
|
|
|
#define IP4_SERVICE_SIGNATURE SIGNATURE_32 ('I', 'P', '4', 'S')
|
2008-11-12 02:14:36 +01:00
|
|
|
|
2009-11-04 09:18:34 +01:00
|
|
|
//
|
|
|
|
// The state of IP4 protocol. It starts from UNCONFIGED. if it is
|
|
|
|
// successfully configured, it goes to CONFIGED. if configure NULL
|
2017-03-16 11:03:36 +01:00
|
|
|
// is called, it becomes UNCONFIGED again.
|
2009-11-04 09:18:34 +01:00
|
|
|
//
|
|
|
|
#define IP4_STATE_UNCONFIGED 0
|
|
|
|
#define IP4_STATE_CONFIGED 1
|
2008-11-12 02:14:36 +01:00
|
|
|
|
2009-11-04 09:18:34 +01:00
|
|
|
//
|
|
|
|
// The state of IP4 service. It starts from UNSTARTED. It transits
|
|
|
|
// to STARTED if autoconfigure is started. If default address is
|
2012-10-17 10:23:41 +02:00
|
|
|
// configured, it becomes CONFIGED. and if partly destroyed, it goes
|
|
|
|
// to DESTROY.
|
2009-11-04 09:18:34 +01:00
|
|
|
//
|
|
|
|
#define IP4_SERVICE_UNSTARTED 0
|
|
|
|
#define IP4_SERVICE_STARTED 1
|
|
|
|
#define IP4_SERVICE_CONFIGED 2
|
2012-10-17 10:23:41 +02:00
|
|
|
#define IP4_SERVICE_DESTROY 3
|
2007-09-30 05:08:02 +02:00
|
|
|
|
|
|
|
|
2008-11-11 10:23:25 +01:00
|
|
|
///
|
|
|
|
/// IP4_TXTOKEN_WRAP wraps the upper layer's transmit token.
|
|
|
|
/// The user's data is kept in the Packet. When fragment is
|
|
|
|
/// needed, each fragment of the Packet has a reference to the
|
|
|
|
/// Packet, no data is actually copied. The Packet will be
|
|
|
|
/// released when all the fragments of it have been recycled by
|
|
|
|
/// MNP. Upon then, the IP4_TXTOKEN_WRAP will be released, and
|
|
|
|
/// user's event signalled.
|
|
|
|
///
|
2007-09-30 05:08:02 +02:00
|
|
|
typedef struct {
|
|
|
|
IP4_PROTOCOL *IpInstance;
|
|
|
|
EFI_IP4_COMPLETION_TOKEN *Token;
|
2009-11-11 08:06:27 +01:00
|
|
|
EFI_EVENT IpSecRecycleSignal;
|
2007-09-30 05:08:02 +02:00
|
|
|
NET_BUF *Packet;
|
|
|
|
BOOLEAN Sent;
|
|
|
|
INTN Life;
|
|
|
|
} IP4_TXTOKEN_WRAP;
|
|
|
|
|
2009-11-11 08:06:27 +01:00
|
|
|
///
|
|
|
|
/// IP4_IPSEC_WRAP wraps the packet received from MNP layer. The packet
|
|
|
|
/// will be released after it has been processed by the receiver. Upon then,
|
|
|
|
/// the IP4_IPSEC_WRAP will be released, and the IpSecRecycleSignal will be signaled
|
|
|
|
/// to notice IPsec to free the resources.
|
|
|
|
///
|
|
|
|
typedef struct {
|
|
|
|
EFI_EVENT IpSecRecycleSignal;
|
|
|
|
NET_BUF *Packet;
|
|
|
|
} IP4_IPSEC_WRAP;
|
|
|
|
|
2008-11-11 10:23:25 +01:00
|
|
|
///
|
|
|
|
/// IP4_RXDATA_WRAP wraps the data IP4 child delivers to the
|
|
|
|
/// upper layers. The received packet is kept in the Packet.
|
|
|
|
/// The Packet itself may be constructured from some fragments.
|
|
|
|
/// All the fragments of the Packet is organized by a
|
|
|
|
/// IP4_ASSEMBLE_ENTRY structure. If the Packet is recycled by
|
|
|
|
/// the upper layer, the assemble entry and its associated
|
|
|
|
/// fragments will be freed at last.
|
|
|
|
///
|
2007-09-30 05:08:02 +02:00
|
|
|
typedef struct {
|
2008-02-14 10:40:22 +01:00
|
|
|
LIST_ENTRY Link;
|
2007-09-30 05:08:02 +02:00
|
|
|
IP4_PROTOCOL *IpInstance;
|
|
|
|
NET_BUF *Packet;
|
|
|
|
EFI_IP4_RECEIVE_DATA RxData;
|
|
|
|
} IP4_RXDATA_WRAP;
|
|
|
|
|
2008-11-12 02:14:36 +01:00
|
|
|
|
|
|
|
struct _IP4_PROTOCOL {
|
2007-09-30 05:08:02 +02:00
|
|
|
UINT32 Signature;
|
|
|
|
|
|
|
|
EFI_IP4_PROTOCOL Ip4Proto;
|
|
|
|
EFI_HANDLE Handle;
|
|
|
|
INTN State;
|
|
|
|
|
2018-06-27 15:08:52 +02:00
|
|
|
BOOLEAN InDestroy;
|
2017-03-16 11:03:36 +01:00
|
|
|
|
2007-09-30 05:08:02 +02:00
|
|
|
IP4_SERVICE *Service;
|
2009-11-11 08:06:27 +01:00
|
|
|
LIST_ENTRY Link; // Link to all the IP protocol from the service
|
2007-09-30 05:08:02 +02:00
|
|
|
|
|
|
|
//
|
2020-02-07 02:07:52 +01:00
|
|
|
// User's transmit/receive tokens, and received/delivered packets
|
2007-09-30 05:08:02 +02:00
|
|
|
//
|
|
|
|
NET_MAP RxTokens;
|
|
|
|
NET_MAP TxTokens; // map between (User's Token, IP4_TXTOKE_WRAP)
|
2008-02-14 10:40:22 +01:00
|
|
|
LIST_ENTRY Received; // Received but not delivered packet
|
|
|
|
LIST_ENTRY Delivered; // Delivered and to be recycled packets
|
2007-09-30 05:08:02 +02:00
|
|
|
EFI_LOCK RecycleLock;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Instance's address and route tables. There are two route tables.
|
|
|
|
// RouteTable is used by the IP4 driver to route packet. EfiRouteTable
|
|
|
|
// is used to communicate the current route info to the upper layer.
|
|
|
|
//
|
|
|
|
IP4_INTERFACE *Interface;
|
2008-02-14 10:40:22 +01:00
|
|
|
LIST_ENTRY AddrLink; // Ip instances with the same IP address.
|
2007-09-30 05:08:02 +02:00
|
|
|
IP4_ROUTE_TABLE *RouteTable;
|
|
|
|
|
|
|
|
EFI_IP4_ROUTE_TABLE *EfiRouteTable;
|
|
|
|
UINT32 EfiRouteCount;
|
|
|
|
|
|
|
|
//
|
|
|
|
// IGMP data for this instance
|
|
|
|
//
|
2009-11-11 08:06:27 +01:00
|
|
|
IP4_ADDR *Groups; // stored in network byte order
|
2007-09-30 05:08:02 +02:00
|
|
|
UINT32 GroupCount;
|
|
|
|
|
|
|
|
EFI_IP4_CONFIG_DATA ConfigData;
|
|
|
|
|
2008-11-12 02:14:36 +01:00
|
|
|
};
|
2007-09-30 05:08:02 +02:00
|
|
|
|
2008-11-12 02:14:36 +01:00
|
|
|
struct _IP4_SERVICE {
|
2007-09-30 05:08:02 +02:00
|
|
|
UINT32 Signature;
|
|
|
|
EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
|
|
|
|
INTN State;
|
|
|
|
|
|
|
|
//
|
|
|
|
// List of all the IP instances and interfaces, and default
|
|
|
|
// interface and route table and caches.
|
|
|
|
//
|
|
|
|
UINTN NumChildren;
|
2008-02-14 10:40:22 +01:00
|
|
|
LIST_ENTRY Children;
|
2007-09-30 05:08:02 +02:00
|
|
|
|
2008-02-14 10:40:22 +01:00
|
|
|
LIST_ENTRY Interfaces;
|
2007-09-30 05:08:02 +02:00
|
|
|
|
|
|
|
IP4_INTERFACE *DefaultInterface;
|
|
|
|
IP4_ROUTE_TABLE *DefaultRouteTable;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Ip reassemble utilities, and IGMP data
|
|
|
|
//
|
|
|
|
IP4_ASSEMBLE_TABLE Assemble;
|
|
|
|
IGMP_SERVICE_DATA IgmpCtrl;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Low level protocol used by this service instance
|
|
|
|
//
|
|
|
|
EFI_HANDLE Image;
|
|
|
|
EFI_HANDLE Controller;
|
|
|
|
|
|
|
|
EFI_HANDLE MnpChildHandle;
|
|
|
|
EFI_MANAGED_NETWORK_PROTOCOL *Mnp;
|
|
|
|
|
|
|
|
EFI_MANAGED_NETWORK_CONFIG_DATA MnpConfigData;
|
|
|
|
EFI_SIMPLE_NETWORK_MODE SnpMode;
|
|
|
|
|
|
|
|
EFI_EVENT Timer;
|
2018-01-11 08:28:41 +01:00
|
|
|
EFI_EVENT ReconfigCheckTimer;
|
2015-08-18 05:12:16 +02:00
|
|
|
EFI_EVENT ReconfigEvent;
|
|
|
|
|
2015-08-20 08:47:13 +02:00
|
|
|
BOOLEAN Reconfig;
|
|
|
|
|
2015-08-18 05:12:16 +02:00
|
|
|
//
|
2018-06-27 15:08:52 +02:00
|
|
|
// Underlying media present status.
|
2015-08-18 05:12:16 +02:00
|
|
|
//
|
|
|
|
BOOLEAN MediaPresent;
|
|
|
|
|
2007-09-30 05:08:02 +02:00
|
|
|
//
|
2015-07-07 10:19:55 +02:00
|
|
|
// IPv4 Configuration II Protocol instance
|
2007-09-30 05:08:02 +02:00
|
|
|
//
|
2015-07-07 10:19:55 +02:00
|
|
|
IP4_CONFIG2_INSTANCE Ip4Config2Instance;
|
|
|
|
|
|
|
|
CHAR16 *MacString;
|
2007-09-30 05:08:02 +02:00
|
|
|
|
2009-11-11 08:06:27 +01:00
|
|
|
UINT32 MaxPacketSize;
|
|
|
|
UINT32 OldMaxPacketSize; ///< The MTU before IPsec enable.
|
2008-11-12 02:14:36 +01:00
|
|
|
};
|
2007-09-30 05:08:02 +02:00
|
|
|
|
|
|
|
#define IP4_INSTANCE_FROM_PROTOCOL(Ip4) \
|
|
|
|
CR ((Ip4), IP4_PROTOCOL, Ip4Proto, IP4_PROTOCOL_SIGNATURE)
|
|
|
|
|
|
|
|
#define IP4_SERVICE_FROM_PROTOCOL(Sb) \
|
|
|
|
CR ((Sb), IP4_SERVICE, ServiceBinding, IP4_SERVICE_SIGNATURE)
|
|
|
|
|
2015-07-07 10:19:55 +02:00
|
|
|
#define IP4_SERVICE_FROM_CONFIG2_INSTANCE(This) \
|
|
|
|
CR (This, IP4_SERVICE, Ip4Config2Instance, IP4_SERVICE_SIGNATURE)
|
|
|
|
|
|
|
|
|
2007-09-30 05:08:02 +02:00
|
|
|
#define IP4_NO_MAPPING(IpInstance) (!(IpInstance)->Interface->Configured)
|
|
|
|
|
|
|
|
extern EFI_IP4_PROTOCOL mEfiIp4ProtocolTemplete;
|
|
|
|
|
2008-11-18 10:29:44 +01:00
|
|
|
/**
|
|
|
|
Config the MNP parameter used by IP. The IP driver use one MNP
|
|
|
|
child to transmit/receive frames. By default, it configures MNP
|
|
|
|
to receive unicast/multicast/broadcast. And it will enable/disable
|
|
|
|
the promiscous receive according to whether there is IP child
|
|
|
|
enable that or not. If Force is FALSE, it will iterate through
|
|
|
|
all the IP children to check whether the promiscuous receive
|
|
|
|
setting has been changed. If it hasn't been changed, it won't
|
|
|
|
reconfigure the MNP. If Force is TRUE, the MNP is configured no
|
|
|
|
matter whether that is changed or not.
|
|
|
|
|
2009-01-16 01:09:52 +01:00
|
|
|
@param[in] IpSb The IP4 service instance that is to be changed.
|
|
|
|
@param[in] Force Force the configuration or not.
|
2008-11-18 10:29:44 +01:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS The MNP is successfully configured/reconfigured.
|
|
|
|
@retval Others Configuration failed.
|
|
|
|
|
|
|
|
**/
|
2007-09-30 05:08:02 +02:00
|
|
|
EFI_STATUS
|
|
|
|
Ip4ServiceConfigMnp (
|
|
|
|
IN IP4_SERVICE *IpSb,
|
|
|
|
IN BOOLEAN Force
|
|
|
|
);
|
|
|
|
|
2008-11-18 10:29:44 +01:00
|
|
|
/**
|
2020-02-07 02:07:52 +01:00
|
|
|
Initialize the IP4_PROTOCOL structure to the unconfigured states.
|
2008-11-18 10:29:44 +01:00
|
|
|
|
|
|
|
@param IpSb The IP4 service instance.
|
|
|
|
@param IpInstance The IP4 child instance.
|
|
|
|
|
|
|
|
**/
|
2007-09-30 05:08:02 +02:00
|
|
|
VOID
|
|
|
|
Ip4InitProtocol (
|
2008-11-18 10:29:44 +01:00
|
|
|
IN IP4_SERVICE *IpSb,
|
|
|
|
IN OUT IP4_PROTOCOL *IpInstance
|
2007-09-30 05:08:02 +02:00
|
|
|
);
|
|
|
|
|
2008-11-18 10:29:44 +01:00
|
|
|
/**
|
|
|
|
Clean up the IP4 child, release all the resources used by it.
|
|
|
|
|
2009-01-16 01:09:52 +01:00
|
|
|
@param[in] IpInstance The IP4 child to clean up.
|
2008-11-18 10:29:44 +01:00
|
|
|
|
2015-07-07 10:19:55 +02:00
|
|
|
@retval EFI_SUCCESS The IP4 child is cleaned up.
|
|
|
|
@retval EFI_DEVICE_ERROR Some resources failed to be released.
|
2008-11-18 10:29:44 +01:00
|
|
|
|
|
|
|
**/
|
2007-09-30 05:08:02 +02:00
|
|
|
EFI_STATUS
|
|
|
|
Ip4CleanProtocol (
|
|
|
|
IN IP4_PROTOCOL *IpInstance
|
|
|
|
);
|
|
|
|
|
2008-11-18 10:29:44 +01:00
|
|
|
/**
|
|
|
|
Cancel the user's receive/transmit request.
|
|
|
|
|
2015-07-07 10:19:55 +02:00
|
|
|
@param[in] IpInstance The IP4 child.
|
2009-01-16 01:09:52 +01:00
|
|
|
@param[in] Token The token to cancel. If NULL, all token will be
|
2008-11-18 10:29:44 +01:00
|
|
|
cancelled.
|
|
|
|
|
2015-07-07 10:19:55 +02:00
|
|
|
@retval EFI_SUCCESS The token is cancelled.
|
2008-11-18 10:29:44 +01:00
|
|
|
@retval EFI_NOT_FOUND The token isn't found on either the
|
2015-07-07 10:19:55 +02:00
|
|
|
transmit/receive queue.
|
2008-11-18 10:29:44 +01:00
|
|
|
@retval EFI_DEVICE_ERROR Not all token is cancelled when Token is NULL.
|
|
|
|
|
|
|
|
**/
|
2007-09-30 05:08:02 +02:00
|
|
|
EFI_STATUS
|
|
|
|
Ip4Cancel (
|
|
|
|
IN IP4_PROTOCOL *IpInstance,
|
2008-11-18 10:29:44 +01:00
|
|
|
IN EFI_IP4_COMPLETION_TOKEN *Token OPTIONAL
|
2007-09-30 05:08:02 +02:00
|
|
|
);
|
|
|
|
|
2008-11-18 10:29:44 +01:00
|
|
|
/**
|
|
|
|
Change the IP4 child's multicast setting. The caller
|
|
|
|
should make sure that the parameters is valid.
|
|
|
|
|
2009-01-16 01:09:52 +01:00
|
|
|
@param[in] IpInstance The IP4 child to change the setting.
|
|
|
|
@param[in] JoinFlag TRUE to join the group, otherwise leave it
|
|
|
|
@param[in] GroupAddress The target group address
|
2008-11-18 10:29:44 +01:00
|
|
|
|
|
|
|
@retval EFI_ALREADY_STARTED Want to join the group, but already a member of it
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Failed to allocate some resources.
|
2020-02-07 02:07:52 +01:00
|
|
|
@retval EFI_DEVICE_ERROR Failed to set the group configuration
|
2008-11-18 10:29:44 +01:00
|
|
|
@retval EFI_SUCCESS Successfully updated the group setting.
|
|
|
|
@retval EFI_NOT_FOUND Try to leave the group which it isn't a member.
|
|
|
|
|
|
|
|
**/
|
2007-09-30 05:08:02 +02:00
|
|
|
EFI_STATUS
|
|
|
|
Ip4Groups (
|
|
|
|
IN IP4_PROTOCOL *IpInstance,
|
|
|
|
IN BOOLEAN JoinFlag,
|
2008-11-18 10:29:44 +01:00
|
|
|
IN EFI_IPv4_ADDRESS *GroupAddress OPTIONAL
|
2007-09-30 05:08:02 +02:00
|
|
|
);
|
|
|
|
|
2008-11-18 10:29:44 +01:00
|
|
|
/**
|
2018-06-27 15:08:52 +02:00
|
|
|
This heart beat timer of IP4 service instance times out all of its IP4 children's
|
|
|
|
received-but-not-delivered and transmitted-but-not-recycle packets, and provides
|
2018-01-11 08:28:41 +01:00
|
|
|
time input for its IGMP protocol.
|
2008-11-18 10:29:44 +01:00
|
|
|
|
2009-01-16 01:09:52 +01:00
|
|
|
@param[in] Event The IP4 service instance's heart beat timer.
|
|
|
|
@param[in] Context The IP4 service instance.
|
2008-11-18 10:29:44 +01:00
|
|
|
|
|
|
|
**/
|
2007-09-30 05:08:02 +02:00
|
|
|
VOID
|
|
|
|
EFIAPI
|
|
|
|
Ip4TimerTicking (
|
|
|
|
IN EFI_EVENT Event,
|
|
|
|
IN VOID *Context
|
|
|
|
);
|
|
|
|
|
2018-01-11 08:28:41 +01:00
|
|
|
/**
|
2018-06-27 15:08:52 +02:00
|
|
|
This dedicated timer is used to poll underlying network media status. In case
|
|
|
|
of cable swap or wireless network switch, a new round auto configuration will
|
|
|
|
be initiated. The timer will signal the IP4 to run DHCP configuration again.
|
|
|
|
IP4 driver will free old IP address related resource, such as route table and
|
|
|
|
Interface, then initiate a DHCP process to acquire new IP, eventually create
|
2018-01-11 08:28:41 +01:00
|
|
|
route table for new IP address.
|
|
|
|
|
|
|
|
@param[in] Event The IP4 service instance's heart beat timer.
|
|
|
|
@param[in] Context The IP4 service instance.
|
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
EFIAPI
|
|
|
|
Ip4TimerReconfigChecking (
|
|
|
|
IN EFI_EVENT Event,
|
|
|
|
IN VOID *Context
|
|
|
|
);
|
|
|
|
|
2008-11-18 10:29:44 +01:00
|
|
|
/**
|
|
|
|
Decrease the life of the transmitted packets. If it is
|
|
|
|
decreased to zero, cancel the packet. This function is
|
|
|
|
called by Ip4PacketTimerTicking which time out both the
|
|
|
|
received-but-not-delivered and transmitted-but-not-recycle
|
|
|
|
packets.
|
|
|
|
|
2009-01-16 01:09:52 +01:00
|
|
|
@param[in] Map The IP4 child's transmit map.
|
2015-07-07 10:19:55 +02:00
|
|
|
@param[in] Item Current transmitted packet.
|
2009-01-16 01:09:52 +01:00
|
|
|
@param[in] Context Not used.
|
2008-11-18 10:29:44 +01:00
|
|
|
|
2015-07-07 10:19:55 +02:00
|
|
|
@retval EFI_SUCCESS Always returns EFI_SUCCESS.
|
2008-11-18 10:29:44 +01:00
|
|
|
|
|
|
|
**/
|
2007-09-30 05:08:02 +02:00
|
|
|
EFI_STATUS
|
2010-04-17 01:24:45 +02:00
|
|
|
EFIAPI
|
2007-09-30 05:08:02 +02:00
|
|
|
Ip4SentPacketTicking (
|
|
|
|
IN NET_MAP *Map,
|
|
|
|
IN NET_MAP_ITEM *Item,
|
|
|
|
IN VOID *Context
|
|
|
|
);
|
2009-11-11 08:06:27 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
The callback function for the net buffer which wraps the user's
|
|
|
|
transmit token. Although it seems this function is pretty simple,
|
|
|
|
there are some subtle things.
|
|
|
|
When user requests the IP to transmit a packet by passing it a
|
|
|
|
token, the token is wrapped in an IP4_TXTOKEN_WRAP and the data
|
|
|
|
is wrapped in an net buffer. the net buffer's Free function is
|
|
|
|
set to Ip4FreeTxToken. The Token and token wrap are added to the
|
|
|
|
IP child's TxToken map. Then the buffer is passed to Ip4Output for
|
|
|
|
transmission. If something error happened before that, the buffer
|
|
|
|
is freed, which in turn will free the token wrap. The wrap may
|
|
|
|
have been added to the TxToken map or not, and the user's event
|
|
|
|
shouldn't be fired because we are still in the EfiIp4Transmit. If
|
|
|
|
the buffer has been sent by Ip4Output, it should be removed from
|
|
|
|
the TxToken map and user's event signaled. The token wrap and buffer
|
|
|
|
are bound together. Check the comments in Ip4Output for information
|
|
|
|
about IP fragmentation.
|
|
|
|
|
2015-07-07 10:19:55 +02:00
|
|
|
@param[in] Context The token's wrap.
|
2009-11-11 08:06:27 +01:00
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
2010-04-17 01:24:45 +02:00
|
|
|
EFIAPI
|
2009-11-11 08:06:27 +01:00
|
|
|
Ip4FreeTxToken (
|
|
|
|
IN VOID *Context
|
|
|
|
);
|
|
|
|
|
2010-10-15 07:40:41 +02:00
|
|
|
extern EFI_IPSEC2_PROTOCOL *mIpSec;
|
2015-08-31 09:44:12 +02:00
|
|
|
extern BOOLEAN mIpSec2Installed;
|
2009-11-11 08:06:27 +01:00
|
|
|
|
2007-09-30 05:08:02 +02:00
|
|
|
#endif
|