sensors.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Hardware Abstraction Layer - Sensors module
  3. *
  4. * Public interface
  5. */
  6. #define NETSNMP_SENSOR_TYPE_OTHER 1
  7. #define NETSNMP_SENSOR_TYPE_VOLTAGE_AC 3
  8. #define NETSNMP_SENSOR_TYPE_VOLTAGE_DC 4
  9. #define NETSNMP_SENSOR_TYPE_CURRENT 5
  10. #define NETSNMP_SENSOR_TYPE_POWER 6
  11. #define NETSNMP_SENSOR_TYPE_FREQUENCY 7
  12. #define NETSNMP_SENSOR_TYPE_TEMPERATURE 8
  13. #define NETSNMP_SENSOR_TYPE_HUMIDITY 9
  14. #define NETSNMP_SENSOR_TYPE_RPM 10
  15. #define NETSNMP_SENSOR_TYPE_VOLUME 11
  16. #define NETSNMP_SENSOR_TYPE_BOOLEAN 12
  17. #define NETSNMP_SENSOR_FLAG_ACTIVE 0x01
  18. #define NETSNMP_SENSOR_FLAG_NAVAIL 0x02
  19. #define NETSNMP_SENSOR_FLAG_BROKEN 0x04
  20. #define NETSNMP_SENSOR_FLAG_DISABLE 0x08
  21. #define NETSNMP_SENSOR_MASK_STATUS 0x06 /* NAVAIL|BROKEN */
  22. #define NETSNMP_SENSOR_FIND_CREATE 1 /* or use one of the sensor type values */
  23. #define NETSNMP_SENSOR_FIND_EXIST 0
  24. typedef struct netsnmp_sensor_info_s netsnmp_sensor_info;
  25. struct netsnmp_sensor_info_s {
  26. netsnmp_index idx;
  27. /* int idx; */
  28. char name[256];
  29. int type;
  30. float value;
  31. char descr[256];
  32. long flags;
  33. };
  34. netsnmp_container *get_sensor_container( void );
  35. netsnmp_cache *get_sensor_cache( void );
  36. netsnmp_sensor_info *sensor_by_name( const char *, int );
  37. NetsnmpCacheLoad netsnmp_sensor_load;
  38. NetsnmpCacheFree netsnmp_sensor_free;