blob: 475cf260029d82f56f8b986c795647ec2fb0fe9c [file] [log] [blame]
shockjianga5ae48c2014-07-27 23:21:41 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (c) 2014, Regents of the University of California.
4 *
5 * This file is part of NDNS (Named Data Networking Domain Name Service).
6 * See AUTHORS.md for complete list of NDNS authors and contributors.
7 *
8 * NDNS is free software: you can redistribute it and/or modify it under the terms
9 * of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
11 *
12 * NDNS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * NDNS, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18 */
19#ifndef NAME_DIG_HPP_
20#define NAME_DIG_HPP_
21
22#include "ndn-app.hpp"
23#include "rr.hpp"
24#include "response.hpp"
25#include "query.hpp"
26
27namespace ndn {
28namespace ndns {
29
30class NameDig: public NDNApp {
31public:
32 NameDig(const char *programName, const char *prefix);
33 virtual ~NameDig();
34
35 void
36 onData(const ndn::Interest& interest, Data& data);
37
38
39 void
40 onTimeout(const ndn::Interest& interest);
41
42 void
43 sendQuery();
44
45 void
46 run();
47
48 const vector<RR>& getRrs() const {
49 return m_rrs;
50 }
51
52 void setRrs(const vector<RR>& rrs) {
53 m_rrs = rrs;
54 }
55
56 const Name& getResolverName() const {
57 return m_resolverName;
58 }
59
60 void setResolverName(const Name& resolverName) {
61 m_resolverName = resolverName;
62 }
63
64
65
66 const Name& getDstLabel() const {
67 return m_dstLabel;
68 }
69
70 void setDstLabel(const Name& dstLabel) {
71 m_dstLabel = dstLabel;
72 }
73
74 RR::RRType getRrType() const {
75 return m_rrType;
76 }
77
78 void setRrType(RR::RRType rrType) {
79 m_rrType = rrType;
80 }
81
82private:
83 Name m_resolverName;
84 Name m_dstLabel;
85 RR::RRType m_rrType;
86 vector<RR> m_rrs;
87};
88
89} /* namespace ndns */
90} /* namespace ndn */
91
92#endif /* NAME_DIG_HPP_ */