"item_optional": true, "item_default": "memory"
}
]
+ },
+ {
+ "command_name": "start_ddns_forwarder",
+ "command_description": "(Re)start internal forwarding of DDNS Update packets.",
+ "command_args": []
+ },
+ {
+ "command_name": "stop_ddns_forwarder",
+ "command_description": "Stop internal forwarding of DDNS Update packets",
+ "command_args": []
}
],
"statistics": [
// Successfully initialized.
LOG_INFO(auth_logger, AUTH_SERVER_STARTED);
+
+ // Ping any interested module that (a new) auth is up
+ cc_session->group_sendmsg(isc::config::createCommand("auth_started"), "DDNS");
io_service.run();
} catch (const std::exception& ex) {
# Outstanding TCP context: fileno=>(context_obj, dst)
self._tcp_ctxs = {}
+ # Notify Auth server that DDNS update packets can now be forwarded
+ self.__notify_start_forwarder()
+
class InternalError(Exception):
'''Exception for internal errors in an update session.
logger.info(DDNS_RECEIVED_SHUTDOWN_COMMAND)
self.trigger_shutdown()
answer = create_answer(0)
+ elif cmd == "auth_started":
+ self.__notify_start_forwarder()
+ answer = None
else:
answer = create_answer(1, "Unknown command: " + str(cmd))
return answer
Do NOT call this to initialize shutdown, use trigger_shutdown().
'''
+ # tell Auth not to forward UPDATE packets anymore
+ self.__notify_stop_forwarder()
# tell the ModuleCCSession to send a message that this module is
# stopping.
self._cc.send_stopping()
return True
+ def __notify_start_forwarder(self):
+ '''Notify auth that DDNS Update packets can now be forwarded'''
+ seq = self._cc._session.group_sendmsg(create_command("start_ddns_forwarder"),
+ AUTH_MODULE_NAME)
+ answer, _ = self._cc._session.group_recvmsg(False, seq)
+ rcode, error_msg = parse_answer(answer)
+ if (rcode != 0):
+ raise Exception(error_msg)
+
+ def __notify_stop_forwarder(self):
+ '''Notify auth that DDNS Update packets can now be forwarded'''
+ seq = self._cc._session.group_sendmsg(create_command("stop_ddns_forwarder"),
+ AUTH_MODULE_NAME)
+ answer, _ = self._cc._session.group_recvmsg(False, seq)
+ rcode, error_msg = parse_answer(answer)
+ if (rcode != 0):
+ raise Exception(error_msg)
+
def __notify_auth(self, zname, zclass):
'''Notify auth of the update, if necessary.'''
msg = auth_loadzone_command(self._cc, zname, zclass)
# Test 8
# Known issue: after shutdown, first new attempt results in SERVFAIL
When I use DDNS to set the SOA serial to 1238
- The DDNS response should be SERVFAIL
- And the SOA serial for example.org should be 1237
+ The DDNS response should be SUCCESS
+ And the SOA serial for example.org should be 1238
- When I use DDNS to set the SOA serial to 1238
+ When I use DDNS to set the SOA serial to 1239
And wait for new bind10 stderr message AUTH_LOAD_ZONE
The DDNS response should be SUCCESS
- And the SOA serial for example.org should be 1238
+ And the SOA serial for example.org should be 1239
# Test 9
When I send bind10 the command Auth shutdown
And wait for new bind10 stderr message AUTH_SERVER_STARTED
# Test 10
- When I use DDNS to set the SOA serial to 1239
+ When I use DDNS to set the SOA serial to 1240
And wait for new bind10 stderr message AUTH_LOAD_ZONE
The DDNS response should be SUCCESS
- And the SOA serial for example.org should be 1239
+ And the SOA serial for example.org should be 1240
# Test 11
When I configure BIND10 to stop running DDNS
bind10 module DDNS should not be running
# Test 12
- When I use DDNS to set the SOA serial to 1240
+ When I use DDNS to set the SOA serial to 1241
# should this be REFUSED again?
The DDNS response should be NOTIMP
- And the SOA serial for example.org should be 1239
+ And the SOA serial for example.org should be 1240
Scenario: ACL
Given I have bind10 running with configuration ddns/ddns.config