Yingdi Yu | 01d1135 | 2013-10-18 17:04:19 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2013, Regents of the University of California |
| 4 | * Yingdi Yu |
| 5 | * |
| 6 | * BSD license, See the LICENSE file for more information |
| 7 | * |
| 8 | * Author: Yingdi Yu <yingdi@cs.ucla.edu> |
| 9 | */ |
| 10 | |
| 11 | #ifndef LINKNDN_DNS_STORAGE_H |
| 12 | #define LINKNDN_DNS_STORAGE_H |
| 13 | |
| 14 | #include <sqlite3.h> |
| 15 | #include <ndn.cxx/data.h> |
| 16 | |
| 17 | class DnsStorage |
| 18 | { |
| 19 | public: |
| 20 | DnsStorage(); |
| 21 | |
| 22 | ~DnsStorage(); |
| 23 | |
| 24 | void |
| 25 | updateDnsSelfProfileData(const ndn::Data& data, const ndn::Name& identity); |
| 26 | |
| 27 | void |
| 28 | updateDnsEndorseOthers(const ndn::Data& data, const ndn::Name& identity, const ndn::Name& endorsee); |
| 29 | |
| 30 | void |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame^] | 31 | updateDnsOthersEndorse(const ndn::Data& data, const ndn::Name& identity); |
Yingdi Yu | 01d1135 | 2013-10-18 17:04:19 -0700 | [diff] [blame] | 32 | |
| 33 | ndn::Ptr<ndn::Data> |
| 34 | getData(const ndn::Name& name); |
| 35 | |
| 36 | private: |
| 37 | void |
| 38 | updateDnsData(const ndn::Blob& data, const std::string& identity, const std::string& name, const std::string& type, const std::string& dataName); |
| 39 | |
| 40 | private: |
| 41 | sqlite3 *m_db; |
| 42 | }; |
| 43 | |
| 44 | #endif |