Source code of Windows XP (NT5)
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.

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