swinst.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* Portions of this file are subject to the following copyright(s). See
  2. * the Net-SNMP's COPYING file for more details and other copyrights
  3. * that may apply:
  4. */
  5. /*
  6. * Portions of this file are copyrighted by:
  7. * Copyright (C) 2007 Apple, Inc. All rights reserved.
  8. * Use is subject to license terms specified in the COPYING file
  9. * distributed with the Net-SNMP package.
  10. */
  11. #ifndef NETSNMP_SWINST_H
  12. #define NETSNMP_SWINST_H
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. /*
  17. * Data structure for a swinst entry
  18. */
  19. typedef struct hrSWInstalledTable_entry {
  20. netsnmp_index oid_index;
  21. /*
  22. * Index values; MIB type is int32, but we use oid so this
  23. * structure can be used directly with a table_container.
  24. */
  25. oid swIndex;
  26. /*
  27. * Column values
  28. */
  29. char swName[64];
  30. char swDate[11];
  31. #ifdef NETSNMP_HAVE_SWID
  32. oid *swID;
  33. u_char swID_len;
  34. #endif
  35. u_char swType;
  36. u_char swName_len;
  37. u_char swDate_len;
  38. } netsnmp_swinst_entry;
  39. #define HRSWINSTALLEDTYPE_UNKNOWN 1
  40. #define HRSWINSTALLEDTYPE_OPERATINGSYSTEM 2
  41. #define HRSWINSTALLEDTYPE_DEVICEDRIVER 3
  42. #define HRSWINSTALLEDTYPE_APPLICATION 4
  43. #define NETSNMP_SWINST_NOFLAGS 0x00000000
  44. #define NETSNMP_SWINST_ALL_OR_NONE 0x00000001
  45. #define NETSNMP_SWINST_DONT_FREE_ITEMS 0x00000002
  46. netsnmp_container *
  47. netsnmp_swinst_container_load(netsnmp_container *container, int flags );
  48. void netsnmp_swinst_container_free(netsnmp_container *container,
  49. u_int flags);
  50. void netsnmp_swinst_container_free_items(netsnmp_container *container);
  51. void netsnmp_swinst_entry_remove(netsnmp_container * container,
  52. netsnmp_swinst_entry *entry);
  53. netsnmp_swinst_entry * netsnmp_swinst_entry_create(int32_t index);
  54. void netsnmp_swinst_entry_free(netsnmp_swinst_entry *entry);
  55. int32_t netsnmp_swinst_add_name(const char *name);
  56. int32_t netsnmp_swinst_get_id(const char *name);
  57. const char * netsnmp_swinst_get_name(int32_t id);
  58. #ifdef __cplusplus
  59. }
  60. #endif
  61. #endif /* NETSNMP_SWINST_H */