Update validation related codes to security v2
Change-Id: I5467b87092820666c04f22623f0f1665ce9a1194
diff --git a/tools/ndns-add-rr.cpp b/tools/ndns-add-rr.cpp
index 23f5b90..e4047e2 100644
--- a/tools/ndns-add-rr.cpp
+++ b/tools/ndns-add-rr.cpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2014-2017, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
@@ -129,7 +129,8 @@
std::cerr << "Error: type must be specified" << std::endl;
return 1;
}
- } else {
+ }
+ else {
if (vm.count("resign")) {
needResign = true;
}
@@ -145,7 +146,7 @@
Name zoneName(zoneStr);
Name label(rrLabelStr);
name::Component type(rrTypeStr);
- ndn::KeyChain keyChain;
+ KeyChain keyChain;
time::seconds ttl;
if (ttlInt == -1)
@@ -179,17 +180,18 @@
Rrset rrset;
if (type == label::NS_RR_TYPE) {
- ndn::Link::DelegationSet delegations;
+ ndn::DelegationList delegations;
for (const auto& i : content) {
std::vector<string> data;
boost::split(data, i, boost::is_any_of(","));
- uint32_t priority = boost::lexical_cast<uint32_t>(data[0]);
- delegations.insert(std::make_pair(priority, data[1]));
+ uint64_t priority = boost::lexical_cast<uint64_t>(data[0]);
+ delegations.insert(priority, Name(data[1]));
}
rrset = rrsetFactory.generateNsRrset(label, type,
version, ttl, delegations);
- } else if (type == label::TXT_RR_TYPE) {
+ }
+ else if (type == label::TXT_RR_TYPE) {
rrset = rrsetFactory.generateTxtRrset(label, type,
version, ttl, content);
}
@@ -199,7 +201,8 @@
if (label.size() > 1) {
NDNS_LOG_TRACE("add multi-level label Rrset, using the same TTL as the Rrset");
tool.addMultiLevelLabelRrset(rrset, rrsetFactory, ttl);
- } else {
+ }
+ else {
tool.addRrset(rrset);
}
}