summaryrefslogtreecommitdiff
path: root/ASNMP/asnmp
diff options
context:
space:
mode:
authormrm <mrm@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-08-20 04:19:40 +0000
committermrm <mrm@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-08-20 04:19:40 +0000
commite86d11408626fcbc6a88879e4f0cba7229af9f01 (patch)
tree852cca618556042c22f9b11dec0bae5b2dc40585 /ASNMP/asnmp
parenta513e2032f2da30392becc11a246e994528fa2e3 (diff)
downloadATCD-e86d11408626fcbc6a88879e4f0cba7229af9f01.tar.gz
renamed is_arpa() to is_private()
Diffstat (limited to 'ASNMP/asnmp')
-rw-r--r--ASNMP/asnmp/address.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/ASNMP/asnmp/address.cpp b/ASNMP/asnmp/address.cpp
index e8081eea4f0..05b7f1e2459 100644
--- a/ASNMP/asnmp/address.cpp
+++ b/ASNMP/asnmp/address.cpp
@@ -316,21 +316,35 @@ int IpAddress::is_multicast() const
return FALSE;
}
-// The old ARPA net used 10.x.x.x. But now it is not assignable in the Internet
-// even though it is no longer used. Some companies use it
-// internally and apply NAT to allow translation instead of paying for
-// ip networks. Cisco IOS can provide NAT or Network Address Translation
+// Private addressess not are not assignable in the Internet, they are
+// defined in RFC 1597 as: 10, 172.16, and 192.168.0
+// Some companies use them internally and apply NAT to allow translation
+// instead of paying for ip networks.
+// Cisco IOS devices can provide NAT aka Network Address Translation
// but don't expect SNMP based networks to handle cross-NAT address spaces.
// assumes storage in network byte order mrm@cisco.com 7/28/97
-int IpAddress::is_arpanet() const
+int IpAddress::is_private() const
{
if (valid()) {
- return (address_buffer[0] == 10);
+ if (address_buffer[0] == 10)
+ return TRUE;
+ if (address_buffer[0] == 172 && address_buffer[1] == 16)
+ return TRUE;
+ if (address_buffer[0] == 192 && address_buffer[1] == 168 &&
+ address_buffer[2] == 0)
+ return TRUE;
}
return FALSE;
}
+ // convert address into octet string format in network byte order
+void IpAddress::to_octet(OctetStr& octet) const
+{
+
+}
+
+
int IpAddress::is_broadcast() const
{
if (valid()) {