snmp-tc.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef SNMP_TC_H
  2. #define SNMP_TC_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /*
  7. * snmp-tc.h: Provide some standard #defines for Textual Convention
  8. * related value information
  9. */
  10. int
  11. netsnmp_dateandtime_set_buf_from_vars(u_char *buf, size_t *bufsize,
  12. u_short y, u_char mon, u_char d,
  13. u_char h, u_char min, u_char s,
  14. u_char deci_seconds,
  15. int utc_offset_direction,
  16. u_char utc_offset_hours,
  17. u_char utc_offset_minutes);
  18. NETSNMP_IMPORT
  19. u_char *date_n_time(const time_t *, size_t *);
  20. time_t ctime_to_timet(const char *);
  21. /*
  22. * TrueValue
  23. */
  24. #define TV_TRUE 1
  25. #define TV_FALSE 2
  26. /*
  27. * RowStatus
  28. */
  29. #define RS_NONEXISTENT 0
  30. #define RS_ACTIVE 1
  31. #define RS_NOTINSERVICE 2
  32. #define RS_NOTREADY 3
  33. #define RS_CREATEANDGO 4
  34. #define RS_CREATEANDWAIT 5
  35. #define RS_DESTROY 6
  36. #define RS_IS_GOING_ACTIVE( x ) ( x == RS_CREATEANDGO || x == RS_ACTIVE )
  37. #define RS_IS_ACTIVE( x ) ( x == RS_ACTIVE )
  38. #define RS_IS_NOT_ACTIVE( x ) ( ! RS_IS_GOING_ACTIVE(x) )
  39. /*
  40. * StorageType
  41. */
  42. #define ST_NONE 0
  43. #define ST_OTHER 1
  44. #define ST_VOLATILE 2
  45. #define ST_NONVOLATILE 3
  46. #define ST_PERMANENT 4
  47. #define ST_READONLY 5
  48. NETSNMP_IMPORT
  49. char check_rowstatus_transition(int old_val, int new_val);
  50. NETSNMP_IMPORT
  51. char check_rowstatus_with_storagetype_transition(int old_val, int new_val, int old_storage);
  52. NETSNMP_IMPORT
  53. char check_storage_transition(int old_val, int new_val);
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. #endif /* SNMP_TC_H */