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
1.5 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. // User Datagram Protocol initialization code.
  14. //
  15. #include "oscfg.h"
  16. #include "ndis.h"
  17. #include "ip6imp.h"
  18. #include "ip6def.h"
  19. #include "tdi.h"
  20. #include "tdistat.h"
  21. #include "tdint.h"
  22. #include "tdistat.h"
  23. #include "queue.h"
  24. #include "transprt.h"
  25. #include "addr.h"
  26. #include "udp.h"
  27. #include "info.h"
  28. //* UDPInit - Initialize the User Datagram Protocol.
  29. //
  30. // Initialize UDP and raw IP.
  31. //
  32. int
  33. UDPInit(void)
  34. {
  35. //
  36. // First initialize the underlying datagram processing code
  37. // that both UDP and raw IP depend upon.
  38. //
  39. if (!InitDG())
  40. return FALSE;
  41. //
  42. // Clear UDP statistics.
  43. //
  44. RtlZeroMemory(&UStats, sizeof(UDPStats));
  45. //
  46. // Register our UDP protocol handler with the IP layer.
  47. //
  48. IPv6RegisterULProtocol(IP_PROTOCOL_UDP, UDPReceive, UDPControlReceive);
  49. return TRUE;
  50. }
  51. //* UDPUnload
  52. //
  53. // Cleanup and prepare UDP and raw IP for stack unload.
  54. //
  55. void
  56. UDPUnload(void)
  57. {
  58. DGUnload();
  59. }