diff options
Diffstat (limited to 'ACE/ASNMP')
-rw-r--r-- | ACE/ASNMP/examples/get/get.cpp | 4 | ||||
-rw-r--r-- | ACE/ASNMP/examples/get/get_async.cpp | 35 | ||||
-rw-r--r-- | ACE/ASNMP/examples/next/next.cpp | 4 | ||||
-rw-r--r-- | ACE/ASNMP/examples/set/set.cpp | 4 |
4 files changed, 26 insertions, 21 deletions
diff --git a/ACE/ASNMP/examples/get/get.cpp b/ACE/ASNMP/examples/get/get.cpp index 1829c381442..5d17cd7b7cc 100644 --- a/ACE/ASNMP/examples/get/get.cpp +++ b/ACE/ASNMP/examples/get/get.cpp @@ -190,8 +190,8 @@ int getapp::run() else { VbIter iter(pdu_); while (iter.next(vb)) { - cout << "\tOid = " << vb.to_string_oid() << "\n"; - cout << "\tValue = " << vb.to_string_value() << "\n"; + cout << "\tOid = " << vb.to_string_oid() << "\n"; + cout << "\tValue = " << vb.to_string_value() << "\n"; } } } diff --git a/ACE/ASNMP/examples/get/get_async.cpp b/ACE/ASNMP/examples/get/get_async.cpp index 163d559f58e..ebeff2a577a 100644 --- a/ACE/ASNMP/examples/get/get_async.cpp +++ b/ACE/ASNMP/examples/get/get_async.cpp @@ -194,21 +194,26 @@ void getapp::result(Snmp *, int rc) Vb vb; if (rc < 0) { - const char *ptr = snmp_.error_string(); - cout << "ASNMP:ERROR: get command failed reason: " << ptr << endl; - } else { - // check to see if there are any errors - if (pdu_.get_error_status()) { - cout << "ERROR: agent replied as follows\n"; - cout << pdu_.agent_error_reason() << endl; - } - else { - VbIter iter(pdu_); - while (iter.next(vb)) { - cout << "\tOid = " << vb.to_string_oid() << "\n"; - cout << "\tValue = " << vb.to_string_value() << "\n"; - } - } + const char *ptr = snmp_.error_string(); + cout << "ASNMP:ERROR: get command failed reason: " << ptr << endl; + } + else + { + // check to see if there are any errors + if (pdu_.get_error_status()) + { + cout << "ERROR: agent replied as follows\n"; + cout << pdu_.agent_error_reason() << endl; + } + else + { + VbIter iter(pdu_); + while (iter.next(vb)) + { + cout << "\tOid = " << vb.to_string_oid() << "\n"; + cout << "\tValue = " << vb.to_string_value() << "\n"; + } + } } cout << "\nASNMP:INFO: command completed normally.\n"<< endl; ACE_Reactor::instance()->end_reactor_event_loop(); diff --git a/ACE/ASNMP/examples/next/next.cpp b/ACE/ASNMP/examples/next/next.cpp index a246c1ce549..921439c0c21 100644 --- a/ACE/ASNMP/examples/next/next.cpp +++ b/ACE/ASNMP/examples/next/next.cpp @@ -189,8 +189,8 @@ int nextapp::run() else { VbIter iter(pdu_); while (iter.next(vb)) { - cout << "\tOid = " << vb.to_string_oid() << "\n"; - cout << "\tValue = " << vb.to_string_value() << "\n"; + cout << "\tOid = " << vb.to_string_oid() << "\n"; + cout << "\tValue = " << vb.to_string_value() << "\n"; } } } diff --git a/ACE/ASNMP/examples/set/set.cpp b/ACE/ASNMP/examples/set/set.cpp index 8cd8752f48a..4c0103bfbb8 100644 --- a/ACE/ASNMP/examples/set/set.cpp +++ b/ACE/ASNMP/examples/set/set.cpp @@ -260,8 +260,8 @@ int set::run() else { VbIter iter(pdu_); while (iter.next(vb)) { - cout << "\tOid = " << vb.to_string_oid() << "\n"; - cout << "\tValue = " << vb.to_string_value() << "\n"; + cout << "\tOid = " << vb.to_string_oid() << "\n"; + cout << "\tValue = " << vb.to_string_value() << "\n"; } } } |