SNMP Subagent Programmer's Guide
Programming Tutorials
SNMP Subagent Programmer’s Guide—119728 2-75
System Time Manager
10. The GET_systemTimeString() access function determines and formats the current 
system time by using three C library functions:
11. The SET_systemTimeString() access function changes the system time. It is called 
only if TEST_systemTimeString() succeeds. To change the system time, the 
function uses the Guardian procedure SETSYSTEMCLOCK, which uses the Julian 
timestamp value assigned in the Test function. This Set function returns one of 
these statuses, defined in the header file named snmperrh: 
12. The TEST_systemTimeString() access function determines whether to perform the 
Set operation requested. It conducts a series of value tests. Only if all tests succeed 
is the Set function called. 
13. If the input string is not 19 characters, the Test function returns SNMP error 
SNMP_ERR_BAD_VALUE, then terminates. The run-time library never calls the 
Set function.
14. If the input string does not contain six values (one each for year, month, day, hour, 
minutes, and seconds), the Test function returns SNMP error 
SNMP_ERR_BAD_VALUE, then terminates. The run-time library never calls the 
Set function.
15. Guardian procedure COMPUTETIMESTAMP converts the time value into Julian 
timestamp format, which the procedure in the Set function requires. If the 
procedure call fails, the Test function returns SNMP error 
SNMP_ERR_BAD_VALUE, then terminates. The run-time library never calls the 
Set function.
16. Guardian procedure CONVERTTIMESTAMP converts the time value from local 
time to GMT.  If the procedure call fails, the Test function returns SNMP error 
SNMP_ERR_BAD_VALUE, then terminates. The run-time library never calls the 
Set function.
time Determines the current calendar time, expressed as seconds that have 
elapsed since January 1, 1970
localtime Breaks down the time value returned by time and stores it in a 
structure of type struct tm, returning the address of the structure
strftime Formats the time into the 19-character format described in the MIB 
definition
SNMP_ERR_NO_ERROR Is returned if the procedure call succeeds
SNMP_ERR_GEN_ERR Is returned if the subagent process was not started 
by a member of the super group
SNMP_ERR_BAD_VALUE Is returned if the time value is outside the range 
allowed by the Guardian system time










