-bool OdbxBackend::getSOA( const string& domain, SOAData& sd, DNSPacket* p )
+bool OdbxBackend::getSOA( const DNSName& domain, SOAData& sd, DNSPacket* p )
{
const char* tmp;
DLOG( L.log( m_myname + " getSOA()", Logger::Debug ) );
string stmt = getArg( "sql-lookupsoa" );
- string& stmtref = strbind( ":name", escape( toLower( domain ), READ ), stmt );
+ string& stmtref = strbind( ":name", escape( domain.toStringNoDot(), READ ), stmt );
if( !execStmt( stmtref.c_str(), stmtref.size(), READ ) ) { return false; }
if( !getRecord( READ ) ) { return false; }
if( ( tmp = odbx_field_value( m_result, 2 ) ) != NULL )
{
sd.ttl = strtoul( tmp, NULL, 10 );
- }
+ }
if( sd.serial == 0 && ( tmp = odbx_field_value( m_result, 1 ) ) != NULL )
{
-bool OdbxBackend::list( const string& target, int zoneid, bool include_disabled )
+bool OdbxBackend::list( const DNSName& target, int zoneid, bool include_disabled )
{
try
{
-void OdbxBackend::lookup( const QType& qtype, const string& qname, DNSPacket* dnspkt, int zoneid )
+void OdbxBackend::lookup( const QType& qtype, const DNSName& qname, DNSPacket* dnspkt, int zoneid )
{
try
{
stmtref = strbind( ":id", string( m_buffer, len ), stmtref );
}
- string tmp = qname;
+ string tmp = qname.toStringNoDot();
stmtref = strbind( ":name", escape( toLowerByRef( tmp ), READ ), stmtref );
if( !execStmt( stmtref.c_str(), stmtref.size(), READ ) )
return false;
}
- string tmp = rr.qname;
+ string tmp = rr.qname.toStringNoDot();
int priority=0;
string content(rr.content);
enum QueryType { READ, WRITE };
string m_myname;
- string m_qname;
+ DNSName m_qname;
int m_default_ttl;
bool m_qlog;
odbx_t* m_handle[2];
OdbxBackend( const string& suffix="" );
~OdbxBackend();
- void lookup( const QType& qtype, const string& qdomain, DNSPacket* p = 0, int zoneid = -1 );
- bool getSOA( const string& domain, SOAData& sd, DNSPacket* p );
- bool list( const string& target, int domain_id, bool include_disabled=false );
+ void lookup( const QType& qtype, const DNSName& qdomain, DNSPacket* p = 0, int zoneid = -1 );
+ bool getSOA( const DNSName& domain, SOAData& sd, DNSPacket* p );
+ bool list( const DNSName& target, int domain_id, bool include_disabled=false );
bool get( DNSResourceRecord& rr );
bool startTransaction( const string& domain, int domain_id );