SNMP Subagent Programmer's Guide
Dynamic Directory Program
2-46 119728—SNMP Subagent Programmer’s Guide
Programming Tutorials
Logic
Dynamic Directory is implemented by using three source code files:
Logic Flow
As Figure 2-5 illustrates, Dynamic Directory processes SNMP requests until connection
with the NonStop agent is lost. When a request arrives, mgmt_poll() processes it, using
the next (next_file()) and locator (locate_file()) functions to re-create and navigate
through the table.
Source Code
The Dynamic Directory source code appears in the Example 2-10 and Example 2-11:
Example 2-10 shows the source code in dynamlsc.
Example 2-11 shows the source code in dirC.
Numbers in the examples correspond to comments in the discussions located between
here and the examples.
Example 2-8, earlier in this section, shows the source code in dirH.
dynamlsc The main program as well as the next and locator function definitions
dirH The definition of structures directory and file_entry
dirC The definition of other functions used by the subagent: build_files(),
insert_new_file(), comp_files(), and free_files()