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.

141 lines
3.6 KiB

  1. /*
  2. Copyright (c) 1997, Microsoft Corporation, all rights reserved
  3. File:
  4. bap.h
  5. Description:
  6. Remote Access PPP Bandwidth Allocation Protocol. Include ppp.h and rasman.h
  7. before including this file.
  8. History:
  9. Mar 27, 1997: Vijay Baliga created original version.
  10. */
  11. #ifndef _BAP_H_
  12. #define _BAP_H_
  13. #include "wincrypt.h"
  14. // BAP packet types
  15. #define BAP_PACKET_CALL_REQ 0x01 // Call-Request
  16. #define BAP_PACKET_CALL_RESP 0x02 // Call-Response
  17. #define BAP_PACKET_CALLBACK_REQ 0x03 // Callback-Request
  18. #define BAP_PACKET_CALLBACK_RESP 0x04 // Callback-Response
  19. #define BAP_PACKET_DROP_REQ 0x05 // Link-Drop-Query-Request
  20. #define BAP_PACKET_DROP_RESP 0x06 // Link-Drop-Query-Response
  21. #define BAP_PACKET_STATUS_IND 0x07 // Call-Status-Indication
  22. #define BAP_PACKET_STAT_RESP 0x08 // Call-Status-Response
  23. #define BAP_PACKET_LIMIT 0x08 // Highest number we can handle
  24. // BAP option types
  25. #define BAP_OPTION_LINK_TYPE 0x01 // Link-Type
  26. #define BAP_OPTION_PHONE_DELTA 0x02 // Phone-Delta
  27. #define BAP_OPTION_NO_PH_NEEDED 0x03 // No-Phone-Number-Needed
  28. #define BAP_OPTION_REASON 0x04 // Reason
  29. #define BAP_OPTION_LINK_DISC 0x05 // Link-Discriminator
  30. #define BAP_OPTION_CALL_STATUS 0x06 // Call-Status
  31. #define BAP_OPTION_LIMIT 0x06 // Highest number we can handle
  32. // BAP sub-option types
  33. #define BAP_SUB_OPTION_UNIQUE_DIGITS 0x01 // Unique-Digits
  34. #define BAP_SUB_OPTION_SUBSCRIB_NUM 0x02 // Subscriber-Number
  35. #define BAP_SUB_OPTION_SUB_ADDR 0x03 // Phone-Number-Sub-Address
  36. // BAP options
  37. #define BAP_N_LINK_TYPE (1 << BAP_OPTION_LINK_TYPE)
  38. #define BAP_N_PHONE_DELTA (1 << BAP_OPTION_PHONE_DELTA)
  39. #define BAP_N_NO_PH_NEEDED (1 << BAP_OPTION_NO_PH_NEEDED)
  40. #define BAP_N_REASON (1 << BAP_OPTION_REASON)
  41. #define BAP_N_LINK_DISC (1 << BAP_OPTION_LINK_DISC)
  42. #define BAP_N_CALL_STATUS (1 << BAP_OPTION_CALL_STATUS)
  43. // BAP response code
  44. #define BAP_RESPONSE_ACK 0x00 // Request-Ack
  45. #define BAP_RESPONSE_NAK 0x01 // Request-Nak
  46. #define BAP_RESPONSE_REJ 0x02 // Request-Rej
  47. #define BAP_RESPONSE_FULL_NAK 0x03 // Request-Full-Nak
  48. // The time we give to a favored peer to bring down a link
  49. #define BAP_TIMEOUT_FAV_PEER 45
  50. typedef struct _RASDIAL_ARGS
  51. {
  52. BOOL fServerRouter;
  53. HRASCONN hRasConn;
  54. RASDIALPARAMS RasDialParams;
  55. RASDIALEXTENSIONS RasDialExtensions;
  56. PPP_INTERFACE_INFO InterfaceInfo;
  57. CHAR* szPhonebookPath;
  58. BYTE* pbEapInfo;
  59. //CHAR chSeed; //Seed used for encoding the password
  60. DATA_BLOB DBPassword;
  61. } RASDIAL_ARGS;
  62. // Functions
  63. VOID
  64. BapTrace(
  65. CHAR* Format,
  66. ...
  67. );
  68. BOOL
  69. FGetOurPhoneNumberFromHPort(
  70. IN HPORT hPort,
  71. OUT CHAR* szOurPhoneNumber
  72. );
  73. VOID
  74. BapEventAddLink(
  75. IN BCB* pBcbLocal
  76. );
  77. VOID
  78. BapEventDropLink(
  79. IN BCB* pBcbLocal
  80. );
  81. // PCB and PPP_PACKET need ppp.h
  82. VOID
  83. BapEventReceive(
  84. IN BCB* pBcbLocal,
  85. IN PPP_PACKET* pPacket,
  86. IN DWORD dwPacketLength
  87. );
  88. VOID
  89. BapEventTimeout(
  90. IN BCB* pBcbLocal,
  91. IN DWORD dwId
  92. );
  93. // BAP_CALL_RESULT needs ppp.h
  94. VOID
  95. BapEventCallResult(
  96. IN BCB* pBcbLocal,
  97. IN BAP_CALL_RESULT* pBapCallResult
  98. );
  99. VOID
  100. BapSetPolicy(
  101. BCB* pBcb
  102. );
  103. HPORT
  104. RasGetHport(
  105. IN HRASCONN hRasConnSubEntry
  106. );
  107. #endif // #ifndef _BAP_H_