| 144 | |
| 145 | |
| 146 | class SecurityDatabase : public VSecDb |
| 147 | { |
| 148 | public: |
| 149 | bool lookup(void* inMsg, void* outMsg) override; |
| 150 | |
| 151 | bool test() override |
| 152 | { |
| 153 | return fb_ping(status, &lookup_db) == FB_SUCCESS; |
| 154 | } |
| 155 | |
| 156 | // This 2 are needed to satisfy temporarily different calling requirements |
| 157 | static int shutdown(const int, const int, void*) |
| 158 | { |
| 159 | return instances->shutdown(); |
| 160 | } |
| 161 | static void cleanup() |
| 162 | { |
| 163 | instances->shutdown(); |
| 164 | } |
| 165 | |
| 166 | SecurityDatabase(const char* secDbName) |
| 167 | : lookup_db(0), lookup_req(0) |
| 168 | { |
| 169 | prepare(secDbName); |
| 170 | } |
| 171 | |
| 172 | private: |
| 173 | ISC_STATUS_ARRAY status; |
| 174 | |
| 175 | isc_db_handle lookup_db; |
| 176 | isc_req_handle lookup_req; |
| 177 | |
| 178 | ~SecurityDatabase(); |
| 179 | |
| 180 | void prepare(const char* secDbName); |
| 181 | void checkStatus(const char* callName, ISC_STATUS userError = isc_psw_db_error); |
| 182 | }; |
| 183 | |
| 184 | /****************************************************************************** |
| 185 | * |