Functions | |
EFI_STATUS | Ping6GetFrequency (VOID) |
UINT64 | Ping6CalculateTick (IN UINT64 Begin, IN UINT64 End) |
VOID | Ping6DestroyTxInfo (IN PING6_ICMP6_TX_INFO *TxInfo) |
EFI_STATUS | Ping6MatchEchoReply (IN PING6_PRIVATE_DATA *Private, IN ICMP6_ECHO_REQUEST_REPLY *Packet) |
VOID EFIAPI | Ping6OnEchoRequestSent (IN EFI_EVENT Event, IN VOID *Context) |
VOID EFIAPI | Ping6OnEchoReplyReceived (IN EFI_EVENT Event, IN VOID *Context) |
EFI_IP6_COMPLETION_TOKEN * | Ping6GenerateToken (IN PING6_PRIVATE_DATA *Private, IN UINT64 TimeStamp, IN UINT16 SequenceNum) |
EFI_STATUS | Ping6SendEchoRequest (IN PING6_PRIVATE_DATA *Private) |
EFI_STATUS | Ping6ReceiveEchoReply (IN PING6_PRIVATE_DATA *Private) |
VOID EFIAPI | Ping6OnTimerRoutine (IN EFI_EVENT Event, IN VOID *Context) |
EFI_STATUS | Ping6CreateIp6Instance (IN PING6_PRIVATE_DATA *Private) |
VOID | Ping6DestroyIp6Instance (IN PING6_PRIVATE_DATA *Private) |
EFI_STATUS | Ping6 (IN EFI_HANDLE ImageHandle, IN UINT32 SendNumber, IN UINT32 BufferSize, IN EFI_IPv6_ADDRESS *SrcAddress, IN EFI_IPv6_ADDRESS *DstAddress) |
EFI_STATUS EFIAPI | InitializePing6 (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Variables | |
SHELL_PARAM_ITEM | Ping6ParamList [] |
EFI_HII_HANDLE | mHiiHandle |
CONST CHAR16 * | mIp6DstString |
CONST CHAR16 * | mIp6SrcString |
UINT64 | mFrequency = 0 |
Copyright (c) 2009 - 2015, 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.
EFI_STATUS EFIAPI InitializePing6 | ( | IN EFI_HANDLE | ImageHandle, | |
IN EFI_SYSTEM_TABLE * | SystemTable | |||
) |
This is the declaration of an EFI image entry point. This entry point is the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers, including both device drivers and bus drivers.
The entry point for the Ping6 application that parses the command line input and calls the Ping6 process.
[in] | ImageHandle | The firmware allocated handle for the UEFI image. |
[in] | SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The operation completed successfully. | |
EFI_INVALID_PARAMETETR | Input parameters combination is invalid. | |
Others | Some errors occur. |
References mHiiHandle, mIp6DstString, mIp6SrcString, Ping6(), PING6_MAX_BUFFER_SIZE, PING6_MAX_SEND_NUMBER, Ping6GetFrequency(), and Ping6ParamList.
EFI_STATUS Ping6 | ( | IN EFI_HANDLE | ImageHandle, | |
IN UINT32 | SendNumber, | |||
IN UINT32 | BufferSize, | |||
IN EFI_IPv6_ADDRESS * | SrcAddress, | |||
IN EFI_IPv6_ADDRESS * | DstAddress | |||
) |
The Ping6 Process.
[in] | ImageHandle | The firmware allocated handle for the UEFI image. |
[in] | SendNumber | The send request count. |
[in] | BufferSize | The send buffer size. |
[in] | SrcAddress | The source IPv6 address. |
[in] | DstAddress | The destination IPv6 address. |
EFI_SUCCESS | The ping6 processed successfullly. | |
others | The ping6 processed unsuccessfully. |
References _PING6_PRIVATE_DATA::BufferSize, _PING6_PRIVATE_DATA::DstAddress, _PING6_PRIVATE_DATA::ImageHandle, _PING6_PRIVATE_DATA::Ip6, _PING6_PRIVATE_DATA::Ip6ChildHandle, _PING6_ICMP6_TX_INFO::Link, mHiiHandle, mIp6DstString, PING6_ONE_SECOND, Ping6CreateIp6Instance(), Ping6DestroyIp6Instance(), Ping6DestroyTxInfo(), Ping6OnTimerRoutine(), Ping6ReceiveEchoReply(), Ping6SendEchoRequest(), _PING6_PRIVATE_DATA::RttMax, _PING6_PRIVATE_DATA::RttMin, _PING6_PRIVATE_DATA::RttSum, _PING6_PRIVATE_DATA::RxCount, _PING6_PRIVATE_DATA::RxToken, _PING6_PRIVATE_DATA::SendNum, _PING6_PRIVATE_DATA::SrcAddress, _PING6_PRIVATE_DATA::Status, _PING6_PRIVATE_DATA::Timer, _PING6_ICMP6_TX_INFO::Token, _PING6_PRIVATE_DATA::TxCount, and _PING6_PRIVATE_DATA::TxList.
Referenced by InitializePing6().
UINT64 Ping6CalculateTick | ( | IN UINT64 | Begin, | |
IN UINT64 | End | |||
) |
Get and calculate the duration in ms.
[in] | Begin | The start point of time. |
[in] | End | The end point of time. |
References mFrequency.
Referenced by Ping6OnEchoReplyReceived(), and Ping6OnTimerRoutine().
EFI_STATUS Ping6CreateIp6Instance | ( | IN PING6_PRIVATE_DATA * | Private | ) |
Create a valid IP6 instance.
[in] | Private | The pointer of PING6_PRIVATE_DATA. |
EFI_SUCCESS | Create a valid IP6 instance successfully. | |
EFI_ABORTED | Locate handle with ip6 service binding protocol unsuccessfully. | |
EFI_INVALID_PARAMETER | The source address is unspecified when the destination address is a link -ocal address. | |
EFI_OUT_OF_RESOURCES | No memory is available on the platform. | |
EFI_NOT_FOUND | The source address is not found. |
References mHiiHandle, and mIp6SrcString.
Referenced by Ping6().
VOID Ping6DestroyIp6Instance | ( | IN PING6_PRIVATE_DATA * | Private | ) |
Destroy the IP6 instance.
[in] | Private | The pointer of PING6_PRIVATE_DATA. |
Referenced by Ping6().
VOID Ping6DestroyTxInfo | ( | IN PING6_ICMP6_TX_INFO * | TxInfo | ) |
Destroy IPING6_ICMP6_TX_INFO, and recollect the memory.
[in] | TxInfo | The pointer to PING6_ICMP6_TX_INFO. |
Referenced by Ping6(), Ping6MatchEchoReply(), Ping6OnTimerRoutine(), and Ping6SendEchoRequest().
EFI_IP6_COMPLETION_TOKEN* Ping6GenerateToken | ( | IN PING6_PRIVATE_DATA * | Private, | |
IN UINT64 | TimeStamp, | |||
IN UINT16 | SequenceNum | |||
) |
Initial EFI_IP6_COMPLETION_TOKEN.
[in] | Private | The pointer of PING6_PRIVATE_DATA. |
[in] | TimeStamp | The TimeStamp of request. |
[in] | SequenceNum | The SequenceNum of request. |
References _ICMP6_ECHO_REQUEST_REPLY::Checksum, _ICMP6_ECHO_REQUEST_REPLY::Code, _ICMP6_ECHO_REQUEST_REPLY::Identifier, Ping6OnEchoRequestSent(), _ICMP6_ECHO_REQUEST_REPLY::SequenceNum, _ICMP6_ECHO_REQUEST_REPLY::TimeStamp, and _ICMP6_ECHO_REQUEST_REPLY::Type.
Referenced by Ping6SendEchoRequest().
EFI_STATUS Ping6GetFrequency | ( | VOID | ) |
Get and calculate the frequency in tick/ms. The result is saved in the globle variable mFrequency
EFI_SUCCESS | Calculated the frequency successfully. | |
Others | Failed to calculate the frequency. |
References mFrequency, and NTTIMERPERIOD.
Referenced by InitializePing6().
EFI_STATUS Ping6MatchEchoReply | ( | IN PING6_PRIVATE_DATA * | Private, | |
IN ICMP6_ECHO_REQUEST_REPLY * | Packet | |||
) |
Match the request, and reply with SequenceNum/TimeStamp.
[in] | Private | The pointer to PING6_PRIVATE_DATA. |
[in] | Packet | The pointer to ICMP6_ECHO_REQUEST_REPLY. |
EFI_SUCCESS | The match is successful. | |
EFI_NOT_FOUND | The reply can't be matched with any request. |
References _PING6_ICMP6_TX_INFO::Link, Ping6DestroyTxInfo(), _PING6_ICMP6_TX_INFO::SequenceNum, and _PING6_ICMP6_TX_INFO::TimeStamp.
Referenced by Ping6OnEchoReplyReceived().
VOID EFIAPI Ping6OnEchoReplyReceived | ( | IN EFI_EVENT | Event, | |
IN VOID * | Context | |||
) |
receive reply, match and print reply infomation.
[in] | Event | A EFI_EVENT type event. |
[in] | Context | The pointer to context. |
References _PING6_PRIVATE_DATA::BufferSize, _ICMP6_ECHO_REQUEST_REPLY::Code, _PING6_PRIVATE_DATA::DstAddress, _PING6_PRIVATE_DATA::Ip6, mHiiHandle, mIp6DstString, Ping6CalculateTick(), Ping6MatchEchoReply(), ReadTime(), _PING6_PRIVATE_DATA::RttMax, _PING6_PRIVATE_DATA::RttMin, _PING6_PRIVATE_DATA::RttSum, _PING6_PRIVATE_DATA::RxCount, _PING6_PRIVATE_DATA::RxToken, _PING6_PRIVATE_DATA::SendNum, _ICMP6_ECHO_REQUEST_REPLY::SequenceNum, _PING6_PRIVATE_DATA::Status, _ICMP6_ECHO_REQUEST_REPLY::TimeStamp, and _ICMP6_ECHO_REQUEST_REPLY::Type.
Referenced by Ping6ReceiveEchoReply().
VOID EFIAPI Ping6OnEchoRequestSent | ( | IN EFI_EVENT | Event, | |
IN VOID * | Context | |||
) |
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 rountine.
[in] | Event | A EFI_EVENT type event. |
[in] | Context | The pointer to Context. |
Referenced by Ping6GenerateToken().
VOID EFIAPI Ping6OnTimerRoutine | ( | IN EFI_EVENT | Event, | |
IN VOID * | Context | |||
) |
Remove the timeout request from the list.
[in] | Event | A EFI_EVENT type event. |
[in] | Context | The pointer to Context. |
References _PING6_PRIVATE_DATA::Ip6, _PING6_ICMP6_TX_INFO::Link, mHiiHandle, PING6_DEFAULT_TIMEOUT, Ping6CalculateTick(), Ping6DestroyTxInfo(), Ping6SendEchoRequest(), ReadTime(), _PING6_PRIVATE_DATA::SendNum, _PING6_ICMP6_TX_INFO::SequenceNum, _PING6_PRIVATE_DATA::Status, _PING6_ICMP6_TX_INFO::TimeStamp, _PING6_ICMP6_TX_INFO::Token, _PING6_PRIVATE_DATA::TxCount, and _PING6_PRIVATE_DATA::TxList.
Referenced by Ping6().
EFI_STATUS Ping6ReceiveEchoReply | ( | IN PING6_PRIVATE_DATA * | Private | ) |
Place a completion token into the receive packet queue to receive the echo reply.
[in] | Private | The pointer of PING6_PRIVATE_DATA. |
EFI_SUCCESS | Put the token into the receive packet queue successfully. | |
others | Put the token into the receive packet queue unsuccessfully. |
References Ping6OnEchoReplyReceived().
Referenced by Ping6().
EFI_STATUS Ping6SendEchoRequest | ( | IN PING6_PRIVATE_DATA * | Private | ) |
Transmit the EFI_IP6_COMPLETION_TOKEN.
[in] | Private | The pointer of PING6_PRIVATE_DATA. |
EFI_SUCCESS | Transmitted successfully. | |
EFI_OUT_OF_RESOURCES | No memory is available on the platform. | |
others | Transmitted unsuccessfully. |
References _PING6_ICMP6_TX_INFO::Link, Ping6DestroyTxInfo(), Ping6GenerateToken(), ReadTime(), _PING6_ICMP6_TX_INFO::SequenceNum, _PING6_ICMP6_TX_INFO::TimeStamp, and _PING6_ICMP6_TX_INFO::Token.
Referenced by Ping6(), and Ping6OnTimerRoutine().
UINT64 mFrequency = 0 |
Referenced by Ping6CalculateTick(), and Ping6GetFrequency().
EFI_HII_HANDLE mHiiHandle |
CONST CHAR16* mIp6DstString |
Referenced by InitializePing6(), Ping6(), and Ping6OnEchoReplyReceived().
CONST CHAR16* mIp6SrcString |
Referenced by InitializePing6(), and Ping6CreateIp6Instance().
SHELL_PARAM_ITEM Ping6ParamList[] |
Initial value:
{ { L"-l", TypeValue }, { L"-n", TypeValue }, { L"-s", TypeValue }, { L"-?", TypeFlag }, { NULL, TypeMax }, }
Referenced by InitializePing6().