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.

1000 lines
55 KiB

  1. /****************************************************************************/
  2. /* */
  3. /* ERNCCONF.HPP */
  4. /* */
  5. /* Base Conference class for the Reference System Node Controller. */
  6. /* */
  7. /* Copyright Data Connection Ltd. 1995 */
  8. /* */
  9. /****************************************************************************/
  10. /* Changes: */
  11. /* */
  12. /* 12Jul95 NFC Created. */
  13. /* */
  14. /****************************************************************************/
  15. #ifndef __ERNCCONF_HPP_
  16. #define __ERNCCONF_HPP_
  17. extern "C"
  18. {
  19. #include "T120.h"
  20. }
  21. #include "events.hpp"
  22. #include <cuserdta.hpp>
  23. #include "inodecnt.h"
  24. extern IT120ControlSAP *g_pIT120ControlSap;
  25. class CNodeIdNameList2 : public CList2
  26. {
  27. DEFINE_CLIST2_(CNodeIdNameList2, LPSTR, T120NodeID)
  28. };
  29. class CUserDataList2 : public CList2
  30. {
  31. DEFINE_CLIST2_(CUserDataList2, CNCUserDataList*, T120NodeID)
  32. };
  33. class DCRNCConference;
  34. /****************************************************************************/
  35. /* */
  36. /* Structures */
  37. /* */
  38. /****************************************************************************/
  39. // List of local addresses in the conference
  40. // LONCHANC: This class is insane. We should fix it.
  41. class CLocalAddress : public CRefCount
  42. {
  43. friend class CLocalAddressList;
  44. public:
  45. CLocalAddress(PCSTR szLocalAddress);
  46. ~CLocalAddress(void) { delete m_pszLocalAddress; }
  47. PCSTR GetLocalAddress(void) { return m_pszLocalAddress; }
  48. private:
  49. LPSTR m_pszLocalAddress;
  50. };
  51. class CLocalAddressList : private CList
  52. {
  53. DEFINE_CLIST(CLocalAddressList, CLocalAddress*)
  54. public:
  55. ~CLocalAddressList(void) { ASSERT(IsEmpty()); }
  56. HRESULT AddLocalAddress(ConnectionHandle connection_handle,
  57. BOOL * pbNewAddress,
  58. CLocalAddress ** ppLocalAddr);
  59. HRESULT GetLocalAddressList(UINT * pnAddresses, LPCSTR** ppaAddresses);
  60. void EndReference(CLocalAddress *pLocalAddr);
  61. };
  62. /****************************************************************************/
  63. /* Values for connection state field. */
  64. /****************************************************************************/
  65. typedef enum
  66. {
  67. CONF_CON_PENDING_START,
  68. CONF_CON_PENDING_INVITE,
  69. CONF_CON_PENDING_JOIN,
  70. CONF_CON_CONNECTED,
  71. CONF_CON_PENDING_PASSWORD,
  72. CONF_CON_INVITED,
  73. CONF_CON_JOINED,
  74. CONF_CON_ERROR,
  75. }
  76. LOGICAL_CONN_STATE;
  77. /****************************************************************************/
  78. /* An entry in the connection list. */
  79. /****************************************************************************/
  80. class CLogicalConnection : public CRefCount
  81. {
  82. public:
  83. CLogicalConnection
  84. (
  85. PCONFERENCE pConf,
  86. LOGICAL_CONN_STATE eAction,
  87. ConnectionHandle hConnection,
  88. PUSERDATAINFO pInfo,
  89. UINT nInfo,
  90. BOOL fSecure
  91. );
  92. ~CLogicalConnection(void);
  93. BOOL NewLocalAddress(void);
  94. void Delete(HRESULT hrReason);
  95. HRESULT InviteConnectResult(HRESULT hr);
  96. void InviteComplete(HRESULT hrStatus, PT120PRODUCTVERSION pVersion = NULL);
  97. void SetState(LOGICAL_CONN_STATE eState) { m_eState = eState; }
  98. LOGICAL_CONN_STATE GetState(void) { return m_eState; }
  99. LPSTR GetNodeAddress(void) { return m_pszNodeAddress; }
  100. void SetNodeAddress(LPSTR psz) { m_pszNodeAddress = psz; }
  101. UserID GetConnectionNodeID(void) { return m_nidConnection; }
  102. void SetConnectionNodeID(GCCNodeID nidConn) { m_nidConnection = nidConn; }
  103. ConnectionHandle GetInviteReqConnHandle(void) { return m_hInviteReqConn; }
  104. void SetInviteReqConnHandle(ConnectionHandle hConnReq) { m_hInviteReqConn = hConnReq; }
  105. ConnectionHandle GetConnectionHandle(void) { return m_hConnection; }
  106. void SetConnectionHandle(ConnectionHandle hConn) { m_hConnection = hConn; }
  107. CNCUserDataList *GetUserDataList(void) { return &m_UserDataInfoList; }
  108. void ReArm(void) { m_fEventGrabbed = FALSE; }
  109. BOOL Grab(void)
  110. {
  111. // For this function to work, it relies upon the fact
  112. // that the thread executing it will not be interrupted
  113. // and reenter this function on the same thread.
  114. BOOL fGrabbedByMe = ! m_fEventGrabbed;
  115. m_fEventGrabbed = TRUE;
  116. return fGrabbedByMe;
  117. }
  118. BOOL IsConnectionSecure(void) { return m_fSecure; };
  119. private:
  120. LOGICAL_CONN_STATE m_eState;
  121. LPSTR m_pszNodeAddress;
  122. PCONFERENCE m_pConf;
  123. ConnectionHandle m_hInviteReqConn; // for invite request/indication
  124. ConnectionHandle m_hConnection;
  125. GCCNodeID m_nidConnection;
  126. CLocalAddress *m_pLocalAddress;
  127. CNCUserDataList m_UserDataInfoList;
  128. BOOL m_fSecure;
  129. BOOL m_fEventGrabbed;
  130. };
  131. class CNCConfConnList : public CList
  132. {
  133. DEFINE_CLIST(CNCConfConnList, CLogicalConnection*)
  134. };
  135. /****************************************************************************/
  136. /* States */
  137. /****************************************************************************/
  138. typedef enum
  139. {
  140. CONF_ST_UNINITIALIZED,
  141. CONF_ST_PENDING_CONNECTION,
  142. CONF_ST_LOCAL_PENDING_RECREATE,
  143. CONF_ST_PENDING_T120_START_LOCAL,
  144. // LONCHANC: please do not remove this chunk of code.
  145. #ifdef ENABLE_START_REMOTE
  146. CONF_ST_PENDING_START_REMOTE_FIRST,
  147. CONF_ST_PENDING_START_REMOTE_SECOND,
  148. #endif
  149. CONF_ST_STARTED,
  150. }
  151. NC_CONF_STATE;
  152. typedef enum
  153. {
  154. T120C_ST_IDLE,
  155. T120C_ST_PENDING_START_CONFIRM,
  156. T120C_ST_PENDING_JOIN_CONFIRM,
  157. T120C_ST_PENDING_ROSTER_ENTRY,
  158. T120C_ST_PENDING_ROSTER_MESSAGE,
  159. T120C_ST_PENDING_ANNOUNCE_PERMISSION,
  160. T120C_ST_CONF_STARTED,
  161. T120C_ST_PENDING_DISCONNECT,
  162. T120C_ST_PENDING_TERMINATE,
  163. }
  164. NC_T120_CONF_STATE;
  165. class DCRNCConference : public IDataConference, public CRefCount
  166. {
  167. friend class CLogicalConnection;
  168. friend class CInviteIndWork;
  169. public:
  170. //
  171. // IDataConference Interface
  172. //
  173. STDMETHODIMP_(void) ReleaseInterface(void);
  174. STDMETHODIMP_(UINT_PTR) GetConferenceID(void);
  175. STDMETHODIMP Leave(void);
  176. STDMETHODIMP EjectUser ( UINT nidEjected );
  177. STDMETHODIMP Invite ( LPCSTR pcszNodeAddress, USERDATAINFO aInfo[], UINT cInfo, REQUEST_HANDLE *phRequest );
  178. STDMETHODIMP InviteResponse ( BOOL fResponse );
  179. STDMETHODIMP JoinResponse ( BOOL fResponse );
  180. STDMETHODIMP LaunchGuid ( const GUID *pcGUID, UINT auNodeIDs[], UINT cNodes );
  181. STDMETHODIMP SetUserData ( const GUID *pcGUID, UINT cbData, LPVOID pData );
  182. STDMETHODIMP_(BOOL) IsSecure(void);
  183. STDMETHODIMP UpdateUserData(void);
  184. STDMETHODIMP GetLocalAddressList ( LPWSTR pwszBuffer, UINT cchBuffer );
  185. STDMETHODIMP CancelInvite ( REQUEST_HANDLE hRequest );
  186. STDMETHODIMP SetSecurity ( BOOL fSecure );
  187. STDMETHODIMP GetCred ( PBYTE *ppbCred, DWORD *pcbCred );
  188. STDMETHODIMP_(UINT) GetParentNodeID(void);
  189. public:
  190. // Various ways to get a connection entry.
  191. // Based upon a current pending event (request).
  192. CLogicalConnection * GetConEntry(ConnectionHandle hInviteIndConn);
  193. CLogicalConnection * GetConEntry(LPSTR pszNodeAddress);
  194. CLogicalConnection * GetConEntryByNodeID(GCCNodeID nid);
  195. ULONG GetNodeName(GCCNodeID NodeId, LPSTR pszBuffer, ULONG cbBufSize);
  196. ULONG GetUserGUIDData(GCCNodeID NodeId, GUID *pGuid,
  197. LPBYTE pbBuffer, ULONG cbBufSize);
  198. /************************************************************************/
  199. /* FUNCTION: DCRNCConference Constructor. */
  200. /* */
  201. /* DESCRIPTION: */
  202. /* */
  203. /* This is the constructor for the conference class. */
  204. /* */
  205. /* PARAMETERS: */
  206. /* */
  207. /* conferenceName - name of the conference. */
  208. /* pStatus - pointer to hold result on return. */
  209. /* */
  210. /* RETURNS: */
  211. /* */
  212. /* */
  213. /************************************************************************/
  214. DCRNCConference(LPCWSTR pwszConfName,
  215. GCCConfID nConfID,
  216. BOOL fSecure,
  217. HRESULT *pStatus);
  218. /************************************************************************/
  219. /* FUNCTION: DCRNCConference Destructor. */
  220. /* */
  221. /* DESCRIPTION: */
  222. /* */
  223. /* This is the destructor for the conference class. */
  224. /* */
  225. /* PARAMETERS: */
  226. /* */
  227. /* None. */
  228. /* */
  229. /* RETURNS: */
  230. /* */
  231. /* Nothing. */
  232. /* */
  233. /************************************************************************/
  234. ~DCRNCConference(void);
  235. void OnRemoved(BOOL fReleaseNow = FALSE);
  236. #ifdef _DEBUG
  237. void OnAppended(void) { m_fAppendedToConfList = TRUE; }
  238. #endif
  239. /************************************************************************/
  240. /* FUNCTION: GetID(). */
  241. /* */
  242. /* DESCRIPTION: */
  243. /* */
  244. /* This function returns the ID for this conference. */
  245. /* */
  246. /* PARAMETERS: */
  247. /* */
  248. /* none. */
  249. /* */
  250. /* RETURNS: */
  251. /* */
  252. /************************************************************************/
  253. GCCConferenceID GetID(void) { return m_nConfID; }
  254. void SetID(GCCConfID nConfID) { m_nConfID = nConfID; }
  255. void SetActive(BOOL _bActive) { m_fActive = _bActive; }
  256. BOOL IsActive(void) { return m_fActive; }
  257. void FirstRoster(void);
  258. /************************************************************************/
  259. /* FUNCTION: GetName(). */
  260. /* */
  261. /* DESCRIPTION: */
  262. /* */
  263. /* This function returns the actual name of this conference. For GCC */
  264. /* this is the text part of the conference name. */
  265. /* */
  266. /* PARAMETERS: */
  267. /* */
  268. /* none. */
  269. /* */
  270. /* RETURNS: */
  271. /* */
  272. /************************************************************************/
  273. LPCWSTR GetName(void) { return m_pwszConfName; }
  274. LPSTR GetNumericName(void) { return m_ConfName.numeric_string; }
  275. /************************************************************************/
  276. /* FUNCTION: HandleGCCCallback(). */
  277. /* */
  278. /* DESCRIPTION: */
  279. /* */
  280. /* This function is called by the conference manager when */
  281. /* GCC calls back with an event for this conference. */
  282. /* The events handled by this function are: */
  283. /* */
  284. /* */
  285. /* PARAMETERS: */
  286. /* */
  287. /* pGCCMessage - pointer to the GCC message. */
  288. /* */
  289. /* RETURNS: */
  290. /* */
  291. /* Nothing. */
  292. /* */
  293. /************************************************************************/
  294. void HandleGCCCallback(GCCMessage *pGCCMessage);
  295. void HandleJoinConfirm(JoinConfirmMessage * pJoinConfirm);
  296. HRESULT RefreshRoster(void);
  297. /************************************************************************/
  298. /* FUNCTION: ValidatePassword() */
  299. /* */
  300. /* DESCRIPTION: */
  301. /* */
  302. /* This function is used to verify the password supplied with a */
  303. /* GCC-Conference-Join indication. */
  304. /* */
  305. /* PARAMETERS: */
  306. /* */
  307. /* pPasswordChallenge - Pointer to the GCC structure containing the */
  308. /* supplied password */
  309. /* */
  310. /* RETURNS: */
  311. /* TRUE, if the join is authorized, FALSE, otherwise. */
  312. /* */
  313. /************************************************************************/
  314. BOOL ValidatePassword (GCCChallengeRequestResponse *pPasswordChallenge);
  315. /************************************************************************/
  316. /* FUNCTION: Invite() */
  317. /* */
  318. /* DESCRIPTION: */
  319. /* */
  320. /* This function is called to invite a remote node into the conference. */
  321. /* */
  322. /* PARAMETERS: */
  323. /* */
  324. /* pNodeDetails - details of the address of the node to invite into the */
  325. /* conference. */
  326. /* */
  327. /* RETURNS: */
  328. /* */
  329. /* 0 - success. CONF_RC_BAD_STATE */
  330. /* */
  331. /************************************************************************/
  332. HRESULT InviteResponse ( HRESULT hrResponse );
  333. void InviteComplete(ConnectionHandle hInviteReqConn,
  334. HRESULT result,
  335. PT120PRODUCTVERSION pVersion);
  336. /************************************************************************/
  337. /* FUNCTION: Leave() */
  338. /* */
  339. /* DESCRIPTION: */
  340. /* */
  341. /* This function is called to leave the conference. */
  342. /* */
  343. /* PARAMETERS: */
  344. /* */
  345. /* None. */
  346. /* */
  347. /* RETURNS: */
  348. /* */
  349. /* 0 - success. */
  350. /* CONF_RC_BAD_STATE */
  351. /* */
  352. /************************************************************************/
  353. // HRESULT Leave(void);
  354. /************************************************************************/
  355. /* FUNCTION: Terminate(). */
  356. /* */
  357. /* DESCRIPTION: */
  358. /* */
  359. /* This function is called to terminate the conference. */
  360. /* */
  361. /* PARAMETERS: */
  362. /* */
  363. /* None. */
  364. /* */
  365. /* RETURNS: */
  366. /* */
  367. /* 0 - success. */
  368. /* CONF_RC_BAD_STATE */
  369. /* */
  370. /************************************************************************/
  371. // HRESULT Terminate(void);
  372. /************************************************************************/
  373. /* FUNCTION: Eject(). */
  374. /* */
  375. /* DESCRIPTION: */
  376. /* */
  377. /* This function is called to eject an user from the conference. */
  378. /* */
  379. /* PARAMETERS: */
  380. /* */
  381. /* User ID. */
  382. /* */
  383. /* RETURNS: */
  384. /* */
  385. /* 0 - success. */
  386. /* UI_RC_T120_FAILURE */
  387. /* */
  388. /************************************************************************/
  389. HRESULT Eject(GCCNodeID nidEjected);
  390. /************************************************************************/
  391. /* FUNCTION: SendText(). */
  392. /* */
  393. /* DESCRIPTION: */
  394. /* */
  395. /* This function is called to send text to users in the conference. */
  396. /* */
  397. /* PARAMETERS: */
  398. /* */
  399. /* User ID -> If user id is 0 it sends the text to all participants. */
  400. /* Text Mesage. */
  401. /* */
  402. /* RETURNS: */
  403. /* */
  404. /* 0 - success. */
  405. /* UI_RC_T120_FAILURE */
  406. /* */
  407. /************************************************************************/
  408. // HRESULT SendText(LPWSTR pwszTextMsg, GCCNodeID node_id);
  409. /************************************************************************/
  410. /* FUNCTION: TimeRemaining(). */
  411. /* */
  412. /* DESCRIPTION: */
  413. /* */
  414. /* This function is called to send the time remaining in the conference.*/
  415. /* */
  416. /* PARAMETERS: */
  417. /* */
  418. /* Time remaining in seconds. */
  419. /* User ID -> If user id is 0 it sends the text to all participants. */
  420. /* */
  421. /* RETURNS: */
  422. /* */
  423. /* 0 - success. */
  424. /* UI_RC_T120_FAILURE */
  425. /* */
  426. /************************************************************************/
  427. // HRESULT TimeRemaining(UINT time_remaining, GCCNodeID nidDestination);
  428. /************************************************************************/
  429. /* FUNCTION: Join() */
  430. /* */
  431. /* DESCRIPTION: */
  432. /* */
  433. /* This function is called to join a conference at a remote node. */
  434. /* */
  435. /* PARAMETERS: */
  436. /* */
  437. /* pNodeDetails - details of the address of the node at which to join */
  438. /* the conference. */
  439. /* */
  440. /* RETURNS: */
  441. /* */
  442. /* 0 - success. */
  443. /* CONF_RC_BAD_STATE */
  444. /* */
  445. /************************************************************************/
  446. HRESULT Join(LPSTR pszNodeAddress,
  447. PUSERDATAINFO pInfo,
  448. UINT nInfo,
  449. PCWSTR _wszPassword);
  450. HRESULT JoinWrapper(CLogicalConnection * pConEntry,
  451. PCWSTR _wszPassword);
  452. /************************************************************************/
  453. /* FUNCTION: NotifyConferenceComplete() */
  454. /* */
  455. /* DESCRIPTION: */
  456. /* */
  457. /* This function is called the generic conference when it has */
  458. /* finished its attempt to start. */
  459. /* */
  460. /* PARAMETERS: */
  461. /* */
  462. /* result - result of the attempt to connect. */
  463. /* */
  464. /* RETURNS: */
  465. /* */
  466. /* Nothing. */
  467. /* */
  468. /************************************************************************/
  469. void NotifyConferenceComplete(HRESULT result);
  470. /************************************************************************/
  471. /* FUNCTION: NotifyConnectionComplete() */
  472. /* */
  473. /* DESCRIPTION: */
  474. /* */
  475. /* This function is called by an instance of a PHYSICAL_CONNECTION when */
  476. /* it has finished its attempt to establish a connection. */
  477. /* */
  478. /* PARAMETERS: */
  479. /* */
  480. /* */
  481. /* pConnection - ptr to the connection which has started. */
  482. /* result - result of the attempt to connect. */
  483. /* One of */
  484. /* CONF_CONNECTION_START_PRIMARY */
  485. /* CONF_CONNECTION_START_ALTERNATE */
  486. /* CONF_CONNECTION_START_FAIL */
  487. /* */
  488. /* RETURNS: */
  489. /* */
  490. /* 0 - success. */
  491. /* CONF_RC_BAD_STATE */
  492. /* */
  493. /************************************************************************/
  494. HRESULT NotifyConnectionComplete(CLogicalConnection * pConEntry,
  495. HRESULT result);
  496. /************************************************************************/
  497. /* FUNCTION: NotifyRosterChanged(). */
  498. /* */
  499. /* DESCRIPTION: */
  500. /* */
  501. /* This function is called by the generic conference when its */
  502. /* conference roster has been updated. */
  503. /* */
  504. /* PARAMETERS: */
  505. /* */
  506. /* pRoster - pointer to the new roster. */
  507. /* */
  508. /* RETURNS: */
  509. /* */
  510. /* Nothing. */
  511. /* */
  512. /************************************************************************/
  513. void NotifyRosterChanged(PNC_ROSTER roster);
  514. /************************************************************************/
  515. /* FUNCTION: StartLocal() */
  516. /* */
  517. /* DESCRIPTION: */
  518. /* */
  519. /* This function is called to start a local conference. */
  520. /* */
  521. /* PARAMETERS: */
  522. /* */
  523. /* _wszPassword: The local conference's password (used to validate */
  524. /* GCC-Conference-Join indications. */
  525. /* */
  526. /* RETURNS: */
  527. /* */
  528. /* 0 - success. */
  529. /* CONF_RC_BAD_STATE */
  530. /* */
  531. /************************************************************************/
  532. HRESULT StartLocal(PCWSTR _wszPassword, PBYTE pbHashedPassword, DWORD cbHashedPassword);
  533. /************************************************************************/
  534. /* FUNCTION: StartRemote() */
  535. /* */
  536. /* DESCRIPTION: */
  537. /* */
  538. /* This function is called to start a conference with a remote node. */
  539. /* */
  540. /* PARAMETERS: */
  541. /* pNodeDetails - details of the address of the node with which to */
  542. /* start the conference. */
  543. /* */
  544. /* RETURNS: */
  545. /* */
  546. /* 0 - success. */
  547. /* CONF_RC_BAD_STATE */
  548. /* */
  549. /************************************************************************/
  550. // LONCHANC: please do not remove this chunk of code.
  551. #ifdef ENABLE_START_REMOTE
  552. HRESULT StartRemote(LPSTR pszNodeAddress);
  553. #endif
  554. /************************************************************************/
  555. /* FUNCTION: StartIncoming() */
  556. /* */
  557. /* DESCRIPTION: */
  558. /* */
  559. /* This function is called to start an incoming conference. */
  560. /* */
  561. /* PARAMETERS: */
  562. /* */
  563. /* */
  564. /* RETURNS: */
  565. /* */
  566. /* 0 - success. */
  567. /* CONF_RC_BAD_STATE */
  568. /* */
  569. /************************************************************************/
  570. HRESULT StartIncoming(void);
  571. BOOL GetNotifyToDo(void) { return m_fNotifyToDo; }
  572. void SetNotifyToDo(BOOL fNotifyToDo) { m_fNotifyToDo = fNotifyToDo; }
  573. /************************************************************************/
  574. /* MapPCMtoConfError - map a PCM return code to a Conference return */
  575. /* code. */
  576. /************************************************************************/
  577. HRESULT MapPCMtoConfError(HRESULT PCMrc);
  578. CLogicalConnection *NewLogicalConnection
  579. (
  580. LOGICAL_CONN_STATE eAction,
  581. ConnectionHandle hConnection,
  582. PUSERDATAINFO pInfo = NULL,
  583. UINT nInfo = 0,
  584. BOOL fSecure = FALSE
  585. )
  586. {
  587. CLogicalConnection *pConEntry;
  588. pConEntry = new CLogicalConnection(this, eAction, hConnection, pInfo, nInfo, fSecure);
  589. if (NULL != pConEntry)
  590. {
  591. m_ConnList.Append(pConEntry);
  592. }
  593. return pConEntry;
  594. }
  595. /************************************************************************/
  596. /* StartConnection - add a new connection to our connection list. */
  597. /************************************************************************/
  598. HRESULT StartConnection(LPSTR pszNodeAddress,
  599. LOGICAL_CONN_STATE action,
  600. PUSERDATAINFO pInfo = NULL,
  601. UINT nInfo = 0,
  602. BOOL fSecure = FALSE,
  603. REQUEST_HANDLE * phRequest = NULL);
  604. // LONCHANC: please do not remove this chunk of code.
  605. #ifdef ENABLE_START_REMOTE
  606. /************************************************************************/
  607. /* StartFirstConference() - start the first attempt to create a */
  608. /* conference. */
  609. /************************************************************************/
  610. void StartFirstConference();
  611. /************************************************************************/
  612. /* StartSecondConference() - start the second attempt to create a */
  613. /* conference. */
  614. /************************************************************************/
  615. void StartSecondConference(HRESULT FirstConferenceStatus);
  616. #endif // ENABLE_START_REMOTE
  617. // Local address list wrappers
  618. HRESULT AddLocalAddress(ConnectionHandle hConn, BOOL *pbNewAddr, CLocalAddress **ppLocalAddrToRet)
  619. {
  620. return m_LocalAddressList.AddLocalAddress(hConn, pbNewAddr, ppLocalAddrToRet);
  621. }
  622. void EndReference(CLocalAddress *pLocalAddr)
  623. {
  624. m_LocalAddressList.EndReference(pLocalAddr);
  625. }
  626. // Connection list
  627. BOOL IsConnListEmpty(void) { return m_ConnList.IsEmpty(); }
  628. CLogicalConnection *PeekConnListHead(void) { return m_ConnList.PeekHead(); }
  629. // Invite indication work item
  630. CInviteIndWork *GetInviteIndWork(void) { return m_pInviteUI; }
  631. void SetInviteIndWork(CInviteIndWork *p) { m_pInviteUI = p; }
  632. BOOL FindSocketNumber(GCCNodeID, SOCKET *);
  633. void UpdateNodeIdNameListAndUserData(PGCCMessage message);
  634. UINT InvalidPwdCount(void) { return m_nInvalidPasswords; };
  635. VOID IncInvalidPwdCount(void) { m_nInvalidPasswords++; };
  636. VOID ResetInvalidPwdCount(void) { m_nInvalidPasswords = 0; };
  637. private: // Generic Conference
  638. /************************************************************************/
  639. /* State of this conference. */
  640. /************************************************************************/
  641. NC_CONF_STATE m_eState;
  642. /************************************************************************/
  643. /* ID of this conference. */
  644. /************************************************************************/
  645. GCCConferenceID m_nConfID;
  646. /************************************************************************/
  647. /* List of connections in use by this conference. */
  648. /************************************************************************/
  649. CNCConfConnList m_ConnList;
  650. /************************************************************************/
  651. /* Name of this conference. */
  652. /************************************************************************/
  653. LPWSTR m_pwszConfName;
  654. /************************************************************************/
  655. /* Details of the first node we try to connect to. */
  656. /************************************************************************/
  657. LPSTR m_pszFirstRemoteNodeAddress;
  658. /************************************************************************/
  659. /* Are we incoming or outgoing? */
  660. /************************************************************************/
  661. BOOL m_fIncoming;
  662. /************************************************************************/
  663. /* Conference passwords */
  664. /************************************************************************/
  665. PBYTE m_pbHashedPassword;
  666. DWORD m_cbHashedPassword;
  667. LPWSTR m_pwszPassword;
  668. LPSTR m_pszNumericPassword;
  669. /************************************************************************/
  670. /* Security Setting */
  671. /************************************************************************/
  672. BOOL m_fSecure;
  673. /************************************************************************/
  674. /* Number of invalid passwords attempts */
  675. /************************************************************************/
  676. BOOL m_nInvalidPasswords;
  677. /************************************************************************/
  678. /* Remember the invite indication work item if being invited */
  679. /************************************************************************/
  680. CInviteIndWork *m_pInviteUI;
  681. /************************************************************************/
  682. /* List of local addresses */
  683. /************************************************************************/
  684. CLocalAddressList m_LocalAddressList;
  685. /************************************************************************/
  686. /* Miscellaneous states */
  687. /************************************************************************/
  688. BOOL m_fNotifyToDo;
  689. BOOL m_fActive; // Whether a placeholder or counted as a real conference.
  690. #ifdef _DEBUG
  691. BOOL m_fAppendedToConfList; // TRUE when this object is in NC Mgr's list
  692. #endif
  693. private: // T120 Conference
  694. /************************************************************************/
  695. /* Pointer to base conference */
  696. /************************************************************************/
  697. PCONFERENCE pBase;
  698. /************************************************************************/
  699. /* State. */
  700. /************************************************************************/
  701. NC_T120_CONF_STATE m_eT120State;
  702. /************************************************************************/
  703. /* Conference name structure to pass to GCC. */
  704. /************************************************************************/
  705. GCCConferenceName m_ConfName;
  706. /************************************************************************/
  707. /* Nodes ID. */
  708. /************************************************************************/
  709. GCCNodeID m_nidMyself;
  710. /************************************************************************/
  711. /* The user data for the local member in the conference. */
  712. /************************************************************************/
  713. CNCUserDataList m_LocalUserData;
  714. CNodeIdNameList2 m_NodeIdNameList;
  715. CUserDataList2 m_UserDataList;
  716. PBYTE m_pbCred;
  717. DWORD m_cbCred;
  718. public: // T120 Conference
  719. /****************************************************************************/
  720. /* AnnouncePresence() - announce this nodes participation in the */
  721. /* conference. */
  722. /****************************************************************************/
  723. HRESULT AnnouncePresence(void);
  724. void SetT120State(NC_T120_CONF_STATE eState) { m_eT120State = eState; }
  725. protected: // T120 Conference
  726. /************************************************************************/
  727. /* FUNCTION: T120Invite() */
  728. /* */
  729. /* DESCRIPTION: */
  730. /* */
  731. /* This function is called to invite a remote node into the conference. */
  732. /* */
  733. /* PARAMETERS: */
  734. /* */
  735. /* pNodeDetails - the connection to invite the node over. */
  736. /* */
  737. /* RETURNS: */
  738. /* */
  739. /* 0 - success. UI_RC_T120_FAILURE */
  740. /* */
  741. /************************************************************************/
  742. HRESULT T120Invite(LPSTR pszNodeAddress,
  743. BOOL fSecure,
  744. CNCUserDataList * pUserDataInfoList,
  745. ConnectionHandle * phInviteReqConn);
  746. /************************************************************************/
  747. /* FUNCTION: T120Join() */
  748. /* */
  749. /* DESCRIPTION: */
  750. /* */
  751. /* This function is called to join a conference at a remote node. */
  752. /* */
  753. /* PARAMETERS: */
  754. /* */
  755. /* pNodeDetails - the connection to join the conference over. */
  756. /* conferenceName - name of the conference to join. */
  757. /* */
  758. /* RETURNS: */
  759. /* */
  760. /* 0 - success. */
  761. /* UI_RC_T120_FAILURE */
  762. /* */
  763. /************************************************************************/
  764. HRESULT T120Join(LPSTR pszNodeAddress,
  765. BOOL fSecure,
  766. LPCWSTR conferenceName,
  767. CNCUserDataList *pUserDataInfoList,
  768. LPCWSTR pwszPassword);
  769. // REQUEST_HANDLE *phRequest);
  770. private: // T120 Conference
  771. // The original constructor of T120 Conference
  772. HRESULT NewT120Conference(void);
  773. /************************************************************************/
  774. /* FUNCTION: StartLocal() */
  775. /* */
  776. /* DESCRIPTION: */
  777. /* */
  778. /* This function is called to start a local conference. */
  779. /* */
  780. /* PARAMETERS: */
  781. /* */
  782. /* None. */
  783. /* */
  784. /* RETURNS: */
  785. /* */
  786. /* 0 - success. */
  787. /* UI_RC_T120_FAILURE */
  788. /* */
  789. /************************************************************************/
  790. HRESULT T120StartLocal(BOOL fSecure);
  791. /************************************************************************/
  792. /* FUNCTION: T120StartRemote() */
  793. /* */
  794. /* DESCRIPTION: */
  795. /* */
  796. /* This function is called to start a conference with a remote node. */
  797. /* */
  798. /* PARAMETERS: */
  799. /* */
  800. /* pNodeDetails - connection to establish the conference with. */
  801. /* */
  802. /* RETURNS: */
  803. /* */
  804. /* 0 - success. */
  805. /* UI_RC_T120_FAILURE */
  806. /* */
  807. /************************************************************************/
  808. // LONCHANC: please do not remove this chunk of code.
  809. #ifdef ENABLE_START_REMOTE
  810. HRESULT T120StartRemote(LPSTR pszNodeAddress);
  811. #endif
  812. // Handle a GCC_CONNECTION_BROKEN_INDICATION message.
  813. void HandleConnectionBrokenIndication(ConnectionBrokenIndicationMessage *);
  814. /************************************************************************/
  815. /* HandleAddConfirm - handle a GCC_ADD_CONFIRM message */
  816. /************************************************************************/
  817. void HandleAddConfirm(AddConfirmMessage * pAddConf)
  818. {
  819. ERROR_OUT(("HandleAddConfirm: Not supported yet..."));
  820. }
  821. /************************************************************************/
  822. /* HandleAnnounceConfirm - handle a GCC_ANNOUNCE_PRESENCE_CONFIRM */
  823. /* message */
  824. /************************************************************************/
  825. void HandleAnnounceConfirm(AnnouncePresenceConfirmMessage * pGCCMessage);
  826. /************************************************************************/
  827. /* HandleCreateConfirm - handle a GCC_CREATE_CONFIRM message. */
  828. /************************************************************************/
  829. void HandleCreateConfirm(CreateConfirmMessage * pCreateConfirm);
  830. /************************************************************************/
  831. /* HandleDisconnectConfirm - handle a GCC_DISCONNECT_CONFIRM message. */
  832. /************************************************************************/
  833. void HandleDisconnectConfirm(DisconnectConfirmMessage * pDiscConf);
  834. /************************************************************************/
  835. /* HandleDisconnectInd - handle a GCC_DISCONNECT_INDICATION message. */
  836. /************************************************************************/
  837. void HandleDisconnectInd(DisconnectIndicationMessage * pDiscInd);
  838. /************************************************************************/
  839. /* HandleEjectUser - handle a GCC_EJECT_USER_INDICATION message. */
  840. /************************************************************************/
  841. void HandleEjectUser(EjectUserIndicationMessage * pEjectInd);
  842. /************************************************************************/
  843. /* HandleInviteConfirm - handle a GCC_INVITE_CONFIRM message. */
  844. /************************************************************************/
  845. void HandleInviteConfirm(InviteConfirmMessage * pInviteConf);
  846. /************************************************************************/
  847. /* HandlePermitToAnnounce - handle a GCC_PERMIT_TO_ANNOUNCE_PRESENCE */
  848. /* message. */
  849. /************************************************************************/
  850. void HandlePermitToAnnounce(PermitToAnnouncePresenceMessage * pAnnounce);
  851. // Handle a GCC_ROSTER_REPORT_INDICATION or a GCC_ROSTER_INQUIRE_CONFIRM.
  852. void HandleRosterReport(GCCConferenceRoster * pConferenceRoster);
  853. /************************************************************************/
  854. /* HandleTerminateConfirm - handle a GCC_TERMINATE_CONFIRM message. */
  855. /************************************************************************/
  856. void HandleTerminateConfirm(TerminateConfirmMessage * pTermConf);
  857. /************************************************************************/
  858. /* HandleTerminateInd - handle a GCC_TERMINATE_INDICATION message. */
  859. /************************************************************************/
  860. void HandleTerminateInd(TerminateIndicationMessage * pTermInd);
  861. };
  862. void LoadAnnouncePresenceParameters(
  863. GCCNodeType * nodeType,
  864. GCCNodeProperties * nodeProperties,
  865. LPWSTR * nodeName,
  866. LPWSTR * siteInformation);
  867. void BuildAddressFromNodeDetails(LPSTR pszNodeAddress, LPSTR pszDstAddress);
  868. #endif /* __ERNCCONF_HPP_ */