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.

1898 lines
60 KiB

  1. #include "precomp.h"
  2. /**********************************************************************
  3. * File: gcclog.h
  4. * Abstract: public function definitions for protocol logging functions
  5. * added into GCCNC.DLL to read the contents of GCC and MCS PDU
  6. * contents going over the wire.
  7. * Created: 12/21/95, Venkatesh Gopalakrishnan
  8. * Copyright (c) 1995 Microsoft Corpration
  9. ******************************************************************** */
  10. /** Note: the contents of this file are only included if the constant
  11. ** PDULOG is defined. PDULOG is defined by default ONLY in the
  12. ** Win32 Diagnostic build configuration of GCCNC.DLL
  13. **/
  14. #ifdef PDULOG
  15. #include "ms_util.h"
  16. #include <ctype.h>
  17. #include <windows.h>
  18. #include "pdutypes.h"
  19. #include "gcclog.h"
  20. #define outdeb //OutputDebugString
  21. /**
  22. ** Maintainance Functions for the Protocol Logging Mechanism
  23. **/
  24. /*********************************************************************/
  25. int InitializeGCCLog()
  26. {
  27. FILE *logfile;
  28. /* this should just reset the file pointer */
  29. logfile = fopen(LOG_FILE_NAME,"w");
  30. // this "fake" starting PDU is put in so that the Intel Protocol Browser
  31. // dosen't go nuts if it is reading dynamically.
  32. pduLog(logfile,"START_PDU: ============================== START PDU ===========================\n");
  33. pduLog(logfile,"TIMESTAMP: %s\n",pszTimeStamp());
  34. pduLog(logfile,"LAYER: GCC\n");
  35. pduLog(logfile,"DIRECTION: None\n");
  36. pduLog(logfile,"RAW_PDU: - - - - - - - - RAW PDU - - - - - - - -\n");
  37. pduLog(logfile,"DECODED_PDU: - - - - - - - DECODED PDU - - - - - - -\n");
  38. pduLog(logfile,"PDU_TYPE: Bogus PDU to start the logging.\n");
  39. pduLog(logfile,"END_PDU: ================================ END PDU =============================\n");
  40. fclose(logfile);
  41. return(0);
  42. }
  43. /*********************************************************************/
  44. char *pszTimeStamp()
  45. {
  46. char *timestring;
  47. timestring = (char *) malloc (13*sizeof(char));
  48. _strtime(timestring);
  49. return(timestring);
  50. }
  51. /*********************************************************************/
  52. void pduFragmentation(FILE *logfile,unsigned int i)
  53. {
  54. pduLog(logfile," PDU Fragmentation: ");
  55. if(i==1)
  56. {
  57. pduLog(logfile,"Complete PDU\n");
  58. }
  59. else
  60. {
  61. pduLog(logfile,"!!!! Icomplete PDU !!!!\n");
  62. }
  63. }
  64. /*********************************************************************/
  65. void pduRawOutput (FILE *logfile,unsigned char *data, unsigned long length)
  66. {
  67. unsigned int i=0,j=0;
  68. pduLog(logfile," ");
  69. for (i=0; i<length; i++)
  70. {
  71. pduLog(logfile,"%02x ",*(data+i));
  72. j++;
  73. if (j >= 16)
  74. {
  75. pduLog(logfile,"\n ");
  76. j=0;
  77. }
  78. }
  79. pduLog(logfile,"\n");
  80. }
  81. /*********************************************************************/
  82. void gccLog(PPacket packet, PGCCPDU gcc_pdu, unsigned int direction, int mcs_pdu)
  83. {
  84. FILE *logfile;
  85. logfile = fopen(LOG_FILE_NAME,"a+");
  86. pduLog(logfile,"START_PDU: ============================== START PDU ===========================\n");
  87. pduLog(logfile,"TIMESTAMP: %s\n",pszTimeStamp());
  88. pduLog(logfile,"LAYER: GCC\n");
  89. pduDirection(logfile,direction);
  90. pduLog(logfile,"RAW_PDU: - - - - - - - - RAW PDU - - - - - - - -\n");
  91. pduLog(logfile," %d octets (hex output):\n",packet->GetEncodedDataLength());
  92. pduRawOutput(logfile,packet->GetEncodedData(1),packet->GetEncodedDataLength());
  93. pduLog(logfile,"DECODED_PDU: - - - - - - - DECODED PDU - - - - - - -\n");
  94. pduFragmentation(logfile,packet->IsValid());
  95. pduLogGCCInformation(logfile,gcc_pdu);
  96. pduLog(logfile,"END_PDU: ================================ END PDU =============================\n");
  97. fclose(logfile);
  98. }
  99. /*********************************************************************/
  100. void gccConnectLog(PPacket packet, PConnectGCCPDU connect_pdu, unsigned int direction, int mcs_pdu)
  101. {
  102. FILE *logfile;
  103. logfile = fopen(LOG_FILE_NAME,"a+");
  104. pduLog(logfile,"START_PDU: ============================== START PDU ===========================\n");
  105. pduLog(logfile,"TIMESTAMP: %s\n",pszTimeStamp());
  106. pduLog(logfile,"LAYER: GCC\n");
  107. pduDirection(logfile,direction);
  108. pduLog(logfile,"RAW_PDU: - - - - - - - - RAW PDU - - - - - - - -\n");
  109. pduLog(logfile," %d octets (hex output):\n",packet->GetEncodedDataLength());
  110. if(direction==RECEIVED)
  111. pduRawOutput(logfile,packet->GetEncodedData(1),packet->GetEncodedDataLength());
  112. pduLog(logfile,"DECODED_PDU: - - - - - - - DECODED PDU - - - - - - -\n");
  113. pduFragmentation(logfile,packet->IsValid());
  114. pduLogGCCConnectInfo(logfile,connect_pdu);
  115. pduLog(logfile,"END_PDU: ================================ END PDU =============================\n");
  116. fclose(logfile);
  117. }
  118. /*********************************************************************/
  119. void pduDirection(FILE *logfile,unsigned int direction)
  120. {
  121. switch(direction)
  122. {
  123. case SENT:
  124. pduLog(logfile,"DIRECTION: Sent\n");
  125. break;
  126. case RECEIVED:
  127. pduLog(logfile,"DIRECTION: Received\n");
  128. break;
  129. case FORWARDED:
  130. pduLog(logfile,"DIRECTION: Forwarded\n");
  131. break;
  132. default:
  133. pduLog(logfile,"DIRECTION: Unknown\n");
  134. break;
  135. }
  136. }
  137. /*********************************************************************/
  138. void pduLog (FILE *pFile, char * format,...)
  139. {
  140. char *argument_ptr;
  141. argument_ptr = (char *) &format + sizeof (format);
  142. vfprintf (pFile, format, argument_ptr);
  143. }
  144. /*********************************************************************/
  145. void pduLogUserIDIndication(FILE *logfile,PGCCPDU gcc_pdu)
  146. {
  147. pduLog(logfile,"PDU_TYPE: GCC_UserIDIndication\n");
  148. pduLog(logfile," Tag: %d\n",gcc_pdu->u.indication.u.user_id_indication.tag);
  149. }
  150. /*********************************************************************/
  151. void pduLogRosterUpdateIndication(FILE *logfile, PGCCPDU gcc_pdu)
  152. {
  153. pduLog(logfile,"PDU_TYPE: GCC_RosterUpdateIndication\n");
  154. pduLog(logfile,"Conference Information\n");
  155. pduLog(logfile,"\tFull refresh flag: %d\n",
  156. gcc_pdu->u.indication.u.roster_update_indication.refresh_is_full);
  157. PrintConferenceRoster(logfile,gcc_pdu->u.indication.u.roster_update_indication.node_information);
  158. PrintApplicationRoster(logfile,gcc_pdu->u.indication.u.roster_update_indication.application_information);
  159. }
  160. /*********************************************************************/
  161. void pduLogTextMessageIndication(FILE *logfile, PGCCPDU gcc_pdu)
  162. {
  163. Char print_buffer[255];
  164. pduLog(logfile,"PDU_TYPE: GCC_TextMessageIndication\n");
  165. pduLog(logfile,"Message: %d octets (hex output) \n",
  166. gcc_pdu->u.indication.u.text_message_indication.message.length);
  167. pduRawOutput(logfile,
  168. (unsigned char *) gcc_pdu->u.indication.u.text_message_indication.message.value,
  169. gcc_pdu->u.indication.u.text_message_indication.message.length);
  170. if(CopyTextToChar(print_buffer,gcc_pdu->u.indication.u.text_message_indication.message))
  171. pduLog(logfile,"Text: %s\n",print_buffer);
  172. }
  173. /*********************************************************************/
  174. void pduLogConferenceTerminateIndication(FILE *logfile, PGCCPDU gcc_pdu)
  175. {
  176. char szReason[255];
  177. pduLog(logfile,"PDU_TYPE: GCC_ConferenceTerminateIndication\n");
  178. if(gcc_pdu->u.indication.u.conference_terminate_indication.reason == 0)
  179. strcpy(szReason,"User Initiated");
  180. else
  181. strcpy(szReason,"Terminated Confernece");
  182. pduLog(logfile,"\tReason: %s\n",szReason);
  183. }
  184. /*********************************************************************/
  185. void pduLogConferenceEjectUserIndication(FILE *logfile, PGCCPDU gcc_pdu)
  186. {
  187. pduLog(logfile,"PDU_TYPE: GCC_ConferenceEjectUserIndication\n");
  188. pduLog(logfile,"\tNode to Eject: %u\n",
  189. gcc_pdu->u.indication.u.conference_eject_user_indication.node_to_eject);
  190. switch(gcc_pdu->u.indication.u.conference_eject_user_indication.reason)
  191. {
  192. case 0:
  193. pduLog(logfile,"\tReason: USER_INITIATED\n");
  194. break;
  195. case 1:
  196. pduLog(logfile,"\tReason: HIGHER_NODE_DISCONNECTED\n");
  197. break;
  198. case 2:
  199. pduLog(logfile,"\tReason: HIGHER_NODE_EJECTED\n");
  200. break;
  201. default:
  202. pduLog(logfile,"\tReason: >>> Unkown Reason for Ejection <<<\n");
  203. }
  204. }
  205. /*********************************************************************/
  206. void pduLogConferenceJoinRequest(FILE *logfile, PGCCPDU gcc_pdu)
  207. {
  208. outdeb("TOP: pduLogConferenceJoinRequest\n");
  209. pduLog(logfile,"PDU_TYPE: GCC_ConferenceJoinRequest\n");
  210. PrintConferenceName(logfile,
  211. gcc_pdu->u.request.u.conference_join_request.conference_name);
  212. pduLog(logfile,"\tTag: %u\n",
  213. gcc_pdu->u.request.u.conference_join_request.tag);
  214. if(gcc_pdu->u.request.u.conference_join_request.bit_mask & 0x10)
  215. {
  216. PrintPasswordChallengeRequestResponse(logfile,
  217. gcc_pdu->u.request.u.conference_join_request.cjrq_password);
  218. }
  219. if(gcc_pdu->u.request.u.conference_join_request.bit_mask & 0x08)
  220. {
  221. pduLog(logfile,"\tConvener ");
  222. PrintPasswordSelector(logfile,
  223. gcc_pdu->u.request.u.conference_join_request.cjrq_convener_password);
  224. }
  225. //insert caller id here.
  226. outdeb("Botton: pduLogConferenceJoinRequest\n");
  227. }
  228. /*********************************************************************/
  229. void pduLogConnectJoinRequest(FILE *logfile, PConnectGCCPDU connect_pdu)
  230. {
  231. outdeb("TOP: pduLogConnectJoinRequest\n");
  232. pduLog(logfile,"PDU_TYPE: GCC_ConferenceJoinRequest\n");
  233. PrintConferenceName(logfile,
  234. connect_pdu->u.connect_join_request.conference_name);
  235. pduLog(logfile,"\tTag: %u\n",
  236. connect_pdu->u.connect_join_request.tag);
  237. if(connect_pdu->u.connect_join_request.bit_mask & 0x10)
  238. {
  239. PrintPasswordChallengeRequestResponse(logfile,
  240. connect_pdu->u.connect_join_request.cjrq_password);
  241. }
  242. if(connect_pdu->u.connect_join_request.bit_mask & 0x10)
  243. {
  244. pduLog(logfile,"\tConvener ");
  245. PrintPasswordSelector(logfile,
  246. connect_pdu->u.connect_join_request.cjrq_convener_password);
  247. }
  248. //insert caller id here.
  249. outdeb("BOTTOM: pduLogConnectJoinRequest\n");
  250. }
  251. /*********************************************************************/
  252. void pduLogQueryResponse(FILE *logfile, PConnectGCCPDU connect_pdu)
  253. {
  254. UShort i=0;
  255. SetOfConferenceDescriptors * conference_list;
  256. CHAR print_buffer[255] = " ";
  257. pduLog(logfile,"PDU_TYPE: GCC_ConferenceQueryResponse\n");
  258. pduLog(logfile,"Node Query Information:\n");
  259. switch(connect_pdu->u.conference_query_response.node_type)
  260. {
  261. case GCC_TERMINAL:
  262. pduLog( logfile, "\tnode_type = GCC_TERMINAL\n");
  263. break;
  264. case GCC_MULTIPORT_TERMINAL:
  265. pduLog( logfile,
  266. "\tnode_type = GCC_MULTIPORT_TERMINAL\n");
  267. break;
  268. case GCC_MCU:
  269. pduLog( logfile, "\tnode_type = GCC_MCU\n");
  270. break;
  271. default:
  272. pduLog( logfile,
  273. "\tGCCNODE: ERROR: UNKNOWN NODE TYPE\n");
  274. break;
  275. }
  276. // get a pointer to the returned conference list
  277. conference_list = connect_pdu->u.conference_query_response.conference_list;
  278. for(i=0;conference_list != NULL;i++)
  279. {
  280. pduLog(logfile,"\t**** Conference Record %u ****\n",i);
  281. pduLog(logfile,"\tConference Numeric Name: %s\n",
  282. conference_list->value.conference_name.numeric);
  283. CopySimpleTextToChar(print_buffer,
  284. conference_list->value.conference_name.conference_name_text);
  285. pduLog(logfile,"\tConference Text Name: %s\n",print_buffer);
  286. PrintT120Boolean(logfile,"conference_is_locked = ",
  287. conference_list->value.conference_is_locked);
  288. PrintT120Boolean(logfile,"clear_password_required = ",
  289. conference_list->value.clear_password_required);
  290. conference_list = conference_list->next;
  291. }
  292. }
  293. /*********************************************************************/
  294. void pduLogConferenceCreateRequest(FILE *logfile, PConnectGCCPDU connect_pdu)
  295. {
  296. char print_buffer[255] = "";
  297. pduLog(logfile,"PDU_TYPE: GCC_ConferenceCreateRequest\n");
  298. pduLog(logfile,"\tConference Numeric Name: %s\n",
  299. connect_pdu->u.conference_create_request.conference_name.numeric);
  300. CopySimpleTextToChar(print_buffer,
  301. connect_pdu->u.conference_create_request.conference_name.conference_name_text);
  302. pduLog(logfile,"\tConference Text Name: %s\n",print_buffer);
  303. PrintT120Boolean(logfile,
  304. "\tConference Is Locked: ",
  305. connect_pdu->u.conference_create_request.conference_is_locked);
  306. PrintT120Boolean(logfile,
  307. "\tConference Is Listed: ",
  308. connect_pdu->u.conference_create_request.conference_is_locked);
  309. PrintT120Boolean(logfile,
  310. "\tConference Is Conductible: ",
  311. connect_pdu->u.conference_create_request.conference_is_conductible);
  312. switch(connect_pdu->u.conference_create_request.termination_method)
  313. {
  314. case 0:
  315. pduLog(logfile,"\tTermination Method: AUTOMATIC\n");
  316. break;
  317. case 1:
  318. pduLog(logfile,"\tTermination Method: MANUAL \n");
  319. break;
  320. default:
  321. pduLog(logfile,"\tTermination Method: UNKOWN \n");
  322. break;
  323. }
  324. CopyTextToChar(print_buffer,
  325. connect_pdu->u.conference_create_request.ccrq_caller_id);
  326. pduLog(logfile,"\tCaller ID: %s\n",print_buffer);
  327. }
  328. /*********************************************************************/
  329. void pduLogConferenceCreateResponse(FILE *logfile, PConnectGCCPDU connect_pdu)
  330. {
  331. pduLog(logfile,"PDU_TYPE: GCC_ConferenceCreateResponse\n");
  332. pduLog(logfile,"\tNode ID: %u\n",
  333. connect_pdu->u.conference_create_response.node_id);
  334. pduLog(logfile,"\tTag: %d\n",connect_pdu->u.conference_create_response.tag);
  335. switch(connect_pdu->u.conference_create_response.result)
  336. {
  337. case 0:
  338. pduLog(logfile,"\tResult: SUCCESS\n");
  339. break;
  340. case 1:
  341. pduLog(logfile,"\tResult: USER_REJECTED\n");
  342. break;
  343. case 2:
  344. pduLog(logfile,"\tResult: LOW_RESOURCES\n");
  345. break;
  346. case 3:
  347. pduLog(logfile,"\tResult: REJECTED_FOR_BREAKING_SYMMETRY\n");
  348. break;
  349. case 4:
  350. pduLog(logfile,"\tResult: LOCKED_CONFERENCE_NOT_SUPPORTED\n");
  351. break;
  352. default:
  353. pduLog(logfile,"\tResult: >>> Unkown Result Type\n");
  354. break;
  355. }
  356. }
  357. /*********************************************************************/
  358. void pduLogConnectJoinResponse(FILE *logfile, PConnectGCCPDU connect_pdu)
  359. {
  360. pduLog(logfile,"PDU_TYPE: GCC_ConferenceJoinResponse\n");
  361. pduLog(logfile,"\tcjrs_node_id [%u]\n",
  362. connect_pdu->u.connect_join_response.cjrs_node_id);
  363. pduLog(logfile,"\ttop_node_id [%u]\n",
  364. connect_pdu->u.connect_join_response.top_node_id);
  365. PrintConferenceName(logfile,
  366. connect_pdu->u.connect_join_response.conference_name_alias);
  367. PrintT120Boolean(logfile,"\tclear_password_required = ",
  368. connect_pdu->u.connect_join_response.clear_password_required);
  369. PrintT120Boolean(logfile,"\tconference_is_locked = ",
  370. connect_pdu->u.connect_join_response.conference_is_locked);
  371. PrintT120Boolean(logfile,"\tconference_is_listed = ",
  372. connect_pdu->u.connect_join_response.conference_is_listed);
  373. PrintT120Boolean(logfile,"\tconference_is_conductible = ",
  374. connect_pdu->u.connect_join_response.conference_is_conductible);
  375. switch(connect_pdu->u.connect_join_response.termination_method)
  376. {
  377. case 0:
  378. pduLog(logfile,"\tTermination Method: AUTOMATIC\n");
  379. break;
  380. case 1:
  381. pduLog(logfile,"\tTermination Method: MANUAL \n");
  382. break;
  383. default:
  384. pduLog(logfile,"\tTermination Method: UNKOWN \n");
  385. break;
  386. }
  387. switch(connect_pdu->u.connect_join_response.result)
  388. {
  389. case 0:
  390. pduLog(logfile,"\tResult: RESULT_SUCESS\n");
  391. break;
  392. case 1:
  393. pduLog(logfile,"\tResult: USER_REJECTED\n");
  394. break;
  395. case 2:
  396. pduLog(logfile,"\tResult: INVALID_CONFERENCE\n");
  397. break;
  398. case 3:
  399. pduLog(logfile,"\tResult: INALID_PASSWORD\n");
  400. break;
  401. case 4:
  402. pduLog(logfile,"\tResult: INVALID_CONVENER_PASSWORD\n");
  403. break;
  404. case 5:
  405. pduLog(logfile,"\tResult: CHALLENGE_RESPONSE_REQUIRED\n");
  406. break;
  407. case 6:
  408. pduLog(logfile,"\tResult: INVALID_CHALLENGE_RESPONSE\n");
  409. break;
  410. default:
  411. pduLog(logfile,"\tResult: >>>> Unkown Result <<<< \n");
  412. break;
  413. }
  414. }
  415. /*********************************************************************/
  416. void pduLogConferenceJoinResponse(FILE *logfile, PGCCPDU gcc_pdu)
  417. {
  418. pduLog(logfile,"PDU_TYPE: GCC_ConferenceJoinResponse\n");
  419. pduLog(logfile,"\tcjrs_node_id [%u]\n",
  420. gcc_pdu->u.response.u.conference_join_response.cjrs_node_id);
  421. pduLog(logfile,"\ttop_node_id [%u]\n",
  422. gcc_pdu->u.response.u.conference_join_response.top_node_id);
  423. PrintConferenceName(logfile,
  424. gcc_pdu->u.response.u.conference_join_response.conference_name_alias);
  425. PrintT120Boolean(logfile,"\tclear_password_required = ",
  426. gcc_pdu->u.response.u.conference_join_response.clear_password_required);
  427. PrintT120Boolean(logfile,"\tconference_is_locked = ",
  428. gcc_pdu->u.response.u.conference_join_response.conference_is_locked);
  429. PrintT120Boolean(logfile,"\tconference_is_listed = ",
  430. gcc_pdu->u.response.u.conference_join_response.conference_is_listed);
  431. PrintT120Boolean(logfile,"\tconference_is_conductible = ",
  432. gcc_pdu->u.response.u.conference_join_response.conference_is_conductible);
  433. switch(gcc_pdu->u.response.u.conference_join_response.termination_method)
  434. {
  435. case 0:
  436. pduLog(logfile,"\tTermination Method: AUTOMATIC\n");
  437. break;
  438. case 1:
  439. pduLog(logfile,"\tTermination Method: MANUAL \n");
  440. break;
  441. default:
  442. pduLog(logfile,"\tTermination Method: UNKOWN \n");
  443. break;
  444. }
  445. switch(gcc_pdu->u.response.u.conference_join_response.result)
  446. {
  447. case 0:
  448. pduLog(logfile,"\tResult: RESULT_SUCESS\n");
  449. break;
  450. case 1:
  451. pduLog(logfile,"\tResult: USER_REJECTED\n");
  452. break;
  453. case 2:
  454. pduLog(logfile,"\tResult: INVALID_CONFERENCE\n");
  455. break;
  456. case 3:
  457. pduLog(logfile,"\tResult: INALID_PASSWORD\n");
  458. break;
  459. case 4:
  460. pduLog(logfile,"\tResult: INVALID_CONVENER_PASSWORD\n");
  461. break;
  462. case 5:
  463. pduLog(logfile,"\tResult: CHALLENGE_RESPONSE_REQUIRED\n");
  464. break;
  465. case 6:
  466. pduLog(logfile,"\tResult: INVALID_CHALLENGE_RESPONSE\n");
  467. break;
  468. default:
  469. pduLog(logfile,"\tResult: >>>> Unkown Result <<<< \n");
  470. break;
  471. }
  472. }
  473. /*********************************************************************/
  474. void pduLogConferenceInviteRequest(FILE *logfile, PConnectGCCPDU connect_pdu)
  475. {
  476. char print_buffer[255] = " ";
  477. pduLog(logfile,"PDU_TYPE: GCC_ConferenceInviteRequest\n");
  478. pduLog(logfile,"\tConference Numeric Name: %s\n",
  479. connect_pdu->u.conference_invite_request.conference_name.numeric);
  480. CopySimpleTextToChar(print_buffer,
  481. connect_pdu->u.conference_invite_request.conference_name.conference_name_text);
  482. pduLog(logfile,"\tConference Text Name: %s\n",print_buffer);
  483. pduLog(logfile,"\tnode_id [%u]\n",
  484. connect_pdu->u.conference_invite_request.node_id);
  485. pduLog(logfile,"\top_node_id [%u]\n",
  486. connect_pdu->u.conference_invite_request.top_node_id);
  487. PrintT120Boolean(logfile,"\tclear_password_required = ",
  488. connect_pdu->u.conference_invite_request.clear_password_required);
  489. PrintT120Boolean(logfile,"\tconference_is_locked = ",
  490. connect_pdu->u.conference_invite_request.conference_is_locked);
  491. PrintT120Boolean(logfile,"\tconference_is_conductible = ",
  492. connect_pdu->u.conference_invite_request.conference_is_conductible);
  493. switch(connect_pdu->u.conference_invite_request.termination_method)
  494. {
  495. case 0:
  496. pduLog(logfile,"\tTermination Method: AUTOMATIC\n");
  497. break;
  498. case 1:
  499. pduLog(logfile,"\tTermination Method: MANUAL \n");
  500. break;
  501. default:
  502. pduLog(logfile,"\tTermination Method: UNKOWN \n");
  503. break;
  504. }
  505. }
  506. /*********************************************************************/
  507. void pduLogConferenceInviteResponse(FILE *logfile, PConnectGCCPDU connect_pdu)
  508. {
  509. pduLog(logfile,"PDU_TYPE: GCC_ConferenceInviteResponse\n");
  510. switch(connect_pdu->u.conference_invite_response.result)
  511. {
  512. case 0:
  513. pduLog(logfile,"\tResult: RESULT_SUCCESS\n");
  514. break;
  515. case 1:
  516. pduLog(logfile,"\tResult: USER_REJECTED\n");
  517. break;
  518. default:
  519. pduLog(logfile,"\t>>>> Unkonw Result <<<<\n");
  520. break;
  521. }
  522. }
  523. /*********************************************************************/
  524. void pduLogConferenceAddRequest(FILE *logfile, PGCCPDU gcc_pdu)
  525. {
  526. pduLog(logfile,"PDU_TYPE: GCC_ConferenceAddRequest\n");
  527. pduLog(logfile,"\tNot printing add_request_net_address -- todo later\n");
  528. pduLog(logfile,"\trequesting_node = [%u]\n",gcc_pdu->u.request.u.conference_add_request.requesting_node);
  529. pduLog(logfile,"\ttag = [%l]\n",gcc_pdu->u.request.u.conference_add_request.tag);
  530. if(gcc_pdu->u.request.u.conference_add_request.bit_mask & 0x80) // adding mcu presnt
  531. {
  532. pduLog(logfile,"\tadding_mcu = [%u]\n",
  533. gcc_pdu->u.request.u.conference_add_request.adding_mcu);
  534. }
  535. }
  536. /*********************************************************************/
  537. void pduLogConferenceAddResponse(FILE *logfile, PGCCPDU gcc_pdu)
  538. {
  539. pduLog(logfile,"PDU_TYPE: GCC_ConferenceAddResponse\n");
  540. pduLog(logfile,"\ttag = [%l]\n",gcc_pdu->u.response.u.conference_add_response.tag);
  541. PrintConferenceAddResult(logfile,gcc_pdu->u.response.u.conference_add_response.result);
  542. // user data is optional.
  543. }
  544. /*********************************************************************/
  545. void pduLogGCCConnectInfo(FILE *logfile, PConnectGCCPDU connect_pdu)
  546. {
  547. switch(connect_pdu->choice)
  548. {
  549. case CONFERENCE_CREATE_REQUEST_CHOSEN:
  550. {
  551. pduLogConferenceCreateRequest(logfile,connect_pdu);
  552. }
  553. break;
  554. case CONFERENCE_CREATE_RESPONSE_CHOSEN:
  555. {
  556. pduLogConferenceCreateResponse(logfile, connect_pdu);
  557. }
  558. break;
  559. case CONFERENCE_QUERY_REQUEST_CHOSEN:
  560. {
  561. pduLog(logfile,"PDU_TYPE: GCC_ConferenceQueryRequest\n");
  562. }
  563. break;
  564. case CONFERENCE_QUERY_RESPONSE_CHOSEN:
  565. {
  566. pduLogQueryResponse(logfile,connect_pdu);
  567. //pduLog(logfile,"PDU_TYPE: GCC_ConferenceQueryResponse\n");
  568. }
  569. break;
  570. case CONNECT_JOIN_REQUEST_CHOSEN:
  571. {
  572. pduLogConnectJoinRequest(logfile,connect_pdu);
  573. }
  574. break;
  575. case CONNECT_JOIN_RESPONSE_CHOSEN:
  576. {
  577. pduLogConnectJoinResponse(logfile,connect_pdu);
  578. }
  579. break;
  580. case CONFERENCE_INVITE_REQUEST_CHOSEN:
  581. {
  582. pduLogConferenceInviteRequest(logfile,connect_pdu);
  583. }
  584. break;
  585. case CONFERENCE_INVITE_RESPONSE_CHOSEN:
  586. {
  587. pduLogConferenceInviteResponse(logfile,connect_pdu);
  588. }
  589. break;
  590. default:
  591. {
  592. pduLog(logfile,"PDU_TYPE: ERROR -- Cannot decode the ConnectGCCPDU\n");
  593. }
  594. break;
  595. }
  596. }
  597. /*********************************************************************/
  598. void pduLogGCCInformation(FILE *logfile, PGCCPDU gcc_pdu)
  599. {
  600. switch(gcc_pdu->choice)
  601. {
  602. case INDICATION_CHOSEN:
  603. {
  604. switch(gcc_pdu->u.indication.choice)
  605. {
  606. case USER_ID_INDICATION_CHOSEN:
  607. {
  608. pduLogUserIDIndication(logfile,gcc_pdu);
  609. }
  610. break;
  611. case ROSTER_UPDATE_INDICATION_CHOSEN:
  612. {
  613. pduLogRosterUpdateIndication(logfile,gcc_pdu);
  614. }
  615. break;
  616. case TEXT_MESSAGE_INDICATION_CHOSEN:
  617. {
  618. pduLogTextMessageIndication(logfile,gcc_pdu);
  619. }
  620. break;
  621. case CONFERENCE_LOCK_INDICATION_CHOSEN:
  622. {
  623. pduLog(logfile,"PDU_TYPE: GCC_ConferenceLockIndication\n");
  624. }
  625. break;
  626. case CONFERENCE_UNLOCK_INDICATION_CHOSEN:
  627. {
  628. pduLog(logfile,"PDU_TYPE: GCC_ConferenceUnlockIndication\n");
  629. }
  630. break;
  631. case CONDUCTOR_RELEASE_INDICATION_CHOSEN:
  632. {
  633. pduLog(logfile,"PDU_TYPE: GCC_ConductorRelaseIndication\n");
  634. }
  635. break;
  636. case CONFERENCE_TERMINATE_INDICATION_CHOSEN:
  637. {
  638. pduLogConferenceTerminateIndication(logfile,gcc_pdu);
  639. }
  640. break;
  641. case CONDUCTOR_ASSIGN_INDICATION_CHOSEN:
  642. {
  643. pduLog(logfile,"PDU_TYPE: GCC_ConductorAssignIndication\n");
  644. pduLog(logfile," User ID: %d\n",
  645. gcc_pdu->u.indication.u.conductor_assign_indication.user_id);
  646. }
  647. break;
  648. case CONDUCTOR_PERMISSION_ASK_INDICATION_CHOSEN:
  649. {
  650. pduLog(logfile,"PDU_TYPE: GCC_ConductorPermissionAskIndication\n");
  651. pduLog(logfile," Permission Granted Flag: %d\n",
  652. gcc_pdu->u.indication.u.conductor_permission_ask_indication.permission_is_granted);
  653. }
  654. break;
  655. case CONDUCTOR_PERMISSION_GRANT_INDICATION_CHOSEN:
  656. {
  657. pduLog(logfile,"PDU_TYPE: GCC_ConductorPermissionGrantIndication\n");
  658. }
  659. break;
  660. case APPLICATION_INVOKE_INDICATION_CHOSEN:
  661. {
  662. pduLog(logfile,"PDU_TYPE: GCC_ApplicationInvokeIndication\n");
  663. }
  664. break;
  665. case CONFERENCE_TRANSFER_INDICATION_CHOSEN:
  666. {
  667. pduLog(logfile,"PDU_TYPE: GCC_ConferenceTransferIndication\n");
  668. }
  669. break;
  670. case REGISTRY_MONITOR_ENTRY_INDICATION_CHOSEN:
  671. {
  672. pduLog(logfile,"PDU_TYPE: GCC_RegistryMonitorEntryIndication\n");
  673. }
  674. break;
  675. case CONFERENCE_TIME_REMAINING_INDICATION_CHOSEN:
  676. {
  677. pduLog(logfile,"PDU_TYPE: GCC_ConferenceTimeRemainingIndication\n");
  678. }
  679. break;
  680. case CONFERENCE_TIME_INQUIRE_INDICATION_CHOSEN:
  681. {
  682. pduLog(logfile,"PDU_TYPE: GCC_ConferenceTimeInquireIndication\n");
  683. }
  684. break;
  685. case CONFERENCE_TIME_EXTEND_INDICATION_CHOSEN:
  686. {
  687. pduLog(logfile,"PDU_TYPE: GCC_ConferenceTimeExtendIndication\n");
  688. }
  689. break;
  690. case CONFERENCE_EJECT_USER_INDICATION_CHOSEN:
  691. {
  692. pduLogConferenceEjectUserIndication(logfile,gcc_pdu);
  693. }
  694. break;
  695. case NON_STANDARD_INDICATION_CHOSEN:
  696. {
  697. pduLog(logfile,"PDU_TYPE: GCC_NonStandardPDU\n");
  698. }
  699. break;
  700. default:
  701. {
  702. pduLog(logfile,"PDU_TYPE: ERROR -- Cannot decode the Indication GCCPDU\n");
  703. }
  704. break;
  705. }
  706. }
  707. break;
  708. case RESPONSE_CHOSEN:
  709. {
  710. switch(gcc_pdu->u.response.choice)
  711. {
  712. case CONFERENCE_JOIN_RESPONSE_CHOSEN:
  713. {
  714. pduLogConferenceJoinResponse(logfile,gcc_pdu);
  715. }
  716. break;
  717. case CONFERENCE_ADD_RESPONSE_CHOSEN:
  718. {
  719. pduLog(logfile,"PDU_TYPE: GCC_ConferenceAddResponse\n");
  720. }
  721. break;
  722. case CONFERENCE_LOCK_RESPONSE_CHOSEN:
  723. {
  724. pduLog(logfile,"PDU_TYPE: GCC_ConferenceLockResponse\n");
  725. }
  726. break;
  727. case CONFERENCE_UNLOCK_RESPONSE_CHOSEN:
  728. {
  729. pduLog(logfile,"PDU_TYPE: GCC_ConferenceUnlockResponse\n");
  730. }
  731. case CONFERENCE_TERMINATE_RESPONSE_CHOSEN:
  732. {
  733. pduLog(logfile,"PDU_TYPE: GCC_ConferenceTerminateResponse\n");
  734. switch(gcc_pdu->u.response.u.conference_terminate_response.result)
  735. {
  736. case 0:
  737. pduLog(logfile,"\tResult: RESULT_SUCESS\n");
  738. break;
  739. case 1:
  740. pduLog(logfile,"\tResult: INVALID_REQUESTOR\n");
  741. break;
  742. default:
  743. pduLog(logfile,"\tResult: >>> Unknown Result <<<\n");
  744. break;
  745. }
  746. }
  747. break;
  748. case CONFERENCE_EJECT_USER_RESPONSE_CHOSEN:
  749. {
  750. pduLog(logfile,"PDU_TYPE: GCC_EjectUserResponse\n");
  751. pduLog(logfile,"\tnode_to_eject: [%u]\n",
  752. gcc_pdu->u.response.u.conference_eject_user_response.node_to_eject);
  753. switch(gcc_pdu->u.response.u.conference_eject_user_response.result)
  754. {
  755. case 0:
  756. pduLog(logfile,"\tResult: RESULT_SUCCESS\n");
  757. break;
  758. case 1:
  759. pduLog(logfile,"\tResult: INVALID_REQUESTER\n");
  760. break;
  761. default:
  762. pduLog(logfile,"\tResult: >>> Unkown Result <<<\n");
  763. break;
  764. }
  765. }
  766. break;
  767. case CONFERENCE_TRANSFER_RESPONSE_CHOSEN:
  768. {
  769. pduLog(logfile,"PDU_TYPE: GCC_ConferenceTransferResponse\n");
  770. }
  771. break;
  772. case REGISTRY_RESPONSE_CHOSEN:
  773. {
  774. pduLog(logfile,"PDU_TYPE: GCC_RegistryResponse\n");
  775. }
  776. break;
  777. case REGISTRY_ALLOCATE_HANDLE_RESPONSE_CHOSEN:
  778. {
  779. pduLog(logfile,"PDU_TYPE: GCC_RegistryAllocateHandleResponse\n");
  780. }
  781. break;
  782. case FUNCTION_NOT_SUPPORTED_RESPONSE_CHOSEN:
  783. {
  784. pduLog(logfile,"PDU_TYPE: GCC_FunctionNotSupported\n");
  785. }
  786. break;
  787. case NON_STANDARD_RESPONSE_CHOSEN:
  788. {
  789. pduLog(logfile,"PDU_TYPE: GCC_NonStandardResponse\n");
  790. }
  791. break;
  792. default:
  793. {
  794. pduLog(logfile,"PDU_TYPE: ERROR -- Cannot decode Response GCC PDU\n");
  795. }
  796. break;
  797. }
  798. }
  799. break;
  800. case REQUEST_CHOSEN:
  801. {
  802. switch(gcc_pdu->u.request.choice)
  803. {
  804. case CONFERENCE_JOIN_REQUEST_CHOSEN:
  805. {
  806. pduLogConferenceJoinRequest(logfile,gcc_pdu);
  807. }
  808. break;
  809. case CONFERENCE_ADD_REQUEST_CHOSEN:
  810. {
  811. //pduLog(logfile,"PDU_TYPE: GCC_ConferenceAddRequest\n");
  812. pduLogConferenceAddRequest(logfile,gcc_pdu);
  813. }
  814. break;
  815. case CONFERENCE_LOCK_REQUEST_CHOSEN:
  816. {
  817. pduLog(logfile,"PDU_TYPE: GCC_ConferenceLockRequest\n");
  818. }
  819. break;
  820. case CONFERENCE_UNLOCK_REQUEST_CHOSEN:
  821. {
  822. pduLog(logfile,"PDU_TYPE: GCC_ConferenceUnlockRequest\n");
  823. }
  824. break;
  825. case CONFERENCE_TERMINATE_REQUEST_CHOSEN:
  826. {
  827. pduLog(logfile,"PDU_TYPE: GCC_ConferenceTerminateRequest\n");
  828. switch(gcc_pdu->u.request.u.conference_terminate_request.reason)
  829. {
  830. case 0:
  831. pduLog(logfile,"\tReason: USER_INITIATED\n");
  832. break;
  833. case 1:
  834. pduLog(logfile,"\tReason: CONFERENCE_TERMINATED\n");
  835. break;
  836. default:
  837. pduLog(logfile,"\tReason: >>> Unkown Reason <<<\n");
  838. break;
  839. }
  840. }
  841. break;
  842. case CONFERENCE_EJECT_USER_REQUEST_CHOSEN:
  843. {
  844. pduLog(logfile,"PDU_TYPE: GCC_EjectUserRequest\n");
  845. pduLog(logfile,"\tnode_to_eject: [%u]\n",
  846. gcc_pdu->u.request.u.conference_eject_user_request.node_to_eject);
  847. pduLog(logfile,"\tReason: USER_INITIATED\n");
  848. // Note there is only one reason for a eject request
  849. }
  850. break;
  851. case CONFERENCE_TRANSFER_REQUEST_CHOSEN:
  852. {
  853. pduLog(logfile,"PDU_TYPE: GCC_ConferenceTransferRequest\n");
  854. }
  855. break;
  856. case REGISTRY_REGISTER_CHANNEL_REQUEST_CHOSEN:
  857. {
  858. pduLog(logfile,"PDU_TYPE: GCC_RegistryRegisterChannelRequest\n");
  859. }
  860. break;
  861. case REGISTRY_ASSIGN_TOKEN_REQUEST_CHOSEN:
  862. {
  863. pduLog(logfile,"PDU_TYPE: GCC_AssignTokenRequest\n");
  864. }
  865. break;
  866. case REGISTRY_SET_PARAMETER_REQUEST_CHOSEN:
  867. {
  868. pduLog(logfile,"PDU_TYPE: GCC_RegistrySetParameterRequest\n");
  869. }
  870. break;
  871. case REGISTRY_RETRIEVE_ENTRY_REQUEST_CHOSEN:
  872. {
  873. pduLog(logfile,"PDU_TYPE: GCC_RegistryRetrieveEntryRequest\n");
  874. }
  875. break;
  876. case REGISTRY_DELETE_ENTRY_REQUEST_CHOSEN:
  877. {
  878. pduLog(logfile,"PDU_TYPE: GCC_RegistryDeleteEntryRequest\n");
  879. }
  880. break;
  881. case REGISTRY_MONITOR_ENTRY_REQUEST_CHOSEN:
  882. {
  883. pduLog(logfile,"PDU_TYPE: GCC_RegistryMonitorEntryRequest\n");
  884. }
  885. break;
  886. case REGISTRY_ALLOCATE_HANDLE_REQUEST_CHOSEN:
  887. {
  888. pduLog(logfile,"PDU_TYPE: GCC_RegistryAllocateHandleRequest\n");
  889. }
  890. break;
  891. case NON_STANDARD_REQUEST_CHOSEN:
  892. {
  893. pduLog(logfile,"PDU_TYPE: GCC_NonStandardRequest\n");
  894. }
  895. break;
  896. default:
  897. {
  898. pduLog(logfile,"PDU_TYPE: ERROR Cannot decode the Request GCC PDU\n");
  899. }
  900. break;
  901. }
  902. }
  903. break;
  904. default:
  905. {
  906. // write something, just so we know we got a PDU.
  907. pduLog(logfile,"PDU_TYPE: ERROR -- Cannot decode unkown PDU");
  908. }
  909. break;
  910. }
  911. }
  912. /// ********************************************************************************
  913. /// PDU PRINTING FUNCTIONS
  914. /// ********************************************************************************
  915. /*********************************************************************/
  916. T120Boolean CopyCharToNumeric( GCCNumericString numeric_string,
  917. Char * temp_buffer )
  918. {
  919. if( strcpy((Char *)numeric_string, (const Char *) temp_buffer ) == NULL )
  920. return(FALSE);
  921. else
  922. return(TRUE);
  923. }
  924. /*********************************************************************/
  925. T120Boolean CopyCharToText(LPWSTR text_string, Char *temp_buffer )
  926. {
  927. UShort length;
  928. UShort i;
  929. length = strlen( temp_buffer );
  930. for(i=0;i < length;i++)
  931. {
  932. text_string[i] = (UShort) temp_buffer[i];
  933. }
  934. text_string[length] = 0x0000;
  935. return( TRUE );
  936. }
  937. /*********************************************************************/
  938. T120Boolean CompareTextToNULL( LPWSTR unicode_string )
  939. {
  940. /*
  941. * If the entry from GCCNODE.INI is the text string NULL, then we will
  942. * pass NULL for this parameter. A LPWSTR is a UShort array.
  943. */
  944. //TODO: resolve this and remove
  945. if( unicode_string == 0x0000 )
  946. return( FALSE );
  947. if( ( unicode_string[0] == 0x004E ) &&
  948. ( unicode_string[1] == 0x0055 ) &&
  949. ( unicode_string[2] == 0x004C ) &&
  950. ( unicode_string[3] == 0x004C ) )
  951. return( TRUE );
  952. else
  953. return( FALSE );
  954. }
  955. /*********************************************************************/
  956. T120Boolean CompareNumericToNULL( GCCNumericString numeric_string )
  957. {
  958. /*
  959. * If the entry from GCCNODE.INI is the text string NULL, then we will
  960. * pass NULL for this parameter. A GCCNumericString is an array of UChar.
  961. */
  962. //TODO: resolve this and remove
  963. if( numeric_string == NULL )
  964. return( FALSE );
  965. if( strcmp( (const Char *) numeric_string, "NULL" ) == 0 )
  966. return( TRUE );
  967. else
  968. return( FALSE );
  969. }
  970. /*********************************************************************/
  971. T120Boolean CopySimpleTextToChar (Char * print_string,
  972. SimpleTextString text_string)
  973. {
  974. UShort i;
  975. UShort text_string_length;
  976. LPWSTR text_string_value;
  977. text_string_length = text_string.length;
  978. text_string_value = text_string.value;
  979. //TODO: clean the next few lines up -- its a temp workaround
  980. // because databeam does not initialize the length field to 0
  981. // when there is no string.
  982. if(print_string==NULL)
  983. return(FALSE);
  984. if((text_string_length<=0)||(text_string_value == NULL))
  985. return(FALSE);
  986. if((*text_string_value == 0x0000))
  987. return (FALSE);
  988. for(i=0; i<text_string_length;i++)
  989. {
  990. if( ((text_string_value+i)==NULL) || (*(text_string_value+i) == 0x0000) )
  991. break;
  992. print_string[i] = (Char) text_string_value[i];
  993. }
  994. print_string[i] = 0;
  995. return(TRUE);
  996. }
  997. /*********************************************************************/
  998. T120Boolean CopyTextToChar(Char * print_string,
  999. TextString text_string)
  1000. {
  1001. UShort i;
  1002. UShort text_string_length;
  1003. LPWSTR text_string_value;
  1004. outdeb("TOP: CopyTextToChar\n");
  1005. if(print_string==NULL)
  1006. return(FALSE);
  1007. text_string_length = text_string.length;
  1008. text_string_value = text_string.value;
  1009. outdeb("CopyTextToChar: length and values copied\n");
  1010. if((text_string_length <= 0)||(text_string_value == NULL))
  1011. return( FALSE );
  1012. outdeb("length is not 0 && value is not NULL\n");
  1013. if (*text_string_value == 0x0000)
  1014. return (FALSE);
  1015. outdeb("content is not empty\n");
  1016. for(i=0;i < text_string_length;i++)
  1017. {
  1018. if( ((text_string_value+i)==NULL) || (*(text_string_value+i) == 0x0000))
  1019. break;
  1020. print_string[i] = (Char) text_string_value[i];
  1021. outdeb(print_string);
  1022. outdeb("..copied\n");
  1023. }
  1024. print_string[i] = 0;
  1025. return(TRUE);
  1026. }
  1027. /*********************************************************************/
  1028. T120Boolean CopyUnicodeToChar(Char *print_string, LPWSTR text_string)
  1029. {
  1030. UShort i;
  1031. UShort text_string_length;
  1032. if( text_string == NULL )
  1033. return( FALSE );
  1034. else
  1035. {
  1036. text_string_length = 0;
  1037. while(text_string[text_string_length] != 0x0000)
  1038. text_string_length++;
  1039. for(i=0;i < text_string_length;i++)
  1040. {
  1041. print_string[i] = (Char) text_string[i];
  1042. }
  1043. print_string[text_string_length] = 0;
  1044. }
  1045. return( TRUE );
  1046. }
  1047. /**
  1048. ** These functions print common sturcture entries.
  1049. */
  1050. /*********************************************************************/
  1051. Void PrintPrivilegeList(
  1052. GCCConferencePrivileges FAR * privilege_list,
  1053. Char FAR * print_text,
  1054. FILE * logfile )
  1055. {
  1056. if( privilege_list->terminate_is_allowed )
  1057. pduLog( logfile,
  1058. "%sterminate_is_allowed = TRUE",
  1059. print_text);
  1060. else
  1061. pduLog( logfile,
  1062. "%sterminate_is_allowed = FALSE",
  1063. print_text);
  1064. if( privilege_list->eject_user_is_allowed )
  1065. pduLog( logfile,
  1066. "%seject_user_is_allowed = TRUE",
  1067. print_text);
  1068. else
  1069. pduLog( logfile,
  1070. "%seject_user_is_allowed = FALSE",
  1071. print_text);
  1072. if( privilege_list->add_is_allowed )
  1073. pduLog( logfile,
  1074. "%sadd_is_allowed = TRUE",
  1075. print_text);
  1076. else
  1077. pduLog( logfile,
  1078. "%sadd_is_allowed = FALSE",
  1079. print_text);
  1080. if( privilege_list->lock_unlock_is_allowed )
  1081. pduLog( logfile,
  1082. "%slock_unlock_is_allowed = TRUE",
  1083. print_text);
  1084. else
  1085. pduLog( logfile,
  1086. "%slock_unlock_is_allowed = FALSE",
  1087. print_text);
  1088. if( privilege_list->transfer_is_allowed )
  1089. pduLog( logfile,
  1090. "%stransfer_is_allowed = TRUE",
  1091. print_text);
  1092. else
  1093. pduLog( logfile,
  1094. "%stransfer_is_allowed = FALSE",
  1095. print_text);
  1096. }
  1097. /*********************************************************************/
  1098. Void PrintPasswordChallengeRequestResponse(FILE * logfile,
  1099. PasswordChallengeRequestResponse chrqrs_password)
  1100. {
  1101. switch(chrqrs_password.choice)
  1102. {
  1103. case CHALLENGE_CLEAR_PASSWORD_CHOSEN:
  1104. pduLog(logfile,"\tClear ");
  1105. PrintPasswordSelector(logfile,chrqrs_password.u.challenge_clear_password);
  1106. break;
  1107. case CHALLENGE_REQUEST_RESPONSE_CHOSEN:
  1108. pduLog(logfile,"\t Challenge Request Response Password not implemented\n");
  1109. break;
  1110. default:
  1111. pduLog(logfile,"\t Conference Password is NULL\n");
  1112. break;
  1113. }
  1114. }
  1115. /*********************************************************************/
  1116. Void PrintConferenceName(FILE * logfile,
  1117. ConferenceNameSelector conference_name )
  1118. {
  1119. Char print_buffer[255] = "";
  1120. switch(conference_name.choice)
  1121. {
  1122. case NAME_SELECTOR_NUMERIC_CHOSEN:
  1123. pduLog(logfile,
  1124. "\tNumeric Name Selector: [%s]\n",
  1125. conference_name.u.name_selector_numeric);
  1126. break;
  1127. case NAME_SELECTOR_TEXT_CHOSEN:
  1128. CopySimpleTextToChar(print_buffer,
  1129. conference_name.u.name_selector_text);
  1130. pduLog(logfile,
  1131. "\tText Name Selector: [%s]\n",
  1132. print_buffer);
  1133. break;
  1134. }
  1135. }
  1136. /*********************************************************************/
  1137. Void PrintPasswordSelector(FILE *logfile, PasswordSelector password_selector)
  1138. {
  1139. Char print_buffer[255] = "";
  1140. switch(password_selector.choice)
  1141. {
  1142. case PASSWORD_SELECTOR_NUMERIC_CHOSEN:
  1143. pduLog(logfile,
  1144. "Numeric Password Selector: [%s]\n",
  1145. password_selector.u.password_selector_numeric);
  1146. break;
  1147. case PASSWORD_SELECTOR_TEXT_CHOSEN:
  1148. CopySimpleTextToChar(print_buffer,
  1149. password_selector.u.password_selector_text);
  1150. pduLog(logfile,
  1151. "Text Password Selector: [%s]\n",
  1152. print_buffer);
  1153. break;
  1154. default:
  1155. pduLog(logfile,"\tPassword Selector: [none]\n");
  1156. break;
  1157. }
  1158. }
  1159. /*********************************************************************/
  1160. int PrintObjectID(FILE *logfile, ObjectID object_id)
  1161. {
  1162. if((object_id==NULL)||(logfile==NULL))
  1163. return FALSE;
  1164. pduLog(logfile,"\tObject ID = { ");
  1165. for(; object_id != NULL; object_id = object_id->next)
  1166. {
  1167. pduLog(logfile,"%ul ",object_id->value);
  1168. }
  1169. pduLog(logfile,"}\n");
  1170. return TRUE;
  1171. }
  1172. /*********************************************************************/
  1173. void PrintH221NonStandardIdentifier(FILE *logfile, H221NonStandardIdentifier h221_id)
  1174. {
  1175. char print_buffer[255];
  1176. strncpy(print_buffer,(char *)h221_id.value,h221_id.length);
  1177. pduLog(logfile,"\t\tH221_Non_Standard_Identifier = [%s]\n",print_buffer);
  1178. }
  1179. /*********************************************************************/
  1180. void PrintKey(FILE *logfile, Key key)
  1181. {
  1182. switch(key.choice)
  1183. {
  1184. case OBJECT_CHOSEN:
  1185. PrintObjectID(logfile,key.u.object);
  1186. break;
  1187. case H221_NON_STANDARD_CHOSEN:
  1188. PrintH221NonStandardIdentifier(logfile,key.u.h221_non_standard);
  1189. break;
  1190. default:
  1191. pduLog(logfile,"\t\t>>>> Cannot print Key\n");
  1192. break;
  1193. }
  1194. }
  1195. /*********************************************************************/
  1196. void PrintChannelType(FILE *logfile, ChannelType channel_type)
  1197. {
  1198. pduLog(logfile,"\t\tChannel Type = ");
  1199. switch(channel_type)
  1200. {
  1201. case 0:
  1202. pduLog(logfile,"CHANNEL_TYPE_STATIC\n");
  1203. break;
  1204. case 1:
  1205. pduLog(logfile,"DYNAMIC_MULTICAST\n");
  1206. break;
  1207. case 2:
  1208. pduLog(logfile,"DYNAMIC_PRIVATE\n");
  1209. break;
  1210. case 3:
  1211. pduLog(logfile,"DYNAMIC_USERID\n");
  1212. break;
  1213. default:
  1214. pduLog(logfile,"ERROR: cannot determinte channel type \n");
  1215. break;
  1216. }
  1217. }
  1218. /*********************************************************************/
  1219. void PrintSessionKey(FILE *logfile, SessionKey session_key)
  1220. {
  1221. PrintKey(logfile, session_key.application_protocol_key);
  1222. if(session_key.bit_mask & 0x80)
  1223. pduLog(logfile,"\t\tsession_id = [%u]\n",session_key.session_id);
  1224. }
  1225. /*********************************************************************/
  1226. void PrintCapabilityID(FILE *logfile, CapabilityID capability_id)
  1227. {
  1228. switch(capability_id.choice)
  1229. {
  1230. case STANDARD_CHOSEN:
  1231. pduLog(logfile,"\t\tCapability ID: standard = [%u]\n",
  1232. capability_id.u.standard);
  1233. break;
  1234. case CAPABILITY_NON_STANDARD_CHOSEN:
  1235. pduLog(logfile,"\t\tNon Stnadard Capability Key:\n");
  1236. PrintKey(logfile,capability_id.u.capability_non_standard);
  1237. break;
  1238. default:
  1239. pduLog(logfile,"ERROR: cannot determine capability id\n");
  1240. }
  1241. }
  1242. /*********************************************************************/
  1243. Void PrintApplicationRecord(FILE *logfile, ApplicationRecord application_record)
  1244. {
  1245. unsigned int i=0;
  1246. char print_buffer[255];
  1247. PrintT120Boolean(logfile,
  1248. "\t\tapplication_is_active = ",
  1249. application_record.application_is_active);
  1250. PrintT120Boolean(logfile,
  1251. "\t\tis_conducting_capable = ",
  1252. application_record.is_conducting_capable);
  1253. if(application_record.bit_mask & RECORD_STARTUP_CHANNEL_PRESENT)
  1254. {
  1255. PrintChannelType(logfile, application_record.record_startup_channel);
  1256. }
  1257. if(application_record.bit_mask & APPLICATION_USER_ID_PRESENT)
  1258. {
  1259. pduLog(logfile,"\t\tapplication_user_id = [%u] \n",
  1260. application_record.application_user_id);
  1261. }
  1262. if(application_record.bit_mask & NON_COLLAPSING_CAPABILITIES_PRESENT)
  1263. {
  1264. for(i=0;application_record.non_collapsing_capabilities != NULL; i++)
  1265. {
  1266. pduLog(logfile,"\t**** non collapsing capabilities record [%u] ****\n",i);
  1267. PrintCapabilityID(logfile,application_record.non_collapsing_capabilities->value.capability_id);
  1268. if((application_record.non_collapsing_capabilities->value.bit_mask & APPLICATION_DATA_PRESENT) &&
  1269. (application_record.non_collapsing_capabilities->value.application_data.value != NULL))
  1270. {
  1271. pduLog(logfile,"\tApplication Data :\n");
  1272. pduRawOutput(logfile,application_record.non_collapsing_capabilities->value.application_data.value,
  1273. application_record.non_collapsing_capabilities->value.application_data.length);
  1274. strncpy(print_buffer, (char *) application_record.non_collapsing_capabilities->value.application_data.value,
  1275. application_record.non_collapsing_capabilities->value.application_data.length);
  1276. pduLog(logfile,"\tApplication Data (text): %s\n",print_buffer);
  1277. }
  1278. application_record.non_collapsing_capabilities =
  1279. application_record.non_collapsing_capabilities->next;
  1280. }
  1281. }
  1282. }
  1283. /*********************************************************************/
  1284. void PrintCapabilityClass(FILE *logfile, CapabilityClass capability_class)
  1285. {
  1286. pduLog(logfile,"\t\tCapability Class: ");
  1287. switch(capability_class.choice)
  1288. {
  1289. case LOGICAL_CHOSEN:
  1290. pduLog(logfile,"Logical.\n");
  1291. break;
  1292. case UNSIGNED_MINIMUM_CHOSEN:
  1293. pduLog(logfile,"unsigned_minimum = [%u]\n",capability_class.u.unsigned_minimum);
  1294. break;
  1295. case UNSIGNED_MAXIMUM_CHOSEN:
  1296. pduLog(logfile,"unsigned_maximum = [%u]\n",capability_class.u.unsigned_maximum);
  1297. break;
  1298. default:
  1299. pduLog(logfile,"ERROR: unable to decode capability class\n");
  1300. break;
  1301. }
  1302. }
  1303. /*********************************************************************/
  1304. void PrintApplicationUpdate(FILE *logfile, ApplicationUpdate application_update)
  1305. {
  1306. pduLog(logfile,"*** Application Update ***\n");
  1307. switch(application_update.choice)
  1308. {
  1309. case APPLICATION_ADD_RECORD_CHOSEN:
  1310. pduLog(logfile,"Update Type = application_add_record\n");
  1311. PrintApplicationRecord(logfile, application_update.u.application_add_record);
  1312. break;
  1313. case APPLICATION_REPLACE_RECORD_CHOSEN:
  1314. pduLog(logfile,"Update Type = application_replace_record\n");
  1315. PrintApplicationRecord(logfile, application_update.u.application_replace_record);
  1316. break;
  1317. case APPLICATION_REMOVE_RECORD_CHOSEN:
  1318. pduLog(logfile,"Update Type = application_remove_record\n");
  1319. pduLog(logfile,"\tApplication is removed\n");
  1320. break;
  1321. default:
  1322. pduLog(logfile,"ERROR: Cannot decode Application Update\n");
  1323. break;
  1324. }
  1325. }
  1326. /*********************************************************************/
  1327. void PrintApplicationRecordList(FILE *logfile, ApplicationRecordList application_record_list)
  1328. {
  1329. int i = 0;
  1330. switch(application_record_list.choice)
  1331. {
  1332. case APPLICATION_NO_CHANGE_CHOSEN:
  1333. pduLog(logfile,"No Change in Application Record List\n");
  1334. break;
  1335. case APPLICATION_RECORD_REFRESH_CHOSEN:
  1336. pduLog(logfile,"Application Record Refresh:\n");
  1337. for(i=0; application_record_list.u.application_record_refresh !=NULL; i++)
  1338. {
  1339. pduLog(logfile,"\t**** Application record refresh [%u] ***\n",i);
  1340. pduLog(logfile,"\t\tnode_id = [%u]\n",
  1341. application_record_list.u.application_record_refresh->value.node_id);
  1342. pduLog(logfile,"\t\tentity_id = [%u]\n",
  1343. application_record_list.u.application_record_refresh->value.entity_id);
  1344. PrintApplicationRecord(logfile,application_record_list.u.application_record_refresh->value.application_record);
  1345. application_record_list.u.application_record_refresh =
  1346. application_record_list.u.application_record_refresh->next;
  1347. }
  1348. break;
  1349. case APPLICATION_RECORD_UPDATE_CHOSEN:
  1350. pduLog(logfile,"Application Record Update:\n");
  1351. for(i=0; application_record_list.u.application_record_update !=NULL; i++)
  1352. {
  1353. pduLog(logfile,"\t**** Application record update [%u] ***\n",i);
  1354. pduLog(logfile,"\t\tnode_id = [%u]\n",
  1355. application_record_list.u.application_record_update->value.node_id);
  1356. pduLog(logfile,"\t\tentity_id = [%u]\n",
  1357. application_record_list.u.application_record_update->value.entity_id);
  1358. PrintApplicationUpdate(logfile,application_record_list.u.application_record_update->value.application_update);
  1359. application_record_list.u.application_record_refresh =
  1360. application_record_list.u.application_record_refresh->next;
  1361. }
  1362. break;
  1363. default:
  1364. pduLog(logfile,"ERROR: Application Record List could not be decoded\n");
  1365. break;
  1366. }
  1367. }
  1368. /*********************************************************************/
  1369. void PrintApplicationCapabilitiesList(FILE *logfile, ApplicationCapabilitiesList application_capabilities_list)
  1370. {
  1371. unsigned int i = 0;
  1372. pduLog(logfile,"Application Capabilities List\n");
  1373. switch(application_capabilities_list.choice)
  1374. {
  1375. case CAPABILITY_NO_CHANGE_CHOSEN:
  1376. pduLog(logfile,"\tNo change in capabilities\n");
  1377. break;
  1378. case APPLICATION_CAPABILITY_REFRESH_CHOSEN:
  1379. pduLog(logfile,"\tCapability Refreshes:\n");
  1380. for(i=0; application_capabilities_list.u.application_capability_refresh != NULL; i++)
  1381. {
  1382. pduLog(logfile,"\t**** capability refresh [%u] ****\n",i);
  1383. PrintCapabilityID(logfile,application_capabilities_list.u.application_capability_refresh->value.capability_id);
  1384. PrintCapabilityClass(logfile,application_capabilities_list.u.application_capability_refresh->value.capability_class);
  1385. pduLog(logfile,"\t\tnumber_of_entities = [%u]\n",
  1386. application_capabilities_list.u.application_capability_refresh->value.number_of_entities);
  1387. application_capabilities_list.u.application_capability_refresh =
  1388. application_capabilities_list.u.application_capability_refresh->next;
  1389. }
  1390. break;
  1391. default:
  1392. pduLog(logfile,"ERROR: Cannot decode capabilities list\n");
  1393. }
  1394. }
  1395. /*********************************************************************/
  1396. void PrintConferenceAddResult(FILE *logfile, ConferenceAddResult result)
  1397. {
  1398. pduLog(logfile,"\tResult = ");
  1399. switch(result)
  1400. {
  1401. case 0:
  1402. pduLog(logfile,"SUCCESS\n");
  1403. break;
  1404. case 1:
  1405. pduLog(logfile,"INVALID_REQUESTER\n");
  1406. break;
  1407. case 2:
  1408. pduLog(logfile,"INVALID_NETWORK_ADDRESS\n");
  1409. break;
  1410. case 3:
  1411. pduLog(logfile,"ADDED_NODE_BUSY\n");
  1412. break;
  1413. case 4:
  1414. pduLog(logfile,"NETWORK_BUSY\n");
  1415. break;
  1416. case 5:
  1417. pduLog(logfile,"NO_PORTS_AVAILABLE\n");
  1418. break;
  1419. case 6:
  1420. pduLog(logfile,"CONNECTION_UNSUCCESSFUL\n");
  1421. break;
  1422. default:
  1423. pduLog(logfile,">>> undecodable result <<<\n");
  1424. break;
  1425. }
  1426. }
  1427. /*********************************************************************/
  1428. Void PrintConferenceRoster(FILE *logfile, NodeInformation node_information)
  1429. {
  1430. UShort i;
  1431. NodeRecordList node_record_list;
  1432. Char print_buffer[255] = "";
  1433. outdeb("TOP: PrintConferenceRoster\n");
  1434. pduLog(logfile,
  1435. "\tinstance_number [%u]\n",
  1436. node_information.roster_instance_number );
  1437. PrintT120Boolean(logfile,
  1438. "\tnodes_are_added",
  1439. node_information.nodes_are_added);
  1440. PrintT120Boolean(logfile,
  1441. "\tnodes_are_removed",
  1442. node_information.nodes_are_removed );
  1443. /*
  1444. * Extract the node_information_list pointer from the
  1445. * conf_roster structure.
  1446. */
  1447. node_record_list = node_information.node_record_list;
  1448. switch (node_record_list.choice)
  1449. {
  1450. case NODE_NO_CHANGE_CHOSEN:
  1451. {
  1452. pduLog(logfile,"\tConference Roster: No Change\n");
  1453. }
  1454. break;
  1455. case NODE_RECORD_REFRESH_CHOSEN:
  1456. {
  1457. outdeb("Node record refresh chosen \n");
  1458. for(i=0; node_record_list.u.node_record_refresh != NULL; i++)
  1459. {
  1460. pduLog( logfile,"\tConference Refresh Record [%u]************************\n", i );
  1461. pduLog( logfile,
  1462. "\t\tnode_id [%u]\n",
  1463. node_record_list.u.node_record_refresh->value.node_id );
  1464. pduLog( logfile,
  1465. "\t\tsuperior_node_id [%u]\n",
  1466. node_record_list.u.node_record_refresh->value.node_record.superior_node);
  1467. /* figure out the node type */
  1468. switch( node_record_list.u.node_record_refresh->value.node_record.node_type)
  1469. {
  1470. case GCC_TERMINAL:
  1471. pduLog( logfile, "\t\tnode_type = GCC_TERMINAL\n");
  1472. break;
  1473. case GCC_MULTIPORT_TERMINAL:
  1474. pduLog( logfile,
  1475. "\t\tnode_type = GCC_MULTIPORT_TERMINAL\n");
  1476. break;
  1477. case GCC_MCU:
  1478. pduLog( logfile, "\t\tnode_type = GCC_MCU\n");
  1479. break;
  1480. default:
  1481. pduLog( logfile,
  1482. "\t\tGCCNODE: ERROR: UNKNOWN NODE TYPE\n");
  1483. break;
  1484. }
  1485. pduLog(logfile,"\t\tdevice_is_manager: [%u]\n",
  1486. node_record_list.u.node_record_refresh->value.node_record.node_properties.device_is_manager);
  1487. pduLog(logfile,"\t\tdevice_is_peripheral: [%u] \n",
  1488. node_record_list.u.node_record_refresh->value.node_record.node_properties.device_is_peripheral);
  1489. /* print the node_name field */
  1490. if(CopyTextToChar(print_buffer,
  1491. node_record_list.u.node_record_refresh->value.node_record.node_name))
  1492. pduLog( logfile, "\t\tnode_name is [%s]\n", print_buffer );
  1493. else
  1494. pduLog( logfile, "\t\tnode_name is NULL\n");
  1495. print_buffer[0] = 0;
  1496. /* print the participants_list fields */
  1497. if((node_record_list.u.node_record_refresh->value.node_record.participants_list != NULL)
  1498. && (node_record_list.u.node_record_refresh->value.node_record.bit_mask & 0x20))
  1499. {
  1500. for(i=0;node_record_list.u.node_record_refresh->value.node_record.participants_list->next!=NULL;i++)
  1501. {
  1502. if(CopyTextToChar(print_buffer,node_record_list.u.node_record_refresh->value.node_record.participants_list->value))
  1503. pduLog(logfile, "\t\tparticipant %u is: [%s]\n", print_buffer);
  1504. else
  1505. pduLog(logfile, "\t\tparticipant_list record is NULL\n");
  1506. node_record_list.u.node_record_refresh->value.node_record.participants_list =
  1507. node_record_list.u.node_record_refresh->value.node_record.participants_list->next;
  1508. }
  1509. }
  1510. /* print the site_information field */
  1511. outdeb("printing site information\n");
  1512. if(node_record_list.u.node_record_refresh->value.node_record.bit_mask & 0x10)
  1513. {
  1514. if(CopyTextToChar(print_buffer,
  1515. node_record_list.u.node_record_refresh->value.node_record.site_information))
  1516. pduLog( logfile,
  1517. "\t\tsite_information is [%s]\n",
  1518. print_buffer );
  1519. else
  1520. pduLog( logfile, "\t\tsite_information is NULL\n");
  1521. }
  1522. node_record_list.u.node_record_refresh =
  1523. node_record_list.u.node_record_refresh->next;
  1524. } // end of for loop
  1525. }
  1526. break;
  1527. case NODE_RECORD_UPDATE_CHOSEN:
  1528. {
  1529. outdeb("Node Record Update Chosen\n");
  1530. for(i=0;node_record_list.u.node_record_update!=NULL;i++)
  1531. {
  1532. pduLog(logfile,"\t**********Conference Update Record [%u] **********\n",i);
  1533. pduLog(logfile,"\t\tnode_id [%u]\n",
  1534. node_record_list.u.node_record_update->value.node_id);
  1535. switch(node_record_list.u.node_record_update->value.node_update.choice)
  1536. {
  1537. case NODE_ADD_RECORD_CHOSEN:
  1538. outdeb("Node Add Record Chosen\n");
  1539. pduLog(logfile,"\t\t*** Node is Added ***\n");
  1540. pduLog(logfile,
  1541. "\t\tsuperior_node_id [%u]\n",
  1542. node_record_list.u.node_record_update->value.node_update.u.node_add_record.superior_node);
  1543. switch( node_record_list.u.node_record_update->value.node_update.u.node_add_record.node_type)
  1544. {
  1545. case GCC_TERMINAL:
  1546. pduLog( logfile, "\t\tnode_type = GCC_TERMINAL\n");
  1547. break;
  1548. case GCC_MULTIPORT_TERMINAL:
  1549. pduLog(logfile,"\t\tnode_type = GCC_MULTIPORT_TERMINAL\n");
  1550. break;
  1551. case GCC_MCU:
  1552. pduLog(logfile, "\t\tnode_type = GCC_MCU\n");
  1553. break;
  1554. default:
  1555. pduLog(logfile,"\t\tGCCNODE: ERROR: UNKNOWN NODE TYPE\n");
  1556. break;
  1557. }
  1558. pduLog(logfile,"\t\tdevice_is_manager: [%u]\n",
  1559. node_record_list.u.node_record_update->value.node_update.u.node_add_record.node_properties.device_is_manager);
  1560. pduLog(logfile,"\t\tdevice_is_peripheral: [%u] \n",
  1561. node_record_list.u.node_record_update->value.node_update.u.node_add_record.node_properties.device_is_peripheral);
  1562. /* print the node_name */
  1563. outdeb("Printing node name\n");
  1564. if(CopyTextToChar(print_buffer,
  1565. node_record_list.u.node_record_update->value.node_update.u.node_add_record.node_name))
  1566. pduLog( logfile, "\t\tnode_name is [%s]\n", print_buffer );
  1567. else
  1568. pduLog( logfile, "\t\tnode_name is NULL\n");
  1569. /* print the participants_list fields */
  1570. outdeb("Printing participants list fields\n");
  1571. if((node_record_list.u.node_record_update->value.node_update.u.node_add_record.participants_list != NULL)
  1572. && (node_record_list.u.node_record_update->value.node_update.u.node_add_record.bit_mask & 0x20))
  1573. {
  1574. outdeb("participants list is not NULL\n");
  1575. for(i=0;node_record_list.u.node_record_update->value.node_update.u.node_add_record.participants_list->next!=NULL;i++)
  1576. {
  1577. outdeb("participants_list->next is not NULL\n");
  1578. if(CopyTextToChar(print_buffer,
  1579. node_record_list.u.node_record_update->value.node_update.u.node_add_record.participants_list->value))
  1580. pduLog(logfile, "\t\tparticipant %u is: [%s]\n", print_buffer);
  1581. else
  1582. pduLog(logfile, "\t\tparticipant_list record is NULL\n");
  1583. outdeb("incrementing participant list node\n");
  1584. node_record_list.u.node_record_update->value.node_update.u.node_add_record.participants_list =
  1585. node_record_list.u.node_record_update->value.node_update.u.node_add_record.participants_list->next;
  1586. }
  1587. }
  1588. /* print the site information */
  1589. outdeb("printing site information\n");
  1590. if(node_record_list.u.node_record_update->value.node_update.u.node_add_record.bit_mask & 0x10)
  1591. {
  1592. if(CopyTextToChar(print_buffer,
  1593. node_record_list.u.node_record_update->value.node_update.u.node_add_record.site_information))
  1594. pduLog(logfile,"\t\tsite_information is [%s]\n",print_buffer );
  1595. else
  1596. pduLog( logfile, "\t\tsite_information is NULL\n");
  1597. }
  1598. break;
  1599. case NODE_REPLACE_RECORD_CHOSEN:
  1600. outdeb("Node Replace Record Chosen\n");
  1601. pduLog(logfile,"\t\t*** Node is Replaced ***\n");
  1602. pduLog(logfile,
  1603. "\t\tsuperior_node_id [%u]\n",
  1604. node_record_list.u.node_record_update->value.node_update.u.node_replace_record.superior_node);
  1605. switch( node_record_list.u.node_record_update->value.node_update.u.node_replace_record.node_type)
  1606. {
  1607. case GCC_TERMINAL:
  1608. pduLog( logfile, "\t\tnode_type = GCC_TERMINAL\n");
  1609. break;
  1610. case GCC_MULTIPORT_TERMINAL:
  1611. pduLog(logfile,"\t\tnode_type = GCC_MULTIPORT_TERMINAL\n");
  1612. break;
  1613. case GCC_MCU:
  1614. pduLog(logfile, "\t\tnode_type = GCC_MCU\n");
  1615. break;
  1616. default:
  1617. pduLog(logfile,"\t\tGCCNODE: ERROR: UNKNOWN NODE TYPE\n");
  1618. break;
  1619. }
  1620. pduLog(logfile,"\t\tdevice_is_manager: [%u]\n",
  1621. node_record_list.u.node_record_update->value.node_update.u.node_replace_record.node_properties.device_is_manager);
  1622. pduLog(logfile,"\t\tdevice_is_peripheral: [%u] \n",
  1623. node_record_list.u.node_record_update->value.node_update.u.node_replace_record.node_properties.device_is_peripheral);
  1624. /* print the node name */
  1625. outdeb("printing node name\n");
  1626. if(CopyTextToChar(print_buffer,
  1627. node_record_list.u.node_record_update->value.node_update.u.node_replace_record.node_name))
  1628. pduLog( logfile, "\t\tnode_name is [%s]\n", print_buffer );
  1629. else
  1630. pduLog( logfile, "\t\tnode_name is NULL\n");
  1631. print_buffer[0] = 0;
  1632. /* print the participant list */
  1633. outdeb("printing participants list info\n");
  1634. if((node_record_list.u.node_record_update->value.node_update.u.node_replace_record.participants_list != NULL)
  1635. && (node_record_list.u.node_record_update->value.node_update.u.node_replace_record.bit_mask & 0x20))
  1636. {
  1637. for(i=0;node_record_list.u.node_record_update->value.node_update.u.node_replace_record.participants_list->next!=NULL;i++)
  1638. {
  1639. if(CopyTextToChar(print_buffer,
  1640. node_record_list.u.node_record_update->value.node_update.u.node_replace_record.participants_list->value))
  1641. pduLog(logfile, "\t\tparticipant %u is: [%s]\n", print_buffer);
  1642. else
  1643. pduLog(logfile, "\t\tparticipant_list record is NULL\n");
  1644. node_record_list.u.node_record_update->value.node_update.u.node_replace_record.participants_list =
  1645. node_record_list.u.node_record_update->value.node_update.u.node_replace_record.participants_list->next;
  1646. }
  1647. }
  1648. print_buffer[0] = 0;
  1649. /* print the site information */
  1650. outdeb("printing site information\n");
  1651. if(node_record_list.u.node_record_update->value.node_update.u.node_replace_record.bit_mask & 0x10)
  1652. {
  1653. if( CopyTextToChar(print_buffer,
  1654. node_record_list.u.node_record_update->value.node_update.u.node_replace_record.site_information))
  1655. pduLog(logfile,"\t\tsite_information is [%s]\n",print_buffer );
  1656. else
  1657. pduLog( logfile, "\t\tsite_information is NULL\n");
  1658. }
  1659. break;
  1660. case NODE_REMOVE_RECORD_CHOSEN:
  1661. outdeb("Node remove record chosen\n");
  1662. pduLog(logfile,"\t\t*** UPDATE: Node is REMOVED ***\n");
  1663. break;
  1664. default:
  1665. pduLog(logfile,"\t\t>>>>ERROR: UNKNOWN UPDATE ACTION\n");
  1666. break;
  1667. }
  1668. node_record_list.u.node_record_update =
  1669. node_record_list.u.node_record_update->next;
  1670. }
  1671. }
  1672. break;
  1673. default:
  1674. pduLog(logfile,">>>> Unknown Roster Update Type\n");
  1675. break;
  1676. }
  1677. }
  1678. /****************************************************************/
  1679. void PrintApplicationRoster(FILE *logfile, SetOfApplicationInformation *application_information)
  1680. {
  1681. int i = 0;
  1682. pduLog(logfile,"Application Information: \n");
  1683. for(i=0; application_information != NULL; i++)
  1684. {
  1685. pduLog(logfile,"\t*** application information record [%u] ***\n",i);
  1686. PrintSessionKey(logfile,application_information->value.session_key);
  1687. PrintApplicationRecordList(logfile,application_information->value.application_record_list);
  1688. PrintApplicationCapabilitiesList(logfile,application_information->value.application_capabilities_list);
  1689. pduLog(logfile,"\t\troster_instance_number = %u\n",application_information->value.roster_instance_number);
  1690. PrintT120Boolean(logfile,"\t\tpeer_entities_are_added",application_information->value.peer_entities_are_added);
  1691. PrintT120Boolean(logfile,"\t\tpeer_entities_are_removed",application_information->value.peer_entities_are_removed);
  1692. application_information = application_information->next;
  1693. }
  1694. }
  1695. /****************************************************************/
  1696. void PrintT120Boolean(FILE * logfile,
  1697. Char * print_text,
  1698. T120Boolean T120Boolean)
  1699. {
  1700. if( T120Boolean == FALSE )
  1701. pduLog( logfile, "%s = FALSE\n", print_text );
  1702. else
  1703. pduLog( logfile, "%s = TRUE\n", print_text );
  1704. }
  1705. #endif /// PDULOG