Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.6 KiB

  1. /********************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1990-1992 **/
  4. /********************************************************************/
  5. /* :ts=4 */
  6. //*** icmp.h - IP ICMP header.
  7. //
  8. // This module contains private ICMP definitions.
  9. //
  10. #pragma once
  11. #define PROT_ICMP 1
  12. #define ICMP_ECHO_RESP 0
  13. #define ICMP_ECHO 8
  14. #define ICMP_TIMESTAMP 13
  15. #define ICMP_TIMESTAMP_RESP 14
  16. #define MIN_ERRDATA_LENGTH 8 // Minimum amount of data we need.
  17. // Structure of an ICMP header.
  18. typedef struct ICMPHeader {
  19. uchar ich_type; // Type of ICMP packet.
  20. uchar ich_code; // Subcode of type.
  21. ushort ich_xsum; // Checksum of packet.
  22. ulong ich_param; // Type-specific parameter field.
  23. } ICMPHeader;
  24. typedef struct ICMPRouterAdHeader {
  25. uchar irah_numaddrs; // Number of addresses
  26. uchar irah_addrentrysize; // Address Entry Size
  27. ushort irah_lifetime; // Lifetime
  28. } ICMPRouterAdHeader;
  29. typedef struct ICMPRouterAdAddrEntry {
  30. IPAddr irae_addr; // Router Address
  31. long irae_preference; // Preference Level
  32. } ICMPRouterAdAddrEntry;
  33. typedef struct ICMPSendCompleteCtxt {
  34. uchar iscc_Type;
  35. uchar *iscc_DataPtr;
  36. } ICMPSendCompleteCtxt;
  37. typedef void (*EchoRtn)(struct EchoControl *, IP_STATUS, void *, uint, IPOptInfo *);
  38. typedef struct EchoControl {
  39. struct EchoControl *ec_next; // Next control structure in list.
  40. EchoRtn ec_rtn; // Pointer to routine to call when completing request.
  41. LARGE_INTEGER ec_starttime; // time request was issued
  42. void *ec_replybuf; // buffer to store replies
  43. ulong ec_replybuflen; // size of reply buffer
  44. ulong ec_to; // Timeout
  45. IPAddr ec_src; // IPAddr of source
  46. uint ec_seq; // Seq. # of this ping request. 32-bit
  47. // to reduce collisons from wraparound.
  48. uchar ec_active; // Set when packet has been sent
  49. } EchoControl;
  50. extern ICMPHeader *GetICMPBuffer(uint Size, PNDIS_BUFFER *Buffer);
  51. extern void FreeICMPBuffer(PNDIS_BUFFER Buffer, uchar Type);
  52. extern void ICMPSendComplete(ICMPSendCompleteCtxt *SCC, PNDIS_BUFFER BufferChain, IP_STATUS SendStatus);
  53. extern uint AddrMaskReply;