def end_protocol(self):
        """End protocol definition."""
        protocol = self._get_message_template()
        self._protocols[protocol.name] = protocol
        self._protocol_in_progress = False