# Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.

# No namespace declaration - these constants go in the global namespace
# of the libddns_messages python module.

% LIBDDNS_DATASRC_ERROR update client %1 failed due to data source error: %2
An update attempt failed due to some error in the corresponding data
source.  This is generally an unexpected event, but can still happen
for various reasons such as DB lock contention or a failure of the
backend DB server.  The cause of the error is also logged.  It's
advisable to check the message, and, if necessary, take an appropriate
action (e.g., restarting the DB server if it dies).  If this message
is logged the data source isn't modified due to the
corresponding update request.  When used by the b10-ddns, the server
will return a response with an RCODE of SERVFAIL.

% LIBDDNS_PREREQ_FORMERR update client %1 for zone %2: Format error in prerequisite (%3). Non-zero TTL.
The prerequisite with the given name, class and type is not well-formed.
The specific prerequisite is shown. In this case, it has a non-zero TTL value.
A FORMERR error response is sent to the client.

% LIBDDNS_PREREQ_FORMERR_ANY update client %1 for zone %2: Format error in prerequisite (%3). Non-zero TTL or rdata found.
The prerequisite with the given name, class and type is not well-formed.
The specific prerequisite is shown. In this case, it either has a non-zero
TTL value, or has rdata fields. A FORMERR error response is sent to the client.

% LIBDDNS_PREREQ_FORMERR_CLASS update client %1 for zone %2: Format error in prerequisite (%3). Bad class.
The prerequisite with the given name, class and type is not well-formed.
The specific prerequisite is shown. In this case, the class of the
prerequisite should either match the class of the zone in the Zone Section,
or it should be ANY or NONE, and it is not. A FORMERR error response is sent
to the client.

% LIBDDNS_PREREQ_FORMERR_NONE update client %1 for zone %2: Format error in prerequisite (%3). Non-zero TTL or rdata found.
The prerequisite with the given name, class and type is not well-formed.
The specific prerequisite is shown. In this case, it either has a non-zero
TTL value, or has rdata fields. A FORMERR error response is sent to the client.

% LIBDDNS_PREREQ_NAME_IN_USE_FAILED update client %1 for zone %2: 'Name is in use' prerequisite not satisfied (%3), rcode: %4
A DNS UPDATE prerequisite was not satisfied. The specific prerequisite that
was not satisfied is shown. The client is sent an error response with the
given rcode.
In this case, the specific prerequisite is 'Name is in use'. From RFC2136:
Name is in use.  At least one RR with a specified NAME (in
the zone and class specified by the Zone Section) must exist.
Note that this prerequisite is NOT satisfied by empty
nonterminals.

% LIBDDNS_PREREQ_NAME_NOT_IN_USE_FAILED update client %1 for zone %2: 'Name is not in use' (%3) prerequisite not satisfied, rcode: %4
A DNS UPDATE prerequisite was not satisfied. The specific prerequisite that
was not satisfied is shown. The client is sent an error response with the
given rcode.
In this case, the specific prerequisite is 'Name is not in use'.
From RFC2136:
Name is not in use.  No RR of any type is owned by a
specified NAME.  Note that this prerequisite IS satisfied by
empty nonterminals.

% LIBDDNS_PREREQ_NOTZONE update client %1 for zone %2: prerequisite not in zone (%3)
A DDNS UPDATE prerequisite has a name that does not appear to be inside
the zone specified in the Zone section of the UPDATE message.
The specific prerequisite is shown. A NOTZONE error response is sent to
the client.

% LIBDDNS_PREREQ_RRSET_DOES_NOT_EXIST_FAILED update client %1 for zone %2: 'RRset does not exist' (%3) prerequisite not satisfied, rcode: %4
A DNS UPDATE prerequisite was not satisfied. The specific prerequisite that
was not satisfied is shown. The client is sent an error response with the
given rcode.
In this case, the specific prerequisite is 'RRset does not exist'.
From RFC2136:
RRset does not exist.  No RRs with a specified NAME and TYPE
(in the zone and class denoted by the Zone Section) can exist.

% LIBDDNS_PREREQ_RRSET_EXISTS_FAILED update client %1 for zone %2: 'RRset exists (value independent)' (%3) prerequisite not satisfied, rcode: %4
A DNS UPDATE prerequisite was not satisfied. The specific prerequisite that
was not satisfied is shown. The client is sent an error response with the
given rcode.
In this case, the specific prerequisite is 'RRset exists (value independent)'.
From RFC2136:
RRset exists (value dependent).  A set of RRs with a
specified NAME and TYPE exists and has the same members
with the same RDATAs as the RRset specified here in this
Section.

% LIBDDNS_PREREQ_RRSET_EXISTS_VAL_FAILED update client %1 for zone %2: 'RRset exists (value dependent)' (%3) prerequisite not satisfied, rcode: %4
A DNS UPDATE prerequisite was not satisfied. The specific prerequisite that
was not satisfied is shown. The client is sent an error response with the
given rcode.
In this case, the specific prerequisite is 'RRset exists (value dependent)'.
From RFC2136:
RRset exists (value independent).  At least one RR with a
specified NAME and TYPE (in the zone and class specified by
the Zone Section) must exist.

% LIBDDNS_UPDATE_ADD_BAD_TYPE update client %1 for zone %2: update addition RR bad type: %3
The Update section of a DDNS update message contains a statement
that tries to add a record of an invalid type. Most likely the
record has an RRType that is considered a 'meta' type, which
cannot be zone content data. The specific record is shown.
A FORMERR response is sent back to the client.

