SNMP Subagent Programmer's Guide
System Time Manager
2-72 119728—SNMP Subagent Programmer’s Guide
Programming Tutorials
GDMOC expects the access functions to be named as follows, using the name in the
extension:
Logic
The source code for this subagent is contained in two files:
Logic Flow
Figure 2-7 illustrates the logic flow of System Time Manager. When a Get request
arrives, the run-time library invokes GET_systemTimeString(). This function retrieves
and formats the system time. When a Set request arrives, the run-time library calls
TEST_systemTimeString(). If that function’s tests for input validity all succeed,
SET_systemTimeString() is called to change the time. If any test fails, the Test function
returns an SNMP error for the NonStop agent to forward to the appropriate manager
station, and the Set function is not called. If the Guardian procedure in the Set function
fails, as it does when the subagent process has insufficient privileges or when the new
time value is outside the allowable range, the Set function returns an SNMP error. If the
Set function succeeds, it returns SNMP_ERR_NO_ERROR.
Source Code
The System Time Manager source code appears in Example 2-15 and Example 2-16:
Example 2-15 shows the main control block, contained in systimec.
Example 2-16 shows the access functions, contained in accessfc.
Numbers in the examples correspond to comments in the discussions located between
here and the examples.
GET_systemTimeString The Get function
TEST_systemTimeString The Test function
SET_systemTimeString The Set function
systimec The main block
accessfc The access functions