1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
// $Id: DB2Backend.hh 477 2005-09-03 18:15:37Z ahu $
#ifndef DB2BACKEND_HH
#define DB2BACKEND_HH
#include <string>
#include <map>
using namespace std;
#include <sqlcli1.h>
class DB2Backend : public DNSBackend
{
public:
DB2Backend(const string &suffix = "");
~DB2Backend();
void lookup(const QType &, const string &qdomain, DNSPacket *p = 0, int zoneId = -1);
bool list(int inZoneId);
bool get(DNSResourceRecord& outRecord);
bool getSOA(const string &name, SOAData &soadata);
static DNSBackend *maker();
private:
void Cleanup();
private:
// Handles
SQLHANDLE mConnection;
SQLHANDLE mEnvironment;
SQLHANDLE mStatements[6];
bool mStatementStates[6];
SQLHANDLE mSoaStatement;
SQLHANDLE mCurrentStatement;
// Parameters
char mParamName[256];
char mParamNameLength;
char mParamType[256];
char mParamTypeLength;
int mParamZoneId;
int mParamZoneIdLength;
// Columns
char mResultContent[256];
SQLINTEGER mResultContentIndicator;
int mResultTimeToLive;
SQLINTEGER mResultTimeToLiveIndicator;
int mResultPriority;
SQLINTEGER mResultPriorityIndicator;
char mResultType[256];
SQLINTEGER mResultTypeIndicator;
int mResultZoneId;
SQLINTEGER mResultZoneIdIndicator;
int mResultChangeDate;
SQLINTEGER mResultChangeDateIndicator;
char mResultName[256];
SQLINTEGER mResultNameIndicator;
// SOA Parameters
char mSoaParamName[256];
// SOA Result
int mSoaResultZoneId;
SQLINTEGER mSoaResultZoneIdIndicator;
char mSoaResultNameserver[256];
SQLINTEGER mSoaResultNameserverIndicator;
char mSoaResultHostmaster[256];
SQLINTEGER mSoaResultHostmasterIndicator;
int mSoaResultSerial;
SQLINTEGER mSoaResultSerialIndicator;
};
#endif /* DB2BACKEND_HH */
|