distStatLib.c
上传用户:baixin
上传日期:2008-03-13
资源大小:4795k
文件大小:5k
开发平台:

MultiPlatform

  1. /* distStatLib.c - distributed objects statistics library (VxFusion) */
  2. /* Copyright 1999 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01d,24may99,drm  added vxfusion prefix to VxFusion related includes
  7. 01c,30oct98,drm  documentation updates
  8. 01b,11sep98,drm  moved distDump() to distLib.c
  9. 01a,04sep97,ur   written.
  10. */
  11. /*
  12. DESCRIPTION
  13. This library maintains the following C structure:
  14. .CS
  15. typedef struct                  /@ DIST_STAT @/
  16.     {
  17.     /@ general @/
  18.     u_long tBufShortage;        /@ times no more tBufs were available @/
  19.     u_long memShortage;         /@ times no memory was available @/
  20.     /@ interface layer @/
  21.     u_long ifInReceived;        /@ incoming telegrams received by if layer @/
  22.     u_long ifOutReceived;       /@ outgoing telegrams received by if layer @/
  23.     u_long ifInDiscarded;       /@ incoming telegrams discarded by if layer @/
  24.     u_long ifOutDiscarded;      /@ outgoing telegrams discarded by if layer @/
  25.     u_long ifInLength;          /@ incoming telegrams discarded: wrong length @/
  26.     /@ net layer @/
  27.     u_long netInReceived;       /@ incoming pkts received by net layer @/
  28.     u_long netOutReceived;      /@ outgoing pkts received by net layer @/
  29.     u_long netInDiscarded;      /@ incoming pkts discarded by net layer @/
  30.     u_long netOutDiscarded;     /@ outgoing pkts discarded by net layer @/
  31.     u_long netReassembled;      /@ pkts reassembled @/
  32.     /@ node layer @/
  33.     u_long nodeOutReceived;     /@ outgoing pkts received @/
  34.     u_long nodeInDiscarded;     /@ pkts discarded @/
  35.     u_long nodeAcked;           /@ pkts aknowleded @/
  36.     u_long nodeNotAlive;        /@ pkts tried to send to node not alive @/
  37.     u_long nodePktResend;       /@ pkts resent @/
  38.     u_long nodeFragResend;      /@ fragments resent @/
  39.     u_long nodeDBNoMatch;       /@ node not found in node DB @/
  40.     u_long nodeDBFatal;         /@ fatal error in node DB @/
  41.     /@ msg queue objects @/
  42.     u_long msgQInDiscarded;     /@ #pkts discarded @/
  43.     u_long msgQInTooShort;      /@ #pkts too short @/
  44.     /@ msg queue group objects @/
  45.     u_long msgQGrpInDiscarded;  /@ #pkts discarded @/
  46.     u_long msgQGrpInTooShort;   /@ #pkts too short @/
  47.     /@ distributed name database @/
  48.     u_long dndbInReceived;      /@ #pkts received by DNDB @/
  49.     u_long dndbInDiscarded;     /@ #pkts discarded @/
  50.     /@ incorporation protocol @/
  51.     u_long incoInDiscarded;     /@ #pkts discarded @/
  52.     } DIST_STAT;
  53. .CE
  54. With the exception of the interface layer values, the rest of the values are
  55. incremented by the distributed objects product at runtime.  The interface
  56. layer values are incremented by the installed interface adapter.
  57. When the distIfShow library routine distIfShow() is called, it will display
  58. some of the interface layer values.
  59. INCLUDE FILES: distStatLib.h
  60. SEE ALSO: distIfShow
  61. */
  62. #include "vxWorks.h"
  63. #include "stdio.h"
  64. #include "ctype.h"
  65. #include "string.h"
  66. #include "vxfusion/distStatLib.h"
  67. #include "vxfusion/private/distStatLibP.h"
  68. /* global variables */
  69. DIST_STAT distStat;
  70. /*******************************************************************************
  71. *
  72. * distStatLibInit - initialize the distributed objects statistics library
  73. *
  74. * NOMANUAL
  75. */
  76. void distStatLibInit ()
  77. {
  78. }
  79. /*******************************************************************************
  80. *
  81. * distStatInit - initialize the statistics table
  82. *
  83. * NOMANUAL
  84. */
  85. void distStatInit ()
  86. {
  87. bzero ((char *) &distStat, sizeof (DIST_STAT));
  88. }
  89. /*******************************************************************************
  90. *
  91. * distStatShow - show the statistics table
  92. *
  93. * NOMANUAL
  94. */
  95. void distStatShow ()
  96. {
  97. printf ("Gen:  tBufShortage = %ld, memShortage = %ldn", 
  98. distStat.tBufShortage,
  99. distStat.memShortage);
  100. printf ("If:   ifInReceived = %ld, ifOutReceived = %ldn",
  101. distStat.ifInReceived,
  102. distStat.ifOutReceived);
  103. printf ("      ifInDiscarded = %ld, ifOutDiscarded = %ldn",
  104. distStat.ifInDiscarded,
  105. distStat.ifOutDiscarded);
  106. printf ("      ifInLength = %ldn", distStat.ifInLength);
  107. printf ("Net:  netInReceived = %ld, netOutReceived = %ldn",
  108. distStat.netInReceived,
  109. distStat.netOutReceived);
  110. printf ("      netInDiscarded = %ld, netOutDiscarded = %ldn",
  111. distStat.netInDiscarded,
  112. distStat.netOutDiscarded);
  113. printf ("      netReassembled = %ldn", distStat.netReassembled);
  114. printf ("Node: nodeOutReceived = %ld, nodeInDiscarded = %ldn",
  115. distStat.nodeOutReceived,
  116. distStat.nodeInDiscarded);
  117. printf ("      nodeAcked = %ld, nodeNotAlive = %ldn",
  118. distStat.nodeAcked,
  119. distStat.nodeNotAlive);
  120. printf ("      nodeFragResend = %ld, nodePktResend = %ldn",
  121. distStat.nodeFragResend, distStat.nodePktResend);
  122. printf ("      nodeDBNoMatch = %ld, nodeDBFatal = %ldn",
  123. distStat.nodeDBNoMatch,
  124. distStat.nodeDBFatal);
  125. printf ("MsgQ: msgQInDiscarded = %ld, msgQInTooShort = %ldn",
  126. distStat.msgQInDiscarded,
  127. distStat.msgQInTooShort);
  128. printf ("Grp:  msgQGrpInDiscarded = %ld, msgQGrpInTooShort = %ldn",
  129. distStat.msgQGrpInDiscarded,
  130. distStat.msgQGrpInTooShort);
  131. printf ("DNDB: dndbInReceived = %ld, dndbInDiscarded = %ldn",
  132. distStat.dndbInReceived,
  133. distStat.dndbInDiscarded);
  134. printf ("Inco: incoInDiscarded = %ldn", distStat.incoInDiscarded);
  135. }