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.

1443 lines
47 KiB

  1. /*
  2. * mibtsmi.ntc v0.10
  3. * hostmsmi.c
  4. * Generated in conjunction with Management Factory scripts:
  5. * script version: SNMPv1, 0.16, Apr 25, 1996
  6. * project: D:\TEMP\EXAMPLE\HOSTMIB
  7. *
  8. ****************************************************************************
  9. * *
  10. * (C) Copyright 1995 DIGITAL EQUIPMENT CORPORATION *
  11. * *
  12. * This software is an unpublished work protected under the *
  13. * the copyright laws of the United States of America, all *
  14. * rights reserved. *
  15. * *
  16. * In the event this software is licensed for use by the United *
  17. * States Government, all use, duplication or disclosure by the *
  18. * United States Government is subject to restrictions as set *
  19. * forth in either subparagraph (c)(1)(ii) of the Rights in *
  20. * Technical Data And Computer Software Clause at DFARS *
  21. * 252.227-7013, or the Commercial Computer Software Restricted *
  22. * Rights Clause at FAR 52.221-19, whichever is applicable. *
  23. * *
  24. ****************************************************************************
  25. *
  26. * Facility:
  27. *
  28. * SNMP Extension Agent
  29. *
  30. * Abstract:
  31. *
  32. * This module contains the SMI envelopes around the callout to the
  33. * developer's get and set routines. Note that the developer can modify
  34. * these routines to valid that the types actually conform to contraints
  35. * for a given type.
  36. *
  37. * Functions:
  38. *
  39. * SMIGetxxx() and SMISetxxx() for each user defined type.
  40. *
  41. * Author:
  42. *
  43. * David Burns @ Webenable Inc
  44. *
  45. * Date:
  46. *
  47. * Thu Nov 07 16:38:30 1996
  48. *
  49. * Revision History:
  50. * generated with v0.10 stub
  51. *
  52. * May 15, 1997 - To Microsoft: 4 changes of "malloc" to "SNMP_malloc"
  53. */
  54. #include <snmp.h>
  55. #include <stdlib.h>
  56. #include <malloc.h>
  57. #include <memory.h>
  58. #include <string.h>
  59. #include "smint.h"
  60. #include "hostmsmi.h"
  61. #include "mib.h"
  62. #include "mib_xtrn.h"
  63. /*
  64. * SMIGetBoolean
  65. * Boolean ::= INTEGER a truth value
  66. *
  67. * Encompasses the callouts to variables for the data type Boolean
  68. *
  69. * Arguments:
  70. * VarBind pointer to the variable value pair
  71. * cindex index to the class of the request
  72. * vindex index to the variable of the request
  73. * instance address of the instance specification
  74. * in the form of ordered native datatypes
  75. * Return Codes:
  76. *
  77. * Standard PDU error codes.
  78. *
  79. * SNMP_ERRORSTATUS_NOERROR Successful get
  80. * SNMP_ERRORSTATUS_GENERR Catch-all failure code
  81. * mibtsmii.c v 0.6
  82. */
  83. UINT
  84. SMIGetBoolean(
  85. IN OUT RFC1157VarBind *VarBind , // Variable binding for get
  86. IN unsigned long int cindex ,
  87. IN unsigned long int vindex ,
  88. IN InstanceName *instance )
  89. {
  90. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  91. Boolean outvalue ;
  92. Access_Credential access ; // dummy holder for future use
  93. result = ( *class_info[ cindex ].variable[ vindex ].VarGet )( &outvalue ,
  94. &access ,
  95. instance ) ;
  96. if ( result == SNMP_ERRORSTATUS_NOERROR )
  97. {
  98. VarBind->value.asnType = ASN_INTEGER ;
  99. VarBind->value.asnValue.number =
  100. (AsnInteger)outvalue ;
  101. }
  102. return result ;
  103. } /* end of SMIGetBoolean() */
  104. /*
  105. * SMISetBoolean
  106. * Boolean ::= INTEGER a truth value
  107. *
  108. * Encompasses the callouts to variables for the data type Boolean
  109. *
  110. * Arguments:
  111. * VarBind pointer to the variable value pair
  112. * cindex index to the class of the request
  113. * vindex index to the variable of the request
  114. * instance address of the instance specification
  115. * in the form of ordered native datatypes
  116. * Return Codes:
  117. *
  118. * Standard PDU error codes.
  119. */
  120. UINT
  121. SMISetBoolean(
  122. IN OUT RFC1157VarBind *VarBind , // Variable binding for set
  123. IN unsigned long int cindex ,
  124. IN unsigned long int vindex ,
  125. IN InstanceName *instance )
  126. {
  127. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  128. Boolean *invalue ;
  129. Boolean outvalue ;
  130. Access_Credential access ; // dummy holder for future use
  131. invalue = (Boolean *)
  132. ( &VarBind->value.asnValue.number ) ;
  133. result = ( *class_info[ cindex ].variable[ vindex ].VarSet )
  134. ( invalue, &outvalue, &access, instance ) ;
  135. return result;
  136. } /* end of SMISetBoolean() */
  137. /*
  138. * SMIBuildBoolean
  139. * Boolean ::= INTEGER a truth value
  140. *
  141. * Places the variable of datatype Boolean into a Variable Binding.
  142. *
  143. * Arguments:
  144. *
  145. * VarBind pointer to the variable value pair
  146. * invalue address of the data
  147. *
  148. * Return Codes:
  149. *
  150. * Standard PDU error codes.
  151. */
  152. UINT
  153. SMIBuildBoolean(
  154. IN OUT RFC1157VarBind *VarBind , // Variable binding for building
  155. IN char *invalue )
  156. {
  157. Integer *svalue = (Integer *)invalue;
  158. VarBind->value.asnType = ASN_INTEGER ;
  159. VarBind->value.asnValue.number = *svalue ;
  160. return SNMP_ERRORSTATUS_NOERROR ;
  161. } /* end of SMIBuildBoolean() */
  162. /*
  163. * SMIGetKBytes
  164. * KBytes ::= INTEGER (0..2147483647) memory size, expressed in units of
  165. * 1024 bytes
  166. *
  167. * Encompasses the callouts to variables for the data type KBytes
  168. *
  169. * Arguments:
  170. * VarBind pointer to the variable value pair
  171. * cindex index to the class of the request
  172. * vindex index to the variable of the request
  173. * instance address of the instance specification
  174. * in the form of ordered native datatypes
  175. * Return Codes:
  176. *
  177. * Standard PDU error codes.
  178. *
  179. * SNMP_ERRORSTATUS_NOERROR Successful get
  180. * SNMP_ERRORSTATUS_GENERR Catch-all failure code
  181. * mibtsmii.c v 0.6
  182. */
  183. UINT
  184. SMIGetKBytes(
  185. IN OUT RFC1157VarBind *VarBind , // Variable binding for get
  186. IN unsigned long int cindex ,
  187. IN unsigned long int vindex ,
  188. IN InstanceName *instance )
  189. {
  190. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  191. KBytes outvalue ;
  192. Access_Credential access ; // dummy holder for future use
  193. result = ( *class_info[ cindex ].variable[ vindex ].VarGet )( &outvalue ,
  194. &access ,
  195. instance ) ;
  196. if ( result == SNMP_ERRORSTATUS_NOERROR )
  197. {
  198. VarBind->value.asnType = ASN_INTEGER ;
  199. VarBind->value.asnValue.number =
  200. (AsnInteger)outvalue ;
  201. }
  202. return result ;
  203. } /* end of SMIGetKBytes() */
  204. /*
  205. * SMISetKBytes
  206. * KBytes ::= INTEGER (0..2147483647) memory size, expressed in units of
  207. * 1024 bytes
  208. *
  209. * Encompasses the callouts to variables for the data type KBytes
  210. *
  211. * Arguments:
  212. * VarBind pointer to the variable value pair
  213. * cindex index to the class of the request
  214. * vindex index to the variable of the request
  215. * instance address of the instance specification
  216. * in the form of ordered native datatypes
  217. * Return Codes:
  218. *
  219. * Standard PDU error codes.
  220. */
  221. UINT
  222. SMISetKBytes(
  223. IN OUT RFC1157VarBind *VarBind , // Variable binding for set
  224. IN unsigned long int cindex ,
  225. IN unsigned long int vindex ,
  226. IN InstanceName *instance )
  227. {
  228. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  229. KBytes *invalue ;
  230. KBytes outvalue ;
  231. Access_Credential access ; // dummy holder for future use
  232. invalue = (KBytes *)
  233. ( &VarBind->value.asnValue.number ) ;
  234. result = ( *class_info[ cindex ].variable[ vindex ].VarSet )
  235. ( invalue, &outvalue, &access, instance ) ;
  236. return result;
  237. } /* end of SMISetKBytes() */
  238. /*
  239. * SMIBuildKBytes
  240. * KBytes ::= INTEGER (0..2147483647) memory size, expressed in units of
  241. * 1024 bytes
  242. *
  243. * Places the variable of datatype KBytes into a Variable Binding.
  244. *
  245. * Arguments:
  246. *
  247. * VarBind pointer to the variable value pair
  248. * invalue address of the data
  249. *
  250. * Return Codes:
  251. *
  252. * Standard PDU error codes.
  253. */
  254. UINT
  255. SMIBuildKBytes(
  256. IN OUT RFC1157VarBind *VarBind , // Variable binding for building
  257. IN char *invalue )
  258. {
  259. Integer *svalue = (Integer *)invalue;
  260. VarBind->value.asnType = ASN_INTEGER ;
  261. VarBind->value.asnValue.number = *svalue ;
  262. return SNMP_ERRORSTATUS_NOERROR ;
  263. } /* end of SMIBuildKBytes() */
  264. /*
  265. * SMIGetINThrDeviceStatus
  266. * INThrDeviceStatus ::= INTEGER
  267. *
  268. * Encompasses the callouts to variables for the data type INThrDeviceStatus
  269. *
  270. * Arguments:
  271. * VarBind pointer to the variable value pair
  272. * cindex index to the class of the request
  273. * vindex index to the variable of the request
  274. * instance address of the instance specification
  275. * in the form of ordered native datatypes
  276. * Return Codes:
  277. *
  278. * Standard PDU error codes.
  279. *
  280. * SNMP_ERRORSTATUS_NOERROR Successful get
  281. * SNMP_ERRORSTATUS_GENERR Catch-all failure code
  282. * mibtsmii.c v 0.6
  283. */
  284. UINT
  285. SMIGetINThrDeviceStatus(
  286. IN OUT RFC1157VarBind *VarBind , // Variable binding for get
  287. IN unsigned long int cindex ,
  288. IN unsigned long int vindex ,
  289. IN InstanceName *instance )
  290. {
  291. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  292. INThrDeviceStatus outvalue ;
  293. Access_Credential access ; // dummy holder for future use
  294. result = ( *class_info[ cindex ].variable[ vindex ].VarGet )( &outvalue ,
  295. &access ,
  296. instance ) ;
  297. if ( result == SNMP_ERRORSTATUS_NOERROR )
  298. {
  299. VarBind->value.asnType = ASN_INTEGER ;
  300. VarBind->value.asnValue.number =
  301. (AsnInteger)outvalue ;
  302. }
  303. return result ;
  304. } /* end of SMIGetINThrDeviceStatus() */
  305. /*
  306. * SMISetINThrDeviceStatus
  307. * INThrDeviceStatus ::= INTEGER
  308. *
  309. * Encompasses the callouts to variables for the data type INThrDeviceStatus
  310. *
  311. * Arguments:
  312. * VarBind pointer to the variable value pair
  313. * cindex index to the class of the request
  314. * vindex index to the variable of the request
  315. * instance address of the instance specification
  316. * in the form of ordered native datatypes
  317. * Return Codes:
  318. *
  319. * Standard PDU error codes.
  320. */
  321. UINT
  322. SMISetINThrDeviceStatus(
  323. IN OUT RFC1157VarBind *VarBind , // Variable binding for set
  324. IN unsigned long int cindex ,
  325. IN unsigned long int vindex ,
  326. IN InstanceName *instance )
  327. {
  328. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  329. INThrDeviceStatus *invalue ;
  330. INThrDeviceStatus outvalue ;
  331. Access_Credential access ; // dummy holder for future use
  332. invalue = (INThrDeviceStatus *)
  333. ( &VarBind->value.asnValue.number ) ;
  334. result = ( *class_info[ cindex ].variable[ vindex ].VarSet )
  335. ( invalue, &outvalue, &access, instance ) ;
  336. return result;
  337. } /* end of SMISetINThrDeviceStatus() */
  338. /*
  339. * SMIBuildINThrDeviceStatus
  340. * INThrDeviceStatus ::= INTEGER
  341. *
  342. * Places the variable of datatype INThrDeviceStatus into a Variable Binding.
  343. *
  344. * Arguments:
  345. *
  346. * VarBind pointer to the variable value pair
  347. * invalue address of the data
  348. *
  349. * Return Codes:
  350. *
  351. * Standard PDU error codes.
  352. */
  353. UINT
  354. SMIBuildINThrDeviceStatus(
  355. IN OUT RFC1157VarBind *VarBind , // Variable binding for building
  356. IN char *invalue )
  357. {
  358. Integer *svalue = (Integer *)invalue;
  359. VarBind->value.asnType = ASN_INTEGER ;
  360. VarBind->value.asnValue.number = *svalue ;
  361. return SNMP_ERRORSTATUS_NOERROR ;
  362. } /* end of SMIBuildINThrDeviceStatus() */
  363. /*
  364. * SMIGetINThrPrinterStatus
  365. * INThrPrinterStatus ::= INTEGER
  366. *
  367. * Encompasses the callouts to variables for the data type INThrPrinterStatus
  368. *
  369. * Arguments:
  370. * VarBind pointer to the variable value pair
  371. * cindex index to the class of the request
  372. * vindex index to the variable of the request
  373. * instance address of the instance specification
  374. * in the form of ordered native datatypes
  375. * Return Codes:
  376. *
  377. * Standard PDU error codes.
  378. *
  379. * SNMP_ERRORSTATUS_NOERROR Successful get
  380. * SNMP_ERRORSTATUS_GENERR Catch-all failure code
  381. * mibtsmii.c v 0.6
  382. */
  383. UINT
  384. SMIGetINThrPrinterStatus(
  385. IN OUT RFC1157VarBind *VarBind , // Variable binding for get
  386. IN unsigned long int cindex ,
  387. IN unsigned long int vindex ,
  388. IN InstanceName *instance )
  389. {
  390. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  391. INThrPrinterStatus outvalue ;
  392. Access_Credential access ; // dummy holder for future use
  393. result = ( *class_info[ cindex ].variable[ vindex ].VarGet )( &outvalue ,
  394. &access ,
  395. instance ) ;
  396. if ( result == SNMP_ERRORSTATUS_NOERROR )
  397. {
  398. VarBind->value.asnType = ASN_INTEGER ;
  399. VarBind->value.asnValue.number =
  400. (AsnInteger)outvalue ;
  401. }
  402. return result ;
  403. } /* end of SMIGetINThrPrinterStatus() */
  404. /*
  405. * SMISetINThrPrinterStatus
  406. * INThrPrinterStatus ::= INTEGER
  407. *
  408. * Encompasses the callouts to variables for the data type INThrPrinterStatus
  409. *
  410. * Arguments:
  411. * VarBind pointer to the variable value pair
  412. * cindex index to the class of the request
  413. * vindex index to the variable of the request
  414. * instance address of the instance specification
  415. * in the form of ordered native datatypes
  416. * Return Codes:
  417. *
  418. * Standard PDU error codes.
  419. */
  420. UINT
  421. SMISetINThrPrinterStatus(
  422. IN OUT RFC1157VarBind *VarBind , // Variable binding for set
  423. IN unsigned long int cindex ,
  424. IN unsigned long int vindex ,
  425. IN InstanceName *instance )
  426. {
  427. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  428. INThrPrinterStatus *invalue ;
  429. INThrPrinterStatus outvalue ;
  430. Access_Credential access ; // dummy holder for future use
  431. invalue = (INThrPrinterStatus *)
  432. ( &VarBind->value.asnValue.number ) ;
  433. result = ( *class_info[ cindex ].variable[ vindex ].VarSet )
  434. ( invalue, &outvalue, &access, instance ) ;
  435. return result;
  436. } /* end of SMISetINThrPrinterStatus() */
  437. /*
  438. * SMIBuildINThrPrinterStatus
  439. * INThrPrinterStatus ::= INTEGER
  440. *
  441. * Places the variable of datatype INThrPrinterStatus into a Variable Binding.
  442. *
  443. * Arguments:
  444. *
  445. * VarBind pointer to the variable value pair
  446. * invalue address of the data
  447. *
  448. * Return Codes:
  449. *
  450. * Standard PDU error codes.
  451. */
  452. UINT
  453. SMIBuildINThrPrinterStatus(
  454. IN OUT RFC1157VarBind *VarBind , // Variable binding for building
  455. IN char *invalue )
  456. {
  457. Integer *svalue = (Integer *)invalue;
  458. VarBind->value.asnType = ASN_INTEGER ;
  459. VarBind->value.asnValue.number = *svalue ;
  460. return SNMP_ERRORSTATUS_NOERROR ;
  461. } /* end of SMIBuildINThrPrinterStatus() */
  462. /*
  463. * SMIGetINTAccess
  464. * INTAccess ::= INTEGER
  465. *
  466. * Encompasses the callouts to variables for the data type INTAccess
  467. *
  468. * Arguments:
  469. * VarBind pointer to the variable value pair
  470. * cindex index to the class of the request
  471. * vindex index to the variable of the request
  472. * instance address of the instance specification
  473. * in the form of ordered native datatypes
  474. * Return Codes:
  475. *
  476. * Standard PDU error codes.
  477. *
  478. * SNMP_ERRORSTATUS_NOERROR Successful get
  479. * SNMP_ERRORSTATUS_GENERR Catch-all failure code
  480. * mibtsmii.c v 0.6
  481. */
  482. UINT
  483. SMIGetINTAccess(
  484. IN OUT RFC1157VarBind *VarBind , // Variable binding for get
  485. IN unsigned long int cindex ,
  486. IN unsigned long int vindex ,
  487. IN InstanceName *instance )
  488. {
  489. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  490. INTAccess outvalue ;
  491. Access_Credential access ; // dummy holder for future use
  492. result = ( *class_info[ cindex ].variable[ vindex ].VarGet )( &outvalue ,
  493. &access ,
  494. instance ) ;
  495. if ( result == SNMP_ERRORSTATUS_NOERROR )
  496. {
  497. VarBind->value.asnType = ASN_INTEGER ;
  498. VarBind->value.asnValue.number =
  499. (AsnInteger)outvalue ;
  500. }
  501. return result ;
  502. } /* end of SMIGetINTAccess() */
  503. /*
  504. * SMISetINTAccess
  505. * INTAccess ::= INTEGER
  506. *
  507. * Encompasses the callouts to variables for the data type INTAccess
  508. *
  509. * Arguments:
  510. * VarBind pointer to the variable value pair
  511. * cindex index to the class of the request
  512. * vindex index to the variable of the request
  513. * instance address of the instance specification
  514. * in the form of ordered native datatypes
  515. * Return Codes:
  516. *
  517. * Standard PDU error codes.
  518. */
  519. UINT
  520. SMISetINTAccess(
  521. IN OUT RFC1157VarBind *VarBind , // Variable binding for set
  522. IN unsigned long int cindex ,
  523. IN unsigned long int vindex ,
  524. IN InstanceName *instance )
  525. {
  526. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  527. INTAccess *invalue ;
  528. INTAccess outvalue ;
  529. Access_Credential access ; // dummy holder for future use
  530. invalue = (INTAccess *)
  531. ( &VarBind->value.asnValue.number ) ;
  532. result = ( *class_info[ cindex ].variable[ vindex ].VarSet )
  533. ( invalue, &outvalue, &access, instance ) ;
  534. return result;
  535. } /* end of SMISetINTAccess() */
  536. /*
  537. * SMIBuildINTAccess
  538. * INTAccess ::= INTEGER
  539. *
  540. * Places the variable of datatype INTAccess into a Variable Binding.
  541. *
  542. * Arguments:
  543. *
  544. * VarBind pointer to the variable value pair
  545. * invalue address of the data
  546. *
  547. * Return Codes:
  548. *
  549. * Standard PDU error codes.
  550. */
  551. UINT
  552. SMIBuildINTAccess(
  553. IN OUT RFC1157VarBind *VarBind , // Variable binding for building
  554. IN char *invalue )
  555. {
  556. Integer *svalue = (Integer *)invalue;
  557. VarBind->value.asnType = ASN_INTEGER ;
  558. VarBind->value.asnValue.number = *svalue ;
  559. return SNMP_ERRORSTATUS_NOERROR ;
  560. } /* end of SMIBuildINTAccess() */
  561. /*
  562. * SMIGetINThrDiskStorageMedia
  563. * INThrDiskStorageMedia ::= INTEGER
  564. *
  565. * Encompasses the callouts to variables for the data type INThrDiskStorageMedia
  566. *
  567. * Arguments:
  568. * VarBind pointer to the variable value pair
  569. * cindex index to the class of the request
  570. * vindex index to the variable of the request
  571. * instance address of the instance specification
  572. * in the form of ordered native datatypes
  573. * Return Codes:
  574. *
  575. * Standard PDU error codes.
  576. *
  577. * SNMP_ERRORSTATUS_NOERROR Successful get
  578. * SNMP_ERRORSTATUS_GENERR Catch-all failure code
  579. * mibtsmii.c v 0.6
  580. */
  581. UINT
  582. SMIGetINThrDiskStorageMedia(
  583. IN OUT RFC1157VarBind *VarBind , // Variable binding for get
  584. IN unsigned long int cindex ,
  585. IN unsigned long int vindex ,
  586. IN InstanceName *instance )
  587. {
  588. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  589. INThrDiskStorageMedia outvalue ;
  590. Access_Credential access ; // dummy holder for future use
  591. result = ( *class_info[ cindex ].variable[ vindex ].VarGet )( &outvalue ,
  592. &access ,
  593. instance ) ;
  594. if ( result == SNMP_ERRORSTATUS_NOERROR )
  595. {
  596. VarBind->value.asnType = ASN_INTEGER ;
  597. VarBind->value.asnValue.number =
  598. (AsnInteger)outvalue ;
  599. }
  600. return result ;
  601. } /* end of SMIGetINThrDiskStorageMedia() */
  602. /*
  603. * SMISetINThrDiskStorageMedia
  604. * INThrDiskStorageMedia ::= INTEGER
  605. *
  606. * Encompasses the callouts to variables for the data type INThrDiskStorageMedia
  607. *
  608. * Arguments:
  609. * VarBind pointer to the variable value pair
  610. * cindex index to the class of the request
  611. * vindex index to the variable of the request
  612. * instance address of the instance specification
  613. * in the form of ordered native datatypes
  614. * Return Codes:
  615. *
  616. * Standard PDU error codes.
  617. */
  618. UINT
  619. SMISetINThrDiskStorageMedia(
  620. IN OUT RFC1157VarBind *VarBind , // Variable binding for set
  621. IN unsigned long int cindex ,
  622. IN unsigned long int vindex ,
  623. IN InstanceName *instance )
  624. {
  625. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  626. INThrDiskStorageMedia *invalue ;
  627. INThrDiskStorageMedia outvalue ;
  628. Access_Credential access ; // dummy holder for future use
  629. invalue = (INThrDiskStorageMedia *)
  630. ( &VarBind->value.asnValue.number ) ;
  631. result = ( *class_info[ cindex ].variable[ vindex ].VarSet )
  632. ( invalue, &outvalue, &access, instance ) ;
  633. return result;
  634. } /* end of SMISetINThrDiskStorageMedia() */
  635. /*
  636. * SMIBuildINThrDiskStorageMedia
  637. * INThrDiskStorageMedia ::= INTEGER
  638. *
  639. * Places the variable of datatype INThrDiskStorageMedia into a Variable Binding.
  640. *
  641. * Arguments:
  642. *
  643. * VarBind pointer to the variable value pair
  644. * invalue address of the data
  645. *
  646. * Return Codes:
  647. *
  648. * Standard PDU error codes.
  649. */
  650. UINT
  651. SMIBuildINThrDiskStorageMedia(
  652. IN OUT RFC1157VarBind *VarBind , // Variable binding for building
  653. IN char *invalue )
  654. {
  655. Integer *svalue = (Integer *)invalue;
  656. VarBind->value.asnType = ASN_INTEGER ;
  657. VarBind->value.asnValue.number = *svalue ;
  658. return SNMP_ERRORSTATUS_NOERROR ;
  659. } /* end of SMIBuildINThrDiskStorageMedia() */
  660. /*
  661. * SMIGetINTSWType
  662. * INTSWType ::= INTEGER
  663. *
  664. * Encompasses the callouts to variables for the data type INTSWType
  665. *
  666. * Arguments:
  667. * VarBind pointer to the variable value pair
  668. * cindex index to the class of the request
  669. * vindex index to the variable of the request
  670. * instance address of the instance specification
  671. * in the form of ordered native datatypes
  672. * Return Codes:
  673. *
  674. * Standard PDU error codes.
  675. *
  676. * SNMP_ERRORSTATUS_NOERROR Successful get
  677. * SNMP_ERRORSTATUS_GENERR Catch-all failure code
  678. * mibtsmii.c v 0.6
  679. */
  680. UINT
  681. SMIGetINTSWType(
  682. IN OUT RFC1157VarBind *VarBind , // Variable binding for get
  683. IN unsigned long int cindex ,
  684. IN unsigned long int vindex ,
  685. IN InstanceName *instance )
  686. {
  687. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  688. INTSWType outvalue ;
  689. Access_Credential access ; // dummy holder for future use
  690. result = ( *class_info[ cindex ].variable[ vindex ].VarGet )( &outvalue ,
  691. &access ,
  692. instance ) ;
  693. if ( result == SNMP_ERRORSTATUS_NOERROR )
  694. {
  695. VarBind->value.asnType = ASN_INTEGER ;
  696. VarBind->value.asnValue.number =
  697. (AsnInteger)outvalue ;
  698. }
  699. return result ;
  700. } /* end of SMIGetINTSWType() */
  701. /*
  702. * SMISetINTSWType
  703. * INTSWType ::= INTEGER
  704. *
  705. * Encompasses the callouts to variables for the data type INTSWType
  706. *
  707. * Arguments:
  708. * VarBind pointer to the variable value pair
  709. * cindex index to the class of the request
  710. * vindex index to the variable of the request
  711. * instance address of the instance specification
  712. * in the form of ordered native datatypes
  713. * Return Codes:
  714. *
  715. * Standard PDU error codes.
  716. */
  717. UINT
  718. SMISetINTSWType(
  719. IN OUT RFC1157VarBind *VarBind , // Variable binding for set
  720. IN unsigned long int cindex ,
  721. IN unsigned long int vindex ,
  722. IN InstanceName *instance )
  723. {
  724. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  725. INTSWType *invalue ;
  726. INTSWType outvalue ;
  727. Access_Credential access ; // dummy holder for future use
  728. invalue = (INTSWType *)
  729. ( &VarBind->value.asnValue.number ) ;
  730. result = ( *class_info[ cindex ].variable[ vindex ].VarSet )
  731. ( invalue, &outvalue, &access, instance ) ;
  732. return result;
  733. } /* end of SMISetINTSWType() */
  734. /*
  735. * SMIBuildINTSWType
  736. * INTSWType ::= INTEGER
  737. *
  738. * Places the variable of datatype INTSWType into a Variable Binding.
  739. *
  740. * Arguments:
  741. *
  742. * VarBind pointer to the variable value pair
  743. * invalue address of the data
  744. *
  745. * Return Codes:
  746. *
  747. * Standard PDU error codes.
  748. */
  749. UINT
  750. SMIBuildINTSWType(
  751. IN OUT RFC1157VarBind *VarBind , // Variable binding for building
  752. IN char *invalue )
  753. {
  754. Integer *svalue = (Integer *)invalue;
  755. VarBind->value.asnType = ASN_INTEGER ;
  756. VarBind->value.asnValue.number = *svalue ;
  757. return SNMP_ERRORSTATUS_NOERROR ;
  758. } /* end of SMIBuildINTSWType() */
  759. /*
  760. * SMIGetINThrSWRunStatus
  761. * INThrSWRunStatus ::= INTEGER
  762. *
  763. * Encompasses the callouts to variables for the data type INThrSWRunStatus
  764. *
  765. * Arguments:
  766. * VarBind pointer to the variable value pair
  767. * cindex index to the class of the request
  768. * vindex index to the variable of the request
  769. * instance address of the instance specification
  770. * in the form of ordered native datatypes
  771. * Return Codes:
  772. *
  773. * Standard PDU error codes.
  774. *
  775. * SNMP_ERRORSTATUS_NOERROR Successful get
  776. * SNMP_ERRORSTATUS_GENERR Catch-all failure code
  777. * mibtsmii.c v 0.6
  778. */
  779. UINT
  780. SMIGetINThrSWRunStatus(
  781. IN OUT RFC1157VarBind *VarBind , // Variable binding for get
  782. IN unsigned long int cindex ,
  783. IN unsigned long int vindex ,
  784. IN InstanceName *instance )
  785. {
  786. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  787. INThrSWRunStatus outvalue ;
  788. Access_Credential access ; // dummy holder for future use
  789. result = ( *class_info[ cindex ].variable[ vindex ].VarGet )( &outvalue ,
  790. &access ,
  791. instance ) ;
  792. if ( result == SNMP_ERRORSTATUS_NOERROR )
  793. {
  794. VarBind->value.asnType = ASN_INTEGER ;
  795. VarBind->value.asnValue.number =
  796. (AsnInteger)outvalue ;
  797. }
  798. return result ;
  799. } /* end of SMIGetINThrSWRunStatus() */
  800. /*
  801. * SMISetINThrSWRunStatus
  802. * INThrSWRunStatus ::= INTEGER
  803. *
  804. * Encompasses the callouts to variables for the data type INThrSWRunStatus
  805. *
  806. * Arguments:
  807. * VarBind pointer to the variable value pair
  808. * cindex index to the class of the request
  809. * vindex index to the variable of the request
  810. * instance address of the instance specification
  811. * in the form of ordered native datatypes
  812. * Return Codes:
  813. *
  814. * Standard PDU error codes.
  815. */
  816. UINT
  817. SMISetINThrSWRunStatus(
  818. IN OUT RFC1157VarBind *VarBind , // Variable binding for set
  819. IN unsigned long int cindex ,
  820. IN unsigned long int vindex ,
  821. IN InstanceName *instance )
  822. {
  823. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  824. INThrSWRunStatus *invalue ;
  825. INThrSWRunStatus outvalue ;
  826. Access_Credential access ; // dummy holder for future use
  827. invalue = (INThrSWRunStatus *)
  828. ( &VarBind->value.asnValue.number ) ;
  829. result = ( *class_info[ cindex ].variable[ vindex ].VarSet )
  830. ( invalue, &outvalue, &access, instance ) ;
  831. return result;
  832. } /* end of SMISetINThrSWRunStatus() */
  833. /*
  834. * SMIBuildINThrSWRunStatus
  835. * INThrSWRunStatus ::= INTEGER
  836. *
  837. * Places the variable of datatype INThrSWRunStatus into a Variable Binding.
  838. *
  839. * Arguments:
  840. *
  841. * VarBind pointer to the variable value pair
  842. * invalue address of the data
  843. *
  844. * Return Codes:
  845. *
  846. * Standard PDU error codes.
  847. */
  848. UINT
  849. SMIBuildINThrSWRunStatus(
  850. IN OUT RFC1157VarBind *VarBind , // Variable binding for building
  851. IN char *invalue )
  852. {
  853. Integer *svalue = (Integer *)invalue;
  854. VarBind->value.asnType = ASN_INTEGER ;
  855. VarBind->value.asnValue.number = *svalue ;
  856. return SNMP_ERRORSTATUS_NOERROR ;
  857. } /* end of SMIBuildINThrSWRunStatus() */
  858. /*
  859. * SMIGetDateAndTime
  860. * DateAndTime ::= OCTET STRING (SIZE ( 8 | 11)) A date-time specification
  861. * for the local time of day. This data type is intended toprovide a consistent method of reporting
  862. * dat
  863. *
  864. * Encompasses the callouts to variables for the data type DateAndTime
  865. *
  866. * Arguments:
  867. * VarBind pointer to the variable value pair
  868. * cindex index to the class of the request
  869. * vindex index to the variable of the request
  870. * instance address of the instance specification
  871. * in the form of ordered native datatypes
  872. * Return Codes:
  873. *
  874. * Standard PDU error codes.
  875. *
  876. * SNMP_ERRORSTATUS_NOERROR Successful get
  877. * SNMP_ERRORSTATUS_GENERR Catch-all failure code
  878. * mibtsmio.c v 0.5
  879. */
  880. UINT
  881. SMIGetDateAndTime(
  882. IN OUT RFC1157VarBind *VarBind , // Variable binding for get
  883. IN unsigned long int cindex ,
  884. IN unsigned long int vindex ,
  885. IN InstanceName *instance )
  886. {
  887. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  888. DateAndTime outvalue ;
  889. char stream[ MAX_OCTET_STRING ] ;
  890. Access_Credential access ; // dummy holder for future use
  891. outvalue.string = stream ;
  892. outvalue.length = 0 ;
  893. result = ( *class_info[ cindex ].variable[ vindex ].VarGet )( &outvalue ,
  894. &access ,
  895. instance ) ;
  896. if ( result == SNMP_ERRORSTATUS_NOERROR )
  897. {
  898. if (outvalue.length > 0)
  899. {
  900. VarBind->value.asnValue.string.stream =
  901. SNMP_malloc( outvalue.length * sizeof( char ) ) ;
  902. if ( VarBind->value.asnValue.string.stream == NULL )
  903. {
  904. VarBind->value.asnValue.string.length = 0;
  905. VarBind->value.asnType = ASN_OCTETSTRING ;
  906. VarBind->value.asnValue.string.stream = NULL;
  907. VarBind->value.asnValue.string.dynamic = FALSE ;
  908. result = SNMP_ERRORSTATUS_GENERR ;
  909. }
  910. else
  911. {
  912. VarBind->value.asnValue.string.length = outvalue.length ;
  913. memcpy( VarBind->value.asnValue.string.stream ,
  914. outvalue.string ,
  915. outvalue.length ) ;
  916. VarBind->value.asnType = ASN_OCTETSTRING ;
  917. VarBind->value.asnValue.string.dynamic = TRUE ;
  918. }
  919. }
  920. else
  921. {
  922. VarBind->value.asnValue.string.stream = NULL;
  923. VarBind->value.asnValue.string.length = 0;
  924. VarBind->value.asnType = ASN_OCTETSTRING ;
  925. VarBind->value.asnValue.string.dynamic = FALSE ;
  926. }
  927. }
  928. return result ;
  929. } /* end of SMIGetDateAndTime() */
  930. /*
  931. * SMISetDateAndTime
  932. * DateAndTime ::= OCTET STRING (SIZE ( 8 | 11)) A date-time specification
  933. * for the local time of day. This data type is intended toprovide a consistent method of reporting
  934. * dat
  935. *
  936. * Encompasses the callouts to variables for the data type DateAndTime
  937. *
  938. * Arguments:
  939. * VarBind pointer to the variable value pair
  940. * cindex index to the class of the request
  941. * vindex index to the variable of the request
  942. * instance address of the instance specification
  943. * in the form of ordered native datatypes
  944. * Return Codes:
  945. *
  946. * Standard PDU error codes.
  947. */
  948. UINT
  949. SMISetDateAndTime(
  950. IN OUT RFC1157VarBind *VarBind , // Variable binding for set
  951. IN unsigned long int cindex ,
  952. IN unsigned long int vindex ,
  953. IN InstanceName *instance )
  954. {
  955. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  956. DateAndTime invalue ;
  957. DateAndTime outvalue ;
  958. char out_stream[ MAX_OCTET_STRING ] ;
  959. AsnOctetString *tmp ;
  960. Access_Credential access ; // dummy holder for future use
  961. tmp = &VarBind->value.asnValue.string ;
  962. invalue.length = tmp->length ;
  963. invalue.string = tmp->stream ;
  964. outvalue.string = out_stream ;
  965. outvalue.length = 0 ;
  966. result = ( *class_info[ cindex ].variable[ vindex ].VarSet )
  967. ( &invalue, &outvalue, &access, instance ) ;
  968. return result;
  969. } /* end of SMISetDateAndTime() */
  970. /*
  971. * SMIBuildDateAndTime
  972. * DateAndTime ::= OCTET STRING (SIZE ( 8 | 11)) A date-time specification
  973. * for the local time of day. This data type is intended toprovide a consistent method of reporting
  974. * dat
  975. *
  976. * Places the variable of datatype DateAndTime into a Variable Binding
  977. *
  978. * Arguments:
  979. * VarBind pointer to the variable value pair
  980. * invalue address of the data
  981. * Return Codes:
  982. *
  983. * Standard PDU error codes.
  984. */
  985. UINT
  986. SMIBuildDateAndTime(
  987. IN OUT RFC1157VarBind *VarBind , // Variable binding for set
  988. IN char *invalue )
  989. {
  990. OctetString *svalue = (OctetString *)invalue ;
  991. UINT status = SNMP_ERRORSTATUS_NOERROR ;
  992. if (svalue->length)
  993. {
  994. VarBind->value.asnValue.string.stream =
  995. SNMP_malloc( svalue->length * sizeof( char ) ) ;
  996. if ( VarBind->value.asnValue.string.stream == NULL )
  997. {
  998. VarBind->value.asnValue.string.length = 0;
  999. VarBind->value.asnType = ASN_OCTETSTRING;
  1000. VarBind->value.asnValue.string.dynamic = FALSE;
  1001. status = SNMP_ERRORSTATUS_GENERR ;
  1002. }
  1003. else
  1004. {
  1005. memcpy( VarBind->value.asnValue.string.stream ,
  1006. svalue->string ,
  1007. svalue->length ) ;
  1008. VarBind->value.asnValue.string.length = svalue->length ;
  1009. VarBind->value.asnType = ASN_OCTETSTRING ;
  1010. VarBind->value.asnValue.string.dynamic = TRUE ;
  1011. }
  1012. }
  1013. else
  1014. {
  1015. VarBind->value.asnValue.string.stream = NULL;
  1016. VarBind->value.asnValue.string.length = 0;
  1017. VarBind->value.asnType = ASN_OCTETSTRING ;
  1018. VarBind->value.asnValue.string.dynamic = FALSE;
  1019. }
  1020. return status ;
  1021. } /* end of SMIBuildDateAndTime() */
  1022. /*
  1023. * SMIGetInternationalDisplayString
  1024. * InternationalDisplayString ::= OCTET STRING This data type is used to
  1025. * model textual information in some character set. A network management station should use a local
  1026. * algo
  1027. *
  1028. * Encompasses the callouts to variables for the data type InternationalDisplayString
  1029. *
  1030. * Arguments:
  1031. * VarBind pointer to the variable value pair
  1032. * cindex index to the class of the request
  1033. * vindex index to the variable of the request
  1034. * instance address of the instance specification
  1035. * in the form of ordered native datatypes
  1036. * Return Codes:
  1037. *
  1038. * Standard PDU error codes.
  1039. *
  1040. * SNMP_ERRORSTATUS_NOERROR Successful get
  1041. * SNMP_ERRORSTATUS_GENERR Catch-all failure code
  1042. * mibtsmio.c v 0.5
  1043. */
  1044. UINT
  1045. SMIGetInternationalDisplayString(
  1046. IN OUT RFC1157VarBind *VarBind , // Variable binding for get
  1047. IN unsigned long int cindex ,
  1048. IN unsigned long int vindex ,
  1049. IN InstanceName *instance )
  1050. {
  1051. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  1052. InternationalDisplayString outvalue ;
  1053. char stream[ MAX_OCTET_STRING ] ;
  1054. Access_Credential access ; // dummy holder for future use
  1055. outvalue.string = stream ;
  1056. outvalue.length = 0 ;
  1057. result = ( *class_info[ cindex ].variable[ vindex ].VarGet )( &outvalue ,
  1058. &access ,
  1059. instance ) ;
  1060. if ( result == SNMP_ERRORSTATUS_NOERROR )
  1061. {
  1062. if (outvalue.length > 0)
  1063. {
  1064. VarBind->value.asnValue.string.stream =
  1065. SNMP_malloc( outvalue.length * sizeof( char ) ) ;
  1066. if ( VarBind->value.asnValue.string.stream == NULL )
  1067. {
  1068. VarBind->value.asnValue.string.length = 0;
  1069. VarBind->value.asnType = ASN_OCTETSTRING ;
  1070. VarBind->value.asnValue.string.stream = NULL;
  1071. VarBind->value.asnValue.string.dynamic = FALSE ;
  1072. result = SNMP_ERRORSTATUS_GENERR ;
  1073. }
  1074. else
  1075. {
  1076. memcpy( VarBind->value.asnValue.string.stream ,
  1077. outvalue.string ,
  1078. outvalue.length ) ;
  1079. VarBind->value.asnValue.string.length = outvalue.length ;
  1080. VarBind->value.asnType = ASN_OCTETSTRING ;
  1081. VarBind->value.asnValue.string.dynamic = TRUE ;
  1082. }
  1083. }
  1084. else
  1085. {
  1086. VarBind->value.asnValue.string.stream = NULL;
  1087. VarBind->value.asnValue.string.length = 0;
  1088. VarBind->value.asnType = ASN_OCTETSTRING ;
  1089. VarBind->value.asnValue.string.dynamic = FALSE ;
  1090. }
  1091. }
  1092. return result ;
  1093. } /* end of SMIGetInternationalDisplayString() */
  1094. /*
  1095. * SMISetInternationalDisplayString
  1096. * InternationalDisplayString ::= OCTET STRING This data type is used to
  1097. * model textual information in some character set. A network management station should use a local
  1098. * algo
  1099. *
  1100. * Encompasses the callouts to variables for the data type InternationalDisplayString
  1101. *
  1102. * Arguments:
  1103. * VarBind pointer to the variable value pair
  1104. * cindex index to the class of the request
  1105. * vindex index to the variable of the request
  1106. * instance address of the instance specification
  1107. * in the form of ordered native datatypes
  1108. * Return Codes:
  1109. *
  1110. * Standard PDU error codes.
  1111. */
  1112. UINT
  1113. SMISetInternationalDisplayString(
  1114. IN OUT RFC1157VarBind *VarBind , // Variable binding for set
  1115. IN unsigned long int cindex ,
  1116. IN unsigned long int vindex ,
  1117. IN InstanceName *instance )
  1118. {
  1119. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  1120. InternationalDisplayString invalue ;
  1121. InternationalDisplayString outvalue ;
  1122. char out_stream[ MAX_OCTET_STRING ] ;
  1123. AsnOctetString *tmp ;
  1124. Access_Credential access ; // dummy holder for future use
  1125. tmp = &VarBind->value.asnValue.string ;
  1126. invalue.length = tmp->length ;
  1127. invalue.string = tmp->stream ;
  1128. outvalue.string = out_stream ;
  1129. outvalue.length = 0 ;
  1130. result = ( *class_info[ cindex ].variable[ vindex ].VarSet )
  1131. ( &invalue, &outvalue, &access, instance ) ;
  1132. return result;
  1133. } /* end of SMISetInternationalDisplayString() */
  1134. /*
  1135. * SMIBuildInternationalDisplayString
  1136. * InternationalDisplayString ::= OCTET STRING This data type is used to
  1137. * model textual information in some character set. A network management station should use a local
  1138. * algo
  1139. *
  1140. * Places the variable of datatype InternationalDisplayString into a Variable Binding
  1141. *
  1142. * Arguments:
  1143. * VarBind pointer to the variable value pair
  1144. * invalue address of the data
  1145. * Return Codes:
  1146. *
  1147. * Standard PDU error codes.
  1148. */
  1149. UINT
  1150. SMIBuildInternationalDisplayString(
  1151. IN OUT RFC1157VarBind *VarBind , // Variable binding for set
  1152. IN char *invalue )
  1153. {
  1154. OctetString *svalue = (OctetString *)invalue ;
  1155. UINT status = SNMP_ERRORSTATUS_NOERROR ;
  1156. if (svalue->length)
  1157. {
  1158. VarBind->value.asnValue.string.stream =
  1159. SNMP_malloc( svalue->length * sizeof( char ) ) ;
  1160. if ( VarBind->value.asnValue.string.stream == NULL )
  1161. {
  1162. VarBind->value.asnValue.string.length = 0;
  1163. VarBind->value.asnType = ASN_OCTETSTRING;
  1164. VarBind->value.asnValue.string.dynamic = FALSE;
  1165. status = SNMP_ERRORSTATUS_GENERR ;
  1166. }
  1167. else
  1168. {
  1169. memcpy( VarBind->value.asnValue.string.stream ,
  1170. svalue->string ,
  1171. svalue->length ) ;
  1172. VarBind->value.asnValue.string.length = svalue->length ;
  1173. VarBind->value.asnType = ASN_OCTETSTRING ;
  1174. VarBind->value.asnValue.string.dynamic = TRUE ;
  1175. }
  1176. }
  1177. else
  1178. {
  1179. VarBind->value.asnValue.string.stream = NULL;
  1180. VarBind->value.asnValue.string.length = 0;
  1181. VarBind->value.asnType = ASN_OCTETSTRING;
  1182. VarBind->value.asnValue.string.dynamic = FALSE;
  1183. }
  1184. return status ;
  1185. } /* end of SMIBuildInternationalDisplayString() */
  1186. /*
  1187. * SMIGetProductID
  1188. * ProductID ::= OBJECT IDENTIFIER This textual convention is intended to
  1189. * identify the manufacturer, model, and version of a specific hardware or software
  1190. * product.
  1191. *
  1192. * Encompasses the callouts to variables for the data type ProductID
  1193. *
  1194. * Arguments:
  1195. * VarBind pointer to the variable value pair
  1196. * cindex index to the class of the request
  1197. * vindex index to the variable of the request
  1198. * instance address of the instance specification
  1199. * in the form of ordered native datatypes
  1200. * Return Codes:
  1201. *
  1202. * Standard PDU error codes.
  1203. *
  1204. * SNMP_ERRORSTATUS_NOERROR Successful get
  1205. * SNMP_ERRORSTATUS_GENERR Catch-all failure code
  1206. * mibtsmib.c v 0.5
  1207. */
  1208. UINT
  1209. SMIGetProductID(
  1210. IN OUT RFC1157VarBind *VarBind , // Variable binding for get
  1211. IN unsigned long int cindex ,
  1212. IN unsigned long int vindex ,
  1213. IN InstanceName *instance )
  1214. {
  1215. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  1216. UINT status ;
  1217. ProductID outvalue ;
  1218. Access_Credential access ; // dummy holder for future use
  1219. memset( &outvalue, '\0', sizeof( ProductID ) ) ;
  1220. result = ( *class_info[ cindex ].variable[ vindex ].VarGet )( &outvalue ,
  1221. &access ,
  1222. instance ) ;
  1223. if ( result == SNMP_ERRORSTATUS_NOERROR )
  1224. {
  1225. status = SNMP_oidcpy( &VarBind->value.asnValue.object, &outvalue ) ;
  1226. if ( !status )
  1227. result = SNMP_ERRORSTATUS_GENERR ;
  1228. else
  1229. {
  1230. VarBind->value.asnType = ASN_OBJECTIDENTIFIER ;
  1231. }
  1232. if ( outvalue.idLength != 0 )
  1233. SnmpUtilOidFree( &outvalue ) ;
  1234. }
  1235. return result ;
  1236. } /* end of SMIGetProductID() */
  1237. /*
  1238. * SMISetProductID
  1239. * ProductID ::= OBJECT IDENTIFIER This textual convention is intended to
  1240. * identify the manufacturer, model, and version of a specific hardware or software
  1241. * product.
  1242. *
  1243. * Encompasses the callouts to variables for the data type ProductID
  1244. *
  1245. * Arguments:
  1246. * VarBind pointer to the variable value pair
  1247. * cindex index to the class of the request
  1248. * vindex index to the variable of the request
  1249. * instance address of the instance specification
  1250. * in the form of ordered native datatypes
  1251. * Return Codes:
  1252. *
  1253. * Standard PDU error codes.
  1254. */
  1255. UINT
  1256. SMISetProductID(
  1257. IN OUT RFC1157VarBind *VarBind , // Variable binding for set
  1258. IN unsigned long int cindex ,
  1259. IN unsigned long int vindex ,
  1260. IN InstanceName *instance )
  1261. {
  1262. UINT result = SNMP_ERRORSTATUS_NOERROR ;
  1263. ProductID *invalue ;
  1264. ProductID outvalue ;
  1265. Access_Credential access ; // dummy holder for future use
  1266. invalue = (ProductID *)&VarBind->value.asnValue.object ;
  1267. memset( &outvalue, '\0', sizeof( ProductID ) ) ;
  1268. result = ( *class_info[ cindex ].variable[ vindex ].VarSet )
  1269. ( invalue, &outvalue, &access, instance ) ;
  1270. if ( outvalue.idLength != 0 )
  1271. SnmpUtilOidFree( &outvalue ) ;
  1272. return result ;
  1273. } /* end of SMISetProductID() */
  1274. /*
  1275. * SMIBuildProductID
  1276. * ProductID ::= OBJECT IDENTIFIER This textual convention is intended to
  1277. * identify the manufacturer, model, and version of a specific hardware or software
  1278. * product.
  1279. *
  1280. * Encompasses the callouts to variables for the data type ProductID
  1281. *
  1282. * Arguments:
  1283. * VarBind pointer to the variable value pair
  1284. * invalue address of the data
  1285. *
  1286. * Return Codes:
  1287. *
  1288. * Standard PDU error codes.
  1289. */
  1290. UINT
  1291. SMIBuildProductID(
  1292. IN OUT RFC1157VarBind *VarBind , // Variable binding for set
  1293. IN char *invalue )
  1294. {
  1295. AsnObjectIdentifier *svalue = (AsnObjectIdentifier *)invalue ;
  1296. UINT status = SNMP_ERRORSTATUS_NOERROR ;
  1297. UINT sts = TRUE ;
  1298. sts = SNMP_oidcpy( &VarBind->value.asnValue.object ,
  1299. (AsnObjectIdentifier *)svalue ) ;
  1300. if (!sts)
  1301. status = SNMP_ERRORSTATUS_GENERR ;
  1302. else
  1303. VarBind->value.asnType = ASN_OBJECTIDENTIFIER ;
  1304. return status ;
  1305. } /* end of SMIBuildProductID() */
  1306. /* end of hostmsmi.c */