]> git.proxmox.com Git - mirror_edk2.git/blob - NetworkPkg/Application/Ping6/Ping6.h
914e5e46e161bea333b27798fc2643f3cbe034d9
[mirror_edk2.git] / NetworkPkg / Application / Ping6 / Ping6.h
1 /** @file
2 The interface function declaration of shell application Ping6 (Ping for v6 series).
3
4 Copyright (c) 2009 - 2010, 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 EFI_PING6_GUID \
20 { \
21 0x3f0b2478, 0x3619, 0x46c5, {0x81, 0x50, 0xa5, 0xab, 0xdd, 0xb6, 0x6b, 0xd9} \
22 }
23
24 #define PING6_DEFAULT_TIMEOUT 5000
25 #define PING6_MAX_SEND_NUMBER 10000
26 #define PING6_MAX_BUFFER_SIZE 32768
27 #define PING6_ONE_SECOND 10000000
28
29 //
30 // A similar amount of time that passes in femtoseconds
31 // for each increment of TimerValue. It is for NT32 only.
32 //
33 #define NTTIMERPERIOD 358049
34
35 #pragma pack(1)
36
37 typedef struct _ICMP6_ECHO_REQUEST_REPLY {
38 UINT8 Type;
39 UINT8 Code;
40 UINT16 Checksum;
41 UINT16 Identifier;
42 UINT16 SequenceNum;
43 UINT64 TimeStamp;
44 UINT8 Data[1];
45 } ICMP6_ECHO_REQUEST_REPLY;
46
47 #pragma pack()
48
49 typedef struct _PING6_ICMP6_TX_INFO {
50 LIST_ENTRY Link;
51 UINT16 SequenceNum;
52 UINT64 TimeStamp;
53 EFI_IP6_COMPLETION_TOKEN *Token;
54 } PING6_ICMP6_TX_INFO;
55
56 typedef struct _PING6_PRIVATE_DATA {
57 EFI_HANDLE ImageHandle;
58 EFI_HANDLE NicHandle;
59 EFI_HANDLE Ip6ChildHandle;
60 EFI_IP6_PROTOCOL *Ip6;
61 EFI_EVENT Timer;
62
63 EFI_STATUS Status;
64 LIST_ENTRY TxList;
65 EFI_IP6_COMPLETION_TOKEN RxToken;
66 UINT16 RxCount;
67 UINT16 TxCount;
68 UINT64 RttSum;
69 UINT64 RttMin;
70 UINT64 RttMax;
71 UINT32 SequenceNum;
72
73 EFI_IPv6_ADDRESS SrcAddress;
74 EFI_IPv6_ADDRESS DstAddress;
75 UINT32 SendNum;
76 UINT32 BufferSize;
77 } PING6_PRIVATE_DATA;
78
79 /**
80 Reads and returns the current value of register.
81 In IA64, the register is the Interval Timer Vector (ITV).
82 In X86(IA32/X64), the register is the Time Stamp Counter (TSC)
83
84 @return The current value of the register.
85
86 **/
87 UINT64
88 ReadTime (
89 VOID
90 );
91
92 #endif