The Structure of the Sample Visual C++ ProgramThe sample program is not complex; it has a main() structure made up of just the following two lines: startupRoutine (argumentCount, argumentVector); dispatchOperation(programMode, argumentVector); The first function validates the command-line parameters and determines the program mode ( GET , SET , etc.). The second function executes the required operation. The full source code listing is included in Appendix A, "Terminal Server Serial Ports." The Supported OperationsFive operations are allowed with this manager:
The required operation is specified on the program command line. Overall, the external API provided by this program is a single function called: [View full width]
The program is invoked for a GET operation on the ipInReceives object value as follows , with a three-line response (commands typed by the user are shown in bold; system responses are delimited by angle brackets): [View full width]
The parameters for this are as follows:
The remote (or local) agent responds to the message and the data sent back to snmpmgr.exe is presented as: < SNMP Operation Type GET > < MIB Object Instance = ip.ipInReceives.0 > < Type and Value = Counter32 4929873 > The last two lines indicate the required MIB object instance and its value (in this case, the object is our old friend ipInReceives.0 and has the value 4929873). The supplied DOS batch files automate the process of running the program, freeing the user from having to type complex command lines. The batch files and their use are described in the following sections. |