mgmt: Add addDelegatedRrset to automatically create AUTH records

Change-Id: I4d87ca52d3d176a8541236ec31526f1ca6033e34
diff --git a/tools/ndns-add-rr.cpp b/tools/ndns-add-rr.cpp
index 2ec81aa..4e0a757 100644
--- a/tools/ndns-add-rr.cpp
+++ b/tools/ndns-add-rr.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016, Regents of the University of California.
+ * Copyright (c) 2014-2017, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -30,6 +30,8 @@
 
 #include <string>
 
+NDNS_LOG_INIT("AddRrTool")
+
 int
 main(int argc, char* argv[])
 {
@@ -159,7 +161,13 @@
     }
 
     ndn::ndns::ManagementTool tool(db, keyChain);
-    tool.addRrset(rrset);
+
+    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 {
+      tool.addRrset(rrset);
+    }
 
     /// @todo Report success or failure
     //        May be also show the inserted record in ndns-list-zone format