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.

3561 lines
99 KiB

  1. /*
  2. * connect.h
  3. *
  4. * Copyright (c) 1993 - 1995 by DataBeam Corporation, Lexington, KY
  5. *
  6. * Abstract:
  7. * This is the interface file for the Connection class. Instances of
  8. * this class are used to connect CommandTarget objects within the local
  9. * provider to CommandTarget objects in a remote provider. This class
  10. * inherits from CommandTarget, allowing it to communicate with other
  11. * CommandTarget classes using their common MCS command language.
  12. *
  13. * This class can be thought of as providing a Remote Procedure Call (RPC)
  14. * facility between CommandTarget objects. When an MCS command is sent
  15. * to a Connection object, it encodes the command as a T.125 Protocol
  16. * Data Unit (PDU) and sends it to a remote provider via the transport
  17. * services provided by a TransportInterface object. At the remote side
  18. * The PDU is received by a Connection object who decodes the PDU, and
  19. * issues the equivalent MCS command to the CommandTarget object that it is
  20. * attached to. The fact that the call crossed a transport connection
  21. * in route to its destination is completely transparent to the object
  22. * that initiated the command sequence.
  23. *
  24. * The primary responsibility of this class is to convert MCS commands
  25. * to T.125 PDUs and back again (as described above). This class overrides
  26. * all of the commands that are defined in class CommandTarget.
  27. *
  28. * A secondary responsibility of this class is to provide flow control
  29. * to and from the transport layer. To do this is keeps a queue of PDUs
  30. * that need to be transmitted (actually it keeps 4 queues, one for each
  31. * data priority). During each MCS heartbeat, all Connection objects are
  32. * given the opportunity to flush PDUs from the queues. If the transport
  33. * layer returns an error, the PDU in question will be re-tried during
  34. * the next heartbeat. For data coming from the transport layer, this
  35. * class provides code to allocate memory. If an allocation fails, then
  36. * an error will be returned to the transport layer, effectively telling
  37. * it that it needs to retry that data indication during the next
  38. * heartbeat.
  39. *
  40. * Caveats:
  41. * None.
  42. *
  43. * Author:
  44. * James P. Galvin, Jr.
  45. */
  46. #ifndef _CONNECTION_
  47. #define _CONNECTION_
  48. /*
  49. * These are the owner callback functions that a Connection object can send to
  50. * its creator (which is typically the MCS controller).
  51. *
  52. * When a class uses an instance of the Connection class (or any other class
  53. * that can issue owner callbacks), it is accepting the responsibility of
  54. * receiving and handling these callbacks.
  55. *
  56. * Each owner callback function, along with a description of how its parameters
  57. * are packed, is described in the following section.
  58. */
  59. #define DELETE_CONNECTION 0
  60. #define CONNECT_PROVIDER_CONFIRM 1
  61. typedef struct
  62. {
  63. PDomainParameters domain_parameters;
  64. Result result;
  65. PMemory memory;
  66. } ConnectConfirmInfo;
  67. typedef ConnectConfirmInfo * PConnectConfirmInfo;
  68. /*
  69. * Owner Callback: DELETE_CONNECTION
  70. * Parameter1: PDisconnectProviderIndication
  71. * disconnect_provider_indication
  72. * Parameter2: Unused
  73. *
  74. * Usage:
  75. * This owner callback will be issued if the Connection detects a situation
  76. * is which it is no longer valid. This can happen for several reasons:
  77. * transmission or reception of a ConnectResult with a failed result
  78. * code; transmission or reception of a DisconnectProviderUltimatum; or
  79. * a Disconnect-Indication from the transport layer.
  80. */
  81. /*
  82. * Owner Callback: CONNECT_PROVIDER_CONFIRM
  83. * Parameter1: PConnectConfirmInfo connect_confirm_info
  84. * Parameter2: ConnectionHandle connection_handle
  85. *
  86. * Usage:
  87. * This callback is issued when the connection object completes the
  88. * building of a new MCS connection that was locally requested. This is to
  89. * inform the requester that the connection is ready for use.
  90. */
  91. /*
  92. * This enumeration dsefines the various states that a transport connection
  93. * can be in at any given time.
  94. */
  95. typedef enum
  96. {
  97. TRANSPORT_CONNECTION_UNASSIGNED,
  98. TRANSPORT_CONNECTION_PENDING,
  99. TRANSPORT_CONNECTION_READY
  100. } TransportConnectionState;
  101. typedef TransportConnectionState * PTransportConnectionState;
  102. /*
  103. * This is the class definition for class CommandTarget.
  104. */
  105. class Connection : public CAttachment
  106. {
  107. public:
  108. Connection (
  109. PDomain attachment,
  110. ConnectionHandle connection_handle,
  111. GCCConfID *calling_domain,
  112. GCCConfID *called_domain,
  113. PChar called_address,
  114. BOOL fSecure,
  115. BOOL upward_connection,
  116. PDomainParameters domain_parameters,
  117. PUChar user_data,
  118. ULong user_data_length,
  119. PMCSError connection_error);
  120. Connection (
  121. PDomain attachment,
  122. ConnectionHandle connection_handle,
  123. TransportConnection transport_connection,
  124. BOOL upward_connection,
  125. PDomainParameters domain_parameters,
  126. PDomainParameters min_domain_parameters,
  127. PDomainParameters max_domain_parameters,
  128. PUChar user_data,
  129. ULong user_data_length,
  130. PMCSError connection_error);
  131. ~Connection ();
  132. void RegisterTransportConnection (
  133. TransportConnection transport_connection,
  134. Priority priority);
  135. private:
  136. Void ConnectInitial (
  137. GCCConfID *calling_domain,
  138. GCCConfID *called_domain,
  139. BOOL upward_connection,
  140. PDomainParameters domain_parameters,
  141. PDomainParameters min_domain_parameters,
  142. PDomainParameters max_domain_parameters,
  143. PUChar user_data,
  144. ULong user_data_length);
  145. Void ConnectResponse (
  146. Result result,
  147. PDomainParameters domain_parameters,
  148. ConnectID connect_id,
  149. PUChar user_data,
  150. ULong user_data_length);
  151. Void ConnectAdditional (
  152. ConnectID connect_id,
  153. Priority priority);
  154. Void ConnectResult (
  155. Result result,
  156. Priority priority);
  157. ULong ProcessConnectResponse (
  158. PConnectResponsePDU pdu_structure);
  159. Void ProcessConnectResult (
  160. PConnectResultPDU pdu_structure);
  161. Void IssueConnectProviderConfirm (
  162. Result result);
  163. Void DestroyConnection (
  164. Reason reason);
  165. Void AssignRemainingTransportConnections ();
  166. TransportError CreateTransportConnection (
  167. LPCTSTR called_address,
  168. BOOL fSecure,
  169. Priority priority);
  170. TransportError AcceptTransportConnection (
  171. TransportConnection transport_connection,
  172. Priority priority);
  173. Void AdjustDomainParameters (
  174. PDomainParameters min_domain_parameters,
  175. PDomainParameters max_domain_parameters,
  176. PDomainParameters domain_parameters);
  177. BOOL MergeDomainParameters (
  178. PDomainParameters min_domain_parameters1,
  179. PDomainParameters max_domain_parameters1,
  180. PDomainParameters min_domain_parameters2,
  181. PDomainParameters max_domain_parameters2);
  182. #ifdef DEBUG
  183. Void PrintDomainParameters (
  184. PDomainParameters domain_parameters);
  185. #endif // DEBUG
  186. public:
  187. inline TransportConnection GetTransportConnection (UInt priority)
  188. {
  189. return (Transport_Connection[priority]);
  190. }
  191. virtual Void PlumbDomainIndication (
  192. ULong height_limit);
  193. Void ErectDomainRequest (
  194. ULong height_in_domain,
  195. ULong throughput_interval);
  196. Void RejectUltimatum (
  197. Diagnostic diagnostic,
  198. PUChar octet_string_address,
  199. ULong octet_string_length);
  200. Void MergeChannelsRequest (
  201. CChannelAttributesList *merge_channel_list,
  202. CChannelIDList *purge_channel_list);
  203. Void MergeChannelsConfirm (
  204. CChannelAttributesList *merge_channel_list,
  205. CChannelIDList *purge_channel_list);
  206. virtual Void PurgeChannelsIndication (
  207. CUidList *purge_user_list,
  208. CChannelIDList *purge_channel_list);
  209. Void MergeTokensRequest (
  210. CTokenAttributesList *merge_token_list,
  211. CTokenIDList *purge_token_list);
  212. Void MergeTokensConfirm (
  213. CTokenAttributesList *merge_token_list,
  214. CTokenIDList *purge_token_list);
  215. virtual Void PurgeTokensIndication (
  216. PDomain originator,
  217. CTokenIDList *purge_token_ids);
  218. virtual Void DisconnectProviderUltimatum (
  219. Reason reason);
  220. Void AttachUserRequest ( void );
  221. virtual Void AttachUserConfirm (
  222. Result result,
  223. UserID uidInitiator);
  224. Void DetachUserRequest (
  225. Reason reason,
  226. CUidList *user_id_list);
  227. virtual Void DetachUserIndication (
  228. Reason reason,
  229. CUidList *user_id_list);
  230. Void ChannelJoinRequest (
  231. UserID uidInitiator,
  232. ChannelID channel_id);
  233. virtual Void ChannelJoinConfirm (
  234. Result result,
  235. UserID uidInitiator,
  236. ChannelID requested_id,
  237. ChannelID channel_id);
  238. Void ChannelLeaveRequest (
  239. CChannelIDList *channel_id_list);
  240. Void ChannelConveneRequest (
  241. UserID uidInitiator);
  242. virtual Void ChannelConveneConfirm (
  243. Result result,
  244. UserID uidInitiator,
  245. ChannelID channel_id);
  246. Void ChannelDisbandRequest (
  247. UserID uidInitiator,
  248. ChannelID channel_id);
  249. virtual Void ChannelDisbandIndication (
  250. ChannelID channel_id);
  251. Void ChannelAdmitRequest (
  252. UserID uidInitiator,
  253. ChannelID channel_id,
  254. CUidList *user_id_list);
  255. virtual Void ChannelAdmitIndication (
  256. UserID uidInitiator,
  257. ChannelID channel_id,
  258. CUidList *user_id_list);
  259. Void ChannelExpelRequest (
  260. UserID uidInitiator,
  261. ChannelID channel_id,
  262. CUidList *user_id_list);
  263. virtual Void ChannelExpelIndication (
  264. ChannelID channel_id,
  265. CUidList *user_id_list);
  266. Void SendDataRequest ( PDataPacket data_packet )
  267. {
  268. QueueForTransmission ((PSimplePacket) data_packet,
  269. data_packet->GetPriority());
  270. };
  271. virtual Void SendDataIndication (
  272. UINT,
  273. PDataPacket data_packet)
  274. {
  275. QueueForTransmission ((PSimplePacket) data_packet,
  276. data_packet->GetPriority());
  277. };
  278. Void TokenGrabRequest (
  279. UserID uidInitiator,
  280. TokenID token_id);
  281. virtual Void TokenGrabConfirm (
  282. Result result,
  283. UserID uidInitiator,
  284. TokenID token_id,
  285. TokenStatus token_status);
  286. Void TokenInhibitRequest (
  287. UserID uidInitiator,
  288. TokenID token_id);
  289. virtual Void TokenInhibitConfirm (
  290. Result result,
  291. UserID uidInitiator,
  292. TokenID token_id,
  293. TokenStatus token_status);
  294. Void TokenGiveRequest (
  295. PTokenGiveRecord pTokenGiveRec);
  296. virtual Void TokenGiveIndication (
  297. PTokenGiveRecord pTokenGiveRec);
  298. Void TokenGiveResponse (
  299. Result result,
  300. UserID receiver_id,
  301. TokenID token_id);
  302. virtual Void TokenGiveConfirm (
  303. Result result,
  304. UserID uidInitiator,
  305. TokenID token_id,
  306. TokenStatus token_status);
  307. Void TokenReleaseRequest (
  308. UserID uidInitiator,
  309. TokenID token_id);
  310. virtual Void TokenReleaseConfirm (
  311. Result result,
  312. UserID uidInitiator,
  313. TokenID token_id,
  314. TokenStatus token_status);
  315. Void TokenPleaseRequest (
  316. UserID uidInitiator,
  317. TokenID token_id);
  318. virtual Void TokenPleaseIndication (
  319. UserID uidInitiator,
  320. TokenID token_id);
  321. Void TokenTestRequest (
  322. UserID uidInitiator,
  323. TokenID token_id);
  324. virtual Void TokenTestConfirm (
  325. UserID uidInitiator,
  326. TokenID token_id,
  327. TokenStatus token_status);
  328. virtual Void MergeDomainIndication (
  329. MergeStatus merge_status);
  330. private:
  331. Void SendPacket (
  332. PVoid pdu_structure,
  333. int pdu_type,
  334. Priority priority);
  335. Void QueueForTransmission (
  336. PSimplePacket packet,
  337. Priority priority,
  338. BOOL bFlush = TRUE);
  339. BOOL FlushAMessage (
  340. PSimplePacket packet,
  341. Priority priority);
  342. Void MergeChannelsRC (
  343. ASN1choice_t choice,
  344. CChannelAttributesList *merge_channel_list,
  345. CChannelIDList *purge_channel_list);
  346. Void MergeTokensRC (
  347. ASN1choice_t choice,
  348. CTokenAttributesList *merge_token_list,
  349. CTokenIDList *purge_token_list);
  350. Void UserChannelRI (
  351. ASN1choice_t choice,
  352. UINT reason_userID,
  353. ChannelID channel_id,
  354. CUidList *user_id_list);
  355. public:
  356. BOOL FlushMessageQueue();
  357. BOOL FlushPriority (
  358. Priority priority);
  359. BOOL IsDomainTrafficAllowed() { return Domain_Traffic_Allowed; };
  360. public:
  361. // the old owner callback
  362. TransportError HandleDataIndication(PTransportData, TransportConnection);
  363. void HandleBufferEmptyIndication(TransportConnection transport_connection);
  364. void HandleConnectConfirm(TransportConnection transport_connection);
  365. void HandleDisconnectIndication(TransportConnection transport_connection, ULONG *pnNotify);
  366. LPSTR GetCalledAddress(void) { return m_pszCalledAddress; }
  367. private:
  368. inline ULong ProcessMergeChannelsRequest (
  369. PMergeChannelsRequestPDU pdu_structure);
  370. inline ULong ProcessMergeChannelsConfirm (
  371. PMergeChannelsConfirmPDU pdu_structure);
  372. inline Void ProcessPurgeChannelIndication (
  373. PPurgeChannelIndicationPDU pdu_structure);
  374. inline ULong ProcessMergeTokensRequest (
  375. PMergeTokensRequestPDU pdu_structure);
  376. inline ULong ProcessMergeTokensConfirm (
  377. PMergeTokensConfirmPDU pdu_structure);
  378. inline Void ProcessPurgeTokenIndication (
  379. PPurgeTokenIndicationPDU pdu_structure);
  380. inline Void ProcessDisconnectProviderUltimatum (
  381. PDisconnectProviderUltimatumPDU
  382. pdu_structure);
  383. inline Void ProcessAttachUserRequest (
  384. PAttachUserRequestPDU pdu_structure);
  385. inline Void ProcessAttachUserConfirm (
  386. PAttachUserConfirmPDU pdu_structure);
  387. inline Void ProcessDetachUserRequest (
  388. PDetachUserRequestPDU pdu_structure);
  389. inline Void ProcessDetachUserIndication (
  390. PDetachUserIndicationPDU pdu_structure);
  391. inline Void ProcessChannelJoinRequest (
  392. PChannelJoinRequestPDU pdu_structure);
  393. inline Void ProcessChannelJoinConfirm (
  394. PChannelJoinConfirmPDU pdu_structure);
  395. inline Void ProcessChannelLeaveRequest (
  396. PChannelLeaveRequestPDU pdu_structure);
  397. inline Void ProcessChannelConveneRequest (
  398. PChannelConveneRequestPDU pdu_structure);
  399. inline Void ProcessChannelConveneConfirm (
  400. PChannelConveneConfirmPDU pdu_structure);
  401. inline Void ProcessChannelDisbandRequest (
  402. PChannelDisbandRequestPDU pdu_structure);
  403. inline Void ProcessChannelDisbandIndication (
  404. PChannelDisbandIndicationPDU
  405. pdu_structure);
  406. inline Void ProcessChannelAdmitRequest (
  407. PChannelAdmitRequestPDU pdu_structure);
  408. inline Void ProcessChannelAdmitIndication (
  409. PChannelAdmitIndicationPDU pdu_structure);
  410. inline Void ProcessChannelExpelRequest (
  411. PChannelExpelRequestPDU pdu_structure);
  412. inline Void ProcessChannelExpelIndication (
  413. PChannelExpelIndicationPDU pdu_structure);
  414. inline Void ProcessSendDataRequest (
  415. PSendDataRequestPDU pdu_structure,
  416. PDataPacket packet);
  417. inline Void ProcessSendDataIndication (
  418. PSendDataIndicationPDU pdu_structure,
  419. PDataPacket packet);
  420. inline Void ProcessUniformSendDataRequest (
  421. PUniformSendDataRequestPDU pdu_structure,
  422. PDataPacket packet);
  423. inline Void ProcessUniformSendDataIndication (
  424. PUniformSendDataIndicationPDU
  425. pdu_structure,
  426. PDataPacket packet);
  427. inline Void ProcessTokenGrabRequest (
  428. PTokenGrabRequestPDU pdu_structure);
  429. inline Void ProcessTokenGrabConfirm (
  430. PTokenGrabConfirmPDU pdu_structure);
  431. inline Void ProcessTokenInhibitRequest (
  432. PTokenInhibitRequestPDU pdu_structure);
  433. inline Void ProcessTokenInhibitConfirm (
  434. PTokenInhibitConfirmPDU pdu_structure);
  435. inline Void ProcessTokenReleaseRequest (
  436. PTokenReleaseRequestPDU pdu_structure);
  437. inline Void ProcessTokenReleaseConfirm (
  438. PTokenReleaseConfirmPDU pdu_structure);
  439. inline Void ProcessTokenTestRequest (
  440. PTokenTestRequestPDU pdu_structure);
  441. inline Void ProcessTokenTestConfirm (
  442. PTokenTestConfirmPDU pdu_structure);
  443. inline Void ProcessRejectUltimatum (
  444. PRejectUltimatumPDU pdu_structure);
  445. inline Void ProcessTokenGiveRequest (
  446. PTokenGiveRequestPDU pdu_structure);
  447. inline Void ProcessTokenGiveIndication (
  448. PTokenGiveIndicationPDU pdu_structure);
  449. inline Void ProcessTokenGiveResponse (
  450. PTokenGiveResponsePDU pdu_structure);
  451. inline Void ProcessTokenGiveConfirm (
  452. PTokenGiveConfirmPDU pdu_structure);
  453. inline Void ProcessTokenPleaseRequest (
  454. PTokenPleaseRequestPDU pdu_structure);
  455. inline Void ProcessTokenPleaseIndication (
  456. PTokenPleaseIndicationPDU pdu_structure);
  457. inline Void ProcessPlumbDomainIndication (
  458. PPlumbDomainIndicationPDU pdu_structure);
  459. inline Void ProcessErectDomainRequest (
  460. PErectDomainRequestPDU pdu_structure);
  461. inline ULong ValidateConnectionRequest ();
  462. private:
  463. LPSTR m_pszCalledAddress;
  464. UINT Encoding_Rules;
  465. PDomain m_pDomain;
  466. PDomain m_pPendingDomain;
  467. ConnectionHandle Connection_Handle;
  468. DomainParameters Domain_Parameters;
  469. PMemory Connect_Response_Memory;
  470. TransportConnection Transport_Connection[MAXIMUM_PRIORITIES];
  471. int Transport_Connection_PDU_Type[MAXIMUM_PRIORITIES];
  472. TransportConnectionState
  473. Transport_Connection_State[MAXIMUM_PRIORITIES];
  474. UINT Transport_Connection_Count;
  475. CSimplePktQueue m_OutPktQueue[MAXIMUM_PRIORITIES];
  476. Reason Deletion_Reason;
  477. BOOL Upward_Connection;
  478. BOOL m_fSecure;
  479. BOOL Merge_In_Progress;
  480. BOOL Domain_Traffic_Allowed;
  481. BOOL Connect_Provider_Confirm_Pending;
  482. };
  483. /*
  484. * ULong ProcessMergeChannelsRequest()
  485. *
  486. * Private
  487. *
  488. * Functional Description:
  489. * This routine processes the "MergeChannelsRequest" PDU's being received
  490. * through the transport interface. The pertinent data is read from the
  491. * incoming packet and passed on to the domain.
  492. *
  493. * Caveats:
  494. * None.
  495. */
  496. inline ULong Connection::ProcessMergeChannelsRequest (
  497. PMergeChannelsRequestPDU pdu_structure)
  498. {
  499. PChannelAttributes channel_attributes;
  500. PSetOfChannelIDs channel_ids;
  501. PSetOfUserIDs user_ids;
  502. CUidList admitted_list;
  503. CChannelAttributesList merge_channel_list;
  504. CChannelIDList purge_channel_list;
  505. PSetOfPDUChannelAttributes merge_channels;
  506. BOOL first_set = TRUE;
  507. /*
  508. * Retrieve values from the decoded PDU structure and fill in the
  509. * parameters lists to be passed into the domain.
  510. */
  511. merge_channels = pdu_structure->merge_channels;
  512. while (merge_channels != NULL)
  513. {
  514. DBG_SAVE_FILE_LINE
  515. channel_attributes = new ChannelAttributes;
  516. /*
  517. * Check to make to sure the memory allocation has succeeded. If
  518. * the memory allocation fails we just return an error code which
  519. * results in the PDU being rejected so that it may be tried again
  520. * at a later time. If subsequent allocations fail, we must first
  521. * free the memory for the successful allocations and then return.
  522. */
  523. if (channel_attributes == NULL)
  524. {
  525. if (first_set)
  526. return (TRANSPORT_READ_QUEUE_FULL);
  527. else
  528. {
  529. while (NULL != (channel_attributes = merge_channel_list.Get()))
  530. {
  531. delete channel_attributes;
  532. }
  533. return (TRANSPORT_READ_QUEUE_FULL);
  534. }
  535. }
  536. switch (merge_channels->value.choice)
  537. {
  538. case CHANNEL_ATTRIBUTES_STATIC_CHOSEN:
  539. channel_attributes->channel_type = STATIC_CHANNEL;
  540. channel_attributes->u.static_channel_attributes.channel_id =
  541. merge_channels->value.u.
  542. channel_attributes_static.channel_id;
  543. break;
  544. case CHANNEL_ATTRIBUTES_USER_ID_CHOSEN:
  545. channel_attributes->channel_type = USER_CHANNEL;
  546. channel_attributes->u.user_channel_attributes.joined =
  547. merge_channels->value.u.
  548. channel_attributes_user_id.joined;
  549. channel_attributes->u.user_channel_attributes.user_id =
  550. (UShort)merge_channels->value.u.
  551. channel_attributes_user_id.user_id;
  552. break;
  553. case CHANNEL_ATTRIBUTES_PRIVATE_CHOSEN:
  554. channel_attributes->channel_type = PRIVATE_CHANNEL;
  555. user_ids = merge_channels->value.u.
  556. channel_attributes_private.admitted;
  557. channel_attributes->u.private_channel_attributes.joined =
  558. merge_channels->value.u.
  559. channel_attributes_private.joined;
  560. channel_attributes->u.private_channel_attributes.channel_id=
  561. (UShort)merge_channels->value.u.
  562. channel_attributes_private.channel_id;
  563. channel_attributes->u.private_channel_attributes.
  564. channel_manager = (UShort)merge_channels->
  565. value.u.channel_attributes_private.manager;
  566. /*
  567. * Retrieve all of the user ID's from the PDU structure and
  568. * put them into the list to be passed into the domain.
  569. */
  570. while (user_ids != NULL)
  571. {
  572. admitted_list.Append(user_ids->value);
  573. user_ids = user_ids->next;
  574. }
  575. channel_attributes->u.private_channel_attributes.
  576. admitted_list = &admitted_list;
  577. break;
  578. case CHANNEL_ATTRIBUTES_ASSIGNED_CHOSEN:
  579. channel_attributes->channel_type = ASSIGNED_CHANNEL;
  580. channel_attributes->u.assigned_channel_attributes.
  581. channel_id = (UShort)merge_channels->value.u.
  582. channel_attributes_assigned.channel_id;
  583. break;
  584. default:
  585. ERROR_OUT(("Connection::ProcessMergeChannelsRequest "
  586. "Bad channel attributes choice."));
  587. break;
  588. }
  589. /*
  590. * Put the channel attributes structure into the list to be passed
  591. * into the domain. Retrieve the "next" merge channels structure.
  592. */
  593. merge_channel_list.Append(channel_attributes);
  594. merge_channels = merge_channels->next;
  595. }
  596. /*
  597. * Retrieve all of the purge channel ID's from the PDU structure and
  598. * put them into the list to be passed into the domain.
  599. */
  600. channel_ids = pdu_structure->purge_channel_ids;
  601. while (channel_ids != NULL)
  602. {
  603. purge_channel_list.Append(channel_ids->value);
  604. channel_ids = channel_ids->next;
  605. }
  606. m_pDomain->MergeChannelsRequest(this, &merge_channel_list, &purge_channel_list);
  607. /*
  608. * Free any memory which was allocated for the channel attributes
  609. * structures by setting up an iterator for the list of channel
  610. * attributes and freeing the memory associated with each pointer.
  611. */
  612. while (NULL != (channel_attributes = merge_channel_list.Get()))
  613. {
  614. delete channel_attributes;
  615. }
  616. return (TRANSPORT_NO_ERROR);
  617. }
  618. /*
  619. * ULong ProcessMergeChannelsConfirm()
  620. *
  621. * Private
  622. *
  623. * Functional Description:
  624. * This routine processes the "MergeChannelsConfirm" PDU's being received
  625. * through the transport interface. The pertinent data is read from the
  626. * incoming packet and passed on to the domain.
  627. *
  628. * Caveats:
  629. * None.
  630. */
  631. inline ULong Connection::ProcessMergeChannelsConfirm (
  632. PMergeChannelsConfirmPDU pdu_structure)
  633. {
  634. PChannelAttributes channel_attributes;
  635. PSetOfChannelIDs channel_ids;
  636. PSetOfUserIDs user_ids;
  637. CUidList admitted_list;
  638. CChannelAttributesList merge_channel_list;
  639. CChannelIDList purge_channel_list;
  640. PSetOfPDUChannelAttributes merge_channels;
  641. BOOL first_set = TRUE;
  642. /*
  643. * Retrieve values from the decoded PDU structure and fill in the
  644. * parameters lists to be passed into the domain.
  645. */
  646. merge_channels = pdu_structure->merge_channels;
  647. while (merge_channels != NULL)
  648. {
  649. DBG_SAVE_FILE_LINE
  650. channel_attributes = new ChannelAttributes;
  651. /*
  652. * Check to make to sure the memory allocation has succeeded. If
  653. * the memory allocation fails we just return an error code which
  654. * results in the PDU being rejected so that it may be tried again
  655. * at a later time. If subsequent allocations fail, we must first
  656. * free the memory for the successful allocations and then return.
  657. */
  658. if (channel_attributes == NULL)
  659. {
  660. if (first_set)
  661. return (TRANSPORT_READ_QUEUE_FULL);
  662. else
  663. {
  664. while (NULL != (channel_attributes = merge_channel_list.Get()))
  665. {
  666. delete channel_attributes;
  667. }
  668. return (TRANSPORT_READ_QUEUE_FULL);
  669. }
  670. }
  671. switch (merge_channels->value.choice)
  672. {
  673. case CHANNEL_ATTRIBUTES_STATIC_CHOSEN:
  674. channel_attributes->channel_type = STATIC_CHANNEL;
  675. channel_attributes->u.static_channel_attributes.channel_id =
  676. merge_channels->value.u.
  677. channel_attributes_static.channel_id;
  678. break;
  679. case CHANNEL_ATTRIBUTES_USER_ID_CHOSEN:
  680. channel_attributes->channel_type = USER_CHANNEL;
  681. channel_attributes->u.user_channel_attributes.joined =
  682. merge_channels->value.u.
  683. channel_attributes_user_id.joined;
  684. channel_attributes->u.user_channel_attributes.user_id =
  685. (UShort)merge_channels->value.u.
  686. channel_attributes_user_id.user_id;
  687. break;
  688. case CHANNEL_ATTRIBUTES_PRIVATE_CHOSEN:
  689. channel_attributes->channel_type = PRIVATE_CHANNEL;
  690. user_ids = merge_channels->value.u.
  691. channel_attributes_private.admitted;
  692. channel_attributes->u.private_channel_attributes.joined =
  693. merge_channels->value.u.
  694. channel_attributes_private.joined;
  695. channel_attributes->u.private_channel_attributes.channel_id=
  696. (UShort)merge_channels->value.u.
  697. channel_attributes_private.channel_id;
  698. channel_attributes->u.private_channel_attributes.
  699. channel_manager = (UShort)merge_channels->
  700. value.u.channel_attributes_private.manager;
  701. /*
  702. * Retrieve all of the user ID's from the PDU structure and
  703. * put them into the list to be passed into the domain.
  704. */
  705. while (user_ids != NULL)
  706. {
  707. admitted_list.Append(user_ids->value);
  708. user_ids = user_ids->next;
  709. }
  710. channel_attributes->u.private_channel_attributes.
  711. admitted_list = &admitted_list;
  712. break;
  713. case CHANNEL_ATTRIBUTES_ASSIGNED_CHOSEN:
  714. channel_attributes->channel_type = ASSIGNED_CHANNEL;
  715. channel_attributes->u.assigned_channel_attributes.
  716. channel_id = (UShort)merge_channels->value.u.
  717. channel_attributes_assigned.channel_id;
  718. break;
  719. default:
  720. ERROR_OUT(("Connection::ProcessMergeChannelsConfirm "
  721. "Bad channel attributes choice."));
  722. break;
  723. }
  724. /*
  725. * Put the channel attributes structure into the list to be passed
  726. * into the domain. Retrieve the "next" merge channels structure.
  727. */
  728. merge_channel_list.Append(channel_attributes);
  729. merge_channels = merge_channels->next;
  730. }
  731. /*
  732. * Retrieve all of the purge channel ID's from the PDU structure and
  733. * put them into the list to be passed into the domain.
  734. */
  735. channel_ids = pdu_structure->purge_channel_ids;
  736. while (channel_ids != NULL)
  737. {
  738. purge_channel_list.Append(channel_ids->value);
  739. channel_ids = channel_ids->next;
  740. }
  741. m_pDomain->MergeChannelsConfirm(this, &merge_channel_list, &purge_channel_list);
  742. /*
  743. * Free any memory which was allocated for the channel attributes
  744. * structures by setting up an iterator for the list of channel
  745. * attributes and freeing the memory associated with each pointer.
  746. */
  747. while (NULL != (channel_attributes = merge_channel_list.Get()))
  748. {
  749. delete channel_attributes;
  750. }
  751. return (TRANSPORT_NO_ERROR);
  752. }
  753. /*
  754. * Void ProcessPurgeChannelIndication()
  755. *
  756. * Private
  757. *
  758. * Functional Description:
  759. * This routine processes the "PurgeChannelsIndication" PDU's being
  760. * received through the transport interface. The pertinent data is read
  761. * from the incoming packet and passed on to the domain.
  762. *
  763. * Caveats:
  764. * None.
  765. */
  766. inline Void Connection::ProcessPurgeChannelIndication (
  767. PPurgeChannelIndicationPDU pdu_structure)
  768. {
  769. CUidList purge_user_list;
  770. CChannelIDList purge_channel_list;
  771. PSetOfChannelIDs channel_ids;
  772. PSetOfUserIDs user_ids;
  773. /*
  774. * Retrieve all of the purge user ID's from the PDU structure and put
  775. * them into the list to be passed into the domain.
  776. */
  777. user_ids = pdu_structure->detach_user_ids;
  778. while (user_ids != NULL)
  779. {
  780. purge_user_list.Append(user_ids->value);
  781. user_ids = user_ids->next;
  782. }
  783. /*
  784. * Retrieve all of the purge channel ID's from the PDU structure and
  785. * put them into the list to be passed into the domain.
  786. */
  787. channel_ids = pdu_structure->purge_channel_ids;
  788. while (channel_ids != NULL)
  789. {
  790. purge_channel_list.Append(channel_ids->value);
  791. channel_ids = channel_ids->next;
  792. }
  793. m_pDomain->PurgeChannelsIndication(this, &purge_user_list, &purge_channel_list);
  794. }
  795. /*
  796. * ULong ProcessMergeTokensRequest()
  797. *
  798. * Private
  799. *
  800. * Functional Description:
  801. * This routine processes the "MergeTokenRequest" PDU's being received
  802. * through the transport interface. The pertinent data is read from the
  803. * incoming packet and passed on to the domain.
  804. *
  805. * Caveats:
  806. * None.
  807. */
  808. inline ULong Connection::ProcessMergeTokensRequest (
  809. PMergeTokensRequestPDU pdu_structure)
  810. {
  811. PTokenAttributes token_attributes;
  812. PSetOfTokenIDs token_ids;
  813. PSetOfUserIDs user_ids;
  814. CUidList inhibited_list;
  815. CTokenAttributesList merge_token_list;
  816. CTokenIDList purge_token_list;
  817. PSetOfPDUTokenAttributes merge_tokens;
  818. BOOL first_set = TRUE;
  819. /*
  820. * Retrieve values from the decoded PDU structure and fill in the
  821. * parameters lists to be passed into the domain.
  822. */
  823. merge_tokens = pdu_structure->merge_tokens;
  824. while (merge_tokens != NULL)
  825. {
  826. DBG_SAVE_FILE_LINE
  827. token_attributes = new TokenAttributes;
  828. /*
  829. * Check to make to sure the memory allocation has succeeded. If
  830. * the memory allocation fails we just return an error code which
  831. * results in the PDU being rejected so that it may be tried again
  832. * at a later time. If subsequent allocations fail, we must first
  833. * free the memory for the successful allocations and then return.
  834. */
  835. if (token_attributes == NULL)
  836. {
  837. if (first_set)
  838. return (TRANSPORT_READ_QUEUE_FULL);
  839. else
  840. {
  841. while (NULL != (token_attributes = merge_token_list.Get()))
  842. {
  843. delete token_attributes;
  844. }
  845. return (TRANSPORT_READ_QUEUE_FULL);
  846. }
  847. }
  848. switch (merge_tokens->value.choice)
  849. {
  850. case GRABBED_CHOSEN:
  851. token_attributes->token_state = TOKEN_GRABBED;
  852. token_attributes->u.grabbed_token_attributes.token_id =
  853. (UShort)merge_tokens->value.u.
  854. grabbed.token_id;
  855. token_attributes->u.grabbed_token_attributes.grabber =
  856. (UShort)merge_tokens->
  857. value.u.grabbed.grabber;
  858. break;
  859. case INHIBITED_CHOSEN:
  860. token_attributes->token_state = TOKEN_INHIBITED;
  861. user_ids = merge_tokens->value.u.
  862. inhibited.inhibitors;
  863. token_attributes->u.inhibited_token_attributes.token_id =
  864. (UShort)merge_tokens->
  865. value.u.inhibited.token_id;
  866. /*
  867. * Retrieve all of the user ID's from the PDU structure and
  868. * put them into the list to be passed into the domain.
  869. */
  870. while (user_ids != NULL)
  871. {
  872. inhibited_list.Append(user_ids->value);
  873. user_ids= user_ids->next;
  874. }
  875. token_attributes->u.inhibited_token_attributes.
  876. inhibitors = &inhibited_list;
  877. break;
  878. case GIVING_CHOSEN:
  879. token_attributes->token_state = TOKEN_GIVING;
  880. token_attributes->u.giving_token_attributes.token_id =
  881. (UShort)merge_tokens->
  882. value.u.giving.token_id;
  883. token_attributes->u.giving_token_attributes.grabber =
  884. (UShort)merge_tokens->
  885. value.u.giving.grabber;
  886. token_attributes->u.giving_token_attributes.recipient =
  887. (UShort)merge_tokens->value.u.giving.
  888. recipient;
  889. break;
  890. case GIVEN_CHOSEN:
  891. token_attributes->token_state = TOKEN_GIVEN;
  892. token_attributes->u.given_token_attributes.token_id =
  893. (UShort)merge_tokens->
  894. value.u.given.token_id;
  895. token_attributes->u.given_token_attributes.recipient =
  896. (UShort)merge_tokens->
  897. value.u.given.recipient;
  898. break;
  899. default:
  900. ERROR_OUT(("Connection::ProcessMergeTokensRequest "
  901. "Bad token attributes choice."));
  902. break;
  903. }
  904. /*
  905. * Put the token attributes structure into the list to be passed
  906. * into the domain. We are only doing one channel attributes
  907. * structures at a time for now.
  908. */
  909. merge_token_list.Append(token_attributes);
  910. merge_tokens = merge_tokens->next;
  911. }
  912. /*
  913. * Retrieve all of the purge token ID's from the PDU structure and put
  914. * them into the list to be passed into the domain.
  915. */
  916. token_ids = pdu_structure->purge_token_ids;
  917. while (token_ids != NULL)
  918. {
  919. purge_token_list.Append(token_ids->value);
  920. token_ids = token_ids->next;
  921. }
  922. m_pDomain->MergeTokensRequest(this, &merge_token_list, &purge_token_list);
  923. /*
  924. * Free any memory which was allocated for the token attributes
  925. * structures by setting up an iterator for the list of token
  926. * attributes and freeing the memory associated with each pointer.
  927. */
  928. while (NULL != (token_attributes = merge_token_list.Get()))
  929. {
  930. delete token_attributes;
  931. }
  932. return (TRANSPORT_NO_ERROR);
  933. }
  934. /*
  935. * ULong ProcessMergeTokensConfirm()
  936. *
  937. * Private
  938. *
  939. * Functional Description:
  940. * This routine processes the "MergeTokenConfirm" PDU's being received
  941. * through the transport interface. The pertinent data is read from the
  942. * incoming packet and passed on to the domain.
  943. *
  944. * Caveats:
  945. * None.
  946. */
  947. inline ULong Connection::ProcessMergeTokensConfirm (
  948. PMergeTokensConfirmPDU pdu_structure)
  949. {
  950. PTokenAttributes token_attributes;
  951. PSetOfTokenIDs token_ids;
  952. PSetOfUserIDs user_ids;
  953. CUidList inhibited_list;
  954. CTokenAttributesList merge_token_list;
  955. CTokenIDList purge_token_list;
  956. PSetOfPDUTokenAttributes merge_tokens;
  957. BOOL first_set = TRUE;
  958. /*
  959. * Retrieve values from the decoded PDU structure and fill in the
  960. * parameters lists to be passed into the domain.
  961. */
  962. merge_tokens = pdu_structure->merge_tokens;
  963. while (merge_tokens != NULL)
  964. {
  965. DBG_SAVE_FILE_LINE
  966. token_attributes = new TokenAttributes;
  967. /*
  968. * Check to make to sure the memory allocation has succeeded. If
  969. * the memory allocation fails we just return an error code which
  970. * results in the PDU being rejected so that it may be tried again
  971. * at a later time. If subsequent allocations fail, we must first
  972. * free the memory for the successful allocations and then return.
  973. */
  974. if (token_attributes == NULL)
  975. {
  976. if (first_set)
  977. return (TRANSPORT_READ_QUEUE_FULL);
  978. else
  979. {
  980. while (NULL != (token_attributes = merge_token_list.Get()))
  981. {
  982. delete token_attributes;
  983. }
  984. return (TRANSPORT_READ_QUEUE_FULL);
  985. }
  986. }
  987. switch (merge_tokens->value.choice)
  988. {
  989. case GRABBED_CHOSEN:
  990. token_attributes->token_state = TOKEN_GRABBED;
  991. token_attributes->u.grabbed_token_attributes.token_id =
  992. (UShort)merge_tokens->value.u.
  993. grabbed.token_id;
  994. token_attributes->u.grabbed_token_attributes.grabber =
  995. (UShort)merge_tokens->
  996. value.u.grabbed.grabber;
  997. break;
  998. case INHIBITED_CHOSEN:
  999. token_attributes->token_state = TOKEN_INHIBITED;
  1000. user_ids = merge_tokens->value.u.
  1001. inhibited.inhibitors;
  1002. token_attributes->u.inhibited_token_attributes.token_id =
  1003. (UShort)merge_tokens->
  1004. value.u.inhibited.token_id;
  1005. /*
  1006. * Retrieve all of the user ID's from the PDU structure and
  1007. * put them into the list to be passed into the domain.
  1008. */
  1009. while (user_ids != NULL)
  1010. {
  1011. inhibited_list.Append(user_ids->value);
  1012. user_ids = user_ids->next;
  1013. }
  1014. token_attributes->u.inhibited_token_attributes.
  1015. inhibitors = &inhibited_list;
  1016. break;
  1017. case GIVING_CHOSEN:
  1018. token_attributes->token_state = TOKEN_GIVING;
  1019. token_attributes->u.giving_token_attributes.token_id =
  1020. (UShort)merge_tokens->
  1021. value.u.giving.token_id;
  1022. token_attributes->u.giving_token_attributes.grabber =
  1023. (UShort)merge_tokens->
  1024. value.u.giving.grabber;
  1025. token_attributes->u.giving_token_attributes.recipient =
  1026. (UShort)merge_tokens->value.u.giving.
  1027. recipient;
  1028. break;
  1029. case GIVEN_CHOSEN:
  1030. token_attributes->token_state = TOKEN_GIVEN;
  1031. token_attributes->u.given_token_attributes.token_id =
  1032. (UShort)merge_tokens->
  1033. value.u.given.token_id;
  1034. token_attributes->u.given_token_attributes.recipient =
  1035. (UShort)merge_tokens->
  1036. value.u.given.recipient;
  1037. break;
  1038. default:
  1039. ERROR_OUT(("Connection::ProcessMergeTokensConfirm "
  1040. "Bad token attributes choice."));
  1041. break;
  1042. }
  1043. /*
  1044. * Put the token attributes structure into the list to be passed
  1045. * into the domain. We are only doing one channel attributes
  1046. * structures at a time for now.
  1047. */
  1048. merge_token_list.Append(token_attributes);
  1049. merge_tokens = merge_tokens->next;
  1050. }
  1051. /*
  1052. * Retrieve all of the purge token ID's from the PDU structure and put
  1053. * them into the list to be passed into the domain.
  1054. */
  1055. token_ids = pdu_structure->purge_token_ids;
  1056. while (token_ids != NULL)
  1057. {
  1058. purge_token_list.Append(token_ids->value);
  1059. token_ids = token_ids->next;
  1060. }
  1061. m_pDomain->MergeTokensConfirm(this, &merge_token_list, &purge_token_list);
  1062. /*
  1063. * Free any memory which was allocated for the token attributes
  1064. * structures by setting up an iterator for the list of token
  1065. * attributes and freeing the memory associated with each pointer.
  1066. */
  1067. while (NULL != (token_attributes = merge_token_list.Get()))
  1068. {
  1069. delete token_attributes;
  1070. }
  1071. return (TRANSPORT_NO_ERROR);
  1072. }
  1073. /*
  1074. * Void ProcessPurgeTokenIndication()
  1075. *
  1076. * Private
  1077. *
  1078. * Functional Description:
  1079. * This routine processes the "PurgeTokenIndication" PDU's being received
  1080. * through the transport interface. The pertinent data is read from the
  1081. * incoming packet and passed on to the domain.
  1082. *
  1083. * Caveats:
  1084. * None.
  1085. */
  1086. inline Void Connection::ProcessPurgeTokenIndication (
  1087. PPurgeTokenIndicationPDU pdu_structure)
  1088. {
  1089. PSetOfTokenIDs token_ids;
  1090. CTokenIDList purge_token_list;
  1091. /*
  1092. * Retrieve all of the purge token ID's from the PDU structure and put
  1093. * them into the list to be passed into the domain.
  1094. */
  1095. token_ids = pdu_structure->purge_token_ids;
  1096. while (token_ids != NULL)
  1097. {
  1098. purge_token_list.Append(token_ids->value);
  1099. token_ids = token_ids->next;
  1100. }
  1101. m_pDomain->PurgeTokensIndication(this, &purge_token_list);
  1102. }
  1103. /*
  1104. * Void ProcessDisconnectProviderUltimatum()
  1105. *
  1106. * Private
  1107. *
  1108. * Functional Description:
  1109. * This routine processes the "DisconnectProviderUltimatum" PDU's being
  1110. * received through the transport interface. The pertinent data is read
  1111. * from the incoming packet and passed on to the domain.
  1112. *
  1113. * Caveats:
  1114. * None.
  1115. */
  1116. inline Void Connection::ProcessDisconnectProviderUltimatum (
  1117. PDisconnectProviderUltimatumPDU pdu_structure)
  1118. {
  1119. TRACE_OUT(("Connection::ProcessDisconnectProviderUltimatum: PDU received"));
  1120. m_pDomain->DisconnectProviderUltimatum(this, (Reason)pdu_structure->reason);
  1121. m_pDomain = NULL;
  1122. }
  1123. /*
  1124. * Void ProcessAttachUserRequest()
  1125. *
  1126. * Private
  1127. *
  1128. * Functional Description:
  1129. * This routine processes the "AttachUserRequest" PDU's being received
  1130. * through the transport interface by forwarding the request on to the
  1131. * domain.
  1132. *
  1133. * Caveats:
  1134. * None.
  1135. */
  1136. inline Void Connection::ProcessAttachUserRequest (PAttachUserRequestPDU)
  1137. {
  1138. m_pDomain->AttachUserRequest(this);
  1139. }
  1140. /*
  1141. * Void ProcessAttachUserConfirm()
  1142. *
  1143. * Private
  1144. *
  1145. * Functional Description:
  1146. * This routine processes the "AttachUserConfirm" PDU's being received
  1147. * through the transport interface. The pertinent data is read from the
  1148. * incoming packet and passed on to the domain.
  1149. *
  1150. * Caveats:
  1151. * None.
  1152. */
  1153. inline Void Connection::ProcessAttachUserConfirm (
  1154. PAttachUserConfirmPDU pdu_structure)
  1155. {
  1156. m_pDomain->AttachUserConfirm(this, (Result) pdu_structure->result,
  1157. (UserID) pdu_structure->initiator);
  1158. }
  1159. /*
  1160. * Void ProcessDetachUserRequest()
  1161. *
  1162. * Private
  1163. *
  1164. * Functional Description:
  1165. * This routine processes the "DetachUserRequest" PDU's being received
  1166. * through the transport interface. The pertinent data is read from the
  1167. * incoming packet and passed on to the domain.
  1168. *
  1169. * Caveats:
  1170. * None.
  1171. */
  1172. inline Void Connection::ProcessDetachUserRequest (
  1173. PDetachUserRequestPDU pdu_structure)
  1174. {
  1175. PSetOfUserIDs user_ids;
  1176. CUidList user_id_list;
  1177. /*
  1178. * Retrieve the user ID's from the PDU structure and put them into the
  1179. * list to be passed into the domain.
  1180. */
  1181. user_ids = pdu_structure->user_ids;
  1182. while (user_ids != NULL)
  1183. {
  1184. user_id_list.Append(user_ids->value);
  1185. user_ids = user_ids->next;
  1186. }
  1187. m_pDomain->DetachUserRequest(this, (Reason) pdu_structure->reason, &user_id_list);
  1188. }
  1189. /*
  1190. * Void ProcessDetachUserIndication()
  1191. *
  1192. * Private
  1193. *
  1194. * Functional Description:
  1195. * This routine processes the "DetachUserIndication" PDU's being received
  1196. * through the transport interface. The pertinent data is read from the
  1197. * incoming packet and passed on to the domain.
  1198. *
  1199. * Caveats:
  1200. * None.
  1201. */
  1202. inline Void Connection::ProcessDetachUserIndication (
  1203. PDetachUserIndicationPDU pdu_structure)
  1204. {
  1205. PSetOfUserIDs user_ids;
  1206. CUidList user_id_list;
  1207. /*
  1208. * Retrieve the user ID's from the PDU structure and put them into the
  1209. * list to be passed into the domain.
  1210. */
  1211. user_ids = pdu_structure->user_ids;
  1212. while (user_ids != NULL)
  1213. {
  1214. user_id_list.Append(user_ids->value);
  1215. user_ids = user_ids->next;
  1216. }
  1217. m_pDomain->DetachUserIndication(this, (Reason) pdu_structure->reason,
  1218. &user_id_list);
  1219. }
  1220. /*
  1221. * Void ProcessChannelJoinRequest()
  1222. *
  1223. * Private
  1224. *
  1225. * Functional Description:
  1226. * This routine processes the "ChannelJoinRequest" PDU's being received
  1227. * through the transport interface. The pertinent data is read from the
  1228. * incoming packet and passed on to the domain.
  1229. *
  1230. * Caveats:
  1231. * None.
  1232. */
  1233. inline Void Connection::ProcessChannelJoinRequest (
  1234. PChannelJoinRequestPDU pdu_structure)
  1235. {
  1236. m_pDomain->ChannelJoinRequest(this, (UserID) pdu_structure->initiator,
  1237. (ChannelID) pdu_structure->channel_id);
  1238. }
  1239. /*
  1240. * Void ProcessChannelJoinConfirm()
  1241. *
  1242. * Private
  1243. *
  1244. * Functional Description:
  1245. * This routine processes the "ChannelJoinConfirm" PDU's being received
  1246. * through the transport interface. The pertinent data is read from the
  1247. * incoming packet and passed on to the domain.
  1248. *
  1249. * Caveats:
  1250. * None.
  1251. */
  1252. inline Void Connection::ProcessChannelJoinConfirm (
  1253. PChannelJoinConfirmPDU pdu_structure)
  1254. {
  1255. m_pDomain->ChannelJoinConfirm(this, (Result) pdu_structure->result,
  1256. (UserID) pdu_structure->initiator,
  1257. (ChannelID) pdu_structure->requested,
  1258. (ChannelID) pdu_structure->join_channel_id);
  1259. }
  1260. /*
  1261. * Void ProcessChannelLeaveRequest()
  1262. *
  1263. * Private
  1264. *
  1265. * Functional Description:
  1266. * This routine processes the "ChannelLeaveRequest" PDU's being received
  1267. * through the transport interface. The pertinent data is read from the
  1268. * incoming packet and passed on to the domain.
  1269. *
  1270. * Caveats:
  1271. * None.
  1272. */
  1273. inline Void Connection::ProcessChannelLeaveRequest (
  1274. PChannelLeaveRequestPDU pdu_structure)
  1275. {
  1276. PSetOfChannelIDs channel_ids;
  1277. CChannelIDList channel_id_list;
  1278. /*
  1279. * Retrieve the channel ID's from the PDU structure and put them into
  1280. * the list to be passed into the domain.
  1281. */
  1282. channel_ids = pdu_structure->channel_ids;
  1283. while (channel_ids != NULL)
  1284. {
  1285. channel_id_list.Append(channel_ids->value);
  1286. channel_ids = channel_ids->next;
  1287. }
  1288. m_pDomain->ChannelLeaveRequest(this, &channel_id_list);
  1289. }
  1290. /*
  1291. * Void ProcessChannelConveneRequest()
  1292. *
  1293. * Private
  1294. *
  1295. * Functional Description:
  1296. * This routine processes the "ChannelConveneRequest" PDU's being received
  1297. * through the transport interface. The pertinent data is read from the
  1298. * incoming packet and passed on to the domain.
  1299. *
  1300. * Caveats:
  1301. * None.
  1302. */
  1303. inline Void Connection::ProcessChannelConveneRequest (
  1304. PChannelConveneRequestPDU pdu_structure)
  1305. {
  1306. m_pDomain->ChannelConveneRequest(this, (UserID) pdu_structure->initiator);
  1307. }
  1308. /*
  1309. * Void ProcessChannelConveneConfirm ()
  1310. *
  1311. * Private
  1312. *
  1313. * Functional Description:
  1314. * This routine processes the "ChannelConveneConfirm" PDU's being received
  1315. * through the transport interface. The pertinent data is read from the
  1316. * incoming packet and passed on to the domain.
  1317. *
  1318. * Caveats:
  1319. * None.
  1320. */
  1321. inline Void Connection::ProcessChannelConveneConfirm (
  1322. PChannelConveneConfirmPDU pdu_structure)
  1323. {
  1324. m_pDomain->ChannelConveneConfirm(this, (Result) pdu_structure->result,
  1325. (UserID) pdu_structure->initiator,
  1326. (ChannelID) pdu_structure->convene_channel_id);
  1327. }
  1328. /*
  1329. * Void ProcessChannelDisbandRequest ()
  1330. *
  1331. * Private
  1332. *
  1333. * Functional Description:
  1334. * This routine processes the "ChannelDisbandRequest" PDU's being received
  1335. * through the transport interface. The pertinent data is read from the
  1336. * incoming packet and passed on to the domain.
  1337. *
  1338. * Caveats:
  1339. * None.
  1340. */
  1341. inline Void Connection::ProcessChannelDisbandRequest (
  1342. PChannelDisbandRequestPDU pdu_structure)
  1343. {
  1344. m_pDomain->ChannelDisbandRequest(this, (UserID) pdu_structure->initiator,
  1345. (ChannelID) pdu_structure->channel_id);
  1346. }
  1347. /*
  1348. * Void ProcessChannelDisbandIndication ()
  1349. *
  1350. * Private
  1351. *
  1352. * Functional Description:
  1353. * This routine processes the "ChannelDisbandIndication" PDU's being
  1354. * received through the transport interface. The pertinent data is read
  1355. * from the incoming packet and passed on to the domain.
  1356. *
  1357. * Caveats:
  1358. * None.
  1359. */
  1360. inline Void Connection::ProcessChannelDisbandIndication (
  1361. PChannelDisbandIndicationPDU pdu_structure)
  1362. {
  1363. m_pDomain->ChannelDisbandIndication(this, (ChannelID) pdu_structure->channel_id);
  1364. }
  1365. /*
  1366. * Void ProcessChannelAdmitRequest ()
  1367. *
  1368. * Private
  1369. *
  1370. * Functional Description:
  1371. * This routine processes the "ChannelAdmitRequest" PDU's being received
  1372. * through the transport interface. The pertinent data is read from the
  1373. * incoming packet and passed on to the domain.
  1374. *
  1375. * Caveats:
  1376. * None.
  1377. */
  1378. inline Void Connection::ProcessChannelAdmitRequest (
  1379. PChannelAdmitRequestPDU pdu_structure)
  1380. {
  1381. PSetOfUserIDs user_ids;
  1382. CUidList user_id_list;
  1383. /*
  1384. * Retrieve the user ID's from the PDU structure and put them into the
  1385. * list to be passed into the domain.
  1386. */
  1387. user_ids = pdu_structure->user_ids;
  1388. while (user_ids != NULL)
  1389. {
  1390. user_id_list.Append(user_ids->value);
  1391. user_ids = user_ids->next;
  1392. }
  1393. m_pDomain->ChannelAdmitRequest(this, (UserID) pdu_structure->initiator,
  1394. (ChannelID) pdu_structure->channel_id,
  1395. &user_id_list);
  1396. }
  1397. /*
  1398. * Void ProcessChannelAdmitIndication ()
  1399. *
  1400. * Private
  1401. *
  1402. * Functional Description:
  1403. * This routine processes the "ChannelAdmitIndication" PDU's being received
  1404. * through the transport interface. The pertinent data is read from the
  1405. * incoming packet and passed on to the domain.
  1406. *
  1407. * Caveats:
  1408. * None.
  1409. */
  1410. inline Void Connection::ProcessChannelAdmitIndication (
  1411. PChannelAdmitIndicationPDU pdu_structure)
  1412. {
  1413. PSetOfUserIDs user_ids;
  1414. CUidList user_id_list;
  1415. /*
  1416. * Retrieve the user ID's from the PDU structure and put them into the
  1417. * list to be passed into the domain.
  1418. */
  1419. user_ids = pdu_structure->user_ids;
  1420. while (user_ids != NULL)
  1421. {
  1422. user_id_list.Append(user_ids->value);
  1423. user_ids = user_ids->next;
  1424. }
  1425. m_pDomain->ChannelAdmitIndication(this, (UserID) pdu_structure->initiator,
  1426. (ChannelID) pdu_structure->channel_id,
  1427. &user_id_list);
  1428. }
  1429. /*
  1430. * Void ProcessChannelExpelRequest ()
  1431. *
  1432. * Private
  1433. *
  1434. * Functional Description:
  1435. * This routine processes the "ChannelExpelRequest" PDU's being received
  1436. * through the transport interface. The pertinent data is read from the
  1437. * incoming packet and passed on to the domain.
  1438. *
  1439. * Caveats:
  1440. * None.
  1441. */
  1442. inline Void Connection::ProcessChannelExpelRequest (
  1443. PChannelExpelRequestPDU pdu_structure)
  1444. {
  1445. PSetOfUserIDs user_ids;
  1446. CUidList user_id_list;
  1447. /*
  1448. * Retrieve the user ID's from the PDU structure and put them into the
  1449. * list to be passed into the domain.
  1450. */
  1451. user_ids = pdu_structure->user_ids;
  1452. while (user_ids != NULL)
  1453. {
  1454. user_id_list.Append(user_ids->value);
  1455. user_ids = user_ids->next;
  1456. }
  1457. m_pDomain->ChannelExpelRequest(this, (UserID) pdu_structure->initiator,
  1458. (ChannelID) pdu_structure->channel_id,
  1459. &user_id_list);
  1460. }
  1461. /*
  1462. * Void ProcessChannelExpelIndication ()
  1463. *
  1464. * Private
  1465. *
  1466. * Functional Description:
  1467. * This routine processes the "ChannelExpelIndication" PDU's being received
  1468. * through the transport interface. The pertinent data is read from the
  1469. * incoming packet and passed on to the domain.
  1470. *
  1471. * Caveats:
  1472. * None.
  1473. */
  1474. inline Void Connection::ProcessChannelExpelIndication (
  1475. PChannelExpelIndicationPDU pdu_structure)
  1476. {
  1477. PSetOfUserIDs user_ids;
  1478. CUidList user_id_list;
  1479. /*
  1480. * Retrieve the user ID's from the PDU structure and put them into the
  1481. * list to be passed into the domain.
  1482. */
  1483. user_ids = pdu_structure->user_ids;
  1484. while (user_ids != NULL)
  1485. {
  1486. user_id_list.Append(user_ids->value);
  1487. user_ids = user_ids->next;
  1488. }
  1489. m_pDomain->ChannelExpelIndication(this, (ChannelID) pdu_structure->channel_id,
  1490. &user_id_list);
  1491. }
  1492. /*
  1493. * Void ProcessSendDataRequest()
  1494. *
  1495. * Private
  1496. *
  1497. * Functional Description:
  1498. * This routine processes the "SendDataRequest" PDU's being received
  1499. * through the transport interface. The pertinent data is read from the
  1500. * incoming packet and passed on to the domain.
  1501. *
  1502. * Caveats:
  1503. * None.
  1504. */
  1505. inline Void Connection::ProcessSendDataRequest (
  1506. PSendDataRequestPDU pdu_structure,
  1507. PDataPacket packet)
  1508. {
  1509. m_pDomain->SendDataRequest(this, MCS_SEND_DATA_INDICATION, packet);
  1510. }
  1511. /*
  1512. * Void ProcessSendDataIndication()
  1513. *
  1514. * Private
  1515. *
  1516. * Functional Description:
  1517. * This routine processes the "SendDataIndication" PDU's being received
  1518. * through the transport interface. The pertinent data is read from the
  1519. * incoming packet and passed on to the domain.
  1520. *
  1521. * Caveats:
  1522. * None.
  1523. */
  1524. inline Void Connection::ProcessSendDataIndication (
  1525. PSendDataIndicationPDU pdu_structure,
  1526. PDataPacket data_packet)
  1527. {
  1528. m_pDomain->SendDataIndication(this, MCS_SEND_DATA_INDICATION, data_packet);
  1529. }
  1530. /*
  1531. * Void ProcessUniformSendDataRequest()
  1532. *
  1533. * Private
  1534. *
  1535. * Functional Description:
  1536. * This routine processes the "UniformSendDataRequest" PDU's being received
  1537. * through the transport interface. The pertinent data is read from the
  1538. * incoming packet and passed on to the domain.
  1539. *
  1540. * Caveats:
  1541. * None.
  1542. */
  1543. inline Void Connection::ProcessUniformSendDataRequest (
  1544. PUniformSendDataRequestPDU pdu_structure,
  1545. PDataPacket packet)
  1546. {
  1547. m_pDomain->SendDataRequest(this, MCS_UNIFORM_SEND_DATA_INDICATION, packet);
  1548. }
  1549. /*
  1550. * Void ProcessUniformSendDataIndication()
  1551. *
  1552. * Private
  1553. *
  1554. * Functional Description:
  1555. * This routine processes the "UniformSendDataIndication" PDU's being
  1556. * received through the transport interface. The pertinent data is read
  1557. * from the incoming packet and passed on to the domain.
  1558. *
  1559. * Caveats:
  1560. * None.
  1561. */
  1562. inline Void Connection::ProcessUniformSendDataIndication (
  1563. PUniformSendDataIndicationPDU pdu_structure,
  1564. PDataPacket data_packet)
  1565. {
  1566. m_pDomain->SendDataIndication(this, MCS_UNIFORM_SEND_DATA_INDICATION, data_packet);
  1567. }
  1568. /*
  1569. * Void ProcessTokenGrabRequest()
  1570. *
  1571. * Private
  1572. *
  1573. * Functional Description:
  1574. * This routine processes the "TokenGrabRequest" PDU's being received
  1575. * through the transport interface. The pertinent data is read from the
  1576. * incoming packet and passed on to the domain.
  1577. *
  1578. * Caveats:
  1579. * None.
  1580. */
  1581. inline Void Connection::ProcessTokenGrabRequest (
  1582. PTokenGrabRequestPDU pdu_structure)
  1583. {
  1584. m_pDomain->TokenGrabRequest(this, (UserID) pdu_structure->initiator,
  1585. (TokenID) pdu_structure->token_id);
  1586. }
  1587. /*
  1588. * Void ProcessTokenGrabConfirm()
  1589. *
  1590. * Private
  1591. *
  1592. * Functional Description:
  1593. * This routine processes the "TokenGrabConfirm" PDU's being received
  1594. * through the transport interface. The pertinent data is read from the
  1595. * incoming packet and passed on to the domain.
  1596. *
  1597. * Caveats:
  1598. * None.
  1599. */
  1600. inline Void Connection::ProcessTokenGrabConfirm (
  1601. PTokenGrabConfirmPDU pdu_structure)
  1602. {
  1603. m_pDomain->TokenGrabConfirm(this, (Result) pdu_structure->result,
  1604. (UserID) pdu_structure->initiator,
  1605. (TokenID) pdu_structure->token_id,
  1606. (TokenStatus)pdu_structure->token_status);
  1607. }
  1608. /*
  1609. * Void ProcessTokenInhibitRequest()
  1610. *
  1611. * Private
  1612. *
  1613. * Functional Description:
  1614. * This routine processes the "TokenInhibitRequest" PDU's being received
  1615. * through the transport interface. The pertinent data is read from the
  1616. * incoming packet and passed on to the domain.
  1617. *
  1618. * Caveats:
  1619. * None.
  1620. */
  1621. inline Void Connection::ProcessTokenInhibitRequest (
  1622. PTokenInhibitRequestPDU pdu_structure)
  1623. {
  1624. m_pDomain->TokenInhibitRequest(this, (UserID) pdu_structure->initiator,
  1625. (TokenID) pdu_structure->token_id);
  1626. }
  1627. /*
  1628. * Void ProcessTokenInhibitConfirm()
  1629. *
  1630. * Private
  1631. *
  1632. * Functional Description:
  1633. * This routine processes the "TokenInhibitConfirm" PDU's being received
  1634. * through the transport interface. The pertinent data is read from the
  1635. * incoming packet and passed on to the domain.
  1636. *
  1637. * Caveats:
  1638. * None.
  1639. */
  1640. inline Void Connection::ProcessTokenInhibitConfirm (
  1641. PTokenInhibitConfirmPDU pdu_structure)
  1642. {
  1643. m_pDomain->TokenInhibitConfirm(this, (Result) pdu_structure->result,
  1644. (UserID) pdu_structure->initiator,
  1645. (TokenID) pdu_structure->token_id,
  1646. (TokenStatus)pdu_structure->token_status);
  1647. }
  1648. /*
  1649. * Void ProcessTokenReleaseRequest()
  1650. *
  1651. * Private
  1652. *
  1653. * Functional Description:
  1654. * This routine processes the "TokenReleaseRequest" PDU's being received
  1655. * through the transport interface. The pertinent data is read from the
  1656. * incoming packet and passed on to the domain.
  1657. *
  1658. * Caveats:
  1659. * None.
  1660. */
  1661. inline Void Connection::ProcessTokenReleaseRequest (
  1662. PTokenReleaseRequestPDU pdu_structure)
  1663. {
  1664. m_pDomain->TokenReleaseRequest(this, (UserID) pdu_structure->initiator,
  1665. (TokenID) pdu_structure->token_id);
  1666. }
  1667. /*
  1668. * Void ProcessTokenReleaseConfirm()
  1669. *
  1670. * Private
  1671. *
  1672. * Functional Description:
  1673. * This routine processes the "TokenReleaseConfirm" PDU's being received
  1674. * through the transport interface. The pertinent data is read from the
  1675. * incoming packet and passed on to the domain.
  1676. *
  1677. * Caveats:
  1678. * None.
  1679. */
  1680. inline Void Connection::ProcessTokenReleaseConfirm (
  1681. PTokenReleaseConfirmPDU pdu_structure)
  1682. {
  1683. m_pDomain->TokenReleaseConfirm(this, (Result) pdu_structure->result,
  1684. (UserID) pdu_structure->initiator,
  1685. (TokenID) pdu_structure->token_id,
  1686. (TokenStatus)pdu_structure->token_status);
  1687. }
  1688. /*
  1689. * Void ProcessTokenTestRequest()
  1690. *
  1691. * Private
  1692. *
  1693. * Functional Description:
  1694. * This routine processes the "TokenTestRequest" PDU's being received
  1695. * through the transport interface. The pertinent data is read from the
  1696. * incoming packet and passed on to the domain.
  1697. *
  1698. * Caveats:
  1699. * None.
  1700. */
  1701. inline Void Connection::ProcessTokenTestRequest (
  1702. PTokenTestRequestPDU pdu_structure)
  1703. {
  1704. m_pDomain->TokenTestRequest(this, (UserID) pdu_structure->initiator,
  1705. (TokenID) pdu_structure->token_id);
  1706. }
  1707. /*
  1708. * Void ProcessTokenTestConfirm()
  1709. *
  1710. * Private
  1711. *
  1712. * Functional Description:
  1713. * This routine processes the "TokenTestConfirm" PDU's being received
  1714. * through the transport interface. The pertinent data is read from the
  1715. * incoming packet and passed on to the domain.
  1716. *
  1717. * Caveats:
  1718. * None.
  1719. */
  1720. inline Void Connection::ProcessTokenTestConfirm (
  1721. PTokenTestConfirmPDU pdu_structure)
  1722. {
  1723. m_pDomain->TokenTestConfirm(this, (UserID) pdu_structure->initiator,
  1724. (TokenID) pdu_structure->token_id,
  1725. (TokenStatus)pdu_structure->token_status);
  1726. }
  1727. /*
  1728. * Void ProcessRejectUltimatum()
  1729. *
  1730. * Private
  1731. *
  1732. * Functional Description:
  1733. * This routine processes the "RejectUltimatum" PDU's being received
  1734. * through the transport interface. The pertinent data is read from the
  1735. * incoming packet and passed on to the domain.
  1736. *
  1737. * Caveats:
  1738. * None.
  1739. */
  1740. inline Void Connection::ProcessRejectUltimatum (
  1741. PRejectUltimatumPDU pdu_structure)
  1742. {
  1743. m_pDomain->RejectUltimatum(this,
  1744. pdu_structure->diagnostic,
  1745. pdu_structure->initial_octets.value,
  1746. (ULong) pdu_structure->initial_octets.length);
  1747. }
  1748. /*
  1749. * Void ProcessTokenGiveRequest()
  1750. *
  1751. * Private
  1752. *
  1753. * Functional Description:
  1754. * This routine processes the "TokenGiveRequest" PDU's being received
  1755. * through the transport interface. The pertinent data is read from the
  1756. * incoming packet and passed on to the domain.
  1757. *
  1758. * Caveats:
  1759. * None.
  1760. */
  1761. inline Void Connection::ProcessTokenGiveRequest (
  1762. PTokenGiveRequestPDU pdu_structure)
  1763. {
  1764. TokenGiveRecord TokenGiveRec;
  1765. // Fill in the TokenGive record
  1766. TokenGiveRec.uidInitiator = pdu_structure->initiator;
  1767. TokenGiveRec.token_id = pdu_structure->token_id;
  1768. TokenGiveRec.receiver_id = pdu_structure->recipient;
  1769. m_pDomain->TokenGiveRequest(this, &TokenGiveRec);
  1770. }
  1771. /*
  1772. * Void ProcessTokenGiveIndication()
  1773. *
  1774. * Private
  1775. *
  1776. * Functional Description:
  1777. * This routine processes the "TokenGiveIndication" PDU's being received
  1778. * through the transport interface. The pertinent data is read from the
  1779. * incoming packet and passed on to the domain.
  1780. *
  1781. * Caveats:
  1782. * None.
  1783. */
  1784. inline Void Connection::ProcessTokenGiveIndication (
  1785. PTokenGiveIndicationPDU pdu_structure)
  1786. {
  1787. TokenGiveRecord TokenGiveRec;
  1788. // Fill in the TokenGive record
  1789. TokenGiveRec.uidInitiator = pdu_structure->initiator;
  1790. TokenGiveRec.token_id = pdu_structure->token_id;
  1791. TokenGiveRec.receiver_id = pdu_structure->recipient;
  1792. m_pDomain->TokenGiveIndication(this, &TokenGiveRec);
  1793. }
  1794. /*
  1795. * Void ProcessTokenGiveResponse()
  1796. *
  1797. * Private
  1798. *
  1799. * Functional Description:
  1800. * This routine processes the "TokenGiveResponse" PDU's being received
  1801. * through the transport interface. The pertinent data is read from the
  1802. * incoming packet and passed on to the domain.
  1803. *
  1804. * Caveats:
  1805. * None.
  1806. */
  1807. inline Void Connection::ProcessTokenGiveResponse (
  1808. PTokenGiveResponsePDU pdu_structure)
  1809. {
  1810. m_pDomain->TokenGiveResponse(this, (Result) pdu_structure->result,
  1811. (UserID) pdu_structure->recipient,
  1812. (TokenID) pdu_structure->token_id);
  1813. }
  1814. /*
  1815. * Void ProcessTokenGiveConfirm()
  1816. *
  1817. * Private
  1818. *
  1819. * Functional Description:
  1820. * This routine processes the "TokenGiveConfirm" PDU's being received
  1821. * through the transport interface. The pertinent data is read from the
  1822. * incoming packet and passed on to the domain.
  1823. *
  1824. * Caveats:
  1825. * None.
  1826. */
  1827. inline Void Connection::ProcessTokenGiveConfirm (
  1828. PTokenGiveConfirmPDU pdu_structure)
  1829. {
  1830. m_pDomain->TokenGiveConfirm(this, (Result) pdu_structure->result,
  1831. (UserID) pdu_structure->initiator,
  1832. (TokenID) pdu_structure->token_id,
  1833. (TokenStatus)pdu_structure->token_status);
  1834. }
  1835. /*
  1836. * Void ProcessTokenPleaseRequest()
  1837. *
  1838. * Private
  1839. *
  1840. * Functional Description:
  1841. * This routine processes the "TokenPleaseRequest" PDU's being received
  1842. * through the transport interface. The pertinent data is read from the
  1843. * incoming packet and passed on to the domain.
  1844. *
  1845. * Caveats:
  1846. * None.
  1847. */
  1848. inline Void Connection::ProcessTokenPleaseRequest (
  1849. PTokenPleaseRequestPDU pdu_structure)
  1850. {
  1851. m_pDomain->TokenPleaseRequest(this, (UserID) pdu_structure->initiator,
  1852. (TokenID) pdu_structure->token_id);
  1853. }
  1854. /*
  1855. * Void ProcessTokenPleaseIndication()
  1856. *
  1857. * Private
  1858. *
  1859. * Functional Description:
  1860. * This routine processes the "TokenPleaseIndication" PDU's being received
  1861. * through the transport interface. The pertinent data is read from the
  1862. * incoming packet and passed on to the domain.
  1863. *
  1864. * Caveats:
  1865. * None.
  1866. */
  1867. inline Void Connection::ProcessTokenPleaseIndication (
  1868. PTokenPleaseIndicationPDU pdu_structure)
  1869. {
  1870. m_pDomain->TokenPleaseIndication(this, (UserID) pdu_structure->initiator,
  1871. (TokenID) pdu_structure->token_id);
  1872. }
  1873. /*
  1874. * Void ProcessPlumbDomainIndication()
  1875. *
  1876. * Private
  1877. *
  1878. * Functional Description:
  1879. * This routine processes the "PlumbDomainIndication" PDU's being received
  1880. * through the transport interface. The pertinent data is read from the
  1881. * incoming packet and passed on to the domain.
  1882. *
  1883. * Caveats:
  1884. * None.
  1885. */
  1886. inline Void Connection::ProcessPlumbDomainIndication (
  1887. PPlumbDomainIndicationPDU pdu_structure)
  1888. {
  1889. m_pDomain->PlumbDomainIndication(this, pdu_structure->height_limit);
  1890. }
  1891. /*
  1892. * Void ProcessErectDomainRequest()
  1893. *
  1894. * Private
  1895. *
  1896. * Functional Description:
  1897. * This routine processes the "ErectDomainRequest" PDU's being received
  1898. * through the transport interface. The pertinent data is read from the
  1899. * incoming packet and passed on to the domain.
  1900. *
  1901. * Caveats:
  1902. * None.
  1903. */
  1904. inline Void Connection::ProcessErectDomainRequest (
  1905. PErectDomainRequestPDU pdu_structure)
  1906. {
  1907. m_pDomain->ErectDomainRequest(this, pdu_structure->sub_height,
  1908. pdu_structure->sub_interval);
  1909. }
  1910. /*
  1911. * ULong ValidateConnectionRequest ()
  1912. *
  1913. * Private
  1914. *
  1915. * Functional Description:
  1916. * This function is used to determine if it is valid to process an incoming
  1917. * request at the current time. It checks several different conditions
  1918. * to determine this, as follows:
  1919. *
  1920. * - If there is a merge in progress, then the request is not valid.
  1921. * - If this MCS connection is not yet bound to a domain, then the request
  1922. * is not valid.
  1923. * - If there are not enough objects of the Memory, Packet, or UserMessage
  1924. * class to handle a reasonable request, then the request is not valid.
  1925. *
  1926. * Note that the check on number of objects is not an absolute guarantee
  1927. * that there will be enough to handle a given request, because a request
  1928. * can result in MANY PDUs and user messages being generated. For example,
  1929. * a single channel admit request can result in lots of channel admit
  1930. * indications being sent. However, checking against a minimum number
  1931. * of objects can reduce the possibility of failure to be astronomically
  1932. * low. And remember, even if MCS runs out of something while processing
  1933. * such a request, it WILL handle it properly (by cleanly destroying the
  1934. * user attachment or MCS connection upon which the failure occurred). So
  1935. * there is no chance of MCS crashing as a result of this.
  1936. *
  1937. * Caveats:
  1938. * None.
  1939. */
  1940. inline ULong Connection::ValidateConnectionRequest ()
  1941. {
  1942. ULong return_value;
  1943. /*
  1944. * Check to see if there is a domain merger in progress.
  1945. */
  1946. if (Merge_In_Progress == FALSE)
  1947. {
  1948. /*
  1949. * Make sure that this MCS connection is bound to a domain.
  1950. */
  1951. if (m_pDomain != NULL)
  1952. {
  1953. /*
  1954. * Everything is okay, so the request is to be permitted.
  1955. */
  1956. return_value = TRANSPORT_NO_ERROR;
  1957. }
  1958. else
  1959. {
  1960. /*
  1961. * We are not yet attached to a domain.
  1962. */
  1963. TRACE_OUT (("Connection::ValidateConnectionRequest: "
  1964. "not attached to a domain"));
  1965. return_value = TRANSPORT_READ_QUEUE_FULL;
  1966. }
  1967. }
  1968. else
  1969. {
  1970. /*
  1971. * There is a domain merge in progress.
  1972. */
  1973. WARNING_OUT (("Connection::ValidateConnectionRequest: "
  1974. "domain merger in progress"));
  1975. return_value = TRANSPORT_READ_QUEUE_FULL;
  1976. }
  1977. return (return_value);
  1978. }
  1979. /*
  1980. * Connection (
  1981. * PCommandTarget attachment,
  1982. * ConnectionHandle connection_handle,
  1983. * PUChar calling_domain,
  1984. * UINT calling_domain_length,
  1985. * PUChar called_domain,
  1986. * UINT called_domain_length,
  1987. * PChar calling_address,
  1988. * PChar called_address,
  1989. * BOOL upward_connection,
  1990. * PDomainParameters domain_parameters,
  1991. * PUChar user_data,
  1992. * ULong user_data_length,
  1993. * PMCSError connection_error)
  1994. *
  1995. * Functional Description:
  1996. * This is a constructor for the Connection class. This constructor
  1997. * is used for creating outbound connections. It initializes private
  1998. * instance variables and calls the transport interface to set up a
  1999. * transport connection and register this connection object (through a
  2000. * callback structure) with the transport object.
  2001. *
  2002. * Formal Parameters:
  2003. * packet_coder
  2004. * This is the coder which is used by the connection object to encode
  2005. * PDU's into, and decode PDU's from, ASN.1 compliant byte streams.
  2006. * attachment
  2007. * The Domain to which this connection object is attached.
  2008. * connection_handle
  2009. * The handle which uniquely identifies this connection object.
  2010. * owner_object
  2011. * This is a pointer to the owner of this connection object (typically
  2012. * the MCS Controller) which allows this connection to communicate with
  2013. * the owner through callbacks.
  2014. * owner_message_base
  2015. * This is the base value to which offsets are added to identify which
  2016. * callback routine in the owner object this connection is calling.
  2017. * calling_domain
  2018. * This is a pointer to an ASCII string which contains the name of the
  2019. * domain to which this connection object is attached.
  2020. * calling_domain_length
  2021. * The length of the ASCII string which is the name of domain to which
  2022. * this connection object is attached.
  2023. * called_domain
  2024. * This is a pointer to an ASCII string which contains the name of the
  2025. * remote domain with which this connection will communicate.
  2026. * called_domain_length
  2027. * The length of the ASCII string which is the name of the remote
  2028. * domain.
  2029. * calling_address
  2030. * The transport address of the caller.
  2031. * called_address
  2032. * The transport address of the party being called.
  2033. * upward_connection
  2034. * This is a boolean flag which indicates whether this is an upward
  2035. * connection or a downward connection.
  2036. * domain_parameters
  2037. * This is the set of parameters which describes the local domain.
  2038. * user_data
  2039. * This is a pointer to a buffer containing data which is sent to the
  2040. * remote provider through the "ConnectInitial" PDU.
  2041. * user_data_length
  2042. * The length of the user data described above.
  2043. * connection_error
  2044. * A return parameter which indicates any errors which may have
  2045. * occurred in construction of the connection object.
  2046. *
  2047. * Return Value:
  2048. * MCS_NO_ERROR The connection was created successfully.
  2049. * MCS_TRANSPORT_FAILED An error occurred in creating the transport
  2050. * connection.
  2051. *
  2052. * Side Effects:
  2053. * None.
  2054. *
  2055. * Caveats:
  2056. * None.
  2057. */
  2058. /*
  2059. * Connection (
  2060. * PCommandTarget attachment,
  2061. * ConnectionHandle connection_handle,
  2062. * TransportConnection transport_connection,
  2063. * BOOL upward_connection,
  2064. * PDomainParameters domain_parameters,
  2065. * PDomainParameters min_domain_parameters,
  2066. * PDomainParameters max_domain_parameters,
  2067. * PUChar user_data,
  2068. * ULong user_data_length,
  2069. * PMCSError connection_error)
  2070. *
  2071. * Functional Description:
  2072. * This is a constructor for the Connection class. This constructor is
  2073. * used for creating inbound connections and is called when a transport
  2074. * connection already exists. It initializes private instance variables
  2075. * and calls the transport interface to register this connection object
  2076. * (through a callback structure) with the transport object.
  2077. *
  2078. * Formal Parameters:
  2079. * attachment
  2080. * The Domain to which this connection object is attached.
  2081. * connection_handle
  2082. * The handle which uniquely identifies this connection object.
  2083. * owner_object
  2084. * This is a pointer to the owner of this connection object (typically
  2085. * the MCS Controller) which allows this connection to communicate with
  2086. * the owner through callbacks.
  2087. * owner_message_base
  2088. * This is the base value to which offsets are added to identify which
  2089. * callback routine in the owner object this connection is calling.
  2090. * transport_connection
  2091. * This is the object used by this connection to communicate with the
  2092. * transport layer.
  2093. * upward_connection
  2094. * This is a boolean flag which indicates whether this is an upward
  2095. * connection or a downward connection.
  2096. * domain_parameters
  2097. * This is the set of parameters which describes the local domain.
  2098. * min_domain_parameters
  2099. * This is the set of parameters which describes the minimum
  2100. * permissable values for local domain parameters.
  2101. * max_domain_parameters
  2102. * This is the set of parameters which describes the maximum
  2103. * permissable values for local domain parameters.
  2104. * user_data
  2105. * This is a pointer to a buffer containing data which is sent to the
  2106. * remote provider through the "ConnectInitial" PDU.
  2107. * user_data_length
  2108. * The length of the user data described above.
  2109. * connection_error
  2110. * A return parameter which indicates any errors which may have
  2111. * occurred in construction of the connection object.
  2112. *
  2113. * Return Value:
  2114. * MCS_NO_ERROR
  2115. * The connection was created successfully.
  2116. * MCS_TRANSPORT_FAILED
  2117. * An error occurred in accepting the transport connection.
  2118. * MCS_BAD_DOMAIN_PARAMETERS
  2119. * There was no acceptable overlap between the local and remote
  2120. * domain parameters.
  2121. *
  2122. * Side Effects:
  2123. * None.
  2124. *
  2125. * Caveats:
  2126. * None.
  2127. */
  2128. /*
  2129. * ~Connection ()
  2130. *
  2131. * Functional Description:
  2132. * This is the destructor for the Connection class. If no connection
  2133. * deletion is pending, it terminates the current connection by issuing
  2134. * a DisconnectProviderUltimatum to the domain, transmitting a
  2135. * "DISCONNECT_PROVIDER_ULTIMATUM" PDU, and issuing a DisconnectRequest
  2136. * to the transport interface. The destructor also clears the transmission
  2137. * queue and frees any allocated memory.
  2138. *
  2139. * Formal Parameters:
  2140. * None.
  2141. *
  2142. * Return Value:
  2143. * None.
  2144. *
  2145. * Side Effects:
  2146. * None.
  2147. *
  2148. * Caveats:
  2149. * None.
  2150. */
  2151. /*
  2152. * void RegisterTransportConnection ()
  2153. *
  2154. * Functional Description:
  2155. * This routine is called in order to register the transport connection
  2156. * with the connection object.
  2157. *
  2158. * Formal Parameters:
  2159. * None.
  2160. *
  2161. * Return Value:
  2162. *
  2163. * Side Effects:
  2164. * None.
  2165. *
  2166. * Caveats:
  2167. * None.
  2168. */
  2169. /*
  2170. * Void PlumbDomainIndication (
  2171. * PCommandTarget originator,
  2172. * ULong height_limit)
  2173. *
  2174. * Functional Description:
  2175. * This routine is called by the domain in order to send a
  2176. * "PlumbDomainIndication" PDU through the transport interface.
  2177. *
  2178. * Formal Parameters:
  2179. * originator
  2180. * This is the address of the CommandTarget that issued this command.
  2181. * height_limit
  2182. * This is the number of connections between this user and the
  2183. * top provider.
  2184. *
  2185. * Return Value:
  2186. * None.
  2187. *
  2188. * Side Effects:
  2189. * None.
  2190. *
  2191. * Caveats:
  2192. * None.
  2193. */
  2194. /*
  2195. * Void ErectDomainRequest (
  2196. * PCommandTarget originator,
  2197. * ULong height_in_domain,
  2198. * ULong throughput_interval)
  2199. *
  2200. * Functional Description:
  2201. * This routine is called by the domain in order to send a
  2202. * "ErectDomainRequest" PDU through the transport interface.
  2203. *
  2204. * Formal Parameters:
  2205. * originator
  2206. * This is the address of the CommandTarget that issued this command.
  2207. * height_in_domain
  2208. * This is the number of connections between this user and the
  2209. * top provider.
  2210. * throughput_interval
  2211. * The minimum number of octets per second required.
  2212. *
  2213. * Return Value:
  2214. * None.
  2215. *
  2216. * Side Effects:
  2217. * None.
  2218. *
  2219. * Caveats:
  2220. * None.
  2221. */
  2222. /*
  2223. * Void RejectUltimatum (
  2224. * PCommandTarget originator,
  2225. * Diagnostic diagnostic,
  2226. * PUChar octet_string_address,
  2227. * ULong octet_string_length)
  2228. *
  2229. * Functional Description:
  2230. * This routine is called by the domain in order to send a
  2231. * "RejectUltimatum" PDU through the transport interface.
  2232. *
  2233. * Formal Parameters:
  2234. * originator
  2235. * This is the address of the CommandTarget that issued this command.
  2236. * diagnostic
  2237. * An enumeration indicating the reason for this reject.
  2238. * octet_string_address
  2239. * A pointer to the PDU data which resulted in the reject.
  2240. * octet_string_length
  2241. * The length of the PDU data which resulted in the reject.
  2242. *
  2243. * Return Value:
  2244. * None.
  2245. *
  2246. * Side Effects:
  2247. * None.
  2248. *
  2249. * Caveats:
  2250. * None.
  2251. */
  2252. /*
  2253. * Void MergeChannelsRequest (
  2254. * PCommandTarget originator,
  2255. * CChannelAttributesList *merge_channel_list,
  2256. * CChannelIDList *purge_channel_list)
  2257. *
  2258. * Functional Description:
  2259. * This routine is called by the domain in order to send a
  2260. * "MergeChannelsRequest" PDU through the transport interface.
  2261. *
  2262. * Formal Parameters:
  2263. * originator
  2264. * This is the address of the CommandTarget that issued this command.
  2265. * merge_channel_list
  2266. * This is a list of attributes describing the channels which are to
  2267. * be merged.
  2268. * purge_channel_list
  2269. * This is a list of ID's for the channels that are to be purged.
  2270. *
  2271. * Return Value:
  2272. * None.
  2273. *
  2274. * Side Effects:
  2275. * None.
  2276. *
  2277. * Caveats:
  2278. * None.
  2279. */
  2280. /*
  2281. * Void MergeChannelsConfirm (
  2282. * PCommandTarget originator,
  2283. * CChannelAttributesList *merge_channel_list,
  2284. * CChannelIDList *purge_channel_list)
  2285. *
  2286. * Functional Description:
  2287. * This command is received when the local attachment wishes to send a
  2288. * MergeChannelConfirm command to the remote attachment.
  2289. *
  2290. * Formal Parameters:
  2291. * originator
  2292. * This is the address of the CommandTarget that issued this command.
  2293. * merge_channel_list
  2294. * This is a list of attributes describing the channels which are to
  2295. * be merged.
  2296. * purge_channel_list
  2297. * This is a list of ID's for the channels that are to be purged.
  2298. *
  2299. * Return Value:
  2300. * None.
  2301. *
  2302. * Side Effects:
  2303. * None.
  2304. *
  2305. * Caveats:
  2306. * None.
  2307. */
  2308. /*
  2309. * Void PurgeChannelsIndication (
  2310. * PCommandTarget originator,
  2311. * CUidList *purge_user_list,
  2312. * CChannelIDList *purge_channel_list)
  2313. *
  2314. * Functional Description:
  2315. * This routine is called by the domain in order to send a
  2316. * "PurgeChannelsIndication" PDU through the transport interface.
  2317. *
  2318. * Formal Parameters:
  2319. * originator
  2320. * This is the address of the CommandTarget that issued this command.
  2321. * purge_user_list
  2322. * This is a list of IDs of the users being purged.
  2323. * purge_channel_list
  2324. * This is a list of IDs of the channels being purged.
  2325. *
  2326. * Return Value:
  2327. * None.
  2328. *
  2329. * Side Effects:
  2330. * None.
  2331. *
  2332. * Caveats:
  2333. * None.
  2334. */
  2335. /*
  2336. * Void MergeTokensRequest (
  2337. * PCommandTarget originator,
  2338. * CTokenAttributesList *merge_token_list,
  2339. * CTokenIDList *purge_token_list)
  2340. *
  2341. * Functional Description:
  2342. * This routine is called by the domain in order to send a
  2343. * "MergeTokensRequest" PDU through the transport interface.
  2344. *
  2345. * Formal Parameters:
  2346. * originator
  2347. * This is the address of the CommandTarget that issued this command.
  2348. * merge_token_list
  2349. * This is a list of attributes describing the tokens which are to
  2350. * be merged.
  2351. * purge_token_list
  2352. * This is a list of ID's for the tokens that are to be purged.
  2353. *
  2354. * Return Value:
  2355. * None.
  2356. *
  2357. * Side Effects:
  2358. * None.
  2359. *
  2360. * Caveats:
  2361. * None.
  2362. */
  2363. /*
  2364. * Void MergeTokensConfirm (
  2365. * PCommandTarget originator,
  2366. * CTokenAttributesList *merge_token_list,
  2367. * CTokenIDList *purge_token_list)
  2368. *
  2369. * Functional Description:
  2370. * This command is received when the local attachment wishes to send a
  2371. * MergeTokensConfirm command to the remote attachment.
  2372. *
  2373. * Formal Parameters:
  2374. * originator
  2375. * This is the address of the CommandTarget that issued this command.
  2376. * merge_token_list
  2377. * This is a list of attributes describing the tokens which are to
  2378. * be merged.
  2379. * purge_token_list
  2380. * This is a list of ID's for the tokens that are to be purged.
  2381. *
  2382. * Return Value:
  2383. * None.
  2384. *
  2385. * Side Effects:
  2386. * None.
  2387. *
  2388. * Caveats:
  2389. * None.
  2390. */
  2391. /*
  2392. * Void PurgeTokensIndication (
  2393. * PCommandTarget originator,
  2394. * CTokenIDList *purge_token_ids)
  2395. *
  2396. * Functional Description:
  2397. * This command is received when the local attachment wishes to send a
  2398. * PurgeTokenIndication command to the remote attachment.
  2399. *
  2400. * Formal Parameters:
  2401. * originator
  2402. * This is the address of the CommandTarget that issued this command.
  2403. * purge_token_ids
  2404. * This is a list of ID's for the tokens that are to be purged.
  2405. *
  2406. * Return Value:
  2407. * None.
  2408. *
  2409. * Side Effects:
  2410. * None.
  2411. *
  2412. * Caveats:
  2413. * None.
  2414. */
  2415. /*
  2416. * Void DisconnectProviderUltimatum (
  2417. * PCommandTarget originator,
  2418. * Reason reason)
  2419. *
  2420. * Functional Description:
  2421. * This command is received when the local attachment wishes to send a
  2422. * DisconnectProviderUltimatum command to the remote attachment. Note
  2423. * that this command automatically causes this Connection object to
  2424. * destroy itself.
  2425. *
  2426. * Formal Parameters:
  2427. * originator
  2428. * This is the address of the CommandTarget that issued this command.
  2429. * reason
  2430. * The reason for the diconnect.
  2431. *
  2432. * Return Value:
  2433. * None.
  2434. *
  2435. * Side Effects:
  2436. * None.
  2437. *
  2438. * Caveats:
  2439. * None.
  2440. */
  2441. /*
  2442. * Void AttachUserRequest (
  2443. * PCommandTarget originator)
  2444. *
  2445. * Functional Description:
  2446. * This command is received when the local attachment wishes to send a
  2447. * AttachUserRequest command to the remote attachment.
  2448. *
  2449. * Formal Parameters:
  2450. * originator
  2451. * This is the address of the CommandTarget that issued this command.
  2452. *
  2453. * Return Value:
  2454. * None.
  2455. *
  2456. * Side Effects:
  2457. * None.
  2458. *
  2459. * Caveats:
  2460. * None.
  2461. */
  2462. /*
  2463. * Void AttachUserConfirm (
  2464. * PCommandTarget originator,
  2465. * Result result,
  2466. * UserID uidInitiator)
  2467. *
  2468. * Functional Description:
  2469. * This command is received when the local attachment wishes to send a
  2470. * AttachUserConfirm command to the remote attachment.
  2471. *
  2472. * Formal Parameters:
  2473. * originator
  2474. * This is the address of the CommandTarget that issued this command.
  2475. * result
  2476. * The result of the attach request.
  2477. * uidInitiator
  2478. * If the result was successful, this will contain the unique user
  2479. * ID to be associated with this user.
  2480. *
  2481. * Return Value:
  2482. * None.
  2483. *
  2484. * Side Effects:
  2485. * None.
  2486. *
  2487. * Caveats:
  2488. * None.
  2489. */
  2490. /*
  2491. * Void DetachUserRequest (
  2492. * PCommandTarget originator,
  2493. * Reason reason,
  2494. * UserID user_id)
  2495. *
  2496. * Functional Description:
  2497. * This command is received when the local attachment wishes to send a
  2498. * DetachUserRequest command to the remote attachment.
  2499. *
  2500. * Formal Parameters:
  2501. * originator
  2502. * This is the address of the CommandTarget that issued this command.
  2503. * reason
  2504. * This is the reason for the detachment.
  2505. * user_id
  2506. * The ID of the user who wishes to detach.
  2507. *
  2508. * Return Value:
  2509. * None.
  2510. *
  2511. * Side Effects:
  2512. * None.
  2513. *
  2514. * Caveats:
  2515. * None.
  2516. */
  2517. /*
  2518. * Void DetachUserIndication (
  2519. * PCommandTarget originator,
  2520. * Reason reason,
  2521. * UserID user_id)
  2522. *
  2523. * Functional Description:
  2524. * This command is received when the local attachment wishes to send a
  2525. * DetachUserIndication command to the remote attachment.
  2526. *
  2527. * Formal Parameters:
  2528. * originator
  2529. * This is the address of the CommandTarget that issued this command.
  2530. * reason
  2531. * The reason for the detachment.
  2532. * user_id
  2533. * The ID of the user who has detached.
  2534. *
  2535. * Return Value:
  2536. * None.
  2537. *
  2538. * Side Effects:
  2539. * None.
  2540. *
  2541. * Caveats:
  2542. * None.
  2543. */
  2544. /*
  2545. * Void ChannelJoinRequest (
  2546. * PCommandTarget originator,
  2547. * UserID uidInitiator,
  2548. * ChannelID channel_id)
  2549. *
  2550. * Functional Description:
  2551. * This command is received when the local attachment wishes to send a
  2552. * ChannelJoinRequest command to the remote attachment.
  2553. *
  2554. * Formal Parameters:
  2555. * originator
  2556. * This is the address of the CommandTarget that issued this command.
  2557. * uidInitiator
  2558. * The ID of the user who initiated the request.
  2559. * channel_id
  2560. * The ID of the channel to be joined.
  2561. *
  2562. * Return Value:
  2563. * None.
  2564. *
  2565. * Side Effects:
  2566. * None.
  2567. *
  2568. * Caveats:
  2569. * None.
  2570. */
  2571. /*
  2572. * Void ChannelJoinConfirm (
  2573. * PCommandTarget originator,
  2574. * Result result,
  2575. * UserID uidInitiator,
  2576. * ChannelID requested_id,
  2577. * ChannelID channel_id)
  2578. *
  2579. * Functional Description:
  2580. * This command is received when the local attachment wishes to send a
  2581. * ChannelJoinConfirm command to the remote attachment.
  2582. *
  2583. * Formal Parameters:
  2584. * originator
  2585. * This is the address of the CommandTarget that issued this command.
  2586. * result
  2587. * The result of the join request.
  2588. * uidInitiator
  2589. * The ID of the user who initiated the request.
  2590. * requested_id
  2591. * This ID of the channel that the user attempted to join (which may
  2592. * be 0).
  2593. * channel_id
  2594. * The ID of the channel being joined.
  2595. *
  2596. * Return Value:
  2597. * None.
  2598. *
  2599. * Side Effects:
  2600. * None.
  2601. *
  2602. * Caveats:
  2603. * None.
  2604. */
  2605. /*
  2606. * Void ChannelLeaveRequest (
  2607. * PCommandTarget originator,
  2608. * CChannelIDList *channel_id_list)
  2609. *
  2610. * Functional Description:
  2611. * This command is received when the local attachment wishes to send a
  2612. * ChannelLeaveRequest command to the remote attachment.
  2613. *
  2614. * Formal Parameters:
  2615. * originator
  2616. * This is the address of the CommandTarget that issued this command.
  2617. * channel_id_list
  2618. * The list of IDs of the channels to be left.
  2619. *
  2620. * Return Value:
  2621. * None.
  2622. *
  2623. * Side Effects:
  2624. * None.
  2625. *
  2626. * Caveats:
  2627. * None.
  2628. */
  2629. /*
  2630. * Void ChannelConveneRequest (
  2631. * PCommandTarget originator,
  2632. * UserID uidInitiator)
  2633. *
  2634. * Functional Description:
  2635. * This command is received when the local attachment wishes to send a
  2636. * ChannelConveneRequest command to the remote attachment.
  2637. *
  2638. * Formal Parameters:
  2639. * originator
  2640. * This is the address of the CommandTarget that issued this command.
  2641. * uidInitiator
  2642. * This is the ID of the user who is trying to convene a private
  2643. * channel.
  2644. *
  2645. * Return Value:
  2646. * None.
  2647. *
  2648. * Side Effects:
  2649. * None.
  2650. *
  2651. * Caveats:
  2652. * None.
  2653. */
  2654. /*
  2655. * Void ChannelConveneConfirm (
  2656. * PCommandTarget originator,
  2657. * Result result,
  2658. * UserID uidInitiator,
  2659. * ChannelID channel_id)
  2660. *
  2661. * Functional Description:
  2662. * This command is received when the local attachment wishes to send a
  2663. * ChannelConveneConfirm command to the remote attachment.
  2664. *
  2665. * Formal Parameters:
  2666. * originator
  2667. * This is the address of the CommandTarget that issued this command.
  2668. * result
  2669. * This is the result of the previously requested convene operation.
  2670. * uidInitiator
  2671. * This is the ID of the user who tried to convene a new channel.
  2672. * channel_id
  2673. * If the request was successful, this is the ID of the newly created
  2674. * private channel.
  2675. *
  2676. * Return Value:
  2677. * None.
  2678. *
  2679. * Side Effects:
  2680. * None.
  2681. *
  2682. * Caveats:
  2683. * None.
  2684. */
  2685. /*
  2686. * Void ChannelDisbandRequest (
  2687. * PCommandTarget originator,
  2688. * UserID uidInitiator,
  2689. * ChannelID channel_id)
  2690. *
  2691. * Functional Description:
  2692. * This command is received when the local attachment wishes to send a
  2693. * ChannelDisbandRequest command to the remote attachment.
  2694. *
  2695. * Formal Parameters:
  2696. * originator
  2697. * This is the address of the CommandTarget that issued this command.
  2698. * uidInitiator
  2699. * This is the ID of the user who is trying to disband a private
  2700. * channel.
  2701. * channel_id
  2702. * This is the ID of the channel being disbanded.
  2703. *
  2704. * Return Value:
  2705. * None.
  2706. *
  2707. * Side Effects:
  2708. * None.
  2709. *
  2710. * Caveats:
  2711. * None.
  2712. */
  2713. /*
  2714. * Void ChannelDisbandIndication (
  2715. * PCommandTarget originator,
  2716. * ChannelID channel_id)
  2717. *
  2718. * Functional Description:
  2719. * This command is received when the local attachment wishes to send a
  2720. * ChannelDisbandIndication command to the remote attachment.
  2721. *
  2722. * Formal Parameters:
  2723. * originator
  2724. * This is the address of the CommandTarget that issued this command.
  2725. * channel_id
  2726. * This is the ID of the channel being disbanded.
  2727. *
  2728. * Return Value:
  2729. * None.
  2730. *
  2731. * Side Effects:
  2732. * None.
  2733. *
  2734. * Caveats:
  2735. * None.
  2736. */
  2737. /*
  2738. * Void ChannelAdmitRequest (
  2739. * PCommandTarget originator,
  2740. * UserID uidInitiator,
  2741. * ChannelID channel_id,
  2742. * CUidList *user_id_list)
  2743. *
  2744. * Functional Description:
  2745. * This command is received when the local attachment wishes to send a
  2746. * ChannelAdmitRequest command to the remote attachment.
  2747. *
  2748. * Formal Parameters:
  2749. * originator
  2750. * This is the address of the CommandTarget that issued this command.
  2751. * uidInitiator
  2752. * This is the ID of the user who is trying to admit some users to
  2753. * a private channel.
  2754. * channel_id
  2755. * This is the ID of the channel to be affected.
  2756. * user_id_list
  2757. * This is a container holding the IDs of the users to be admitted.
  2758. *
  2759. * Return Value:
  2760. * None.
  2761. *
  2762. * Side Effects:
  2763. * None.
  2764. *
  2765. * Caveats:
  2766. * None.
  2767. */
  2768. /*
  2769. * Void ChannelAdmitIndication (
  2770. * PCommandTarget originator,
  2771. * UserID uidInitiator,
  2772. * ChannelID channel_id,
  2773. * CUidList *user_id_list)
  2774. *
  2775. * Functional Description:
  2776. * This command is received when the local attachment wishes to send a
  2777. * ChannelAdmitIndication command to the remote attachment.
  2778. *
  2779. * Formal Parameters:
  2780. * originator
  2781. * This is the address of the CommandTarget that issued this command.
  2782. * uidInitiator
  2783. * This is the ID of the user who is trying to admit some users to
  2784. * a private channel.
  2785. * channel_id
  2786. * This is the ID of the channel to be affected.
  2787. * user_id_list
  2788. * This is a container holding the IDs of the users to be admitted.
  2789. *
  2790. * Return Value:
  2791. * None.
  2792. *
  2793. * Side Effects:
  2794. * None.
  2795. *
  2796. * Caveats:
  2797. * None.
  2798. */
  2799. /*
  2800. * Void ChannelExpelRequest (
  2801. * PCommandTarget originator,
  2802. * UserID uidInitiator,
  2803. * ChannelID channel_id,
  2804. * CUidList *user_id_list)
  2805. *
  2806. * Functional Description:
  2807. * This command is received when the local attachment wishes to send a
  2808. * ChannelExpelRequest command to the remote attachment.
  2809. *
  2810. * Formal Parameters:
  2811. * originator
  2812. * This is the address of the CommandTarget that issued this command.
  2813. * uidInitiator
  2814. * This is the ID of the user who is trying to expel some users from
  2815. * a private channel.
  2816. * channel_id
  2817. * This is the ID of the channel to be affected.
  2818. * user_id_list
  2819. * This is a container holding the IDs of the users to be expelled.
  2820. *
  2821. * Return Value:
  2822. * None.
  2823. *
  2824. * Side Effects:
  2825. * None.
  2826. *
  2827. * Caveats:
  2828. * None.
  2829. */
  2830. /*
  2831. * Void ChannelExpelIndication (
  2832. * PCommandTarget originator,
  2833. * ChannelID channel_id,
  2834. * CUidList *user_id_list)
  2835. *
  2836. * Functional Description:
  2837. * This command is received when the local attachment wishes to send a
  2838. * ChannelExpelIndication command to the remote attachment.
  2839. *
  2840. * Formal Parameters:
  2841. * originator
  2842. * This is the address of the CommandTarget that issued this command.
  2843. * channel_id
  2844. * This is the ID of the channel to be affected.
  2845. * user_id_list
  2846. * This is a container holding the IDs of the users to be expelled.
  2847. *
  2848. * Return Value:
  2849. * None.
  2850. *
  2851. * Side Effects:
  2852. * None.
  2853. *
  2854. * Caveats:
  2855. * None.
  2856. */
  2857. /*
  2858. * Void SendDataRequest (
  2859. * PCommandTarget originator,
  2860. * UINT type,
  2861. PDataPacket data_packet)
  2862. *
  2863. * Functional Description:
  2864. * This command is received when the local attachment wishes to send a
  2865. * SendDataRequest command to the remote attachment.
  2866. *
  2867. * Formal Parameters:
  2868. * originator (i)
  2869. * This is the address of the CommandTarget that issued this command.
  2870. * type (i)
  2871. * Normal or uniform send data request
  2872. * pDataPacket (i)
  2873. * This is a pointer to a DataPacket object containing the channel
  2874. * ID, the User ID of the data sender, segmentation flags, priority of
  2875. * the data packet and a pointer to the packet to be sent.
  2876. *
  2877. * Return Value:
  2878. * None.
  2879. *
  2880. * Side Effects:
  2881. * None.
  2882. *
  2883. * Caveats:
  2884. * None.
  2885. */
  2886. /*
  2887. * Void SendDataIndication (
  2888. * PCommandTarget originator,
  2889. * UINT type,
  2890. * PDataPacket data_packet)
  2891. *
  2892. * Functional Description:
  2893. * This command is received when the local attachment wishes to send a
  2894. * SendDataIndication command to the remote attachment.
  2895. *
  2896. * Formal Parameters:
  2897. * originator
  2898. * This is the address of the CommandTarget that issued this command.
  2899. * type (i)
  2900. * normal or uniform data indication
  2901. * data_packet (i)
  2902. * This is a pointer to a DataPacket object containing the channel
  2903. * ID, the User ID of the data sender, segmentation flags, priority of
  2904. * the data packet and a pointer to the packet to be sent.
  2905. *
  2906. * Return Value:
  2907. * None.
  2908. *
  2909. * Side Effects:
  2910. * None.
  2911. *
  2912. * Caveats:
  2913. * None.
  2914. */
  2915. /*
  2916. * Void TokenGrabRequest (
  2917. * PCommandTarget originator,
  2918. * UserID uidInitiator,
  2919. * TokenID token_id)
  2920. *
  2921. * Functional Description:
  2922. * This command is received when the local attachment wishes to send a
  2923. * TokenGrabRequest command to the remote attachment.
  2924. *
  2925. * Formal Parameters:
  2926. * originator
  2927. * This is the address of the CommandTarget that issued this command.
  2928. * uidInitiator
  2929. * The ID of the user attempting to grab the token.
  2930. * token_id
  2931. * The ID of the token being grabbed.
  2932. *
  2933. * Return Value:
  2934. * None.
  2935. *
  2936. * Side Effects:
  2937. * None.
  2938. *
  2939. * Caveats:
  2940. * None.
  2941. */
  2942. /*
  2943. * Void TokenGrabConfirm (
  2944. * PCommandTarget originator,
  2945. * Result result,
  2946. * UserID uidInitiator,
  2947. * TokenID token_id,
  2948. * TokenStatus token_status)
  2949. *
  2950. * Functional Description:
  2951. * This command is received when the local attachment wishes to send a
  2952. * TokenGrabConfirm command to the remote attachment.
  2953. *
  2954. * Formal Parameters:
  2955. * originator
  2956. * This is the address of the CommandTarget that issued this command.
  2957. * result
  2958. * The result of the grab operation.
  2959. * uidInitiator
  2960. * The ID of the user attempting to grab the token.
  2961. * token_id
  2962. * The ID of the token being grabbed.
  2963. * token_status
  2964. * The status of the token after processing the request.
  2965. *
  2966. * Return Value:
  2967. * None.
  2968. *
  2969. * Side Effects:
  2970. * None.
  2971. *
  2972. * Caveats:
  2973. * None.
  2974. */
  2975. /*
  2976. * Void TokenInhibitRequest (
  2977. * PCommandTarget originator,
  2978. * UserID uidInitiator,
  2979. * TokenID token_id)
  2980. *
  2981. * Functional Description:
  2982. * This command is received when the local attachment wishes to send a
  2983. * TokenInhibitRequest command to the remote attachment.
  2984. *
  2985. * Formal Parameters:
  2986. * originator
  2987. * This is the address of the CommandTarget that issued this command.
  2988. * uidInitiator
  2989. * The ID of the user attempting to inhibit the token.
  2990. * token_id
  2991. * The ID of the token being inhibited.
  2992. *
  2993. * Return Value:
  2994. * None.
  2995. *
  2996. * Side Effects:
  2997. * None.
  2998. *
  2999. * Caveats:
  3000. * None.
  3001. */
  3002. /*
  3003. * Void TokenInhibitConfirm (
  3004. * PCommandTarget originator,
  3005. * Result result,
  3006. * UserID uidInitiator,
  3007. * TokenID token_id,
  3008. * TokenStatus token_status)
  3009. *
  3010. * Functional Description:
  3011. * This command is received when the local attachment wishes to send a
  3012. * TokenInhibitConfirm command to the remote attachment.
  3013. *
  3014. * Formal Parameters:
  3015. * originator
  3016. * This is the address of the CommandTarget that issued this command.
  3017. * result
  3018. * The result of the inhibit operation.
  3019. * uidInitiator
  3020. * The ID of the user attempting to inhibit the token.
  3021. * token_id
  3022. * The ID of the token being inhibited.
  3023. * token_status
  3024. * The status of the token after processing the request.
  3025. *
  3026. * Return Value:
  3027. * None.
  3028. *
  3029. * Side Effects:
  3030. * None.
  3031. *
  3032. * Caveats:
  3033. * None.
  3034. */
  3035. /*
  3036. * Void TokenGiveRequest (
  3037. * PCommandTarget originator,
  3038. * PTokenGiveRecord pTokenGiveRec)
  3039. *
  3040. * Functional Description:
  3041. * This command is received when the local attachment wishes to send a
  3042. * TokenGiveRequest command to the remote attachment.
  3043. *
  3044. * Formal Parameters:
  3045. * originator
  3046. * This is the address of the CommandTarget that issued this command.
  3047. * pTokenGiveRec (i)
  3048. * This is the address of a structure containing the following information:
  3049. * The ID of the user attempting to give away the token.
  3050. * The ID of the token being given.
  3051. * The ID of the user that the token is being given to.
  3052. *
  3053. * Return Value:
  3054. * None.
  3055. *
  3056. * Side Effects:
  3057. * None.
  3058. *
  3059. * Caveats:
  3060. * None.
  3061. */
  3062. /*
  3063. * Void TokenGiveIndication (
  3064. * PCommandTarget originator,
  3065. * PTokenGiveRecord pTokenGiveRec)
  3066. *
  3067. * Functional Description:
  3068. * This command is received when the local attachment wishes to send a
  3069. * TokenGiveIndication command to the remote attachment.
  3070. *
  3071. * Formal Parameters:
  3072. * originator
  3073. * This is the address of the CommandTarget that issued this command.
  3074. * pTokenGiveRec (i)
  3075. * This is the address of a structure containing the following information:
  3076. * The ID of the user attempting to give away the token.
  3077. * The ID of the token being given.
  3078. * The ID of the user that the token is being given to.
  3079. *
  3080. * Return Value:
  3081. * None.
  3082. *
  3083. * Side Effects:
  3084. * None.
  3085. *
  3086. * Caveats:
  3087. * None.
  3088. */
  3089. /*
  3090. * Void TokenGiveResponse (
  3091. * PCommandTarget originator,
  3092. * Result result,
  3093. * UserID receiver_id,
  3094. * TokenID token_id)
  3095. *
  3096. * Functional Description:
  3097. * This command is received when the local attachment wishes to send a
  3098. * TokenGiveResponse command to the remote attachment.
  3099. *
  3100. * Formal Parameters:
  3101. * originator
  3102. * This is the address of the CommandTarget that issued this command.
  3103. * result
  3104. * The result of the give operation.
  3105. * receiver_id
  3106. * The ID of the user being given the token.
  3107. * token_id
  3108. * The ID of the token being given.
  3109. *
  3110. * Return Value:
  3111. * None.
  3112. *
  3113. * Side Effects:
  3114. * None.
  3115. *
  3116. * Caveats:
  3117. * None.
  3118. */
  3119. /*
  3120. * Void TokenGiveConfirm (
  3121. * PCommandTarget originator,
  3122. * Result result,
  3123. * UserID uidInitiator,
  3124. * TokenID token_id,
  3125. * TokenStatus token_status)
  3126. *
  3127. * Functional Description:
  3128. * This command is received when the local attachment wishes to send a
  3129. * TokenGiveConfirm command to the remote attachment.
  3130. *
  3131. * Formal Parameters:
  3132. * originator
  3133. * This is the address of the CommandTarget that issued this command.
  3134. * result
  3135. * The result of the give operation.
  3136. * uidInitiator
  3137. * The ID of the user being given the token.
  3138. * token_id
  3139. * The ID of the token being given.
  3140. * token_status
  3141. * The status of the token after processing the request.
  3142. *
  3143. * Return Value:
  3144. * None.
  3145. *
  3146. * Side Effects:
  3147. * None.
  3148. *
  3149. * Caveats:
  3150. * None.
  3151. */
  3152. /*
  3153. * Void TokenReleaseRequest (
  3154. * PCommandTarget originator,
  3155. * UserID uidInitiator,
  3156. * TokenID token_id)
  3157. *
  3158. * Functional Description:
  3159. * This command is received when the local attachment wishes to send a
  3160. * TokenReleaseRequest command to the remote attachment.
  3161. *
  3162. * Formal Parameters:
  3163. * originator
  3164. * This is the address of the CommandTarget that issued this command.
  3165. * uidInitiator
  3166. * The ID of the user attempting to release the token.
  3167. * token_id
  3168. * The ID of the token being released.
  3169. *
  3170. * Return Value:
  3171. * None.
  3172. *
  3173. * Side Effects:
  3174. * None.
  3175. *
  3176. * Caveats:
  3177. * None.
  3178. */
  3179. /*
  3180. * Void TokenReleaseConfirm (
  3181. * PCommandTarget originator,
  3182. * Result result,
  3183. * UserID uidInitiator,
  3184. * TokenID token_id,
  3185. * TokenStatus token_status)
  3186. *
  3187. * Functional Description:
  3188. * This command is received when the local attachment wishes to send a
  3189. * TokenReleaseConfirm command to the remote attachment.
  3190. *
  3191. * Formal Parameters:
  3192. * originator
  3193. * This is the address of the CommandTarget that issued this command.
  3194. * result
  3195. * The result of the release operation.
  3196. * uidInitiator
  3197. * The ID of the user attempting to release the token.
  3198. * token_id
  3199. * The ID of the token being released.
  3200. * token_status
  3201. * The status of the token after processing the request.
  3202. *
  3203. * Return Value:
  3204. * None.
  3205. *
  3206. * Side Effects:
  3207. * None.
  3208. *
  3209. * Caveats:
  3210. * None.
  3211. */
  3212. /*
  3213. * Void TokenPleaseRequest (
  3214. * PCommandTarget originator,
  3215. * UserID uidInitiator,
  3216. * TokenID token_id)
  3217. *
  3218. * Functional Description:
  3219. * This command is received when the local attachment wishes to send a
  3220. * TokenPleaseRequest command to the remote attachment.
  3221. *
  3222. * Formal Parameters:
  3223. * originator
  3224. * This is the address of the CommandTarget that issued this command.
  3225. * uidInitiator
  3226. * The ID of the user requesting the token.
  3227. * token_id
  3228. * The ID of the token being requested.
  3229. *
  3230. * Return Value:
  3231. * None.
  3232. *
  3233. * Side Effects:
  3234. * None.
  3235. *
  3236. * Caveats:
  3237. * None.
  3238. */
  3239. /*
  3240. * Void TokenPleaseIndication (
  3241. * PCommandTarget originator,
  3242. * UserID uidInitiator,
  3243. * TokenID token_id)
  3244. *
  3245. * Functional Description:
  3246. * This command is received when the local attachment wishes to send a
  3247. * TokenPleaseIndication command to the remote attachment.
  3248. *
  3249. * Formal Parameters:
  3250. * originator
  3251. * This is the address of the CommandTarget that issued this command.
  3252. * uidInitiator
  3253. * The ID of the user requesting the token.
  3254. * token_id
  3255. * The ID of the token being requested.
  3256. *
  3257. * Return Value:
  3258. * None.
  3259. *
  3260. * Side Effects:
  3261. * None.
  3262. *
  3263. * Caveats:
  3264. * None.
  3265. */
  3266. /*
  3267. * Void TokenTestRequest (
  3268. * PCommandTarget originator,
  3269. * UserID uidInitiator,
  3270. * TokenID token_id)
  3271. *
  3272. * Functional Description:
  3273. * This command is received when the local attachment wishes to send a
  3274. * TokenTestRequest command to the remote attachment.
  3275. *
  3276. * Formal Parameters:
  3277. * originator
  3278. * This is the address of the CommandTarget that issued this command.
  3279. * uidInitiator
  3280. * The ID of the user testing the token.
  3281. * token_id
  3282. * The ID of the token being tested.
  3283. *
  3284. * Return Value:
  3285. * None.
  3286. *
  3287. * Side Effects:
  3288. * None.
  3289. *
  3290. * Caveats:
  3291. * None.
  3292. */
  3293. /*
  3294. * Void TokenTestConfirm (
  3295. * PCommandTarget originator,
  3296. * UserID uidInitiator,
  3297. * TokenID token_id,
  3298. * TokenStatus token_status)
  3299. *
  3300. * Functional Description:
  3301. * This command is received when the local attachment wishes to send a
  3302. * TokenTestConfirm command to the remote attachment.
  3303. *
  3304. * Formal Parameters:
  3305. * originator
  3306. * This is the address of the CommandTarget that issued this command.
  3307. * uidInitiator
  3308. * The ID of the user testing the token.
  3309. * token_id
  3310. * The ID of the token being tested.
  3311. * token_status
  3312. * The status of the token after processing the request.
  3313. *
  3314. * Return Value:
  3315. * None.
  3316. *
  3317. * Side Effects:
  3318. * None.
  3319. *
  3320. * Caveats:
  3321. * None.
  3322. */
  3323. /*
  3324. * Void MergeDomainIndication (
  3325. * PCommandTarget originator,
  3326. * MergeStatus merge_status)
  3327. *
  3328. * Functional Description:
  3329. * This command is received when a domain enters or leaves the domain merge
  3330. * state. When in a domain merge state, NO commands are to be sent to
  3331. * the Domain object.
  3332. *
  3333. * Formal Parameters:
  3334. * originator
  3335. * This is the address of the CommandTarget that issued this command.
  3336. * merge_status
  3337. * This is the current status of the domain merge. It indicates
  3338. * whether the merge is active, or just completed.
  3339. *
  3340. * Return Value:
  3341. * None.
  3342. *
  3343. * Side Effects:
  3344. * All command traffic to the Domain object must halt when the domain is
  3345. * in the merge state.
  3346. *
  3347. * Caveats:
  3348. * None.
  3349. */
  3350. /*
  3351. * Void FlushMessageQueue()
  3352. *
  3353. * Functional Description:
  3354. * This function is called by the controller during the MCS heartbeat to
  3355. * allow it to flush its output buffers. If there is any data waiting
  3356. * to be transmitted (at any priority), the Connection object will attempt
  3357. * to send it at this time.
  3358. *
  3359. * Formal Parameters:
  3360. * None.
  3361. *
  3362. * Return Value:
  3363. * None.
  3364. *
  3365. * Side Effects:
  3366. * None.
  3367. *
  3368. * Caveats:
  3369. * None.
  3370. */
  3371. /*
  3372. * ULong OwnerCallback (
  3373. * unsigned int message,
  3374. * PVoid parameter1,
  3375. TransportConnection transport_connection)
  3376. *
  3377. * Functional Description:
  3378. * This function is used to receive owner callbacks from the Transport
  3379. * Interface object. Connection objects sends data and requests to
  3380. * the Transport Interface object through its public interface, but it
  3381. * receives data and indications through this owner callback. For a more
  3382. * complete description of the callbacks, and how the parameter for each
  3383. * one are packed, see the interface file for the class TransportInterface
  3384. * (since it is this class that originates the callbacks).
  3385. *
  3386. * Formal Parameters:
  3387. * message
  3388. * This is the message to be processed. These are defined in the
  3389. * interface file of the class issuing the callbacks.
  3390. * parameter1
  3391. * The meaning of this parameter varies according to the message
  3392. * being processed.
  3393. * transport_connection
  3394. * The transport connection on which the callback applies.
  3395. *
  3396. * Return Value:
  3397. * The meaning of the return value varies according to the message being
  3398. * processed.
  3399. *
  3400. * Side Effects:
  3401. * None.
  3402. *
  3403. * Caveats:
  3404. * None.
  3405. */
  3406. #endif