face/rib/tools: avoid deprecate Block::fromBuffer overloads
refs #2553
Change-Id: I32ea424ab7547f59fea2fca70ad6f41cd90bab58
diff --git a/tools/nfd-autoreg.cpp b/tools/nfd-autoreg.cpp
index c6de1f5..6cc3288 100644
--- a/tools/nfd-autoreg.cpp
+++ b/tools/nfd-autoreg.cpp
@@ -284,22 +284,21 @@
std::vector<uint64_t> multicastFaces;
size_t offset = 0;
- while (offset < buf->size())
- {
- Block block;
- bool ok = Block::fromBuffer(buf, offset, block);
- if (!ok)
- {
- std::cerr << "ERROR: cannot decode FaceStatus TLV" << std::endl;
- break;
- }
-
- offset += block.size();
-
- nfd::FaceStatus faceStatus(block);
- registerPrefixesIfNeeded(faceStatus.getFaceId(), FaceUri(faceStatus.getRemoteUri()),
- faceStatus.getFacePersistency());
+ while (offset < buf->size()) {
+ bool isOk = false;
+ Block block;
+ std::tie(isOk, block) = Block::fromBuffer(buf, offset);
+ if (!isOk) {
+ std::cerr << "ERROR: cannot decode FaceStatus TLV" << std::endl;
+ break;
}
+
+ offset += block.size();
+
+ nfd::FaceStatus faceStatus(block);
+ registerPrefixesIfNeeded(faceStatus.getFaceId(), FaceUri(faceStatus.getRemoteUri()),
+ faceStatus.getFacePersistency());
+ }
}
int