Commit 0759316c authored by Daniel Salzman's avatar Daniel Salzman

libs: remove unused error codes

parent fd346d4b
......@@ -34,7 +34,6 @@ static const error_message_t ERROR_MESSAGES[] = {
{ DNSSEC_ERROR, "unspecified error" },
{ DNSSEC_NOT_IMPLEMENTED_ERROR, "not implemented" },
{ DNSSEC_MALFORMED_DATA, "malformed data" },
{ DNSSEC_OUT_OF_RANGE, "value out of range" },
{ DNSSEC_NOT_FOUND, "not found" },
{ DNSSEC_PKCS8_IMPORT_ERROR, "PKCS #8 import error" },
......@@ -63,10 +62,6 @@ static const error_message_t ERROR_MESSAGES[] = {
{ DNSSEC_INVALID_DS_ALGORITHM, "invalid DS algorithm" },
{ DNSSEC_DS_HASHING_ERROR, "DS hashing error" },
{ DNSSEC_CONFIG_MALFORMED, "malformed config value" },
{ DNSSEC_CONFIG_INVALID_KEY_ID, "invalid key ID in config" },
{ DNSSEC_KEYSTORE_INVALID_BACKEND, "invalid KASP keystore backend" },
{ DNSSEC_KEYSTORE_INVALID_CONFIG, "invalid KASP keystore configuration" },
{ DNSSEC_P11_FAILED_TO_LOAD_MODULE, "failed to load PKCS #11 module" },
......
......@@ -55,7 +55,6 @@ enum dnssec_error {
DNSSEC_ERROR = DNSSEC_ERROR_MIN,
DNSSEC_NOT_IMPLEMENTED_ERROR,
DNSSEC_MALFORMED_DATA,
DNSSEC_OUT_OF_RANGE,
DNSSEC_NOT_FOUND,
DNSSEC_PKCS8_IMPORT_ERROR,
......@@ -84,10 +83,6 @@ enum dnssec_error {
DNSSEC_INVALID_DS_ALGORITHM,
DNSSEC_DS_HASHING_ERROR,
DNSSEC_CONFIG_MALFORMED,
DNSSEC_CONFIG_INVALID_KEY_ID,
DNSSEC_KEYSTORE_INVALID_BACKEND,
DNSSEC_KEYSTORE_INVALID_CONFIG,
DNSSEC_P11_FAILED_TO_LOAD_MODULE,
......
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2018 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -49,43 +49,30 @@ enum knot_error {
/* General errors. */
KNOT_ERROR = KNOT_ERROR_MIN,
KNOT_ENOTRUNNING,
KNOT_EPARSEFAIL,
KNOT_ESEMCHECK,
KNOT_EEXPIRED,
KNOT_EUPTODATE,
KNOT_EFEWDATA,
KNOT_ESPACE,
KNOT_EMALF,
KNOT_ECRYPTO,
KNOT_ENSEC3PAR,
KNOT_ENSEC3CHAIN,
KNOT_EOUTOFZONE,
KNOT_EHASH,
KNOT_EZONEINVAL,
KNOT_EZONENOENT,
KNOT_ENOZONE,
KNOT_ENONODE,
KNOT_ENORECORD,
KNOT_ENOMASTER,
KNOT_EDNAMEPTR,
KNOT_EPAYLOAD,
KNOT_EPREREQ,
KNOT_ETTL,
KNOT_ENOXFR,
KNOT_ENOIXFR,
KNOT_EXFRREFUSED,
KNOT_EDENIED,
KNOT_ECONN,
KNOT_ETIMEOUT,
KNOT_EIXFRSPACE,
KNOT_ECNAME,
KNOT_ENODIFF,
KNOT_EDSDIGESTLEN,
KNOT_ENOTSIG,
KNOT_ELIMIT,
KNOT_EZONESIZE,
KNOT_EWRITABLE,
KNOT_EOF,
KNOT_ESYSTEM,
KNOT_EFILE,
......@@ -115,11 +102,6 @@ enum knot_error {
KNOT_TSIG_EBADTIME,
KNOT_TSIG_EBADTRUNC,
/* Key parsing errors. */
KNOT_KEY_EPUBLIC_KEY_OPEN,
KNOT_KEY_EPRIVATE_KEY_OPEN,
KNOT_KEY_EPUBLIC_KEY_INVALID,
/* DNSSEC errors. */
KNOT_DNSSEC_EMISSINGKEYTYPE,
KNOT_DNSSEC_ENOKEY,
......
......@@ -49,43 +49,30 @@ static const struct error errors[] = {
/* General errors. */
{ KNOT_ERROR, "failed" },
{ KNOT_ENOTRUNNING, "resource is not running" },
{ KNOT_EPARSEFAIL, "parser failed" },
{ KNOT_ESEMCHECK, "semantic check" },
{ KNOT_EEXPIRED, "resource is expired" },
{ KNOT_EUPTODATE, "zone is up-to-date" },
{ KNOT_EFEWDATA, "not enough data to parse" },
{ KNOT_ESPACE, "not enough space provided" },
{ KNOT_EMALF, "malformed data" },
{ KNOT_ECRYPTO, "error in crypto library" },
{ KNOT_ENSEC3PAR, "missing or wrong NSEC3PARAM record" },
{ KNOT_ENSEC3CHAIN, "missing or wrong NSEC3 chain in the zone" },
{ KNOT_EOUTOFZONE, "name does not belong to the zone" },
{ KNOT_EHASH, "error in hash table" },
{ KNOT_EZONEINVAL, "invalid zone file" },
{ KNOT_EZONENOENT, "zone file not found" },
{ KNOT_ENOZONE, "no such zone found" },
{ KNOT_ENONODE, "no such node in zone found" },
{ KNOT_ENORECORD, "no such record in zone found" },
{ KNOT_ENOMASTER, "no usable master" },
{ KNOT_EDNAMEPTR, "domain name pointer larger than allowed" },
{ KNOT_EPAYLOAD, "invalid EDNS payload size" },
{ KNOT_EPREREQ, "UPDATE prerequisity not met" },
{ KNOT_ETTL, "TTL mismatch" },
{ KNOT_ENOXFR, "transfer was not sent" },
{ KNOT_ENOIXFR, "transfer is not IXFR (is in AXFR format)" },
{ KNOT_EXFRREFUSED, "zone transfer refused by the server" },
{ KNOT_EDENIED, "not allowed" },
{ KNOT_ECONN, "connection reset" },
{ KNOT_ETIMEOUT, "connection timeout" },
{ KNOT_EIXFRSPACE, "IXFR reply did not fit in" },
{ KNOT_ECNAME, "CNAME loop found in zone" },
{ KNOT_ENODIFF, "cannot create zone diff" },
{ KNOT_EDSDIGESTLEN, "DS digest length does not match digest type" },
{ KNOT_ENOTSIG, "expected a TSIG or SIG(0)" },
{ KNOT_ELIMIT, "exceeded response rate limit" },
{ KNOT_EZONESIZE, "zone size exceeded" },
{ KNOT_EWRITABLE, "file is not writable" },
{ KNOT_EOF, "end of file" },
{ KNOT_ESYSTEM, "system error" },
{ KNOT_EFILE, "file error" },
......@@ -115,11 +102,6 @@ static const struct error errors[] = {
{ KNOT_TSIG_EBADTIME, "TSIG out of time window" },
{ KNOT_TSIG_EBADTRUNC, "TSIG bad truncation" },
/* Key parsing errors. */
{ KNOT_KEY_EPUBLIC_KEY_OPEN, "cannot open public key file" },
{ KNOT_KEY_EPRIVATE_KEY_OPEN, "cannot open private key file" },
{ KNOT_KEY_EPUBLIC_KEY_INVALID, "public key file is invalid" },
/* DNSSEC errors. */
{ KNOT_DNSSEC_ENOKEY, "no keys for signing" },
{ KNOT_DNSSEC_EMISSINGKEYTYPE, "missing active KSK or ZSK" },
......@@ -182,8 +164,6 @@ int knot_error_from_libdnssec(int libdnssec_errcode)
return KNOT_ERROR;
case DNSSEC_MALFORMED_DATA:
return KNOT_EMALF;
case DNSSEC_OUT_OF_RANGE:
return KNOT_ERANGE;
case DNSSEC_NOT_FOUND:
return KNOT_ENOENT;
case DNSSEC_NO_PUBLIC_KEY:
......
......@@ -287,7 +287,9 @@ static inline uint16_t knot_pkt_rr_offset(const knot_pktsection_t *section,
*
* \param pkt Given packet.
* \param flags Parsing flags (allowed KNOT_PF_KEEPWIRE)
* \return KNOT_EOK, KNOT_EMALF and other errors
* \retval KNOT_EOK if success.
* \retval KNOT_ETRAIL if success but with some trailing data.
* \retval KNOT_EMALF and other errors.
*/
int knot_pkt_parse(knot_pkt_t *pkt, unsigned flags);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment