Leaked source code of windows server 2003
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.

955 lines
43 KiB

  1. #include "precomp.h"
  2. DWORD g_uptimeReference;
  3. MIB_SERVER_HANDLE g_MibServerHandle = 0;
  4. CRITICAL_SECTION g_ConnectionLock;
  5. UCHAR ZERO_NET_NUM[4] = {0,0,0,0};
  6. UCHAR ZERO_SERVER_NAME[1] = {0};
  7. #if DBG
  8. // DWORD DbgLevel=DEF_DBGLEVEL;
  9. DWORD DbgLevel=0xffffffff;
  10. #endif
  11. ///////////////////////////////////////////////////////////////////////////////
  12. // //
  13. // root oid //
  14. // //
  15. ///////////////////////////////////////////////////////////////////////////////
  16. static UINT ids_ms_mipx[] = {1,3,6,1,4,1,311,1,8};
  17. ///////////////////////////////////////////////////////////////////////////////
  18. // //
  19. // mipxBase group (1.3.6.1.4.1.311.1.8.1) //
  20. // //
  21. ///////////////////////////////////////////////////////////////////////////////
  22. static UINT ids_mipxBase[] = {1};
  23. static UINT ids_mipxBaseOperState[] = {1,1,0};
  24. static UINT ids_mipxBasePrimaryNetNumber[] = {1,2,0};
  25. static UINT ids_mipxBaseNode[] = {1,3,0};
  26. static UINT ids_mipxBaseSysName[] = {1,4,0};
  27. static UINT ids_mipxBaseMaxPathSplits[] = {1,5,0};
  28. static UINT ids_mipxBaseIfCount[] = {1,6,0};
  29. static UINT ids_mipxBaseDestCount[] = {1,7,0};
  30. static UINT ids_mipxBaseServCount[] = {1,8,0};
  31. ///////////////////////////////////////////////////////////////////////////////
  32. // //
  33. // mipxInterface group (1.3.6.1.4.1.311.1.8.2) //
  34. // //
  35. ///////////////////////////////////////////////////////////////////////////////
  36. static UINT ids_mipxInterface[] = {2};
  37. static UINT ids_mipxIfTable[] = {2,1};
  38. ///////////////////////////////////////////////////////////////////////////////
  39. // //
  40. // mipxIfEntry table (1.3.6.1.4.1.311.1.8.2.1.1) //
  41. // //
  42. ///////////////////////////////////////////////////////////////////////////////
  43. static UINT ids_mipxIfEntry[] = {2,1,1};
  44. static UINT ids_mipxIfIndex[] = {2,1,1,1};
  45. static UINT ids_mipxIfAdminState[] = {2,1,1,2};
  46. static UINT ids_mipxIfOperState[] = {2,1,1,3};
  47. static UINT ids_mipxIfAdapterIndex[] = {2,1,1,4};
  48. static UINT ids_mipxIfName[] = {2,1,1,5};
  49. static UINT ids_mipxIfType[] = {2,1,1,6};
  50. static UINT ids_mipxIfLocalMaxPacketSize[] = {2,1,1,7};
  51. static UINT ids_mipxIfMediaType[] = {2,1,1,8};
  52. static UINT ids_mipxIfNetNumber[] = {2,1,1,9};
  53. static UINT ids_mipxIfMacAddress[] = {2,1,1,10};
  54. static UINT ids_mipxIfDelay[] = {2,1,1,11};
  55. static UINT ids_mipxIfThroughput[] = {2,1,1,12};
  56. static UINT ids_mipxIfIpxWanEnable[] = {2,1,1,13};
  57. static UINT ids_mipxIfNetbiosAccept[] = {2,1,1,14};
  58. static UINT ids_mipxIfNetbiosDeliver[] = {2,1,1,15};
  59. static UINT ids_mipxIfInHdrErrors[] = {2,1,1,16};
  60. static UINT ids_mipxIfInFilterDrops[] = {2,1,1,17};
  61. static UINT ids_mipxIfInNoRoutes[] = {2,1,1,18};
  62. static UINT ids_mipxIfInDiscards[] = {2,1,1,19};
  63. static UINT ids_mipxIfInDelivers[] = {2,1,1,20};
  64. static UINT ids_mipxIfOutFilterDrops[] = {2,1,1,21};
  65. static UINT ids_mipxIfOutDiscards[] = {2,1,1,22};
  66. static UINT ids_mipxIfOutDelivers[] = {2,1,1,23};
  67. static UINT ids_mipxIfInNetbiosPackets[] = {2,1,1,24};
  68. static UINT ids_mipxIfOutNetbiosPackets[] = {2,1,1,25};
  69. ///////////////////////////////////////////////////////////////////////////////
  70. // //
  71. // mipxForwarding group (1.3.6.1.4.1.311.1.8.3) //
  72. // //
  73. ///////////////////////////////////////////////////////////////////////////////
  74. static UINT ids_mipxForwarding[] = {3};
  75. static UINT ids_mipxDestTable[] = {3,1};
  76. static UINT ids_mipxStaticRouteTable[] = {3,2};
  77. ///////////////////////////////////////////////////////////////////////////////
  78. // //
  79. // mipxDestEntry table (1.3.6.1.4.1.311.1.8.3.1.1) //
  80. // //
  81. ///////////////////////////////////////////////////////////////////////////////
  82. static UINT ids_mipxDestEntry[] = {3,1,1};
  83. static UINT ids_mipxDestNetNum[] = {3,1,1,1};
  84. static UINT ids_mipxDestProtocol[] = {3,1,1,2};
  85. static UINT ids_mipxDestTicks[] = {3,1,1,3};
  86. static UINT ids_mipxDestHopCount[] = {3,1,1,4};
  87. static UINT ids_mipxDestNextHopIfIndex[] = {3,1,1,5};
  88. static UINT ids_mipxDestNextHopMacAddress[] = {3,1,1,6};
  89. static UINT ids_mipxDestFlags[] = {3,1,1,7};
  90. ///////////////////////////////////////////////////////////////////////////////
  91. // //
  92. // mipxStaticRouteEntry table (1.3.6.1.4.1.311.1.8.3.2.1) //
  93. // //
  94. ///////////////////////////////////////////////////////////////////////////////
  95. static UINT ids_mipxStaticRouteEntry[] = {3,2,1};
  96. static UINT ids_mipxStaticRouteIfIndex[] = {3,2,1,1};
  97. static UINT ids_mipxStaticRouteNetNum[] = {3,2,1,2};
  98. static UINT ids_mipxStaticRouteEntryStatus[]= {3,2,1,3};
  99. static UINT ids_mipxStaticRouteTicks[] = {3,2,1,4};
  100. static UINT ids_mipxStaticRouteHopCount[] = {3,2,1,5};
  101. static UINT ids_mipxStaticRouteNextHopMacAddress[]= {3,2,1,6};
  102. ///////////////////////////////////////////////////////////////////////////////
  103. // //
  104. // mipxServices group (1.3.6.1.4.1.311.1.8.4) //
  105. // //
  106. ///////////////////////////////////////////////////////////////////////////////
  107. static UINT ids_mipxServices[] = {4};
  108. static UINT ids_mipxServTable[] = {4,1};
  109. static UINT ids_mipxStaticServTable[] = {4,2};
  110. ///////////////////////////////////////////////////////////////////////////////
  111. // //
  112. // mipxServEntry table (1.3.6.1.4.1.311.1.8.4.1.1) //
  113. // //
  114. ///////////////////////////////////////////////////////////////////////////////
  115. static UINT ids_mipxServEntry[] = {4,1,1};
  116. static UINT ids_mipxServType[] = {4,1,1,1};
  117. static UINT ids_mipxServName[] = {4,1,1,2};
  118. static UINT ids_mipxServProtocol[] = {4,1,1,3};
  119. static UINT ids_mipxServNetNum[] = {4,1,1,4};
  120. static UINT ids_mipxServNode[] = {4,1,1,5};
  121. static UINT ids_mipxServSocket[] = {4,1,1,6};
  122. static UINT ids_mipxServHopCount[] = {4,1,1,7};
  123. ///////////////////////////////////////////////////////////////////////////////
  124. // //
  125. // mipxStaticServEntry table (1.3.6.1.4.1.311.1.8.4.2.1) //
  126. // //
  127. ///////////////////////////////////////////////////////////////////////////////
  128. static UINT ids_mipxStaticServEntry[] = {4,2,1};
  129. static UINT ids_mipxStaticServIfIndex[] = {4,2,1,1};
  130. static UINT ids_mipxStaticServType[] = {4,2,1,2};
  131. static UINT ids_mipxStaticServName[] = {4,2,1,3};
  132. static UINT ids_mipxStaticServEntryStatus[] = {4,2,1,4};
  133. static UINT ids_mipxStaticServNetNum[] = {4,2,1,5};
  134. static UINT ids_mipxStaticServNode[] = {4,2,1,6};
  135. static UINT ids_mipxStaticServSocket[] = {4,2,1,7};
  136. static UINT ids_mipxStaticServHopCount[] = {4,2,1,8};
  137. ///////////////////////////////////////////////////////////////////////////////
  138. // //
  139. // Mib entry list //
  140. // //
  141. ///////////////////////////////////////////////////////////////////////////////
  142. SnmpMibEntry mib_ms_mipx[] = {
  143. MIB_GROUP(mipxBase),
  144. MIB_INTEGER(mipxBaseOperState),
  145. MIB_OCTETSTRING_L(mipxBasePrimaryNetNumber,4,4),
  146. MIB_OCTETSTRING_L(mipxBaseNode,6,6),
  147. MIB_OCTETSTRING_L(mipxBaseSysName,0,48),
  148. MIB_INTEGER_L(mipxBaseMaxPathSplits,1,32),
  149. MIB_INTEGER(mipxBaseIfCount),
  150. MIB_INTEGER(mipxBaseDestCount),
  151. MIB_INTEGER(mipxBaseServCount),
  152. MIB_GROUP(mipxInterface),
  153. MIB_TABLE_ROOT(mipxIfTable),
  154. MIB_TABLE_ENTRY(mipxIfEntry),
  155. MIB_INTEGER(mipxIfIndex),
  156. MIB_INTEGER_RW(mipxIfAdminState),
  157. MIB_INTEGER(mipxIfOperState),
  158. MIB_INTEGER(mipxIfAdapterIndex),
  159. MIB_OCTETSTRING_L(mipxIfName,0,48),
  160. MIB_INTEGER(mipxIfType),
  161. MIB_INTEGER(mipxIfLocalMaxPacketSize),
  162. MIB_INTEGER(mipxIfMediaType),
  163. MIB_OCTETSTRING_L(mipxIfNetNumber,4,4),
  164. MIB_OCTETSTRING_L(mipxIfMacAddress,6,6),
  165. MIB_INTEGER(mipxIfDelay),
  166. MIB_INTEGER(mipxIfThroughput),
  167. MIB_INTEGER_RW(mipxIfIpxWanEnable),
  168. MIB_INTEGER_RW(mipxIfNetbiosAccept),
  169. MIB_INTEGER_RW(mipxIfNetbiosDeliver),
  170. MIB_COUNTER(mipxIfInHdrErrors),
  171. MIB_COUNTER(mipxIfInFilterDrops),
  172. MIB_COUNTER(mipxIfInNoRoutes),
  173. MIB_COUNTER(mipxIfInDiscards),
  174. MIB_COUNTER(mipxIfInDelivers),
  175. MIB_COUNTER(mipxIfOutFilterDrops),
  176. MIB_COUNTER(mipxIfOutDiscards),
  177. MIB_COUNTER(mipxIfOutDelivers),
  178. MIB_COUNTER(mipxIfInNetbiosPackets),
  179. MIB_COUNTER(mipxIfOutNetbiosPackets),
  180. MIB_GROUP(mipxForwarding),
  181. MIB_TABLE_ROOT(mipxDestTable),
  182. MIB_TABLE_ENTRY(mipxDestEntry),
  183. MIB_OCTETSTRING_L(mipxDestNetNum,4,4),
  184. MIB_INTEGER(mipxDestProtocol),
  185. MIB_INTEGER(mipxDestTicks),
  186. MIB_INTEGER(mipxDestHopCount),
  187. MIB_INTEGER(mipxDestNextHopIfIndex),
  188. MIB_OCTETSTRING_L(mipxDestNextHopMacAddress,6,6),
  189. MIB_INTEGER_L(mipxDestFlags,0,3),
  190. MIB_TABLE_ROOT(mipxStaticRouteTable),
  191. MIB_TABLE_ENTRY(mipxStaticRouteEntry),
  192. MIB_INTEGER(mipxStaticRouteIfIndex),
  193. MIB_OCTETSTRING_L(mipxStaticRouteNetNum,4,4),
  194. MIB_INTEGER_RW(mipxStaticRouteEntryStatus),
  195. MIB_INTEGER_RW(mipxStaticRouteTicks),
  196. MIB_INTEGER_RW(mipxStaticRouteHopCount),
  197. MIB_OCTETSTRING_RW_L(mipxStaticRouteNextHopMacAddress,6,6),
  198. MIB_GROUP(mipxServices),
  199. MIB_TABLE_ROOT(mipxServTable),
  200. MIB_TABLE_ENTRY(mipxServEntry),
  201. MIB_OCTETSTRING_L(mipxServType,2,2),
  202. MIB_OCTETSTRING_L(mipxServName,1,48),
  203. MIB_INTEGER(mipxServProtocol),
  204. MIB_OCTETSTRING_L(mipxServNetNum,4,4),
  205. MIB_OCTETSTRING_L(mipxServNode,6,6),
  206. MIB_OCTETSTRING_L(mipxServSocket,2,2),
  207. MIB_INTEGER(mipxServHopCount),
  208. MIB_TABLE_ROOT(mipxStaticServTable),
  209. MIB_TABLE_ENTRY(mipxStaticServEntry),
  210. MIB_INTEGER(mipxStaticServIfIndex),
  211. MIB_OCTETSTRING_L(mipxStaticServType,2,2),
  212. MIB_OCTETSTRING_L(mipxStaticServName,1,48),
  213. MIB_INTEGER_RW(mipxStaticServEntryStatus),
  214. MIB_OCTETSTRING_RW_L(mipxStaticServNetNum,4,4),
  215. MIB_OCTETSTRING_RW_L(mipxStaticServNode,6,6),
  216. MIB_OCTETSTRING_RW_L(mipxStaticServSocket,2,2),
  217. MIB_INTEGER_RW(mipxStaticServHopCount),
  218. MIB_END()
  219. };
  220. ///////////////////////////////////////////////////////////////////////////////
  221. // //
  222. // Mib table list //
  223. // //
  224. ///////////////////////////////////////////////////////////////////////////////
  225. SnmpMibTable tbl_ms_mipx[] = {
  226. MIB_TABLE(ms_mipx,mipxIfEntry,NULL),
  227. MIB_TABLE(ms_mipx,mipxDestEntry,NULL),
  228. MIB_TABLE(ms_mipx,mipxStaticRouteEntry,NULL),
  229. MIB_TABLE(ms_mipx,mipxServEntry,NULL),
  230. MIB_TABLE(ms_mipx,mipxStaticServEntry,NULL)
  231. };
  232. ///////////////////////////////////////////////////////////////////////////////
  233. // //
  234. // root oid //
  235. // //
  236. ///////////////////////////////////////////////////////////////////////////////
  237. static UINT ids_ms_mripsap[] = {1,3,6,1,4,1,311,1,9};
  238. ///////////////////////////////////////////////////////////////////////////////
  239. // //
  240. // mripsapBase group (1.3.6.1.4.1.311.1.9.1) //
  241. // //
  242. ///////////////////////////////////////////////////////////////////////////////
  243. static UINT ids_mripsapBase[] = {1};
  244. static UINT ids_mripsapBaseRipOperState[] = {1,1,0};
  245. static UINT ids_mripsapBaseSapOperState[] = {1,2,0};
  246. ///////////////////////////////////////////////////////////////////////////////
  247. // //
  248. // mripsapInterface group (1.3.6.1.4.1.311.1.9.2) //
  249. // //
  250. ///////////////////////////////////////////////////////////////////////////////
  251. static UINT ids_mripsapInterface[] = {2};
  252. static UINT ids_mripIfTable[] = {2,1};
  253. ///////////////////////////////////////////////////////////////////////////////
  254. // //
  255. // mripIfEntry table (1.3.6.1.4.1.311.1.9.2.1.1) //
  256. // //
  257. ///////////////////////////////////////////////////////////////////////////////
  258. static UINT ids_mripIfEntry[] = {2,1,1};
  259. static UINT ids_mripIfIndex[] = {2,1,1,1};
  260. static UINT ids_mripIfAdminState[] = {2,1,1,2};
  261. static UINT ids_mripIfOperState[] = {2,1,1,3};
  262. static UINT ids_mripIfUpdateMode[] = {2,1,1,4};
  263. static UINT ids_mripIfUpdateInterval[] = {2,1,1,5};
  264. static UINT ids_mripIfAgeMultiplier[] = {2,1,1,6};
  265. static UINT ids_mripIfSupply[] = {2,1,1,7};
  266. static UINT ids_mripIfListen[] = {2,1,1,8};
  267. static UINT ids_mripIfOutPackets[] = {2,1,1,9};
  268. static UINT ids_mripIfInPackets[] = {2,1,1,10};
  269. static UINT ids_msapIfTable[] = {2,2};
  270. ///////////////////////////////////////////////////////////////////////////////
  271. // //
  272. // msapIfEntry table (1.3.6.1.4.1.311.1.9.2.2.1) //
  273. // //
  274. ///////////////////////////////////////////////////////////////////////////////
  275. static UINT ids_msapIfEntry[] = {2,2,1};
  276. static UINT ids_msapIfIndex[] = {2,2,1,1};
  277. static UINT ids_msapIfAdminState[] = {2,2,1,2};
  278. static UINT ids_msapIfOperState[] = {2,2,1,3};
  279. static UINT ids_msapIfUpdateMode[] = {2,2,1,4};
  280. static UINT ids_msapIfUpdateInterval[] = {2,2,1,5};
  281. static UINT ids_msapIfAgeMultiplier[] = {2,2,1,6};
  282. static UINT ids_msapIfSupply[] = {2,2,1,7};
  283. static UINT ids_msapIfListen[] = {2,2,1,8};
  284. static UINT ids_msapIfGetNearestServerReply[]= {2,2,1,9};
  285. static UINT ids_msapIfOutPackets[] = {2,2,1,10};
  286. static UINT ids_msapIfInPackets[] = {2,2,1,11};
  287. ///////////////////////////////////////////////////////////////////////////////
  288. // //
  289. // Mib entry list //
  290. // //
  291. ///////////////////////////////////////////////////////////////////////////////
  292. SnmpMibEntry mib_ms_mripsap[] = {
  293. MIB_GROUP(mripsapBase),
  294. MIB_INTEGER(mripsapBaseRipOperState),
  295. MIB_INTEGER(mripsapBaseSapOperState),
  296. MIB_GROUP(mripsapInterface),
  297. MIB_TABLE_ROOT(mripIfTable),
  298. MIB_TABLE_ENTRY(mripIfEntry),
  299. MIB_INTEGER(mripIfIndex),
  300. MIB_INTEGER_RW(mripIfAdminState),
  301. MIB_INTEGER(mripIfOperState),
  302. MIB_INTEGER_RW(mripIfUpdateMode),
  303. MIB_INTEGER_RW(mripIfUpdateInterval),
  304. MIB_INTEGER_RW(mripIfAgeMultiplier),
  305. MIB_INTEGER_RW(mripIfSupply),
  306. MIB_INTEGER_RW(mripIfListen),
  307. MIB_COUNTER(mripIfOutPackets),
  308. MIB_COUNTER(mripIfInPackets),
  309. MIB_TABLE_ROOT(msapIfTable),
  310. MIB_TABLE_ENTRY(msapIfEntry),
  311. MIB_INTEGER(msapIfIndex),
  312. MIB_INTEGER_RW(msapIfAdminState),
  313. MIB_INTEGER(msapIfOperState),
  314. MIB_INTEGER_RW(msapIfUpdateMode),
  315. MIB_INTEGER_RW(msapIfUpdateInterval),
  316. MIB_INTEGER_RW(msapIfAgeMultiplier),
  317. MIB_INTEGER_RW(msapIfSupply),
  318. MIB_INTEGER_RW(msapIfListen),
  319. MIB_INTEGER_RW(msapIfGetNearestServerReply),
  320. MIB_COUNTER(msapIfOutPackets),
  321. MIB_COUNTER(msapIfInPackets),
  322. MIB_END()
  323. };
  324. ///////////////////////////////////////////////////////////////////////////////
  325. // //
  326. // Mib table list //
  327. // //
  328. ///////////////////////////////////////////////////////////////////////////////
  329. SnmpMibTable tbl_ms_mripsap[] = {
  330. MIB_TABLE(ms_mripsap,mripIfEntry,NULL),
  331. MIB_TABLE(ms_mripsap,msapIfEntry,NULL)
  332. };
  333. ///////////////////////////////////////////////////////////////////////////////
  334. // //
  335. // root oid //
  336. // //
  337. ///////////////////////////////////////////////////////////////////////////////
  338. static UINT ids_nv_nipx[] = {1,3,6,1,4,1,23,2,5};
  339. ///////////////////////////////////////////////////////////////////////////////
  340. // //
  341. // nipxSystem group (1.3.6.1.4.1.23.2.5.1) //
  342. // //
  343. ///////////////////////////////////////////////////////////////////////////////
  344. static UINT ids_nipxSystem[] = {1};
  345. ///////////////////////////////////////////////////////////////////////////////
  346. // //
  347. // nipxBasicSysEntry table (1.3.6.1.4.1.23.2.5.1.1.1) //
  348. // //
  349. ///////////////////////////////////////////////////////////////////////////////
  350. static UINT ids_nipxBasicSysTable[] ={1,1};
  351. static UINT ids_nipxBasicSysEntry[] ={1,1,1};
  352. static UINT ids_nipxBasicSysInstance[] ={1,1,1,1};
  353. static UINT ids_nipxBasicSysExistState[] ={1,1,1,2};
  354. static UINT ids_nipxBasicSysNetNumber[] ={1,1,1,3};
  355. static UINT ids_nipxBasicSysNode[] ={1,1,1,4};
  356. static UINT ids_nipxBasicSysName[] ={1,1,1,5};
  357. static UINT ids_nipxBasicSysInReceives[] ={1,1,1,6};
  358. static UINT ids_nipxBasicSysInHdrErrors[] ={1,1,1,7};
  359. static UINT ids_nipxBasicSysInUnknownSockets[]={1,1,1,8};
  360. static UINT ids_nipxBasicSysInDiscards[] ={1,1,1,9};
  361. static UINT ids_nipxBasicSysInBadChecksums[]={1,1,1,10};
  362. static UINT ids_nipxBasicSysInDelivers[] ={1,1,1,11};
  363. static UINT ids_nipxBasicSysNoRoutes[] ={1,1,1,12};
  364. static UINT ids_nipxBasicSysOutRequests[] ={1,1,1,13};
  365. static UINT ids_nipxBasicSysOutMalformedRequests[]={1,1,1,14};
  366. static UINT ids_nipxBasicSysOutDiscards[] ={1,1,1,15};
  367. static UINT ids_nipxBasicSysOutPackets[] ={1,1,1,16};
  368. static UINT ids_nipxBasicSysConfigSockets[] ={1,1,1,17};
  369. static UINT ids_nipxBasicSysOpenSocketFails[]={1,1,1,18};
  370. ///////////////////////////////////////////////////////////////////////////////
  371. // //
  372. // nipxAdvSysEntry table (1.3.6.1.4.1.23.2.5.1.2.1) //
  373. // //
  374. ///////////////////////////////////////////////////////////////////////////////
  375. static UINT ids_nipxAdvSysTable[] ={1,2};
  376. static UINT ids_nipxAdvSysEntry[] ={1,2,1};
  377. static UINT ids_nipxAdvSysInstance[] ={1,2,1,1};
  378. static UINT ids_nipxAdvSysMaxPathSplits[] ={1,2,1,2};
  379. static UINT ids_nipxAdvSysMaxHops[] ={1,2,1,3};
  380. static UINT ids_nipxAdvSysInTooManyHops[] ={1,2,1,4};
  381. static UINT ids_nipxAdvSysInFiltered[] ={1,2,1,5};
  382. static UINT ids_nipxAdvSysInCompressDiscards[]={1,2,1,6};
  383. static UINT ids_nipxAdvSysNETBIOSPackets[] ={1,2,1,7};
  384. static UINT ids_nipxAdvSysForwPackets[] ={1,2,1,8};
  385. static UINT ids_nipxAdvSysOutFiltered[] ={1,2,1,9};
  386. static UINT ids_nipxAdvSysOutCompressDiscards[]={1,2,1,10};
  387. static UINT ids_nipxAdvSysCircCount[] ={1,2,1,11};
  388. static UINT ids_nipxAdvSysDestCount[] ={1,2,1,12};
  389. static UINT ids_nipxAdvSysServCount[] ={1,2,1,13};
  390. ///////////////////////////////////////////////////////////////////////////////
  391. // //
  392. // nipxCircuit group (1.3.6.1.4.1.23.2.5.2) //
  393. // //
  394. ///////////////////////////////////////////////////////////////////////////////
  395. static UINT ids_nipxCircuit[] ={2};
  396. ///////////////////////////////////////////////////////////////////////////////
  397. // //
  398. // nipxCircEntry table (1.3.6.1.4.1.23.2.5.2.1.1) //
  399. // //
  400. ///////////////////////////////////////////////////////////////////////////////
  401. static UINT ids_nipxCircTable[] ={2,1};
  402. static UINT ids_nipxCircEntry[] ={2,1,1};
  403. static UINT ids_nipxCircSysInstance[] ={2,1,1,1};
  404. static UINT ids_nipxCircIndex[] ={2,1,1,2};
  405. static UINT ids_nipxCircExistState[] ={2,1,1,3};
  406. static UINT ids_nipxCircOperState[] ={2,1,1,4};
  407. static UINT ids_nipxCircIfIndex[] ={2,1,1,5};
  408. static UINT ids_nipxCircName[] ={2,1,1,6};
  409. static UINT ids_nipxCircType[] ={2,1,1,7};
  410. static UINT ids_nipxCircDialName[] ={2,1,1,8};
  411. static UINT ids_nipxCircLocalMaxPacketSize[]={2,1,1,9};
  412. static UINT ids_nipxCircCompressState[] ={2,1,1,10};
  413. static UINT ids_nipxCircCompressSlots[] ={2,1,1,11};
  414. static UINT ids_nipxCircStaticStatus[] ={2,1,1,12};
  415. static UINT ids_nipxCircCompressedSent[] ={2,1,1,13};
  416. static UINT ids_nipxCircCompressedInitSent[]={2,1,1,14};
  417. static UINT ids_nipxCircCompressedRejectsSent[]={2,1,1,15};
  418. static UINT ids_nipxCircUncompressedSent[] ={2,1,1,16};
  419. static UINT ids_nipxCircCompressedReceived[]={2,1,1,17};
  420. static UINT ids_nipxCircCompressedInitReceived[]={2,1,1,18};
  421. static UINT ids_nipxCircCompressedRejectsReceived[]={2,1,1,19};
  422. static UINT ids_nipxCircUncompressedReceived[]={2,1,1,20};
  423. static UINT ids_nipxCircMediaType[] ={2,1,1,21};
  424. static UINT ids_nipxCircNetNumber[] ={2,1,1,22};
  425. static UINT ids_nipxCircStateChanges[] ={2,1,1,23};
  426. static UINT ids_nipxCircInitFails[] ={2,1,1,24};
  427. static UINT ids_nipxCircDelay[] ={2,1,1,25};
  428. static UINT ids_nipxCircThroughput[] ={2,1,1,26};
  429. static UINT ids_nipxCircNeighRouterName[] ={2,1,1,27};
  430. static UINT ids_nipxCircNeighInternalNetNum[]={2,1,1,28};
  431. ///////////////////////////////////////////////////////////////////////////////
  432. // //
  433. // nipxForwarding group (1.3.6.1.4.1.23.2.5.3) //
  434. // //
  435. ///////////////////////////////////////////////////////////////////////////////
  436. static UINT ids_nipxForwarding[] ={3};
  437. ///////////////////////////////////////////////////////////////////////////////
  438. // //
  439. // nipxDestEntry table (1.3.6.1.4.1.23.2.5.3.1.1) //
  440. // //
  441. ///////////////////////////////////////////////////////////////////////////////
  442. static UINT ids_nipxDestTable[] ={3,1};
  443. static UINT ids_nipxDestEntry[] ={3,1,1};
  444. static UINT ids_nipxDestSysInstance[] ={3,1,1,1};
  445. static UINT ids_nipxDestNetNum[] ={3,1,1,2};
  446. static UINT ids_nipxDestProtocol[] ={3,1,1,3};
  447. static UINT ids_nipxDestTicks[] ={3,1,1,4};
  448. static UINT ids_nipxDestHopCount[] ={3,1,1,5};
  449. static UINT ids_nipxDestNextHopCircIndex[] ={3,1,1,6};
  450. static UINT ids_nipxDestNextHopNICAddress[] ={3,1,1,7};
  451. static UINT ids_nipxDestNextHopNetNum[] ={3,1,1,8};
  452. ///////////////////////////////////////////////////////////////////////////////
  453. // //
  454. // ids_nipxStaticRouteEntry table (1.3.6.1.4.1.23.2.5.3.1.2) //
  455. // //
  456. ///////////////////////////////////////////////////////////////////////////////
  457. static UINT ids_nipxStaticRouteTable[] ={3,2};
  458. static UINT ids_nipxStaticRouteEntry[] ={3,2,1};
  459. static UINT ids_nipxStaticRouteSysInstance[]={3,2,1,1};
  460. static UINT ids_nipxStaticRouteCircIndex[] ={3,2,1,2};
  461. static UINT ids_nipxStaticRouteNetNum[] ={3,2,1,3};
  462. static UINT ids_nipxStaticRouteExistState[] ={3,2,1,4};
  463. static UINT ids_nipxStaticRouteTicks[] ={3,2,1,5};
  464. static UINT ids_nipxStaticRouteHopCount[] ={3,2,1,6};
  465. ///////////////////////////////////////////////////////////////////////////////
  466. // //
  467. // nipxServices group (1.3.6.1.4.1.23.2.5.4) //
  468. // //
  469. ///////////////////////////////////////////////////////////////////////////////
  470. static UINT ids_nipxServices[] ={4};
  471. ///////////////////////////////////////////////////////////////////////////////
  472. // //
  473. // nipxServEntry table (1.3.6.1.4.1.23.2.5.4.1.1) //
  474. // //
  475. ///////////////////////////////////////////////////////////////////////////////
  476. static UINT ids_nipxServTable[] ={4,1};
  477. static UINT ids_nipxServEntry[] ={4,1,1};
  478. static UINT ids_nipxServSysInstance[] ={4,1,1,1};
  479. static UINT ids_nipxServType[] ={4,1,1,2};
  480. static UINT ids_nipxServName[] ={4,1,1,3};
  481. static UINT ids_nipxServProtocol[] ={4,1,1,4};
  482. static UINT ids_nipxServNetNum[] ={4,1,1,5};
  483. static UINT ids_nipxServNode[] ={4,1,1,6};
  484. static UINT ids_nipxServSocket[] ={4,1,1,7};
  485. static UINT ids_nipxServHopCount[] ={4,1,1,8};
  486. ///////////////////////////////////////////////////////////////////////////////
  487. // //
  488. // nipxDestServEntry table (1.3.6.1.4.1.23.2.5.4.2.1) //
  489. // //
  490. ///////////////////////////////////////////////////////////////////////////////
  491. static UINT ids_nipxDestServTable[] ={4,2};
  492. static UINT ids_nipxDestServEntry[] ={4,2,1};
  493. static UINT ids_nipxDestServSysInstance[] ={4,2,1,1};
  494. static UINT ids_nipxDestServNetNum[] ={4,2,1,2};
  495. static UINT ids_nipxDestServNode[] ={4,2,1,3};
  496. static UINT ids_nipxDestServSocket[] ={4,2,1,4};
  497. static UINT ids_nipxDestServName[] ={4,2,1,5};
  498. static UINT ids_nipxDestServType[] ={4,2,1,6};
  499. static UINT ids_nipxDestServProtocol[] ={4,2,1,7};
  500. static UINT ids_nipxDestServHopCount[] ={4,2,1,8};
  501. ///////////////////////////////////////////////////////////////////////////////
  502. // //
  503. // nipxStaticServEntry table (1.3.6.1.4.1.23.2.5.4.3.1) //
  504. // //
  505. ///////////////////////////////////////////////////////////////////////////////
  506. static UINT ids_nipxStaticServTable[] ={4,3};
  507. static UINT ids_nipxStaticServEntry[] ={4,3,1};
  508. static UINT ids_nipxStaticServSysInstance[] ={4,3,1,1};
  509. static UINT ids_nipxStaticServCircIndex[] ={4,3,1,2};
  510. static UINT ids_nipxStaticServType[] ={4,3,1,3};
  511. static UINT ids_nipxStaticServName[] ={4,3,1,4};
  512. static UINT ids_nipxStaticServExistState[] ={4,3,1,5};
  513. static UINT ids_nipxStaticServNetNum[] ={4,3,1,6};
  514. static UINT ids_nipxStaticServNode[] ={4,3,1,7};
  515. static UINT ids_nipxStaticServSocket[] ={4,3,1,8};
  516. static UINT ids_nipxStaticServHopCount[] ={4,3,1,9};
  517. ///////////////////////////////////////////////////////////////////////////////
  518. // //
  519. // Mib entry list //
  520. // //
  521. ///////////////////////////////////////////////////////////////////////////////
  522. SnmpMibEntry mib_nv_nipx[] = {
  523. MIB_GROUP(nipxSystem),
  524. MIB_TABLE_ROOT(nipxBasicSysTable),
  525. MIB_TABLE_ENTRY(nipxBasicSysEntry),
  526. MIB_INTEGER(nipxBasicSysInstance),
  527. MIB_INTEGER(nipxBasicSysExistState),
  528. MIB_OCTETSTRING_L(nipxBasicSysNetNumber,4,4),
  529. MIB_OCTETSTRING_L(nipxBasicSysNode,6,6),
  530. MIB_OCTETSTRING_L(nipxBasicSysName,0,48),
  531. MIB_COUNTER(nipxBasicSysInReceives),
  532. MIB_COUNTER(nipxBasicSysInHdrErrors),
  533. MIB_COUNTER(nipxBasicSysInUnknownSockets),
  534. MIB_COUNTER(nipxBasicSysInDiscards),
  535. MIB_COUNTER(nipxBasicSysInBadChecksums),
  536. MIB_COUNTER(nipxBasicSysInDelivers),
  537. MIB_COUNTER(nipxBasicSysNoRoutes),
  538. MIB_COUNTER(nipxBasicSysOutRequests),
  539. MIB_COUNTER(nipxBasicSysOutMalformedRequests),
  540. MIB_COUNTER(nipxBasicSysOutDiscards),
  541. MIB_COUNTER(nipxBasicSysOutPackets),
  542. MIB_COUNTER(nipxBasicSysConfigSockets),
  543. MIB_COUNTER(nipxBasicSysOpenSocketFails),
  544. MIB_TABLE_ROOT(nipxAdvSysTable),
  545. MIB_TABLE_ENTRY(nipxAdvSysEntry),
  546. MIB_INTEGER(nipxAdvSysInstance),
  547. MIB_INTEGER(nipxAdvSysMaxPathSplits),
  548. MIB_INTEGER(nipxAdvSysMaxHops),
  549. MIB_COUNTER(nipxAdvSysInTooManyHops),
  550. MIB_COUNTER(nipxAdvSysInFiltered),
  551. MIB_COUNTER(nipxAdvSysInCompressDiscards),
  552. MIB_COUNTER(nipxAdvSysNETBIOSPackets),
  553. MIB_COUNTER(nipxAdvSysForwPackets),
  554. MIB_COUNTER(nipxAdvSysOutFiltered),
  555. MIB_COUNTER(nipxAdvSysOutCompressDiscards),
  556. MIB_COUNTER(nipxAdvSysCircCount),
  557. MIB_COUNTER(nipxAdvSysDestCount),
  558. MIB_COUNTER(nipxAdvSysServCount),
  559. MIB_GROUP(nipxCircuit),
  560. MIB_TABLE_ROOT(nipxCircTable),
  561. MIB_TABLE_ENTRY(nipxCircEntry),
  562. MIB_INTEGER(nipxCircSysInstance),
  563. MIB_INTEGER(nipxCircIndex),
  564. MIB_INTEGER(nipxCircExistState),
  565. MIB_INTEGER_RW(nipxCircOperState),
  566. MIB_INTEGER(nipxCircIfIndex),
  567. MIB_OCTETSTRING_L(nipxCircName,0,48),
  568. MIB_INTEGER(nipxCircType),
  569. MIB_OCTETSTRING_L(nipxCircDialName,0,48),
  570. MIB_INTEGER(nipxCircLocalMaxPacketSize),
  571. MIB_INTEGER(nipxCircCompressState),
  572. MIB_INTEGER(nipxCircCompressSlots),
  573. MIB_INTEGER(nipxCircStaticStatus),
  574. MIB_COUNTER(nipxCircCompressedSent),
  575. MIB_COUNTER(nipxCircCompressedInitSent),
  576. MIB_COUNTER(nipxCircCompressedRejectsSent),
  577. MIB_COUNTER(nipxCircUncompressedSent),
  578. MIB_COUNTER(nipxCircCompressedReceived),
  579. MIB_COUNTER(nipxCircCompressedInitReceived),
  580. MIB_COUNTER(nipxCircCompressedRejectsReceived),
  581. MIB_COUNTER(nipxCircUncompressedReceived),
  582. MIB_OCTETSTRING_L(nipxCircMediaType,2,2),
  583. MIB_OCTETSTRING_L(nipxCircNetNumber,4,4),
  584. MIB_COUNTER(nipxCircStateChanges),
  585. MIB_COUNTER(nipxCircInitFails),
  586. MIB_INTEGER(nipxCircDelay),
  587. MIB_INTEGER(nipxCircThroughput),
  588. MIB_OCTETSTRING_L(nipxCircNeighRouterName,0,48),
  589. MIB_OCTETSTRING_L(nipxCircNeighInternalNetNum,4,4),
  590. MIB_GROUP(nipxForwarding),
  591. MIB_TABLE_ROOT(nipxDestTable),
  592. MIB_TABLE_ENTRY(nipxDestEntry),
  593. MIB_INTEGER(nipxDestSysInstance),
  594. MIB_OCTETSTRING_L(nipxDestNetNum,4,4),
  595. MIB_INTEGER(nipxDestProtocol),
  596. MIB_INTEGER(nipxDestTicks),
  597. MIB_INTEGER(nipxDestHopCount),
  598. MIB_INTEGER(nipxDestNextHopCircIndex),
  599. MIB_OCTETSTRING_L(nipxDestNextHopNICAddress,6,6),
  600. MIB_OCTETSTRING_L(nipxDestNextHopNetNum,4,4),
  601. MIB_TABLE_ROOT(nipxStaticRouteTable),
  602. MIB_TABLE_ENTRY(nipxStaticRouteEntry),
  603. MIB_INTEGER(nipxStaticRouteSysInstance),
  604. MIB_INTEGER(nipxStaticRouteCircIndex),
  605. MIB_OCTETSTRING_RW_L(nipxStaticRouteNetNum,4,4),
  606. MIB_INTEGER_RW(nipxStaticRouteExistState),
  607. MIB_INTEGER_RW(nipxStaticRouteTicks),
  608. MIB_INTEGER_RW(nipxStaticRouteHopCount),
  609. MIB_GROUP(nipxServices),
  610. MIB_TABLE_ROOT(nipxServTable),
  611. MIB_TABLE_ENTRY(nipxServEntry),
  612. MIB_INTEGER(nipxServSysInstance),
  613. MIB_OCTETSTRING_L(nipxServType,2,2),
  614. MIB_OCTETSTRING_L(nipxServName,1,48),
  615. MIB_INTEGER(nipxServProtocol),
  616. MIB_OCTETSTRING_L(nipxServNetNum,4,4),
  617. MIB_OCTETSTRING_L(nipxServNode,6,6),
  618. MIB_OCTETSTRING_L(nipxServSocket,2,2),
  619. MIB_INTEGER(nipxServHopCount),
  620. MIB_TABLE_ROOT(nipxDestServTable),
  621. MIB_TABLE_ENTRY(nipxDestServEntry),
  622. MIB_INTEGER(nipxDestServSysInstance),
  623. MIB_OCTETSTRING_L(nipxDestServNetNum,4,4),
  624. MIB_OCTETSTRING_L(nipxDestServNode,6,6),
  625. MIB_OCTETSTRING_L(nipxDestServSocket,2,2),
  626. MIB_OCTETSTRING_L(nipxDestServName,1,48),
  627. MIB_OCTETSTRING_L(nipxDestServType,2,2),
  628. MIB_INTEGER(nipxDestServProtocol),
  629. MIB_INTEGER(nipxDestServHopCount),
  630. MIB_TABLE_ROOT(nipxStaticServTable),
  631. MIB_TABLE_ENTRY(nipxStaticServEntry),
  632. MIB_INTEGER(nipxStaticServSysInstance),
  633. MIB_INTEGER(nipxStaticServCircIndex),
  634. MIB_OCTETSTRING_RW_L(nipxStaticServType,2,2),
  635. MIB_OCTETSTRING_RW_L(nipxStaticServName,1,48),
  636. MIB_INTEGER_RW(nipxStaticServExistState),
  637. MIB_OCTETSTRING_RW_L(nipxStaticServNetNum,4,4),
  638. MIB_OCTETSTRING_RW_L(nipxStaticServNode,6,6),
  639. MIB_OCTETSTRING_RW_L(nipxStaticServSocket,2,2),
  640. MIB_INTEGER_RW(nipxStaticServHopCount),
  641. MIB_END()
  642. };
  643. ///////////////////////////////////////////////////////////////////////////////
  644. // //
  645. // Mib table list //
  646. // //
  647. ///////////////////////////////////////////////////////////////////////////////
  648. SnmpMibTable tbl_nv_nipx[] = {
  649. MIB_TABLE(nv_nipx,nipxBasicSysEntry,NULL),
  650. MIB_TABLE(nv_nipx,nipxAdvSysEntry,NULL),
  651. MIB_TABLE(nv_nipx,nipxCircEntry,NULL),
  652. MIB_TABLE(nv_nipx,nipxDestEntry,NULL),
  653. MIB_TABLE(nv_nipx,nipxStaticRouteEntry,NULL),
  654. MIB_TABLE(nv_nipx,nipxServEntry,NULL),
  655. MIB_TABLE(nv_nipx,nipxDestServEntry,NULL),
  656. MIB_TABLE(nv_nipx,nipxStaticServEntry,NULL)
  657. };
  658. ///////////////////////////////////////////////////////////////////////////////
  659. // //
  660. // Mib view //
  661. // //
  662. ///////////////////////////////////////////////////////////////////////////////
  663. // [pmay] This array must have its elements ordered lexigraphically or else
  664. // snmp service will get confused. This may be a bug on snmp's part.
  665. SnmpMibView v_rtipx[3] = {
  666. MIB_VIEW(nv_nipx),
  667. MIB_VIEW(ms_mipx),
  668. MIB_VIEW(ms_mripsap)
  669. };
  670. UINT viewIndex = 0;
  671. SnmpTfxHandle tfxHandle;
  672. #define NUM_VIEWS (sizeof(v_rtipx)/sizeof(SnmpMibView))
  673. ///////////////////////////////////////////////////////////////////////////////
  674. // //
  675. // snmp extension entry points //
  676. // //
  677. ///////////////////////////////////////////////////////////////////////////////
  678. BOOL
  679. SnmpExtensionInit(
  680. IN DWORD uptimeReference,
  681. OUT HANDLE * lpPollForTrapEvent,
  682. OUT AsnObjectIdentifier * lpFirstSupportedView
  683. )
  684. {
  685. DbgTrace (DBG_LOAD, ("\nMIPX: SnmpExtensionInit: entered, nv= %d vi= %d\n", NUM_VIEWS, viewIndex));
  686. // save uptime reference
  687. g_uptimeReference = uptimeReference;
  688. // obtain handle to subagent framework
  689. tfxHandle = SnmpTfxOpen(3,v_rtipx);
  690. // validate handle
  691. if (tfxHandle == NULL) {
  692. DbgTrace (DBG_LOAD, ("MIPX: TfxOpen, result: %ld", GetLastError()));
  693. return FALSE;
  694. }
  695. // pass back first view identifier to master
  696. *lpFirstSupportedView = v_rtipx[viewIndex++].viewOid;
  697. // traps not supported yet
  698. *lpPollForTrapEvent = NULL;
  699. return TRUE;
  700. }
  701. BOOL
  702. SnmpExtensionInitEx(
  703. OUT AsnObjectIdentifier * lpNextSupportedView
  704. )
  705. {
  706. // check if there are views to register
  707. BOOL fMoreViews = (viewIndex < NUM_VIEWS);
  708. DbgTrace (DBG_LOAD, ("MIPX: SnmpExtensionInitEx: entered, nv= %d, vi= %d, fm=%d\n", NUM_VIEWS, viewIndex, fMoreViews));
  709. if (fMoreViews) {
  710. // pass back next supported view to master
  711. *lpNextSupportedView = v_rtipx[viewIndex++].viewOid;
  712. }
  713. // report status
  714. return fMoreViews;
  715. }
  716. BOOL
  717. SnmpExtensionQuery(
  718. IN BYTE requestType,
  719. IN OUT RFC1157VarBindList * variableBindings,
  720. OUT AsnInteger * errorStatus,
  721. OUT AsnInteger * errorIndex
  722. )
  723. {
  724. // forward to framework
  725. return SnmpTfxQuery(
  726. tfxHandle,
  727. requestType,
  728. variableBindings,
  729. errorStatus,
  730. errorIndex
  731. );
  732. }
  733. BOOL
  734. SnmpExtensionTrap(
  735. OUT AsnObjectIdentifier *enterprise,
  736. OUT AsnInteger *genericTrap,
  737. OUT AsnInteger *specificTrap,
  738. OUT AsnTimeticks *timeStamp,
  739. OUT RFC1157VarBindList *variableBindings
  740. )
  741. {
  742. // no traps
  743. return FALSE;
  744. }
  745. /*++
  746. *******************************************************************
  747. D l l M a i n
  748. Routine Description:
  749. Dll entry point to be called from CRTstartup dll entry point (it
  750. will be actually an entry point for this dll)
  751. Arguments:
  752. hinstDLL - handle of DLL module
  753. fdwReason - reason for calling function
  754. lpvReserved - reserved
  755. Return Value:
  756. TRUE - process initialization was performed OK
  757. FALSE - intialization failed
  758. *******************************************************************
  759. --*/
  760. BOOL WINAPI DllMain(
  761. HINSTANCE hinstDLL,
  762. DWORD fdwReason,
  763. LPVOID lpvReserved
  764. ) {
  765. switch (fdwReason) {
  766. case DLL_PROCESS_ATTACH: // We are being attached to a new process
  767. InitializeCriticalSection (&g_ConnectionLock);
  768. ConnectToRouter ();
  769. DbgTrace (DBG_LOAD, ("MIPX: Loaded %x", g_MibServerHandle));
  770. return TRUE;
  771. case DLL_PROCESS_DETACH: // The process is exiting
  772. if (g_MibServerHandle!=0)
  773. MprAdminMIBServerDisconnect (g_MibServerHandle);
  774. DeleteCriticalSection (&g_ConnectionLock);
  775. DbgTrace (DBG_LOAD, ("MIPX: Unloaded\n"));
  776. default: // Not interested in all other cases
  777. return TRUE;
  778. }
  779. }
  780. //
  781. // Tests whether the remoteaccess service is running.
  782. //
  783. DWORD IsServiceRunning (
  784. IN PBOOL pbIsRunning)
  785. {
  786. *pbIsRunning = MprAdminIsServiceRunning(NULL);
  787. return NO_ERROR;
  788. }
  789. DWORD
  790. ConnectToRouter (
  791. VOID
  792. ) {
  793. DWORD rc;
  794. BOOL bServiceRunning;
  795. // Check to see if the service is running
  796. //
  797. if ((rc = IsServiceRunning (&bServiceRunning)) != NO_ERROR)
  798. return NO_ERROR;
  799. // If not, return an error
  800. if (!bServiceRunning) {
  801. EnterCriticalSection (&g_ConnectionLock);
  802. g_MibServerHandle = 0;
  803. LeaveCriticalSection (&g_ConnectionLock);
  804. return ERROR_SERVICE_DEPENDENCY_FAIL;
  805. }
  806. // If we're already connected, return
  807. else if (g_MibServerHandle)
  808. return NO_ERROR;
  809. EnterCriticalSection (&g_ConnectionLock);
  810. if (g_MibServerHandle==0) {
  811. rc = MprAdminMIBServerConnect (NULL, &g_MibServerHandle);
  812. if (rc!=NO_ERROR)
  813. g_MibServerHandle = 0; // Indicates that we are not connected
  814. DbgTrace (DBG_LOAD, ("MIPX: Connect to router, result: %ld", rc));
  815. }
  816. else
  817. rc = NO_ERROR;
  818. LeaveCriticalSection (&g_ConnectionLock);
  819. return rc;
  820. }
  821. //
  822. // Returns TRUE if the router connection is stable, false
  823. // otherwise.
  824. //
  825. BOOL EnsureRouterConnection() {
  826. return (ConnectToRouter() == NO_ERROR);
  827. // If we haven't connected, attempt to do so
  828. //if (g_MibServerHandle == NULL) {
  829. // if (ConnectToRouter() == NO_ERROR)
  830. // return TRUE;
  831. // return FALSE;
  832. // }
  833. // If we have a valid handle, m
  834. //
  835. // ? TRUE
  836. // : (ConnectToRouter ()==NO_ERROR)
  837. // )
  838. }