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.

82 lines
3.1 KiB

  1. // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil -*- (for GNU Emacs)
  2. //
  3. // Copyright (c) 1985-2000 Microsoft Corporation
  4. //
  5. // This file is part of the Microsoft Research IPv6 Network Protocol Stack.
  6. // You should have received a copy of the Microsoft End-User License Agreement
  7. // for this software along with this release; see the file "license.txt".
  8. // If not, please see http://www.research.microsoft.com/msripv6/license.htm,
  9. // or write to Microsoft Research, One Microsoft Way, Redmond, WA 98052-6399.
  10. //
  11. // Abstract:
  12. //
  13. // Internet Control Message Protocol for IPv6 definitions.
  14. // See RFC 1885 and RFC 1970 for details.
  15. //
  16. #ifndef ICMP_INCLUDED
  17. #define ICMP_INCLUDED 1
  18. #include "icmp6.h" // Protocol definitions & constants.
  19. //
  20. // Stuff to handle in-kernel ping functionality.
  21. //
  22. typedef void (*EchoRtn)(void *, IP_STATUS,
  23. const IPv6Addr *, uint, void *, uint);
  24. typedef struct EchoControl {
  25. struct EchoControl *Next; // Next control structure in list.
  26. ulong TimeoutTimer; // Timeout value (in IPv6Timer ticks).
  27. EchoRtn CompleteRoutine; // Routine to call when completing request.
  28. ulong Seq; // Sequence number of this ping request.
  29. LARGE_INTEGER WhenIssued; // Timestamp (in system timer ticks since boot).
  30. void *ReplyBuf; // Buffer to store replies.
  31. ulong ReplyBufLen; // Size of reply buffer.
  32. IPAddr V4Dest; // IPv4 destination (or INADDR_ANY).
  33. } EchoControl;
  34. extern void
  35. ICMPv6EchoRequest(void *InputBuffer, uint InputBufferLength,
  36. EchoControl *ControlBlock, EchoRtn Callback);
  37. extern NTSTATUS
  38. ICMPv6EchoComplete(EchoControl *ControlBlock,
  39. IP_STATUS Status, const IPv6Addr *Address, uint ScopeId,
  40. void *Data, uint DataSize, ULONG_PTR *BytesReturned);
  41. extern void
  42. ICMPv6ProcessTunnelError(IPAddr V4Dest,
  43. IPv6Addr *V4Src, uint ScopeId,
  44. IP_STATUS Status);
  45. //
  46. // General prototypes.
  47. //
  48. extern void
  49. ICMPv6Send(
  50. RouteCacheEntry *RCE, // RCE to send on
  51. PNDIS_PACKET Packet, // Packet to send.
  52. uint IPv6Offset, // Offset to IPv6 header in packet.
  53. uint ICMPv6Offset, // Offset to ICMPv6 header in packet.
  54. IPv6Header UNALIGNED *IP, // Pointer to IPv6 header.
  55. uint PayloadLength, // Length of IPv6 payload in bytes.
  56. ICMPv6Header UNALIGNED *ICMP); // Pointer to ICMPv6 header.
  57. extern void
  58. ICMPv6SendError(
  59. IPv6Packet *Packet, // Offending/invoking packet.
  60. uchar ICMPType, // ICMP error type.
  61. uchar ICMPCode, // ICMP error code pertaining to type.
  62. ulong ICMPPointer, // ICMP pointer indicating a packet offset.
  63. uint NextHeader, // Type of header following in Packet.
  64. int MulticastOverride); // Allow replies to multicast packets?
  65. extern int
  66. ICMPv6RateLimit(RouteCacheEntry *RCE);
  67. #endif // ICMP_INCLUDED