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.

167 lines
5.2 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. channel.h
  5. Abstract:
  6. Definitions for H.323 TAPI Service Provider channel objects.
  7. Environment:
  8. User Mode - Win32
  9. Revision History:
  10. --*/
  11. #ifndef _INC_CHANNEL
  12. #define _INC_CHANNEL
  13. ///////////////////////////////////////////////////////////////////////////////
  14. // //
  15. // Header files //
  16. // //
  17. ///////////////////////////////////////////////////////////////////////////////
  18. #include "h323pdu.h"
  19. ///////////////////////////////////////////////////////////////////////////////
  20. // //
  21. // Type definitions //
  22. // //
  23. ///////////////////////////////////////////////////////////////////////////////
  24. typedef enum _H323_CHANNELSTATE {
  25. H323_CHANNELSTATE_ALLOCATED = 0,
  26. H323_CHANNELSTATE_CLOSED,
  27. H323_CHANNELSTATE_OPENING,
  28. H323_CHANNELSTATE_OPENED
  29. } H323_CHANNELSTATE, *PH323_CHANNELSTATE;
  30. typedef struct _H323_CHANNEL {
  31. H323_CHANNELSTATE nState; // state of channel
  32. STREAMSETTINGS Settings; // stream settings
  33. HANDLE hmChannel; // msp channel handle
  34. CC_HCHANNEL hccChannel; // intelcc channel handle
  35. CC_ADDR ccLocalRTPAddr; // local rtp address
  36. CC_ADDR ccLocalRTCPAddr; // local rtcp address
  37. CC_ADDR ccRemoteRTPAddr; // remote rtp address
  38. CC_ADDR ccRemoteRTCPAddr; // remote rtcp address
  39. CC_TERMCAP ccTermCaps; // channel capabilities
  40. BYTE bPayloadType; // rtp payload type
  41. BYTE bSessionID; // rtp session id
  42. BOOL fInbound; // inbound channel
  43. struct _H323_CALL * pCall; // containing call object
  44. } H323_CHANNEL, *PH323_CHANNEL;
  45. typedef struct _H323_CHANNEL_TABLE {
  46. DWORD dwNumSlots; // number of entries
  47. DWORD dwNumInUse; // number of entries in use
  48. DWORD dwNumAllocated; // number of entries allocated
  49. DWORD dwNextAvailable; // next available table index
  50. PH323_CHANNEL pChannels[ANYSIZE]; // array of object pointers
  51. } H323_CHANNEL_TABLE, *PH323_CHANNEL_TABLE;
  52. ///////////////////////////////////////////////////////////////////////////////
  53. // //
  54. // Macros //
  55. // //
  56. ///////////////////////////////////////////////////////////////////////////////
  57. #define H323IsChannelAllocated(_pChannel_) \
  58. ((_pChannel_) != NULL)
  59. #define H323IsChannelInUse(_pChannel_) \
  60. (H323IsChannelAllocated(_pChannel_) && \
  61. ((_pChannel_)->nState > H323_CHANNELSTATE_ALLOCATED))
  62. #define H323IsChannelOpen(_pChannel_) \
  63. (H323IsChannelAllocated(_pChannel_) && \
  64. ((_pChannel_)->nState == H323_CHANNELSTATE_OPENED))
  65. #define H323IsChannelEqual(_pChannel_,_hccChannel_) \
  66. (H323IsChannelInUse(_pChannel_) && \
  67. ((_hccChannel_) == ((_pChannel_)->hccChannel)))
  68. #define H323IsSessionIDEqual(_pChannel_,_bSessionID_) \
  69. (H323IsChannelInUse(_pChannel_) && \
  70. ((_bSessionID_) == ((_pChannel_)->bSessionID)))
  71. #define H323IsChannelInbound(_pChannel_) \
  72. ((_pChannel_)->fInbound == TRUE)
  73. ///////////////////////////////////////////////////////////////////////////////
  74. // //
  75. // Public prototypes //
  76. // //
  77. ///////////////////////////////////////////////////////////////////////////////
  78. BOOL
  79. H323OpenChannel(
  80. PH323_CHANNEL pChannel
  81. );
  82. BOOL
  83. H323CloseChannel(
  84. PH323_CHANNEL pChannel
  85. );
  86. BOOL
  87. H323AllocChannelTable(
  88. PH323_CHANNEL_TABLE * ppChannelTable
  89. );
  90. BOOL
  91. H323FreeChannelTable(
  92. PH323_CHANNEL_TABLE pChannelTable
  93. );
  94. BOOL
  95. H323CloseChannelTable(
  96. PH323_CHANNEL_TABLE pChannelTable
  97. );
  98. BOOL
  99. H323AllocChannelFromTable(
  100. PH323_CHANNEL * ppChannel,
  101. PH323_CHANNEL_TABLE * ppChannelTable,
  102. struct _H323_CALL * pCall
  103. );
  104. BOOL
  105. H323FreeChannelFromTable(
  106. PH323_CHANNEL pChannel,
  107. PH323_CHANNEL_TABLE pChannelTable
  108. );
  109. BOOL
  110. H323LookupChannelByHandle(
  111. PH323_CHANNEL * ppChannel,
  112. PH323_CHANNEL_TABLE pChannelTable,
  113. CC_HCHANNEL hccChannel
  114. );
  115. BOOL
  116. H323LookupChannelBySessionID(
  117. PH323_CHANNEL * ppChannel,
  118. PH323_CHANNEL_TABLE pChannelTable,
  119. BYTE bSessionID
  120. );
  121. BOOL
  122. H323AreThereOutgoingChannels(
  123. PH323_CHANNEL_TABLE pChannelTable,
  124. BOOL fIgnoreOpenChannels
  125. );
  126. #endif // _INC_CHANNEL