swrun.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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_SWRUN_H
  12. #define NETSNMP_SWRUN_H
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. /*-*****************************************************************
  17. *
  18. * Data structure for a row entry
  19. */
  20. typedef struct hrSWRunTable_entry {
  21. netsnmp_index oid_index;
  22. /*
  23. * Index values
  24. */
  25. oid hrSWRunIndex;
  26. /*
  27. * Column values
  28. */
  29. char hrSWRunName[ 64+1]; /* size per MIB + 1 */
  30. char hrSWRunPath[128+1]; /* size per MIB + 1 */
  31. char hrSWRunParameters[128+1]; /* size per MIB + 1 */
  32. #ifdef NETSNMP_SWRUN_HAVE_ID /* if not defined, will always use nullOid */
  33. oid hrSWRunID[SNMP_MAXOID];
  34. u_char hrSWRunID_len;
  35. #endif
  36. u_char hrSWRunName_len;
  37. u_char hrSWRunPath_len;
  38. u_char hrSWRunParameters_len;
  39. u_char hrSWRunType;
  40. u_char hrSWRunStatus;
  41. u_char old_hrSWRunStatus;
  42. /*
  43. * Perf values
  44. */
  45. int32_t hrSWRunPerfCPU;
  46. int32_t hrSWRunPerfMem;
  47. } netsnmp_swrun_entry;
  48. /*
  49. * enums for column hrSWRunType
  50. */
  51. #define HRSWRUNTYPE_UNKNOWN 1
  52. #define HRSWRUNTYPE_OPERATINGSYSTEM 2
  53. #define HRSWRUNTYPE_DEVICEDRIVER 3
  54. #define HRSWRUNTYPE_APPLICATION 4
  55. /*
  56. * enums for column hrSWRunStatus
  57. */
  58. #define HRSWRUNSTATUS_RUNNING 1
  59. #define HRSWRUNSTATUS_RUNNABLE 2
  60. #define HRSWRUNSTATUS_NOTRUNNABLE 3
  61. #define HRSWRUNSTATUS_INVALID 4
  62. /*-*****************************************************************
  63. *
  64. * Prototypes
  65. */
  66. netsnmp_container *
  67. netsnmp_swrun_container_load(netsnmp_container *container, u_int flags );
  68. void netsnmp_swrun_container_free(netsnmp_container *container, u_int flags);
  69. void netsnmp_swrun_container_free_items(netsnmp_container * container);
  70. netsnmp_swrun_entry *
  71. netsnmp_swrun_entry_create(int32_t swIndex);
  72. void netsnmp_swrun_entry_free(netsnmp_swrun_entry *entry);
  73. int swrun_count_processes( int include_kthreads );
  74. int swrun_max_processes( void );
  75. int swrun_count_processes_by_name( char *name );
  76. #ifndef NETSNMP_FEATURE_REMOVE_SWRUN_COUNT_PROCESSES_BY_REGEX
  77. struct real_pcre;
  78. int swrun_count_processes_by_regex(char *name, struct real_pcre *regexp);
  79. #endif
  80. #define NETSNMP_SWRUN_NOFLAGS 0x00000000
  81. #define NETSNMP_SWRUN_ALL_OR_NONE 0x00000001
  82. #define NETSNMP_SWRUN_DONT_FREE_ITEMS 0x00000002
  83. /*#define NETSNMP_SWRUN_xx 0x00000004 */
  84. #ifdef __cplusplus
  85. }
  86. #endif
  87. #endif /* NETSNMP_SWRUN_H */