40 static const char* adapter_str =
"adapter";
59 ods_log_error(
"[%s] unable to create adapter: allocator_strdup() " 60 "failed", adapter_str);
65 switch(adapter->
type) {
72 ods_log_error(
"[%s] unable to create adapter: " 73 "dnsin_create() failed", adapter_str);
80 ods_log_error(
"[%s] unable to create adapter: " 81 "dnsout_create() failed", adapter_str);
103 ods_status status = ODS_STATUS_OK;
106 return ODS_STATUS_ASSERT_ERR;
109 switch(adapter->
type) {
113 ods_log_assert(adapter->
config);
118 if (status == ODS_STATUS_OK) {
119 ods_log_assert(dnsin);
120 }
else if (status != ODS_STATUS_UNCHANGED) {
123 return ODS_STATUS_OK;
128 if (status == ODS_STATUS_OK) {
129 ods_log_assert(dnsout);
130 }
else if (status != ODS_STATUS_UNCHANGED) {
138 return ODS_STATUS_OK;
150 ods_log_error(
"[%s] unable to read zone: no input adapter",
152 return ODS_STATUS_ASSERT_ERR;
157 ods_log_verbose(
"[%s] read zone %s from file input adapter %s",
161 ods_log_verbose(
"[%s] read zone %s from dns input adapter %s",
165 ods_log_error(
"[%s] unable to read zone %s from adapter: unknown " 166 "adapter", adapter_str, zone->
name);
167 return ODS_STATUS_ERR;
170 return ODS_STATUS_ERR;
182 ods_log_error(
"[%s] unable to write zone: no output adapter",
184 return ODS_STATUS_ASSERT_ERR;
186 ods_log_assert(zone->
name);
191 ods_log_verbose(
"[%s] write zone %s serial %u to output file " 192 "adapter %s", adapter_str, zone->
name,
198 ods_log_error(
"[%s] unable to write zone %s to adapter: unknown " 199 "adapter", adapter_str, zone->
name);
200 return ODS_STATUS_ERR;
203 return ODS_STATUS_ERR;
240 switch(adapter->
type) {
int adapter_compare(adapter_type *a1, adapter_type *a2)
void dnsout_cleanup(dnsout_type *addns)
ods_status adapter_load_config(adapter_type *adapter)
adapter_type * adoutbound
ods_status adfile_read(void *zone)
void dnsin_cleanup(dnsin_type *addns)
ods_status adfile_write(void *zone, const char *filename)
time_t config_last_modified
adapter_type * adapter_create(const char *str, adapter_mode type, unsigned in)
ods_status adapter_write(zone_type *zone)
ods_status addns_read(void *zone)
enum adapter_mode_enum adapter_mode
ods_status dnsout_update(dnsout_type **addns, const char *filename, time_t *last_mod)
ods_status addns_write(void *zone)
dnsin_type * dnsin_create(void)
ods_status dnsin_update(dnsin_type **addns, const char *filename, time_t *last_mod)
void adapter_cleanup(adapter_type *adapter)
ods_status adapter_read(zone_type *zone)
dnsout_type * dnsout_create(void)