local_zone_data.h 2.3 KB
 zhanglikun committed Jan 21, 2011 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ``````// Copyright (C) 2010 Internet Systems Consortium, Inc. ("ISC") // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above // copyright notice and this permission notice appear in all copies. // // THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. `````` Mukund Sivaraman committed Oct 25, 2012 15 16 ``````#ifndef LOCAL_ZONE_DATA #define LOCAL_ZONE_DATA `````` zhanglikun committed Jan 21, 2011 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 `````` #include #include #include #include namespace isc { namespace cache { /// \brief Local Zone Data /// The object of LocalZoneData represents the data of one /// local zone. It provides the interface for lookup the rrsets /// in the zone. class LocalZoneData { public: `````` JINMEI Tatuya committed Feb 21, 2013 32 33 34 35 36 37 `````` /// \brief Constructor. /// /// The passed parameter is expected to be an RR class value, but is not /// currently unused. And this library will be quite likely to /// deprecated anyway, so we don't touch it heavily. LocalZoneData(uint16_t) {} `````` zhanglikun committed Jan 21, 2011 38 39 `````` /// \brief Look up one rrset. `````` Jelte Jansen committed Feb 10, 2011 40 41 42 43 `````` /// /// \param qname The query name to look up /// \param qtype The query type to look up /// \return return the shared_ptr of rrset if it is `````` zhanglikun committed Jan 21, 2011 44 `````` /// found in the local zone, or else, return NULL. `````` zhanglikun committed Jan 23, 2011 45 46 47 `````` isc::dns::RRsetPtr lookup(const isc::dns::Name& qname, const isc::dns::RRType& qtype); `````` Jelte Jansen committed Feb 10, 2011 48 49 50 51 52 53 `````` /// \brief Update the rrset in the local zone. /// /// If the rrset doesn't exist, it will be added. /// Otherwise, the existed one will be overwritten. /// /// \param rrset The rrset to update `````` Stephen Morris committed Jan 31, 2012 54 `````` void update(const isc::dns::AbstractRRset& rrset); `````` zhanglikun committed Jan 21, 2011 55 56 `````` private: `````` zhanglikun committed Jan 23, 2011 57 `````` std::map rrsets_map_; // RRsets of the zone `````` zhanglikun committed Jan 21, 2011 58 59 ``````}; `````` zhanglikun committed Jan 23, 2011 60 61 62 ``````typedef boost::shared_ptr LocalZoneDataPtr; typedef boost::shared_ptr ConstLocalZoneDataPtr; `````` zhanglikun committed Jan 21, 2011 63 64 65 ``````} // namespace cache } // namespace isc `````` Mukund Sivaraman committed Oct 25, 2012 66 ``````#endif // LOCAL_ZONE_DATA `````` zhanglikun committed Jan 21, 2011 67