diff options
Diffstat (limited to 'ASNMP/asnmp/address.cpp')
-rw-r--r-- | ASNMP/asnmp/address.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/ASNMP/asnmp/address.cpp b/ASNMP/asnmp/address.cpp index 230788e9f67..77da41ec76e 100644 --- a/ASNMP/asnmp/address.cpp +++ b/ASNMP/asnmp/address.cpp @@ -37,6 +37,8 @@ =====================================================================*/ #include "asnmp/address.h" +#include "ace/OS_String.h" +#include "ace/os_include/ctype.h" ACE_RCSID(asnmp, address, "$Id$") @@ -88,7 +90,7 @@ unsigned char& Address::operator[]( const int position) // overloaded equivlence operator, are two addresses equal? int operator==( const Address &lhs, const Address &rhs) { - if ( strcmp( (const char*) lhs, (const char*)rhs)==0) + if ( ACE_OS_String::strcmp( (const char*) lhs, (const char*)rhs)==0) return 1; else return 0; @@ -106,7 +108,7 @@ int operator!=( const Address &lhs, const Address &rhs) // overloaded > operator, is a1 > a2 int operator>( const Address &lhs, const Address &rhs) { - if ( strcmp( (const char*) lhs, (const char*)rhs)>0) + if ( ACE_OS_String::strcmp( (const char*) lhs, (const char*)rhs)>0) return 1; else return 0; @@ -136,7 +138,7 @@ int operator<=( const Address &lhs,const Address &rhs) // overloaded < operator, is a1 < a2 int operator<( const Address &lhs, const Address &rhs) { - if ( strcmp( (const char*) lhs, (const char*)rhs)<0) + if ( ACE_OS_String::strcmp( (const char*) lhs, (const char*)rhs)<0) return 1; else return 0; @@ -148,7 +150,7 @@ int operator==( const Address &lhs,const char *rhs) { if (!rhs && !lhs.valid()) return 1; - if (strcmp( (const char *) lhs, rhs)== 0) + if (ACE_OS_String::strcmp( (const char *) lhs, rhs)== 0) return 1; else return 0; @@ -167,7 +169,7 @@ int operator>( const Address &lhs,const char *rhs) { if (!rhs) return lhs.valid(); // if lhs valid then > 0, else invalid !> 0 - if (strcmp( (const char *) lhs, rhs)> 0) + if (ACE_OS_String::strcmp( (const char *) lhs, rhs)> 0) return 1; else return 0; @@ -179,7 +181,7 @@ int operator>=( const Address &lhs,const char *rhs) { if (!rhs) return 1; // always >= 0 - if (strcmp( (const char *) lhs, rhs)>= 0) + if (ACE_OS_String::strcmp( (const char *) lhs, rhs)>= 0) return 1; else return 0; @@ -191,7 +193,7 @@ int operator<( const Address &lhs,const char *rhs) { if (!rhs) return 0; // always >= 0 - if (strcmp( (const char *) lhs, rhs)< 0) + if (ACE_OS_String::strcmp( (const char *) lhs, rhs)< 0) return 1; else return 0; @@ -203,7 +205,7 @@ int operator<=( const Address &lhs,const char *rhs) { if (!rhs) return !lhs.valid(); // invalid == 0, else valid > 0 - if (strcmp( (const char *) lhs, rhs)<= 0) + if (ACE_OS_String::strcmp( (const char *) lhs, rhs)<= 0) return 1; else return 0; @@ -450,7 +452,7 @@ int IpAddress::parse_dotted_ipstring( const char *inaddr) return 0; // look for dot token separator - ip_token = strtok( (char *) temp,"."); + ip_token = ACE_OS_String::strtok( (char *) temp,"."); // while more tokens.. while ( ip_token != 0) { @@ -466,12 +468,12 @@ int IpAddress::parse_dotted_ipstring( const char *inaddr) if (( value > 0)&& ( value <=255)) address_buffer[token_count] = (unsigned char) value; else - if ( strcmp(ip_token,"0")==0) + if (ACE_OS_String::strcmp(ip_token,"0")==0) address_buffer[token_count]= (unsigned char) 0; else error_status = 1; token_count++; - ip_token = strtok( 0, "."); + ip_token = ACE_OS_String::strtok( 0, "."); } // gota be four in len |