diff options
author | dhinton <dhinton@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-08-24 19:13:15 +0000 |
---|---|---|
committer | dhinton <dhinton@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-08-24 19:13:15 +0000 |
commit | e52e5f8e343c03ddf9ee67a8559f5203a0f22356 (patch) | |
tree | e403c1364507d63685d72b22654a033420b89f38 /ASNMP/examples/walk/walk.cpp | |
parent | 6b82e03ef4fcc60e5ab57bd9fac65dc001323cf8 (diff) | |
download | ATCD-e52e5f8e343c03ddf9ee67a8559f5203a0f22356.tar.gz |
ChangeLogTag:Sun Aug 24 19:04:23 UTC 2003 Don Hinton <dhinton@dresystems.com>
Diffstat (limited to 'ASNMP/examples/walk/walk.cpp')
-rw-r--r-- | ASNMP/examples/walk/walk.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ASNMP/examples/walk/walk.cpp b/ASNMP/examples/walk/walk.cpp index 620783484f2..91f3721f3fa 100644 --- a/ASNMP/examples/walk/walk.cpp +++ b/ASNMP/examples/walk/walk.cpp @@ -190,13 +190,13 @@ int MibIter::next(Vb& vb, char *& reason) } if (rc != SNMP_CLASS_SUCCESS) { - reason = snmp_->error_string(); + reason = const_cast <char*> (snmp_->error_string()); return 0; } // 2. check for problems if (pdu_.get_error_status()) { - reason = pdu_.agent_error_reason(); + reason = const_cast <char*> (pdu_.agent_error_reason()); return 0; } @@ -231,11 +231,10 @@ int walkapp::run() " WALK SAMPLE PROGRAM \nOID: " << oid_.to_string() << "\n"; target_.get_address(address_); // target updates port used int rc; - char *name = address_.resolve_hostname(rc); - if (rc) - name = "<< did not resolve via gethostbyname() >>"; + const char *name = address_.resolve_hostname(rc); - cout << "Device: " << address_ << " " << name << "\n"; + cout << "Device: " << address_ << " "; + cout << (rc ? "<< did not resolve via gethostbyname() >>" : name) << "\n"; cout << "[ Retries=" << target_.get_retry() << " \ Timeout=" << target_.get_timeout() <<" ms " << "Community=" << \ community_.to_string() << " ]"<< endl; |