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.

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