mib.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  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. /*--------------------- Export Definitions -------------------------*/
  34. //
  35. // 802.11 counter
  36. //
  37. typedef struct tagSDot11Counters {
  38. unsigned long Length; // Length of structure
  39. unsigned long long TransmittedFragmentCount;
  40. unsigned long long MulticastTransmittedFrameCount;
  41. unsigned long long FailedCount;
  42. unsigned long long RetryCount;
  43. unsigned long long MultipleRetryCount;
  44. unsigned long long RTSSuccessCount;
  45. unsigned long long RTSFailureCount;
  46. unsigned long long ACKFailureCount;
  47. unsigned long long FrameDuplicateCount;
  48. unsigned long long ReceivedFragmentCount;
  49. unsigned long long MulticastReceivedFrameCount;
  50. unsigned long long FCSErrorCount;
  51. unsigned long long TKIPLocalMICFailures;
  52. unsigned long long TKIPRemoteMICFailures;
  53. unsigned long long TKIPICVErrors;
  54. unsigned long long TKIPCounterMeasuresInvoked;
  55. unsigned long long TKIPReplays;
  56. unsigned long long CCMPFormatErrors;
  57. unsigned long long CCMPReplays;
  58. unsigned long long CCMPDecryptErrors;
  59. unsigned long long FourWayHandshakeFailures;
  60. // unsigned long long WEPUndecryptableCount;
  61. // unsigned long long WEPICVErrorCount;
  62. // unsigned long long DecryptSuccessCount;
  63. // unsigned long long DecryptFailureCount;
  64. } SDot11Counters, *PSDot11Counters;
  65. //
  66. // MIB2 counter
  67. //
  68. typedef struct tagSMib2Counter {
  69. long ifIndex;
  70. char ifDescr[256]; // max size 255 plus zero ending
  71. // e.g. "interface 1"
  72. long ifType;
  73. long ifMtu;
  74. unsigned long ifSpeed;
  75. unsigned char ifPhysAddress[ETH_ALEN];
  76. long ifAdminStatus;
  77. long ifOperStatus;
  78. unsigned long ifLastChange;
  79. unsigned long ifInOctets;
  80. unsigned long ifInUcastPkts;
  81. unsigned long ifInNUcastPkts;
  82. unsigned long ifInDiscards;
  83. unsigned long ifInErrors;
  84. unsigned long ifInUnknownProtos;
  85. unsigned long ifOutOctets;
  86. unsigned long ifOutUcastPkts;
  87. unsigned long ifOutNUcastPkts;
  88. unsigned long ifOutDiscards;
  89. unsigned long ifOutErrors;
  90. unsigned long ifOutQLen;
  91. unsigned long ifSpecific;
  92. } SMib2Counter, *PSMib2Counter;
  93. // Value in the ifType entry
  94. //#define ETHERNETCSMACD 6 //
  95. #define WIRELESSLANIEEE80211b 6 //
  96. // Value in the ifAdminStatus/ifOperStatus entry
  97. #define UP 1 //
  98. #define DOWN 2 //
  99. #define TESTING 3 //
  100. //
  101. // RMON counter
  102. //
  103. typedef struct tagSRmonCounter {
  104. long etherStatsIndex;
  105. unsigned long etherStatsDataSource;
  106. unsigned long etherStatsDropEvents;
  107. unsigned long etherStatsOctets;
  108. unsigned long etherStatsPkts;
  109. unsigned long etherStatsBroadcastPkts;
  110. unsigned long etherStatsMulticastPkts;
  111. unsigned long etherStatsCRCAlignErrors;
  112. unsigned long etherStatsUndersizePkts;
  113. unsigned long etherStatsOversizePkts;
  114. unsigned long etherStatsFragments;
  115. unsigned long etherStatsJabbers;
  116. unsigned long etherStatsCollisions;
  117. unsigned long etherStatsPkt64Octets;
  118. unsigned long etherStatsPkt65to127Octets;
  119. unsigned long etherStatsPkt128to255Octets;
  120. unsigned long etherStatsPkt256to511Octets;
  121. unsigned long etherStatsPkt512to1023Octets;
  122. unsigned long etherStatsPkt1024to1518Octets;
  123. unsigned long etherStatsOwners;
  124. unsigned long etherStatsStatus;
  125. } SRmonCounter, *PSRmonCounter;
  126. //
  127. // Custom counter
  128. //
  129. typedef struct tagSCustomCounters {
  130. unsigned long Length;
  131. unsigned long long ullTsrAllOK;
  132. unsigned long long ullRsr11M;
  133. unsigned long long ullRsr5M;
  134. unsigned long long ullRsr2M;
  135. unsigned long long ullRsr1M;
  136. unsigned long long ullRsr11MCRCOk;
  137. unsigned long long ullRsr5MCRCOk;
  138. unsigned long long ullRsr2MCRCOk;
  139. unsigned long long ullRsr1MCRCOk;
  140. unsigned long long ullRsr54M;
  141. unsigned long long ullRsr48M;
  142. unsigned long long ullRsr36M;
  143. unsigned long long ullRsr24M;
  144. unsigned long long ullRsr18M;
  145. unsigned long long ullRsr12M;
  146. unsigned long long ullRsr9M;
  147. unsigned long long ullRsr6M;
  148. unsigned long long ullRsr54MCRCOk;
  149. unsigned long long ullRsr48MCRCOk;
  150. unsigned long long ullRsr36MCRCOk;
  151. unsigned long long ullRsr24MCRCOk;
  152. unsigned long long ullRsr18MCRCOk;
  153. unsigned long long ullRsr12MCRCOk;
  154. unsigned long long ullRsr9MCRCOk;
  155. unsigned long long ullRsr6MCRCOk;
  156. } SCustomCounters, *PSCustomCounters;
  157. //
  158. // Custom counter
  159. //
  160. typedef struct tagSISRCounters {
  161. unsigned long Length;
  162. unsigned long dwIsrTx0OK;
  163. unsigned long dwIsrAC0TxOK;
  164. unsigned long dwIsrBeaconTxOK;
  165. unsigned long dwIsrRx0OK;
  166. unsigned long dwIsrTBTTInt;
  167. unsigned long dwIsrSTIMERInt;
  168. unsigned long dwIsrWatchDog;
  169. unsigned long dwIsrUnrecoverableError;
  170. unsigned long dwIsrSoftInterrupt;
  171. unsigned long dwIsrMIBNearfull;
  172. unsigned long dwIsrRxNoBuf;
  173. unsigned long dwIsrUnknown; // unknown interrupt count
  174. unsigned long dwIsrRx1OK;
  175. unsigned long dwIsrATIMTxOK;
  176. unsigned long dwIsrSYNCTxOK;
  177. unsigned long dwIsrCFPEnd;
  178. unsigned long dwIsrATIMEnd;
  179. unsigned long dwIsrSYNCFlushOK;
  180. unsigned long dwIsrSTIMER1Int;
  181. /////////////////////////////////////
  182. } SISRCounters, *PSISRCounters;
  183. // Value in the etherStatsStatus entry
  184. #define VALID 1 //
  185. #define CREATE_REQUEST 2 //
  186. #define UNDER_CREATION 3 //
  187. #define INVALID 4 //
  188. //#define MAX_RATE 12
  189. //
  190. // statistic counter
  191. //
  192. typedef struct tagSStatCounter {
  193. //
  194. // ISR status count
  195. //
  196. // RSR status count
  197. //
  198. unsigned long dwRsrFrmAlgnErr;
  199. unsigned long dwRsrErr;
  200. unsigned long dwRsrCRCErr;
  201. unsigned long dwRsrCRCOk;
  202. unsigned long dwRsrBSSIDOk;
  203. unsigned long dwRsrADDROk;
  204. unsigned long dwRsrBCNSSIDOk;
  205. unsigned long dwRsrLENErr;
  206. unsigned long dwRsrTYPErr;
  207. unsigned long dwNewRsrDECRYPTOK;
  208. unsigned long dwNewRsrCFP;
  209. unsigned long dwNewRsrUTSF;
  210. unsigned long dwNewRsrHITAID;
  211. unsigned long dwNewRsrHITAID0;
  212. unsigned long dwRsrLong;
  213. unsigned long dwRsrRunt;
  214. unsigned long dwRsrRxControl;
  215. unsigned long dwRsrRxData;
  216. unsigned long dwRsrRxManage;
  217. unsigned long dwRsrRxPacket;
  218. unsigned long dwRsrRxOctet;
  219. unsigned long dwRsrBroadcast;
  220. unsigned long dwRsrMulticast;
  221. unsigned long dwRsrDirected;
  222. // 64-bit OID
  223. unsigned long long ullRsrOK;
  224. // for some optional OIDs (64 bits) and DMI support
  225. unsigned long long ullRxBroadcastBytes;
  226. unsigned long long ullRxMulticastBytes;
  227. unsigned long long ullRxDirectedBytes;
  228. unsigned long long ullRxBroadcastFrames;
  229. unsigned long long ullRxMulticastFrames;
  230. unsigned long long ullRxDirectedFrames;
  231. unsigned long dwRsrRxFragment;
  232. unsigned long dwRsrRxFrmLen64;
  233. unsigned long dwRsrRxFrmLen65_127;
  234. unsigned long dwRsrRxFrmLen128_255;
  235. unsigned long dwRsrRxFrmLen256_511;
  236. unsigned long dwRsrRxFrmLen512_1023;
  237. unsigned long dwRsrRxFrmLen1024_1518;
  238. // TSR status count
  239. //
  240. unsigned long dwTsrTotalRetry[TYPE_MAXTD]; // total collision retry count
  241. unsigned long dwTsrOnceRetry[TYPE_MAXTD]; // this packet only occur one collision
  242. unsigned long dwTsrMoreThanOnceRetry[TYPE_MAXTD]; // this packet occur more than one collision
  243. unsigned long dwTsrRetry[TYPE_MAXTD]; // this packet has ever occur collision,
  244. // that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0)
  245. unsigned long dwTsrACKData[TYPE_MAXTD];
  246. unsigned long dwTsrErr[TYPE_MAXTD];
  247. unsigned long dwAllTsrOK[TYPE_MAXTD];
  248. unsigned long dwTsrRetryTimeout[TYPE_MAXTD];
  249. unsigned long dwTsrTransmitTimeout[TYPE_MAXTD];
  250. unsigned long dwTsrTxPacket[TYPE_MAXTD];
  251. unsigned long dwTsrTxOctet[TYPE_MAXTD];
  252. unsigned long dwTsrBroadcast[TYPE_MAXTD];
  253. unsigned long dwTsrMulticast[TYPE_MAXTD];
  254. unsigned long dwTsrDirected[TYPE_MAXTD];
  255. // RD/TD count
  256. unsigned long dwCntRxFrmLength;
  257. unsigned long dwCntTxBufLength;
  258. unsigned char abyCntRxPattern[16];
  259. unsigned char abyCntTxPattern[16];
  260. // Software check....
  261. unsigned long dwCntRxDataErr; // rx buffer data software compare CRC err count
  262. unsigned long dwCntDecryptErr; // rx buffer data software compare CRC err count
  263. unsigned long dwCntRxICVErr; // rx buffer data software compare CRC err count
  264. unsigned int idxRxErrorDesc[TYPE_MAXRD]; // index for rx data error RD
  265. // 64-bit OID
  266. unsigned long long ullTsrOK[TYPE_MAXTD];
  267. // for some optional OIDs (64 bits) and DMI support
  268. unsigned long long ullTxBroadcastFrames[TYPE_MAXTD];
  269. unsigned long long ullTxMulticastFrames[TYPE_MAXTD];
  270. unsigned long long ullTxDirectedFrames[TYPE_MAXTD];
  271. unsigned long long ullTxBroadcastBytes[TYPE_MAXTD];
  272. unsigned long long ullTxMulticastBytes[TYPE_MAXTD];
  273. unsigned long long ullTxDirectedBytes[TYPE_MAXTD];
  274. // unsigned long dwTxRetryCount[8];
  275. //
  276. // ISR status count
  277. //
  278. SISRCounters ISRStat;
  279. SCustomCounters CustomStat;
  280. #ifdef Calcu_LinkQual
  281. //Tx count:
  282. unsigned long TxNoRetryOkCount; //success tx no retry !
  283. unsigned long TxRetryOkCount; //success tx but retry !
  284. unsigned long TxFailCount; //fail tx ?
  285. //Rx count:
  286. unsigned long RxOkCnt; //success rx !
  287. unsigned long RxFcsErrCnt; //fail rx ?
  288. //statistic
  289. unsigned long SignalStren;
  290. unsigned long LinkQuality;
  291. #endif
  292. } SStatCounter, *PSStatCounter;
  293. /*--------------------- Export Classes ----------------------------*/
  294. /*--------------------- Export Variables --------------------------*/
  295. /*--------------------- Export Functions --------------------------*/
  296. void STAvClearAllCounter(PSStatCounter pStatistic);
  297. void STAvUpdateIsrStatCounter(PSStatCounter pStatistic, unsigned long dwIsr);
  298. void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
  299. unsigned char byRSR, unsigned char byNewRSR, unsigned char byRxRate,
  300. unsigned char *pbyBuffer, unsigned int cbFrameLength);
  301. void STAvUpdateRDStatCounterEx(PSStatCounter pStatistic,
  302. unsigned char byRSR, unsigned char byNewRsr, unsigned char byRxRate,
  303. unsigned char *pbyBuffer, unsigned int cbFrameLength);
  304. void STAvUpdateTDStatCounter(PSStatCounter pStatistic, unsigned char byTSR0, unsigned char byTSR1,
  305. unsigned char *pbyBuffer, unsigned int cbFrameLength, unsigned int uIdx);
  306. void STAvUpdateTDStatCounterEx(
  307. PSStatCounter pStatistic,
  308. unsigned char *pbyBuffer,
  309. unsigned long cbFrameLength
  310. );
  311. void STAvUpdate802_11Counter(
  312. PSDot11Counters p802_11Counter,
  313. PSStatCounter pStatistic,
  314. unsigned long dwCounter
  315. );
  316. void STAvClear802_11Counter(PSDot11Counters p802_11Counter);
  317. #endif // __MIB_H__