• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** @file
2   The interface function declaration of shell application Ping6 (Ping for v6 series).
3 
4   Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
5 
6   This program and the accompanying materials
7   are licensed and made available under the terms and conditions of the BSD License
8   which accompanies this distribution.  The full text of the license may be found at
9   http://opensource.org/licenses/bsd-license.php.
10 
11   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 
14 **/
15 
16 #ifndef _PING6_H_
17 #define _PING6_H_
18 
19 #define PING6_DEFAULT_TIMEOUT      5000
20 #define PING6_MAX_SEND_NUMBER      10000
21 #define PING6_MAX_BUFFER_SIZE      32768
22 #define PING6_ONE_SECOND           10000000
23 
24 //
25 // A similar amount of time that passes in femtoseconds
26 // for each increment of TimerValue. It is for NT32 only.
27 //
28 #define NTTIMERPERIOD    358049
29 
30 #pragma pack(1)
31 
32 typedef struct _ICMP6_ECHO_REQUEST_REPLY {
33   UINT8                       Type;
34   UINT8                       Code;
35   UINT16                      Checksum;
36   UINT16                      Identifier;
37   UINT16                      SequenceNum;
38   UINT64                      TimeStamp;
39   UINT8                       Data[1];
40 } ICMP6_ECHO_REQUEST_REPLY;
41 
42 #pragma pack()
43 
44 typedef struct _PING6_ICMP6_TX_INFO {
45   LIST_ENTRY                  Link;
46   UINT16                      SequenceNum;
47   UINT64                      TimeStamp;
48   EFI_IP6_COMPLETION_TOKEN    *Token;
49 } PING6_ICMP6_TX_INFO;
50 
51 typedef struct _PING6_PRIVATE_DATA {
52   EFI_HANDLE                  ImageHandle;
53   EFI_HANDLE                  NicHandle;
54   EFI_HANDLE                  Ip6ChildHandle;
55   EFI_IP6_PROTOCOL            *Ip6;
56   EFI_EVENT                   Timer;
57 
58   EFI_STATUS                  Status;
59   LIST_ENTRY                  TxList;
60   EFI_IP6_COMPLETION_TOKEN    RxToken;
61   UINT16                      RxCount;
62   UINT16                      TxCount;
63   UINT64                      RttSum;
64   UINT64                      RttMin;
65   UINT64                      RttMax;
66   UINT32                      SequenceNum;
67 
68   EFI_IPv6_ADDRESS            SrcAddress;
69   EFI_IPv6_ADDRESS            DstAddress;
70   UINT32                      SendNum;
71   UINT32                      BufferSize;
72 } PING6_PRIVATE_DATA;
73 
74 /**
75   Reads and returns the current value of register.
76   In IA64, the register is the Interval Timer Vector (ITV).
77   In X86(IA32/X64), the register is the Time Stamp Counter (TSC)
78 
79   @return The current value of the register.
80 
81 **/
82 UINT64
83 ReadTime (
84   VOID
85   );
86 
87 #endif
88