Parcourir la source

[2325] Option6IA::setIAID() implemented.

Tomek Mrugalski il y a 12 ans
Parent
commit
cacc927a70
2 fichiers modifiés avec 10 ajouts et 2 suppressions
  1. 7 2
      src/lib/dhcp/option6_ia.h
  2. 3 0
      src/lib/dhcp/tests/option6_ia_unittest.cc

+ 7 - 2
src/lib/dhcp/option6_ia.h

@@ -68,12 +68,17 @@ public:
     /// Sets T1 timer.
     ///
     /// @param t1 t1 value to be set
-    void setT1(uint32_t t1) { t1_=t1; }
+    void setT1(uint32_t t1) { t1_ = t1; }
 
     /// Sets T2 timer.
     ///
     /// @param t2 t2 value to be set
-    void setT2(uint32_t t2) { t2_=t2; }
+    void setT2(uint32_t t2) { t2_ = t2; }
+
+    /// Sets Identity Association Identifier.
+    ///
+    /// @param iaid IAID value to be set
+    void setIAID(uint32_t iaid) { iaid_ = iaid; }
 
     /// Returns IA identifier.
     ///

+ 3 - 0
src/lib/dhcp/tests/option6_ia_unittest.cc

@@ -119,6 +119,9 @@ TEST_F(Option6IATest, simple) {
     EXPECT_EQ(2345, ia->getT1());
     EXPECT_EQ(3456, ia->getT2());
 
+    ia->setIAID(890);
+    EXPECT_EQ(890, ia->getIAID());
+
     EXPECT_NO_THROW(
         delete ia;
     );