mgmt: add congestion marking parameters
refs #4465
Change-Id: I5090d93b59fe3fc425e5ce529c4f66b8211155dd
diff --git a/tests/unit-tests/mgmt/nfd/control-command.t.cpp b/tests/unit-tests/mgmt/nfd/control-command.t.cpp
index 537e9ee..0cc3642 100644
--- a/tests/unit-tests/mgmt/nfd/control-command.t.cpp
+++ b/tests/unit-tests/mgmt/nfd/control-command.t.cpp
@@ -45,6 +45,8 @@
ControlParameters p2(p1);
p2.setLocalUri("tcp4://192.0.2.2:32114")
.setFacePersistency(FACE_PERSISTENCY_PERMANENT)
+ .setBaseCongestionMarkingInterval(100_ms)
+ .setDefaultCongestionThreshold(10000)
.setFlags(0x3)
.setMask(0x1);
BOOST_CHECK_NO_THROW(command.validateRequest(p1));
@@ -78,6 +80,8 @@
.setUri("tcp4://192.0.2.1:6363")
.setLocalUri("tcp4://192.0.2.2:32114")
.setFacePersistency(FACE_PERSISTENCY_PERMANENT)
+ .setBaseCongestionMarkingInterval(500_ns)
+ .setDefaultCongestionThreshold(12345)
.setFlags(0x3);
BOOST_CHECK_NO_THROW(command.validateResponse(p1));
@@ -121,6 +125,8 @@
ControlParameters p2;
p2.setFaceId(1)
.setFacePersistency(FACE_PERSISTENCY_PERSISTENT)
+ .setBaseCongestionMarkingInterval(765_ns)
+ .setDefaultCongestionThreshold(54321)
.setFlagBit(BIT_LOCAL_FIELDS_ENABLED, false);
BOOST_CHECK_NO_THROW(command.validateRequest(p2));
BOOST_CHECK_THROW(command.validateResponse(p2), ControlCommand::ArgumentError); // Mask forbidden but present
diff --git a/tests/unit-tests/mgmt/nfd/controller.t.cpp b/tests/unit-tests/mgmt/nfd/controller.t.cpp
index e9a3c4f..e80f7ea 100644
--- a/tests/unit-tests/mgmt/nfd/controller.t.cpp
+++ b/tests/unit-tests/mgmt/nfd/controller.t.cpp
@@ -76,7 +76,9 @@
.setUri("tcp4://192.0.2.1:6363")
.setLocalUri("tcp4://192.0.2.2:10847")
.setFacePersistency(ndn::nfd::FacePersistency::FACE_PERSISTENCY_PERSISTENT)
- .setFlags(0x7);
+ .setFlags(0x7)
+ .setBaseCongestionMarkingInterval(12_ns)
+ .setDefaultCongestionThreshold(10);
return resp;
}
diff --git a/tests/unit-tests/mgmt/nfd/face-status.t.cpp b/tests/unit-tests/mgmt/nfd/face-status.t.cpp
index dee1de2..0f16a12 100644
--- a/tests/unit-tests/mgmt/nfd/face-status.t.cpp
+++ b/tests/unit-tests/mgmt/nfd/face-status.t.cpp
@@ -43,6 +43,8 @@
.setFacePersistency(FACE_PERSISTENCY_ON_DEMAND)
.setLinkType(LINK_TYPE_MULTI_ACCESS)
.setExpirationPeriod(10_s)
+ .setBaseCongestionMarkingInterval(5_ns)
+ .setDefaultCongestionThreshold(7)
.setNInInterests(10)
.setNInData(200)
.setNInNacks(1)
@@ -65,16 +67,17 @@
// printf("0x%02x, ", *it);
// }
static const uint8_t expected[] = {
- 0x80, 0x61, 0x69, 0x01, 0x64, 0x72, 0x15, 0x74, 0x63, 0x70,
+ 0x80, 0x67, 0x69, 0x01, 0x64, 0x72, 0x15, 0x74, 0x63, 0x70,
0x34, 0x3a, 0x2f, 0x2f, 0x31, 0x39, 0x32, 0x2e, 0x30, 0x2e,
0x32, 0x2e, 0x31, 0x3a, 0x36, 0x33, 0x36, 0x33, 0x81, 0x16,
0x74, 0x63, 0x70, 0x34, 0x3a, 0x2f, 0x2f, 0x31, 0x39, 0x32,
0x2e, 0x30, 0x2e, 0x32, 0x2e, 0x32, 0x3a, 0x35, 0x35, 0x35,
0x35, 0x35, 0x6d, 0x02, 0x27, 0x10, 0x84, 0x01, 0x01, 0x85,
- 0x01, 0x01, 0x86, 0x01, 0x01, 0x90, 0x01, 0x0a, 0x91, 0x01,
- 0xc8, 0x97, 0x01, 0x01, 0x92, 0x02, 0x0b, 0xb8, 0x93, 0x01,
- 0x04, 0x98, 0x01, 0x02, 0x94, 0x04, 0x4f, 0x41, 0xe7, 0x7b,
- 0x95, 0x04, 0x3b, 0x8d, 0x37, 0x30, 0x6c, 0x01, 0x07,
+ 0x01, 0x01, 0x86, 0x01, 0x01, 0x87, 0x01, 0x05, 0x88, 0x01,
+ 0x07, 0x90, 0x01, 0x0a, 0x91, 0x01, 0xc8, 0x97, 0x01, 0x01,
+ 0x92, 0x02, 0x0b, 0xb8, 0x93, 0x01, 0x04, 0x98, 0x01, 0x02,
+ 0x94, 0x04, 0x4f, 0x41, 0xe7, 0x7b, 0x95, 0x04, 0x3b, 0x8d,
+ 0x37, 0x30, 0x6c, 0x01, 0x07,
};
BOOST_CHECK_EQUAL_COLLECTIONS(expected, expected + sizeof(expected),
wire.begin(), wire.end());
@@ -106,6 +109,8 @@
" FaceScope: non-local,\n"
" FacePersistency: persistent,\n"
" LinkType: point-to-point,\n"
+ " BaseCongestionMarkingInterval: 0 nanoseconds,\n"
+ " DefaultCongestionThreshold: 0 bytes,\n"
" Flags: 0x0,\n"
" Counters: {Interests: {in: 0, out: 0},\n"
" Data: {in: 0, out: 0},\n"
@@ -122,6 +127,8 @@
" FaceScope: local,\n"
" FacePersistency: on-demand,\n"
" LinkType: multi-access,\n"
+ " BaseCongestionMarkingInterval: 5 nanoseconds,\n"
+ " DefaultCongestionThreshold: 7 bytes,\n"
" Flags: 0x7,\n"
" Counters: {Interests: {in: 10, out: 3000},\n"
" Data: {in: 200, out: 4},\n"