Changeset 2037
- Timestamp:
- 02/17/11 14:00:15 (2 years ago)
- Location:
- trunk/pdns/pdns
- Files:
-
- 2 modified
-
dnsparser.cc (modified) (1 diff)
-
dnsparser.hh (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/dnsparser.cc
r1976 r2037 179 179 } 180 180 181 DNSRecordContent::n amemap_t& DNSRecordContent::getNamemap()182 { 183 static DNSRecordContent::n amemap_t namemap;181 DNSRecordContent::n2typemap_t& DNSRecordContent::getN2Typemap() 182 { 183 static DNSRecordContent::n2typemap_t namemap; 184 184 return namemap; 185 185 } 186 187 DNSRecordContent::t2namemap_t& DNSRecordContent::getT2Namemap() 188 { 189 static DNSRecordContent::t2namemap_t namemap; 190 return namemap; 191 } 192 186 193 187 194 DNSRecordContent::zmakermap_t& DNSRecordContent::getZmakermap() -
trunk/pdns/pdns/dnsparser.hh
r1993 r2037 32 32 #include <boost/tuple/tuple.hpp> 33 33 #include <boost/tuple/tuple_comparison.hpp> 34 #include <boost/bimap.hpp>35 34 #include "dns.hh" 36 35 #include "dnswriter.hh" … … 189 188 getZmakermap()[make_pair(cl,ty)]=z; 190 189 191 getNamemap().left.insert(make_pair(make_pair(cl,ty), name)); 190 getT2Namemap().insert(make_pair(make_pair(cl,ty), name)); 191 getN2Typemap().insert(make_pair(name, make_pair(cl,ty))); 192 192 } 193 193 … … 201 201 static uint16_t TypeToNumber(const string& name) 202 202 { 203 n amemap_t::right_const_iterator iter = getNamemap().right.find(name);204 if(iter != getN amemap().right.end())203 n2typemap_t::const_iterator iter = getN2Typemap().find(name); 204 if(iter != getN2Typemap().end()) 205 205 return iter->second.second; 206 206 … … 213 213 static const string NumberToType(uint16_t num, uint16_t classnum=1) 214 214 { 215 namemap_t::left_const_iterator iter = getNamemap().left.find(make_pair(classnum, num));216 if(iter == get Namemap().left.end())215 t2namemap_t::const_iterator iter = getT2Namemap().find(make_pair(classnum, num)); 216 if(iter == getT2Namemap().end()) 217 217 return "TYPE" + lexical_cast<string>(num); 218 218 // throw runtime_error("Unknown DNS type with numerical id "+lexical_cast<string>(num)); … … 238 238 typedef std::map<std::pair<uint16_t, uint16_t>, makerfunc_t* > typemap_t; 239 239 typedef std::map<std::pair<uint16_t, uint16_t>, zmakerfunc_t* > zmakermap_t; 240 typedef boost::bimap<std::pair<uint16_t, uint16_t>, string >namemap_t;241 240 typedef std::map<std::pair<uint16_t, uint16_t>, string > t2namemap_t; 241 typedef std::map<string, std::pair<uint16_t, uint16_t> > n2typemap_t; 242 242 static typemap_t& getTypemap(); 243 static namemap_t& getNamemap(); 243 static t2namemap_t& getT2Namemap(); 244 static n2typemap_t& getN2Typemap(); 244 245 static zmakermap_t& getZmakermap(); 245 246 };