Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygentracert.h
Go to the documentation of this file.
00001 #define WIN32_LEAN_AND_MEAN 00002 #include <winsock2.h> 00003 #include <tchar.h> 00004 #include <stdio.h> 00005 #include <stdlib.h> 00006 #include <ws2tcpip.h> 00007 #include <string.h> 00008 #include <time.h> 00009 00010 #define ECHO_REPLY 0 00011 #define DEST_UNREACHABLE 3 00012 #define ECHO_REQUEST 8 00013 #define TTL_EXCEEDED 11 00014 00015 #define MAX_PING_PACKET_SIZE 1024 00016 #define MAX_PING_DATA_SIZE (MAX_PING_PACKET_SIZE + sizeof(IPv4Header)) 00017 #define PACKET_SIZE 32 00018 #define ICMP_MIN_SIZE 8 00019 00020 /* we need this for packets which have the 'dont fragment' 00021 * bit set, as they can get quite large otherwise */ 00022 #define MAX_REC_SIZE 200 00023 00024 /* pack the structures */ 00025 #include <pshpack1.h> 00026 00027 /* IPv4 Header, 20 bytes */ 00028 typedef struct IPv4Header 00029 { 00030 BYTE h_len:4; 00031 BYTE version:4; 00032 BYTE tos; 00033 USHORT length; 00034 USHORT id; 00035 USHORT flag_frag; 00036 BYTE ttl; 00037 BYTE proto; 00038 USHORT checksum; 00039 ULONG source; 00040 ULONG dest; 00041 } IPv4_HEADER, *PIPv4_HEADER; 00042 00043 /* ICMP Header, 8 bytes */ 00044 typedef struct ICMPHeader 00045 { 00046 BYTE type; 00047 BYTE code; 00048 USHORT checksum; 00049 USHORT id; // not used in time exceeded 00050 USHORT seq; // not used in time exceeded 00051 } ICMP_HEADER, *PICMP_HEADER; 00052 00053 /* ICMP Echo Reply Header */ 00054 typedef struct EchoReplyHeader 00055 { 00056 struct ICMPHeader icmpheader; 00057 } ECHO_REPLY_HEADER, *PECHO_REPLY_HEADER; 00058 00059 #include <poppack.h> 00060 00061 typedef struct _APPINFO 00062 { 00063 SOCKET icmpSock; // socket descriptor 00064 SOCKADDR_IN source, dest; // source and destination address info 00065 PECHO_REPLY_HEADER SendPacket; // ICMP echo packet 00066 PIPv4_HEADER RecvPacket; // return reveive packet 00067 00068 BOOL bUsePerformanceCounter; // whether to use the high res performance counter 00069 LARGE_INTEGER TicksPerMs; // number of millisecs in relation to proc freq 00070 LARGE_INTEGER TicksPerUs; // number of microsecs in relation to proc freq 00071 LONGLONG lTimeStart; // send packet, timer start 00072 LONGLONG lTimeEnd; // receive packet, timer end 00073 00074 BOOL bResolveAddresses; // -d MS ping defaults to true. 00075 INT iMaxHops; // -h Max number of hops before trace ends 00076 INT iHostList; // -j Source route 00077 INT iTimeOut; // -w time before packet times out 00078 00079 } APPINFO, *PAPPINFO; Generated on Sun May 27 2012 04:17:18 for ReactOS by
1.7.6.1
|