NetworkPkg/Application/Ping6/Ping6.c File Reference


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

Detailed Description

The implementation for Ping6 application.

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.


Function Documentation

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.

Parameters:
[in] ImageHandle The firmware allocated handle for the UEFI image.
[in] SystemTable A pointer to the EFI System Table.
Return values:
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 
)

UINT64 Ping6CalculateTick ( IN UINT64  Begin,
IN UINT64  End 
)

Get and calculate the duration in ms.

Parameters:
[in] Begin The start point of time.
[in] End The end point of time.
Returns:
The duration in ms.

References mFrequency.

Referenced by Ping6OnEchoReplyReceived(), and Ping6OnTimerRoutine().

EFI_STATUS Ping6CreateIp6Instance ( IN PING6_PRIVATE_DATA Private  ) 

Create a valid IP6 instance.

Parameters:
[in] Private The pointer of PING6_PRIVATE_DATA.
Return values:
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.

Parameters:
[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.

Parameters:
[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.

Parameters:
[in] Private The pointer of PING6_PRIVATE_DATA.
[in] TimeStamp The TimeStamp of request.
[in] SequenceNum The SequenceNum of request.
Returns:
The pointer of EFI_IP6_COMPLETION_TOKEN.

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

Return values:
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.

Parameters:
[in] Private The pointer to PING6_PRIVATE_DATA.
[in] Packet The pointer to ICMP6_ECHO_REQUEST_REPLY.
Return values:
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 
)

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.

Parameters:
[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 
)

EFI_STATUS Ping6ReceiveEchoReply ( IN PING6_PRIVATE_DATA Private  ) 

Place a completion token into the receive packet queue to receive the echo reply.

Parameters:
[in] Private The pointer of PING6_PRIVATE_DATA.
Return values:
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.

Parameters:
[in] Private The pointer of PING6_PRIVATE_DATA.
Return values:
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().


Variable Documentation

UINT64 mFrequency = 0

EFI_HII_HANDLE mHiiHandle

CONST CHAR16* mIp6DstString

CONST CHAR16* mIp6SrcString

SHELL_PARAM_ITEM Ping6ParamList[]

Initial value:

 {
  {
    L"-l",
    TypeValue
  },
  {
    L"-n",
    TypeValue
  },
  {
    L"-s",
    TypeValue
  },
  {
    L"-?",
    TypeFlag
  },
  {
    NULL,
    TypeMax
  },
}

Referenced by InitializePing6().


Generated on Mon Sep 28 08:49:05 2015 for NetworkPkg[ALL] by  doxygen 1.5.7.1