% LIBDDNS_UPDATE_APPROVED update client %1 for zone %2 approved
Debug message.  An update request was approved in terms of the zone's
update ACL.

% LIBDDNS_UPDATE_BAD_CLASS update client %1 for zone %2: bad class in update RR: %3
The Update section of a DDNS update message contains an RRset with
a bad class. The class of the update RRset must be either the same
as the class in the Zone Section, ANY, or NONE.
A FORMERR response is sent back to the client.

% LIBDDNS_UPDATE_DATASRC_ERROR error in datasource during DDNS update: %1
An error occured while committing the DDNS update changes to the
datasource. The specific error is printed. A SERVFAIL response is sent
back to the client.

% LIBDDNS_UPDATE_DELETE_BAD_TYPE update client %1 for zone %2: update deletion RR bad type: %3
The Update section of a DDNS update message contains a statement
that tries to delete an rrset of an invalid type. Most likely the
record has an RRType that is considered a 'meta' type, which
cannot be zone content data. The specific record is shown.
A FORMERR response is sent back to the client.

% LIBDDNS_UPDATE_DELETE_NONZERO_TTL update client %1 for zone %2: update deletion RR has non-zero TTL: %3
The Update section of a DDNS update message contains a 'delete rrset'
statement with a non-zero TTL. This is not allowed by the protocol.
A FORMERR response is sent back to the client.

% LIBDDNS_UPDATE_DELETE_RRSET_NOT_EMPTY update client %1 for zone %2: update deletion RR contains data %3
The Update section of a DDNS update message contains a 'delete rrset'
statement with a non-empty RRset. This is not allowed by the protocol.
A FORMERR response is sent back to the client.

% LIBDDNS_UPDATE_DELETE_RR_BAD_TYPE update client %1 for zone %2: update deletion RR bad type: %3
The Update section of a DDNS update message contains a statement
that tries to delete one or more rrs of an invalid type. Most
likely the records have an RRType that is considered a 'meta'
type, which cannot be zone content data. The specific record is
shown. A FORMERR response is sent back to the client.

% LIBDDNS_UPDATE_DELETE_RR_NONZERO_TTL update client %1 for zone %2: update deletion RR has non-zero TTL: %3
The Update section of a DDNS update message contains a 'delete rrs'
statement with a non-zero TTL. This is not allowed by the protocol.
A FORMERR response is sent back to the client.

% LIBDDNS_UPDATE_DENIED update client %1 for zone %2 denied
Informational message.  An update request was denied because it was
rejected by the zone's update ACL.  When this library is used by
b10-ddns, the server will respond to the request with an RCODE of
REFUSED as described in Section 3.3 of RFC2136.

% LIBDDNS_UPDATE_DROPPED update client %1 for zone %2 dropped
Informational message.  An update request was denied because it was
rejected by the zone's update ACL.  When this library is used by
b10-ddns, the server will then completely ignore the request; no
response will be sent.

% LIBDDNS_UPDATE_ERROR update client %1 for zone %2: %3
Debug message.  An error is found in processing a dynamic update
request.  This log message is used for general errors that are not
normally expected to happen.  So, in general, it would mean some
problem in the client implementation or an interoperability issue
with this implementation.  The client's address, the zone name and
class, and description of the error are logged.

% LIBDDNS_UPDATE_FORWARD_FAIL update client %1 for zone %2: update forwarding not supported
Debug message.  An update request is sent to a secondary server.  This
is not necessarily invalid, but this implementation does not yet
support update forwarding as specified in Section 6 of RFC2136 and it
will simply return a response with an RCODE of NOTIMP to the client.
The client's address and the zone name/class are logged.

% LIBDDNS_UPDATE_NOTAUTH update client %1 for zone %2: not authoritative for update zone
Debug message.  An update request was received for a zone for which
the receiving server doesn't have authority.  In theory this is an
unexpected event, but there are client implementations that could send
update requests carelessly, so it may not necessarily be so uncommon
in practice.  If possible, you may want to check the implementation or
configuration of those clients to suppress the requests.  As specified
in Section 3.1 of RFC2136, the receiving server will return a response
with an RCODE of NOTAUTH.

% LIBDDNS_UPDATE_NOTZONE update client %1 for zone %2: update RR out of zone %3
A DDNS UPDATE record has a name that does not appear to be inside
the zone specified in the Zone section of the UPDATE message.
The specific update record is shown. A NOTZONE error response is
sent to the client.

% LIBDDNS_UPDATE_PREREQUISITE_FAILED prerequisite failed in update client %1 for zone %2: result code %3
The handling of the prerequisite section (RFC2136 Section 3.2) found
that one of the prerequisites was not satisfied. The result code
should give more information on what prerequisite type failed.
If the result code is FORMERR, the prerequisite section was not well-formed.
An error response with the given result code is sent back to the client.

% LIBDDNS_UPDATE_UNCAUGHT_EXCEPTION update client %1 for zone %2: uncaught exception while processing update section: %3
An uncaught exception was encountered while processing the Update
section of a DDNS message. The specific exception is shown in the log message.
To make sure DDNS service is not interrupted, this problem is caught instead
of reraised; The update is aborted, and a SERVFAIL is sent back to the client.
This is most probably a bug in the DDNS code, but *could* be caused by
the data source.
