blob: 9d6f5cddb953c9a11fb0db996158c5694e268e29 [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 NDNS_NAME_SERVER_HPP
20#define NDNS_NAME_SERVER_HPP
21
22#include <boost/asio.hpp>
23#include <boost/noncopyable.hpp>
24
25#include <ndn-cxx/face.hpp>
26#include <ndn-cxx/name.hpp>
27#include <ndn-cxx/security/key-chain.hpp>
28
29#include "zone.hpp"
30#include "db/zone-mgr.hpp"
31#include "db/rr-mgr.hpp"
32#include "query.hpp"
33#include "response.hpp"
34#include "rr.hpp"
35
36#include "ndn-app.hpp"
37
38using namespace std;
39using namespace ndn;
40
41
42namespace ndn{
43namespace ndns{
44class NameServer : public NDNApp
45{
46
47public:
48explicit
49NameServer(const char *programName, const char *prefix, const char *nameZone);
50
51void
52onInterest(const Name &name, const Interest &interest);
53
54
55void
56run();
57
58public:
59 /*
60 * the name used by the server to provide routeable accessory.
61
62 Name m_name;
63 */
64 /*
65 * the zone the server is in charge of
66 */
67 Zone m_zone;
68
69 /*
70 * to manage the m_zone; m_zoneMgr.getZone() returns the referrence of m_zone
71 */
72 ZoneMgr m_zoneMgr;
73
74};//clcass NameServer
75}//namespace ndns
76}//namespace ndn
77#endif /* NAME_SERVER_HPP_ */