TianoCore EDK2 master
|
#include "UefiShellNetwork1CommandsLib.h"
Go to the source code of this file.
Data Structures | |
struct | PING_IPX_PROTOCOL |
union | PING_PACKET |
struct | PING_IPX_COMPLETION_TOKEN |
struct | _ICMPX_ECHO_REQUEST_REPLY |
struct | _PING_ICMP_TX_INFO |
struct | _PING_PRIVATE_DATA |
Macros | |
#define | PING_IP4_COPY_ADDRESS(Dest, Src) (CopyMem ((Dest), (Src), sizeof (EFI_IPv4_ADDRESS))) |
#define | DEFAULT_TIMEOUT 5000 |
#define | MAX_SEND_NUMBER 10000 |
#define | MAX_BUFFER_SIZE 32768 |
#define | DEFAULT_TIMER_PERIOD 358049 |
#define | ONE_SECOND 10000000 |
#define | PING_IP_CHOICE_IP4 1 |
#define | PING_IP_CHOICE_IP6 2 |
#define | DEFAULT_SEND_COUNT 10 |
#define | DEFAULT_BUFFER_SIZE 16 |
#define | ICMP_V4_ECHO_REQUEST 0x8 |
#define | ICMP_V4_ECHO_REPLY 0x0 |
#define | STALL_1_MILLI_SECOND 1000 |
#define | PING_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('P', 'i', 'n', 'g') |
Typedefs | |
typedef EFI_STATUS(EFIAPI * | PING_IPX_POLL) (IN VOID *This) |
typedef EFI_STATUS(EFIAPI * | PING_IPX_TRANSMIT) (IN VOID *This, IN VOID *Token) |
typedef EFI_STATUS(EFIAPI * | PING_IPX_RECEIVE) (IN VOID *This, IN VOID *Token) |
typedef EFI_STATUS(EFIAPI * | PING_IPX_CANCEL) (IN VOID *This, IN VOID *Token OPTIONAL) |
typedef struct _ICMPX_ECHO_REQUEST_REPLY | ICMPX_ECHO_REQUEST_REPLY |
typedef struct _PING_ICMP_TX_INFO | PING_ICMPX_TX_INFO |
typedef struct _PING_PRIVATE_DATA | PING_PRIVATE_DATA |
Variables | |
UINT64 | mCurrentTick = 0 |
STATIC CONST SHELL_PARAM_ITEM | PingParamList [] |
STATIC CONST CHAR16 * | mDstString |
STATIC CONST CHAR16 * | mSrcString |
The implementation for Ping shell command.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Ping.c.
#define PING_IP4_COPY_ADDRESS | ( | Dest, | |
Src | |||
) | (CopyMem ((Dest), (Src), sizeof (EFI_IPv4_ADDRESS))) |
#define PING_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('P', 'i', 'n', 'g') |
typedef EFI_STATUS(EFIAPI * PING_IPX_CANCEL) (IN VOID *This, IN VOID *Token OPTIONAL) |
typedef EFI_STATUS(EFIAPI * PING_IPX_POLL) (IN VOID *This) |
typedef EFI_STATUS(EFIAPI * PING_IPX_RECEIVE) (IN VOID *This, IN VOID *Token) |
typedef EFI_STATUS(EFIAPI * PING_IPX_TRANSMIT) (IN VOID *This, IN VOID *Token) |
UINT32 CalculateTick | ( | PING_PRIVATE_DATA * | Private, |
IN UINT32 | Begin, | ||
IN UINT32 | End | ||
) |
UINT32 GetTimerPeriod | ( | VOID | ) |
VOID Ping6DestroyIp6Instance | ( | IN PING_PRIVATE_DATA * | Private | ) |
EFI_STATUS Ping6MatchEchoReply | ( | IN PING_PRIVATE_DATA * | Private, |
IN ICMPX_ECHO_REQUEST_REPLY * | Packet | ||
) |
Match the request, and reply with SequenceNum/TimeStamp.
[in] | Private | The pointer to PING_PRIVATE_DATA. |
[in] | Packet | The pointer to ICMPX_ECHO_REQUEST_REPLY. |
EFI_SUCCESS | The match is successful. |
EFI_NOT_FOUND | The reply can't be matched with any request. |
The original intention is to send a request. Currently, the application retransmits an icmp6 echo request packet per second in sendnumber times that is specified by the user. Because nothing can be done here, all things move to the timer routine.
[in] | Event | A EFI_EVENT type event. |
[in] | Context | The pointer to Context. |
EFI_STATUS Ping6ReceiveEchoReply | ( | IN PING_PRIVATE_DATA * | Private | ) |
Place a completion token into the receive packet queue to receive the echo reply.
[in] | Private | The pointer of PING_PRIVATE_DATA. |
EFI_SUCCESS | Put the token into the receive packet queue successfully. |
others | Put the token into the receive packet queue unsuccessfully. |
EFI_STATUS PingCreateIpInstance | ( | IN PING_PRIVATE_DATA * | Private | ) |
Create a valid IP instance.
[in] | Private | The pointer of PING_PRIVATE_DATA. |
EFI_SUCCESS | Create a valid IPx instance successfully. |
EFI_ABORTED | Locate handle with ipx service binding protocol unsuccessfully. |
EFI_INVALID_PARAMETER | The source address is unspecified when the destination address is a link-local address. |
EFI_OUT_OF_RESOURCES | No memory is available on the platform. |
EFI_NOT_FOUND | The source address is not found. |
VOID PingDestroyTxInfo | ( | IN PING_ICMPX_TX_INFO * | TxInfo, |
IN UINT32 | IpChoice | ||
) |
VOID PingFreeRttTimer | ( | PING_PRIVATE_DATA * | Private | ) |
PING_IPX_COMPLETION_TOKEN * PingGenerateToken | ( | IN PING_PRIVATE_DATA * | Private, |
IN UINT32 | TimeStamp, | ||
IN UINT16 | SequenceNum | ||
) |
Create a PING_IPX_COMPLETION_TOKEN.
[in] | Private | The pointer of PING_PRIVATE_DATA. |
[in] | TimeStamp | The TimeStamp of request. |
[in] | SequenceNum | The SequenceNum of request. |
EFI_STATUS PingInitRttTimer | ( | PING_PRIVATE_DATA * | Private | ) |
BOOLEAN PingNetIp4IsLinkLocalAddr | ( | IN CONST EFI_IPv4_ADDRESS * | Address | ) |
BOOLEAN PingNetIp4IsUnspecifiedAddr | ( | IN CONST EFI_IPv4_ADDRESS * | Address | ) |
EFI_STATUS PingSendEchoRequest | ( | IN PING_PRIVATE_DATA * | Private | ) |
Transmit the PING_IPX_COMPLETION_TOKEN.
[in] | Private | The pointer of PING_PRIVATE_DATA. |
EFI_SUCCESS | Transmitted successfully. |
EFI_OUT_OF_RESOURCES | No memory is available on the platform. |
others | Transmitted unsuccessfully. |
UINT32 ReadTime | ( | PING_PRIVATE_DATA * | Private | ) |
SHELL_STATUS EFIAPI ShellCommandRunPing | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
SHELL_STATUS ShellPing | ( | IN UINT32 | SendNumber, |
IN UINT32 | BufferSize, | ||
IN EFI_IPv6_ADDRESS * | SrcAddress, | ||
IN EFI_IPv6_ADDRESS * | DstAddress, | ||
IN UINT32 | IpChoice | ||
) |
The Ping Process.
[in] | SendNumber | The send request count. |
[in] | BufferSize | The send buffer size. |
[in] | SrcAddress | The source address. |
[in] | DstAddress | The destination address. |
[in] | IpChoice | The choice between IPv4 and IPv6. |
SHELL_SUCCESS | The ping processed successfullly. |
others | The ping processed unsuccessfully. |
STATIC CONST SHELL_PARAM_ITEM PingParamList[] |
Reads and returns the current value of register. In IA64, the register is the Interval Timer Vector (ITV). In X86(IA32/X64), the register is the Time Stamp Counter (TSC)