mib.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. /*
  2. * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
  3. * All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18. *
  19. * File: mib.h
  20. *
  21. * Purpose: Implement MIB Data Structure
  22. *
  23. * Author: Tevin Chen
  24. *
  25. * Date: May 21, 1996
  26. *
  27. */
  28. #ifndef __MIB_H__
  29. #define __MIB_H__
  30. #include "ttype.h"
  31. #include "tether.h"
  32. #include "desc.h"
  33. //
  34. // 802.11 counter
  35. //
  36. typedef struct tagSDot11Counters {
  37. unsigned long Length;
  38. unsigned long long TransmittedFragmentCount;
  39. unsigned long long MulticastTransmittedFrameCount;
  40. unsigned long long FailedCount;
  41. unsigned long long RetryCount;
  42. unsigned long long MultipleRetryCount;
  43. unsigned long long RTSSuccessCount;
  44. unsigned long long RTSFailureCount;
  45. unsigned long long ACKFailureCount;
  46. unsigned long long FrameDuplicateCount;
  47. unsigned long long ReceivedFragmentCount;
  48. unsigned long long MulticastReceivedFrameCount;
  49. unsigned long long FCSErrorCount;
  50. unsigned long long TKIPLocalMICFailures;
  51. unsigned long long TKIPRemoteMICFailures;
  52. unsigned long long TKIPICVErrors;
  53. unsigned long long TKIPCounterMeasuresInvoked;
  54. unsigned long long TKIPReplays;
  55. unsigned long long CCMPFormatErrors;
  56. unsigned long long CCMPReplays;
  57. unsigned long long CCMPDecryptErrors;
  58. unsigned long long FourWayHandshakeFailures;
  59. } SDot11Counters, *PSDot11Counters;
  60. //
  61. // MIB2 counter
  62. //
  63. typedef struct tagSMib2Counter {
  64. long ifIndex;
  65. char ifDescr[256];
  66. long ifType;
  67. long ifMtu;
  68. unsigned long ifSpeed;
  69. unsigned char ifPhysAddress[ETH_ALEN];
  70. long ifAdminStatus;
  71. long ifOperStatus;
  72. unsigned long ifLastChange;
  73. unsigned long ifInOctets;
  74. unsigned long ifInUcastPkts;
  75. unsigned long ifInNUcastPkts;
  76. unsigned long ifInDiscards;
  77. unsigned long ifInErrors;
  78. unsigned long ifInUnknownProtos;
  79. unsigned long ifOutOctets;
  80. unsigned long ifOutUcastPkts;
  81. unsigned long ifOutNUcastPkts;
  82. unsigned long ifOutDiscards;
  83. unsigned long ifOutErrors;
  84. unsigned long ifOutQLen;
  85. unsigned long ifSpecific;
  86. } SMib2Counter, *PSMib2Counter;
  87. // Value in the ifType entry
  88. #define WIRELESSLANIEEE80211b 6
  89. // Value in the ifAdminStatus/ifOperStatus entry
  90. #define UP 1
  91. #define DOWN 2
  92. #define TESTING 3
  93. //
  94. // RMON counter
  95. //
  96. typedef struct tagSRmonCounter {
  97. long etherStatsIndex;
  98. unsigned long etherStatsDataSource;
  99. unsigned long etherStatsDropEvents;
  100. unsigned long etherStatsOctets;
  101. unsigned long etherStatsPkts;
  102. unsigned long etherStatsBroadcastPkts;
  103. unsigned long etherStatsMulticastPkts;
  104. unsigned long etherStatsCRCAlignErrors;
  105. unsigned long etherStatsUndersizePkts;
  106. unsigned long etherStatsOversizePkts;
  107. unsigned long etherStatsFragments;
  108. unsigned long etherStatsJabbers;
  109. unsigned long etherStatsCollisions;
  110. unsigned long etherStatsPkt64Octets;
  111. unsigned long etherStatsPkt65to127Octets;
  112. unsigned long etherStatsPkt128to255Octets;
  113. unsigned long etherStatsPkt256to511Octets;
  114. unsigned long etherStatsPkt512to1023Octets;
  115. unsigned long etherStatsPkt1024to1518Octets;
  116. unsigned long etherStatsOwners;
  117. unsigned long etherStatsStatus;
  118. } SRmonCounter, *PSRmonCounter;
  119. //
  120. // Custom counter
  121. //
  122. typedef struct tagSCustomCounters {
  123. unsigned long Length;
  124. unsigned long long ullTsrAllOK;
  125. unsigned long long ullRsr11M;
  126. unsigned long long ullRsr5M;
  127. unsigned long long ullRsr2M;
  128. unsigned long long ullRsr1M;
  129. unsigned long long ullRsr11MCRCOk;
  130. unsigned long long ullRsr5MCRCOk;
  131. unsigned long long ullRsr2MCRCOk;
  132. unsigned long long ullRsr1MCRCOk;
  133. unsigned long long ullRsr54M;
  134. unsigned long long ullRsr48M;
  135. unsigned long long ullRsr36M;
  136. unsigned long long ullRsr24M;
  137. unsigned long long ullRsr18M;
  138. unsigned long long ullRsr12M;
  139. unsigned long long ullRsr9M;
  140. unsigned long long ullRsr6M;
  141. unsigned long long ullRsr54MCRCOk;
  142. unsigned long long ullRsr48MCRCOk;
  143. unsigned long long ullRsr36MCRCOk;
  144. unsigned long long ullRsr24MCRCOk;
  145. unsigned long long ullRsr18MCRCOk;
  146. unsigned long long ullRsr12MCRCOk;
  147. unsigned long long ullRsr9MCRCOk;
  148. unsigned long long ullRsr6MCRCOk;
  149. } SCustomCounters, *PSCustomCounters;
  150. //
  151. // Custom counter
  152. //
  153. typedef struct tagSISRCounters {
  154. unsigned long Length;
  155. unsigned long dwIsrTx0OK;
  156. unsigned long dwIsrAC0TxOK;
  157. unsigned long dwIsrBeaconTxOK;
  158. unsigned long dwIsrRx0OK;
  159. unsigned long dwIsrTBTTInt;
  160. unsigned long dwIsrSTIMERInt;
  161. unsigned long dwIsrWatchDog;
  162. unsigned long dwIsrUnrecoverableError;
  163. unsigned long dwIsrSoftInterrupt;
  164. unsigned long dwIsrMIBNearfull;
  165. unsigned long dwIsrRxNoBuf;
  166. unsigned long dwIsrUnknown;
  167. unsigned long dwIsrRx1OK;
  168. unsigned long dwIsrATIMTxOK;
  169. unsigned long dwIsrSYNCTxOK;
  170. unsigned long dwIsrCFPEnd;
  171. unsigned long dwIsrATIMEnd;
  172. unsigned long dwIsrSYNCFlushOK;
  173. unsigned long dwIsrSTIMER1Int;
  174. } SISRCounters, *PSISRCounters;
  175. // Value in the etherStatsStatus entry
  176. #define VALID 1
  177. #define CREATE_REQUEST 2
  178. #define UNDER_CREATION 3
  179. #define INVALID 4
  180. //
  181. // statistic counter
  182. //
  183. typedef struct tagSStatCounter {
  184. // RSR status count
  185. //
  186. unsigned long dwRsrFrmAlgnErr;
  187. unsigned long dwRsrErr;
  188. unsigned long dwRsrCRCErr;
  189. unsigned long dwRsrCRCOk;
  190. unsigned long dwRsrBSSIDOk;
  191. unsigned long dwRsrADDROk;
  192. unsigned long dwRsrBCNSSIDOk;
  193. unsigned long dwRsrLENErr;
  194. unsigned long dwRsrTYPErr;
  195. unsigned long dwNewRsrDECRYPTOK;
  196. unsigned long dwNewRsrCFP;
  197. unsigned long dwNewRsrUTSF;
  198. unsigned long dwNewRsrHITAID;
  199. unsigned long dwNewRsrHITAID0;
  200. unsigned long dwRsrLong;
  201. unsigned long dwRsrRunt;
  202. unsigned long dwRsrRxControl;
  203. unsigned long dwRsrRxData;
  204. unsigned long dwRsrRxManage;
  205. unsigned long dwRsrRxPacket;
  206. unsigned long dwRsrRxOctet;
  207. unsigned long dwRsrBroadcast;
  208. unsigned long dwRsrMulticast;
  209. unsigned long dwRsrDirected;
  210. // 64-bit OID
  211. unsigned long long ullRsrOK;
  212. // for some optional OIDs (64 bits) and DMI support
  213. unsigned long long ullRxBroadcastBytes;
  214. unsigned long long ullRxMulticastBytes;
  215. unsigned long long ullRxDirectedBytes;
  216. unsigned long long ullRxBroadcastFrames;
  217. unsigned long long ullRxMulticastFrames;
  218. unsigned long long ullRxDirectedFrames;
  219. unsigned long dwRsrRxFragment;
  220. unsigned long dwRsrRxFrmLen64;
  221. unsigned long dwRsrRxFrmLen65_127;
  222. unsigned long dwRsrRxFrmLen128_255;
  223. unsigned long dwRsrRxFrmLen256_511;
  224. unsigned long dwRsrRxFrmLen512_1023;
  225. unsigned long dwRsrRxFrmLen1024_1518;
  226. // TSR status count
  227. //
  228. unsigned long dwTsrTotalRetry[TYPE_MAXTD]; // total collision retry count
  229. unsigned long dwTsrOnceRetry[TYPE_MAXTD]; // this packet only occur one collision
  230. unsigned long dwTsrMoreThanOnceRetry[TYPE_MAXTD]; // this packet occur more than one collision
  231. unsigned long dwTsrRetry[TYPE_MAXTD]; // this packet has ever occur collision,
  232. // that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0)
  233. unsigned long dwTsrACKData[TYPE_MAXTD];
  234. unsigned long dwTsrErr[TYPE_MAXTD];
  235. unsigned long dwAllTsrOK[TYPE_MAXTD];
  236. unsigned long dwTsrRetryTimeout[TYPE_MAXTD];
  237. unsigned long dwTsrTransmitTimeout[TYPE_MAXTD];
  238. unsigned long dwTsrTxPacket[TYPE_MAXTD];
  239. unsigned long dwTsrTxOctet[TYPE_MAXTD];
  240. unsigned long dwTsrBroadcast[TYPE_MAXTD];
  241. unsigned long dwTsrMulticast[TYPE_MAXTD];
  242. unsigned long dwTsrDirected[TYPE_MAXTD];
  243. // RD/TD count
  244. unsigned long dwCntRxFrmLength;
  245. unsigned long dwCntTxBufLength;
  246. unsigned char abyCntRxPattern[16];
  247. unsigned char abyCntTxPattern[16];
  248. // Software check....
  249. unsigned long dwCntRxDataErr; // rx buffer data software compare CRC err count
  250. unsigned long dwCntDecryptErr; // rx buffer data software compare CRC err count
  251. unsigned long dwCntRxICVErr; // rx buffer data software compare CRC err count
  252. unsigned int idxRxErrorDesc[TYPE_MAXRD]; // index for rx data error RD
  253. // 64-bit OID
  254. unsigned long long ullTsrOK[TYPE_MAXTD];
  255. // for some optional OIDs (64 bits) and DMI support
  256. unsigned long long ullTxBroadcastFrames[TYPE_MAXTD];
  257. unsigned long long ullTxMulticastFrames[TYPE_MAXTD];
  258. unsigned long long ullTxDirectedFrames[TYPE_MAXTD];
  259. unsigned long long ullTxBroadcastBytes[TYPE_MAXTD];
  260. unsigned long long ullTxMulticastBytes[TYPE_MAXTD];
  261. unsigned long long ullTxDirectedBytes[TYPE_MAXTD];
  262. SISRCounters ISRStat;
  263. SCustomCounters CustomStat;
  264. #ifdef Calcu_LinkQual
  265. //Tx count:
  266. unsigned long TxNoRetryOkCount;
  267. unsigned long TxRetryOkCount;
  268. unsigned long TxFailCount;
  269. //Rx count:
  270. unsigned long RxOkCnt;
  271. unsigned long RxFcsErrCnt;
  272. //statistic
  273. unsigned long SignalStren;
  274. unsigned long LinkQuality;
  275. #endif
  276. } SStatCounter, *PSStatCounter;
  277. void STAvClearAllCounter(PSStatCounter pStatistic);
  278. void STAvUpdateIsrStatCounter(PSStatCounter pStatistic, unsigned long dwIsr);
  279. void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
  280. unsigned char byRSR, unsigned char byNewRSR, unsigned char byRxRate,
  281. unsigned char *pbyBuffer, unsigned int cbFrameLength);
  282. void STAvUpdateRDStatCounterEx(PSStatCounter pStatistic,
  283. unsigned char byRSR, unsigned char byNewRsr, unsigned char byRxRate,
  284. unsigned char *pbyBuffer, unsigned int cbFrameLength);
  285. void STAvUpdateTDStatCounter(PSStatCounter pStatistic, unsigned char byTSR0, unsigned char byTSR1,
  286. unsigned char *pbyBuffer, unsigned int cbFrameLength, unsigned int uIdx);
  287. void STAvUpdateTDStatCounterEx(
  288. PSStatCounter pStatistic,
  289. unsigned char *pbyBuffer,
  290. unsigned long cbFrameLength
  291. );
  292. void STAvUpdate802_11Counter(
  293. PSDot11Counters p802_11Counter,
  294. PSStatCounter pStatistic,
  295. unsigned long dwCounter
  296. );
  297. void STAvClear802_11Counter(PSDot11Counters p802_11Counter);
  298. #endif // __MIB_H__