]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3553] Changes after review:
authorTomek Mrugalski <tomasz@isc.org>
Wed, 14 Jan 2015 11:22:07 +0000 (12:22 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Wed, 14 Jan 2015 11:22:07 +0000 (12:22 +0100)
- copyright year updated
- comment clarified
- added @todo in Pkt::setHWAddrMember()
- getMACfromDocsis*() don't use intermediate members, will accept
  options with length 1

src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
src/bin/dhcp6/tests/hooks_unittest.cc
src/lib/dhcp/dhcp4.h
src/lib/dhcp/pkt.cc
src/lib/dhcp/pkt6.cc
src/lib/dhcp/tests/pkt_captures.h
src/lib/dhcp/tests/pkt_captures4.cc
src/lib/dhcp/tests/pkt_captures6.cc

index 489d776713087677a5a1990be419f01af76ee761..7a4cf34fc671c59c625a2f382e8a81640a964929 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2014  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2015  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -52,7 +52,6 @@
 
 using namespace isc;
 using namespace isc::data;
-//using namespace isc::config;
 using namespace isc::test;
 using namespace isc::asiolink;
 using namespace isc::dhcp;
index 20da23aabb66585c887d99682c2e00b14e20a5d2..ec1ac067a0af27b89d48ac368d60e9615f9ced9f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -39,7 +39,6 @@
 
 using namespace isc;
 using namespace isc::data;
-//using namespace isc::config;
 using namespace isc::test;
 using namespace isc::asiolink;
 using namespace isc::dhcp;
index 5b69f9df232244f4987d78c75164b9cbf793854b..c074d6ba29ff34819b551362ade74d32fb826df4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004-2011, 2014 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2011, 2014-2015 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 1995-2003 by Internet Software Consortium
  *
  * Permission to use, copy, modify, and distribute this software for any
@@ -54,7 +54,7 @@ static const uint16_t BOOTP_BROADCAST = 32768L;
 /* Possible values for hardware type (htype) field... */
 enum HType {
     HTYPE_ETHER = 1,   /* Ethernet 10Mbps */
-    HTYPE_DOCSIS = 1,  /* the traffic captures we have from cable modems as well
+    HTYPE_DOCSIS = 1,  /* The traffic captures we have from cable modems as well
                           as this list by IANA: http://www.iana.org/assignments/
                           arp-parameters/arp-parameters.xhtml suggest that
                           Ethernet (1) should be used in DOCSIS environment. */
index abb244a549759dbec475fc6c65a2ef68d22002fc..83ee05e22f4662d56f82c314169dd09370a94d43 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -129,6 +129,8 @@ HWAddrPtr
 Pkt::getMAC(uint32_t hw_addr_src) {
     HWAddrPtr mac;
 
+    /// @todo: Implement an array of method pointers instead of set of ifs
+
     // Method 1: from raw sockets.
     if (hw_addr_src & HWAddr::HWADDR_SOURCE_RAW) {
         mac = getRemoteHWAddr();
index a87d99083adffb1bcfa4913b91d5406a23da7bd7..54cb1e04831ca3fa482894a0d41a77c783f755f5 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -644,8 +644,8 @@ Pkt6::getMACFromDocsisModem() {
         return (HWAddrPtr());
     }
 
-    OptionBuffer buf = device_id->getData();
-    if (buf.size() > 1) {
+    // If the option contains any data, use it as MAC address
+    if (!device_id->getData().empty()) {
         return (HWAddrPtr(new HWAddr(device_id->getData(), HTYPE_DOCSIS)));
     } else {
         return (HWAddrPtr());
@@ -675,8 +675,8 @@ Pkt6::getMACFromDocsisCMTS() {
         return (HWAddrPtr());
     }
 
-    OptionBuffer buf = cm_mac->getData();
-    if (buf.size() > 1) {
+    // If the option contains any data, use it as MAC address
+    if (!cm_mac->getData().empty()) {
         return (HWAddrPtr(new HWAddr(cm_mac->getData(), HTYPE_DOCSIS)));
     } else {
         return (HWAddrPtr());
index 712295f5616cbd7ca458050ca6ed4f801996d3fa..f702a2d1f3839afdbb71ec9625c097a1e29d211b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -37,7 +37,7 @@ public:
     /// @return relayed DISCOVER
     static isc::dhcp::Pkt4Ptr captureRelayedDiscover2();
 
-    // see wireshark.cc for descriptions
+    // see pkt_captures6.cc for descriptions
     // The descriptions are too large and too closely related to the
     // code, so it is kept in .cc rather than traditionally in .h
     static isc::dhcp::Pkt6Ptr captureSimpleSolicit();
index ff422274aeac8a2749226a0ebdc6a731847d998d..90eedda67a128e83f0cbaafbe47cca00bffd03a1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
index b1348d67212e4b0db1f4eb69810df773ffeaa7d6..796478ca54fc173082645a1f1442b019eb3b9ada 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -18,7 +18,7 @@
 #include <dhcp/tests/pkt_captures.h>
 #include <string>
 
-/// @file   wireshark.cc
+/// @file   pkt_captures6.cc
 ///
 /// @brief  contains packet captures imported from Wireshark
 ///