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.

79 lines
1.7 KiB

  1. /*******************************************************************/
  2. /* Copyright(c) 1992 Microsoft Corporation */
  3. /*******************************************************************/
  4. //***
  5. //
  6. // Filename: rasmanif.c
  7. //
  8. // Description: implements the IPXCP i/f with rasman
  9. //
  10. //
  11. // Author: Stefan Solomon (stefans) December 2, 1993.
  12. //
  13. // Revision History:
  14. //
  15. //***
  16. #include "precomp.h"
  17. #pragma hdrstop
  18. DWORD
  19. RmAllocateRoute(ULONG ConnectionId)
  20. {
  21. RASMAN_ROUTEINFO routeinfo;
  22. DWORD rc;
  23. if(rc = RasAllocateRoute((HPORT)ULongToPtr(ConnectionId),
  24. IPX,
  25. FALSE,
  26. &routeinfo)) {
  27. TraceIpx(RASMANIF_TRACE, "RasAllocateRoute failed err = 0x%x\n", rc);
  28. }
  29. return rc;
  30. }
  31. DWORD
  32. RmDeallocateRoute(ULONG ConnectionId)
  33. {
  34. DWORD rc;
  35. if(rc = RasDeAllocateRoute((HPORT) ULongToPtr(ConnectionId), IPX)) {
  36. TraceIpx(RASMANIF_TRACE, "RasDeAllocateRoute failed err = 0x%x\n", rc);
  37. }
  38. return rc;
  39. }
  40. typedef struct _IPX_CONFIG_INFO {
  41. DWORD IpxConfigLength;
  42. BYTE IpxConfigInfo[sizeof(IPXCP_CONFIGURATION)];
  43. } IPX_CONFIG_INFO, *PIPX_CONFIG_INFO;
  44. DWORD
  45. RmActivateRoute(ULONG ConnectionId,
  46. PIPXCP_CONFIGURATION configp)
  47. {
  48. IPX_CONFIG_INFO configinfo;
  49. RASMAN_ROUTEINFO routeinfo;
  50. DWORD rc;
  51. configinfo.IpxConfigLength = sizeof(IPXCP_CONFIGURATION);
  52. memcpy(configinfo.IpxConfigInfo, configp, sizeof(IPXCP_CONFIGURATION));
  53. if(rc = RasActivateRoute((HPORT)ULongToPtr(ConnectionId),
  54. IPX,
  55. &routeinfo,
  56. (PROTOCOL_CONFIG_INFO *)&configinfo)) {
  57. TraceIpx(RASMANIF_TRACE, "RasActivateRoute failed err = 0x%x\n", rc);
  58. }
  59. return rc;
  60. }