]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Rename logging functions
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Thu, 25 Sep 2025 16:59:52 +0000 (10:59 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Thu, 25 Sep 2025 16:59:52 +0000 (10:59 -0600)
For #121.

76 files changed:
src/algorithm.c
src/asn1/asn1c/Certificate.c
src/asn1/content_info.c
src/asn1/decode.c
src/asn1/oid.c
src/asn1/signed_data.c
src/cache.c
src/cachetmp.c
src/common.c
src/config.c
src/config/boolean.c
src/config/curl_offset.c
src/config/file_type.c
src/config/filename_format.c
src/config/incidences.c
src/config/log_conf.c
src/config/mode.c
src/config/output_format.c
src/config/str.c
src/config/string_array.c
src/config/time.c
src/config/uint.c
src/daemon.c
src/ext.c
src/file.c
src/hash.c
src/http.c
src/json_handler.c
src/json_util.c
src/log.c
src/log.h
src/main.c
src/nid.c
src/object/bgpsec.c
src/object/certificate.c
src/object/crl.c
src/object/manifest.c
src/object/roa.c
src/object/signed_object.c
src/object/tal.c
src/object/vcard.c
src/output_printer.c
src/print_file.c
src/prometheus.c
src/relax_ng.c
src/resource.c
src/rrdp.c
src/rsync.c
src/rtr/db/db_table.c
src/rtr/db/delta.c
src/rtr/db/vrps.c
src/rtr/pdu_handler.c
src/rtr/pdu_sender.c
src/rtr/pdu_stream.c
src/rtr/rtr.c
src/sig.c
src/slurm/db_slurm.c
src/slurm/slurm_loader.c
src/slurm/slurm_parser.c
src/stats.c
src/stream.c
src/task.c
src/thread_pool.c
src/thread_var.c
src/types/address.c
src/types/bio_seq.c
src/types/map.c
src/types/name.c
src/types/sorted_array.c
src/types/str.c
src/types/uri.c
src/types/vrp.c
test/cache_test.c
test/mock.c
test/rsync_test.c
test/rtr/pdu_handler_test.c

index 84b61c446172f215f66193c47dd334d990a6aafe..de1e438a208d92d095969f3f0cdbd94db18dd055 100644 (file)
@@ -28,7 +28,7 @@ validate_certificate_signature_algorithm(int nid, char const *what)
        if (nid == NID_sha256WithRSAEncryption)
                return 0;
 
-       return pr_val_err("%s's signature algorithm is NID '%d', not RSA+SHA256.",
+       return pr_err("%s's signature algorithm is NID '%d', not RSA+SHA256.",
            what, nid);
 }
 
@@ -52,7 +52,7 @@ validate_certificate_public_key_algorithm(X509_ALGOR *pa)
        if (nid == NID_rsaEncryption)
                return 0;
 
-       return pr_val_err("Certificate's public key format is NID '%s', not rsaEncryption.",
+       return pr_err("Certificate's public key format is NID '%s', not rsaEncryption.",
            OBJ_nid2sn(nid));
 }
 
@@ -73,18 +73,18 @@ validate_certificate_public_key_algorithm_bgpsec(X509_ALGOR *pa)
 
        /* Validate algorithm and parameters (RFC 8608#section-3.1.1) */
        if (nid != NID_X9_62_id_ecPublicKey)
-               return pr_val_err("Certificate's public key format is NID '%s', not id-ecPublicKey.",
+               return pr_err("Certificate's public key format is NID '%s', not id-ecPublicKey.",
                    OBJ_nid2sn(nid));
 
        if (parameter == NULL)
-               return pr_val_err("Certificate's public key algorithm MUST have parameters");
+               return pr_err("Certificate's public key algorithm MUST have parameters");
 
        if (parameter_type != V_ASN1_OBJECT)
-               return pr_val_err("Certificate's public key parameter type isn't valid");
+               return pr_err("Certificate's public key parameter type isn't valid");
 
        nid = OBJ_obj2nid(parameter);
        if (nid != NID_X9_62_prime256v1)
-               return pr_val_err("Certificate's public key format is NID '%s', not secp256r1 (a.k.a prime256v1).",
+               return pr_err("Certificate's public key format is NID '%s', not secp256r1 (a.k.a prime256v1).",
                    OBJ_nid2sn(nid));
 
        return 0;
@@ -96,7 +96,7 @@ validate_cms_hash_algorithm(AlgorithmIdentifier_t *id, char const *what)
        int error;
 
        if (id == NULL)
-               return pr_val_err("The hash algorithm of the '%s' is absent", what);
+               return pr_err("The hash algorithm of the '%s' is absent", what);
 
        error = validate_cms_hash_algorithm_oid(&id->algorithm, what);
        if (error)
@@ -113,8 +113,8 @@ validate_cms_hash_algorithm(AlgorithmIdentifier_t *id, char const *what)
         */
        if (id->parameters != NULL) {
                error = is_asn1_null_object(id->parameters)
-                   ? pr_val_err("The hash algorithm of the '%s' has a NULL object as parameters", what)
-                   : pr_val_err("The hash algorithm of the '%s' has parameters", what);
+                   ? pr_err("The hash algorithm of the '%s' has a NULL object as parameters", what)
+                   : pr_err("The hash algorithm of the '%s' has parameters", what);
        }
 
        return error;
@@ -136,7 +136,7 @@ validate_cms_hash_algorithm_oid(OBJECT_IDENTIFIER_t *oid, char const *what)
        };
 
        if (oid == NULL)
-               return pr_val_err("The hash algorithm of the '%s' is absent", what);
+               return pr_err("The hash algorithm of the '%s' is absent", what);
 
        if (oid->size != sizeof(sha256))
                goto incorrect_oid;
@@ -146,7 +146,7 @@ validate_cms_hash_algorithm_oid(OBJECT_IDENTIFIER_t *oid, char const *what)
        return 0;
 
 incorrect_oid:
-       return pr_val_err("The hash algorithm of the '%s' is not SHA256.", what);
+       return pr_err("The hash algorithm of the '%s' is not SHA256.", what);
 }
 
 int
@@ -166,7 +166,7 @@ validate_cms_signature_algorithm(AlgorithmIdentifier_t *id)
        uint8_t last;
 
        if (id == NULL)
-               return pr_val_err("The signature algorithm is absent.");
+               return pr_err("The signature algorithm is absent.");
 
        /*
         * rsaEncryption is { pkcs-1 1 }, and sha256WithRSAEncryption is
@@ -224,10 +224,10 @@ validate_cms_signature_algorithm(AlgorithmIdentifier_t *id)
         * accept both.
         */
        if (id->parameters != NULL && !is_asn1_null(id->parameters))
-               return pr_val_err("The signature algorithm has parameters.");
+               return pr_err("The signature algorithm has parameters.");
 
        return 0;
 
 incorrect_oid:
-       return pr_val_err("The Signature algorithm is not RSA nor RSA+SHA256.");
+       return pr_err("The Signature algorithm is not RSA nor RSA+SHA256.");
 }
index ca5060477ae887309d6caec4560812a2074865a6..968fc1a2af9618b23567b5d8e45e2f267bdde0c8 100644 (file)
@@ -189,7 +189,7 @@ Certificate_any2json(ANY_t *ber)
        if (cert == NULL)
                return NULL;
        if (cursor != origin + ber->size)
-               pr_op_warn("There's trailing garbage after one of the certificates.");
+               pr_wrn("There's trailing garbage after one of the certificates.");
 
        json = x509_to_json(cert);
 
index 644d0720d1951889aeebcb37da119047ea5c8bcf..ae83469013194b51a0c994a251ffca06d5bd1f98 100644 (file)
@@ -18,7 +18,7 @@ validate(struct ContentInfo *info)
                return error;
 
        if (!ARCS_EQUAL_OIDS(&arcs, oid_sdata))
-               error = pr_val_err("Incorrect content-type.");
+               error = pr_err("Incorrect content-type.");
 
        free_arcs(&arcs);
        return error;
index f07f66e70b27990f405c4653d643e36f4fd4544c..601da7459e675802a3b68d9a499c5c03382b88f5 100644 (file)
@@ -20,7 +20,7 @@ validate(asn_TYPE_descriptor_t const *descriptor, void *result, bool log)
        errlen = sizeof(errmsg);
        if (asn_check_constraints(descriptor, result, errmsg, &errlen) < 0) {
                if (log)
-                       pr_val_err("Error validating ASN.1 object: %s", errmsg);
+                       pr_err("Error validating ASN.1 object: %s", errmsg);
                return EINVAL;
        }
 
@@ -42,7 +42,7 @@ asn1_decode(const void *buffer, size_t buffer_size,
                ASN_STRUCT_FREE(*descriptor, *result);
                /* We expect the data to be complete; RC_WMORE is an error. */
                if (log)
-                       pr_val_err("Error '%u' decoding ASN.1 object around byte %zu",
+                       pr_err("Error '%u' decoding ASN.1 object around byte %zu",
                            rval.code, rval.consumed);
                return EINVAL;
        }
@@ -62,7 +62,7 @@ asn1_decode_any(ANY_t *any, asn_TYPE_descriptor_t const *descriptor,
 {
        return (any != NULL)
            ? asn1_decode(any->buf, any->size, descriptor, result, log)
-           : pr_val_err("ANY '%s' is NULL.", descriptor->name);
+           : pr_err("ANY '%s' is NULL.", descriptor->name);
 }
 
 int
@@ -71,7 +71,7 @@ asn1_decode_octet_string(OCTET_STRING_t *string,
 {
        return (string != NULL)
            ? asn1_decode(string->buf, string->size, descriptor, result, log)
-           : pr_val_err("Octet String '%s' is NULL.", descriptor->name);
+           : pr_err("Octet String '%s' is NULL.", descriptor->name);
 }
 
 /*
index 678ccf06c2301b4738918d01fd43eded0d251e17..d941ed9df348f72e84f0cc32e2a84ce7ed7bd665 100644 (file)
@@ -32,7 +32,7 @@ oid2arcs(OBJECT_IDENTIFIER_t *oid, struct oid_arcs *result)
 
        count = OBJECT_IDENTIFIER_get_arcs(oid, result->arcs, MAX_ARCS);
        if (count < 0) {
-               pr_val_err("OBJECT_IDENTIFIER_get_arcs() returned %zd.", count);
+               pr_err("OBJECT_IDENTIFIER_get_arcs() returned %zd.", count);
                free(result->arcs);
                return EINVAL;
        }
@@ -46,7 +46,7 @@ oid2arcs(OBJECT_IDENTIFIER_t *oid, struct oid_arcs *result)
 
                count2 = OBJECT_IDENTIFIER_get_arcs(oid, result->arcs, count);
                if (count != count2) {
-                       pr_val_err("OBJECT_IDENTIFIER_get_arcs() returned %zd. (expected %zd)",
+                       pr_err("OBJECT_IDENTIFIER_get_arcs() returned %zd. (expected %zd)",
                            count2, count);
                        free(result->arcs);
                        return EINVAL;
index a8085ca560db3b2920a4a62abf0c2ab7dd2f046b..90e283a9418e24a0d73bbad48876b9d34324bd19 100644 (file)
@@ -23,13 +23,13 @@ get_sid(struct SignerInfo *sinfo, OCTET_STRING_t const **result)
                *result = &sinfo->sid.choice.subjectKeyIdentifier;
                return 0;
        case SignerIdentifier_PR_issuerAndSerialNumber:
-               return pr_val_err("Signer Info's sid is an IssuerAndSerialNumber, not a SubjectKeyIdentifier.");
+               return pr_err("Signer Info's sid is an IssuerAndSerialNumber, not a SubjectKeyIdentifier.");
        case SignerIdentifier_PR_NOTHING:
                break;
        }
 
        *result = NULL;
-       return pr_val_err("Signer Info's sid is not a SubjectKeyIdentifier.");
+       return pr_err("Signer Info's sid is not a SubjectKeyIdentifier.");
 }
 
 static int
@@ -54,9 +54,9 @@ handle_sdata_ee(struct signed_object *so, struct rpki_certificate *ee,
        otmp = tmp;
        ee->x509 = d2i_X509(NULL, &tmp, cer_encoded->size);
        if (ee->x509 == NULL)
-               return val_crypto_err("Signed object's 'certificate' element does not decode into a Certificate");
+               return pr_crypto_err("Signed object's 'certificate' element does not decode into a Certificate");
        if (tmp != otmp + cer_encoded->size)
-               return val_crypto_err("Signed object's 'certificate' element contains trailing garbage");
+               return pr_crypto_err("Signed object's 'certificate' element contains trailing garbage");
 
        return cer_validate_ee(ee, so);
 }
@@ -77,7 +77,7 @@ validate_content_type_attribute(CMSAttributeValue_t *value,
        eContentType = &eci->eContentType;
 
        if (!oid_equal(attrValues, eContentType))
-               error = pr_val_err("The attrValues for the content-type attribute does not match the eContentType in the EncapsulatedContentInfo.");
+               error = pr_err("The attrValues for the content-type attribute does not match the eContentType in the EncapsulatedContentInfo.");
 
        ASN_STRUCT_FREE(asn_DEF_OBJECT_IDENTIFIER, attrValues);
        return error;
@@ -91,7 +91,7 @@ validate_message_digest_attribute(CMSAttributeValue_t *value,
        int error;
 
        if (eci->eContent == NULL)
-               return pr_val_err("There's no content being signed.");
+               return pr_err("There's no content being signed.");
 
        error = asn1_decode_any(value, &asn_DEF_MessageDigest,
            (void **) &digest, true);
@@ -101,7 +101,7 @@ validate_message_digest_attribute(CMSAttributeValue_t *value,
        error = hash_validate(hash_get_sha256(), eci->eContent->buf,
            eci->eContent->size, digest->buf, digest->size);
        if (error > 0)
-               pr_val_err("The content's hash does not match the Message-Digest Attribute.");
+               pr_err("The content's hash does not match the Message-Digest Attribute.");
 
        ASN_STRUCT_FREE(asn_DEF_MessageDigest, digest);
        return abs(error);
@@ -120,22 +120,22 @@ validate_signed_attrs(struct SignerInfo *sinfo, EncapsulatedContentInfo_t *eci)
        int error;
 
        if (sinfo->signedAttrs == NULL)
-               return pr_val_err("The SignerInfo's signedAttrs field is NULL.");
+               return pr_err("The SignerInfo's signedAttrs field is NULL.");
 
        for (i = 0; i < sinfo->signedAttrs->list.count; i++) {
                attr = sinfo->signedAttrs->list.array[i];
                if (attr == NULL) {
-                       pr_val_err("SignedAttrs array element %u is NULL.", i);
+                       pr_err("SignedAttrs array element %u is NULL.", i);
                        continue;
                }
                attrs = &attr->attrValues;
 
                if (attrs->list.count != 1) {
-                       return pr_val_err("signedAttrs's attribute set size (%d) is different than 1",
+                       return pr_err("signedAttrs's attribute set size (%d) is different than 1",
                            attr->attrValues.list.count);
                }
                if (attrs->list.array == NULL || attrs->list.array[0] == NULL)
-                       pr_crit("Array size is 1 but array is NULL.");
+                       pr_panic("Array size is 1 but array is NULL.");
 
                error = oid2arcs(&attr->attrType, &attrType);
                if (error)
@@ -143,7 +143,7 @@ validate_signed_attrs(struct SignerInfo *sinfo, EncapsulatedContentInfo_t *eci)
 
                if (ARCS_EQUAL_OIDS(&attrType, oid_cta)) {
                        if (content_type_found) {
-                               pr_val_err("Multiple ContentTypes found.");
+                               pr_err("Multiple ContentTypes found.");
                                goto illegal_attrType;
                        }
                        error = validate_content_type_attribute(
@@ -152,7 +152,7 @@ validate_signed_attrs(struct SignerInfo *sinfo, EncapsulatedContentInfo_t *eci)
 
                } else if (ARCS_EQUAL_OIDS(&attrType, oid_mda)) {
                        if (message_digest_found) {
-                               pr_val_err("Multiple MessageDigests found.");
+                               pr_err("Multiple MessageDigests found.");
                                goto illegal_attrType;
                        }
                        error = validate_message_digest_attribute(
@@ -161,14 +161,14 @@ validate_signed_attrs(struct SignerInfo *sinfo, EncapsulatedContentInfo_t *eci)
 
                } else if (ARCS_EQUAL_OIDS(&attrType, oid_sta)) {
                        if (signing_time_found) {
-                               pr_val_err("Multiple SigningTimes found.");
+                               pr_err("Multiple SigningTimes found.");
                                goto illegal_attrType;
                        }
                        error = 0; /* No validations needed for now. */
                        signing_time_found = true;
                } else {
                        /* rfc6488#section-3.1.g */
-                       pr_val_err("Illegal attrType OID in SignerInfo.");
+                       pr_err("Illegal attrType OID in SignerInfo.");
                        goto illegal_attrType;
                }
 
@@ -180,11 +180,11 @@ validate_signed_attrs(struct SignerInfo *sinfo, EncapsulatedContentInfo_t *eci)
 
        /* rfc6488#section-3.1.f */
        if (!content_type_found)
-               return pr_val_err("SignerInfo lacks a ContentType attribute.");
+               return pr_err("SignerInfo lacks a ContentType attribute.");
        if (!message_digest_found)
-               return pr_val_err("SignerInfo lacks a MessageDigest attribute.");
+               return pr_err("SignerInfo lacks a MessageDigest attribute.");
        if (!signing_time_found)
-               return pr_val_err("SignerInfo lacks a SigningTime attribute.");
+               return pr_err("SignerInfo lacks a SigningTime attribute.");
 
        return 0;
 
@@ -204,7 +204,7 @@ signed_data_validate(struct signed_object *so, struct rpki_certificate *ee)
        /* rfc6488#section-2.1 */
        sdata = so->sdata;
        if (sdata->signerInfos.list.count != 1) {
-               return pr_val_err("The SignedData's SignerInfo set is supposed to have only one element. (%d given.)",
+               return pr_err("The SignedData's SignerInfo set is supposed to have only one element. (%d given.)",
                    sdata->signerInfos.list.count);
        }
 
@@ -213,20 +213,20 @@ signed_data_validate(struct signed_object *so, struct rpki_certificate *ee)
        error = asn_INTEGER2ulong(&sdata->version, &version);
        if (error) {
                if (errno) {
-                       pr_val_err("Error converting SignedData version: %s",
+                       pr_err("Error converting SignedData version: %s",
                            strerror(errno));
                }
-               return pr_val_err("The SignedData version isn't a valid unsigned long");
+               return pr_err("The SignedData version isn't a valid unsigned long");
        }
        if (version != 3) {
-               return pr_val_err("The SignedData version is only allowed to be 3. (Was %lu.)",
+               return pr_err("The SignedData version is only allowed to be 3. (Was %lu.)",
                    version);
        }
 
        /* rfc6488#section-2.1.2 */
        /* rfc6488#section-3.1.j 1/2 */
        if (sdata->digestAlgorithms.list.count != 1) {
-               return pr_val_err("The SignedData's digestAlgorithms set is supposed to have only one element. (%d given.)",
+               return pr_err("The SignedData's digestAlgorithms set is supposed to have only one element. (%d given.)",
                    sdata->digestAlgorithms.list.count);
        }
 
@@ -254,25 +254,25 @@ signed_data_validate(struct signed_object *so, struct rpki_certificate *ee)
        /* rfc6488#section-2.1.5 */
        /* rfc6488#section-3.1.d */
        if (sdata->crls != NULL && sdata->crls->list.count > 0)
-               return pr_val_err("The SignedData contains at least one CRL.");
+               return pr_err("The SignedData contains at least one CRL.");
 
        /* rfc6488#section-2.1.6.1 */
        /* rfc6488#section-3.1.e */
        sinfo = sdata->signerInfos.list.array[0];
        if (sinfo == NULL)
-               return pr_val_err("The SignerInfo object is NULL.");
+               return pr_err("The SignerInfo object is NULL.");
        so->signature = &sinfo->signature;
 
        error = asn_INTEGER2ulong(&sinfo->version, &version);
        if (error) {
                if (errno) {
-                       pr_val_err("Error converting SignerInfo version: %s",
+                       pr_err("Error converting SignerInfo version: %s",
                            strerror(errno));
                }
-               return pr_val_err("The SignerInfo version isn't a valid unsigned long");
+               return pr_err("The SignerInfo version isn't a valid unsigned long");
        }
        if (version != 3) {
-               return pr_val_err("The SignerInfo version is only allowed to be 3. (Was %lu.)",
+               return pr_err("The SignerInfo version is only allowed to be 3. (Was %lu.)",
                    version);
        }
 
@@ -307,17 +307,17 @@ signed_data_validate(struct signed_object *so, struct rpki_certificate *ee)
        /* rfc6488#section-2.1.6.7 */
        /* rfc6488#section-3.1.i */
        if (sinfo->unsignedAttrs != NULL && sinfo->unsignedAttrs->list.count > 0)
-               return pr_val_err("SignerInfo has at least one unsignedAttr.");
+               return pr_err("SignerInfo has at least one unsignedAttr.");
 
        /* rfc6488#section-2.1.4 */
        /* rfc6488#section-3.1.c 1/2 */
        /* rfc6488#section-3.2 */
        /* rfc6488#section-3.3 */
        if (sdata->certificates == NULL)
-               return pr_val_err("The SignedData does not contain certificates.");
+               return pr_err("The SignedData does not contain certificates.");
 
        if (sdata->certificates->list.count != 1) {
-               return pr_val_err("The SignedData contains %d certificates, one expected.",
+               return pr_err("The SignedData contains %d certificates, one expected.",
                    sdata->certificates->list.count);
        }
 
@@ -402,22 +402,22 @@ get_content_type_attr(struct SignedData *sdata, OBJECT_IDENTIFIER_t **result)
        bool equal;
 
        if (sdata == NULL)
-               return pr_val_err("SignedData is NULL.");
+               return pr_err("SignedData is NULL.");
        if (sdata->signerInfos.list.array == NULL)
-               return pr_val_err("SignerInfos array is NULL.");
+               return pr_err("SignerInfos array is NULL.");
        if (sdata->signerInfos.list.array[0] == NULL)
-               return pr_val_err("SignerInfos array first element is NULL.");
+               return pr_err("SignerInfos array first element is NULL.");
 
        signedAttrs = sdata->signerInfos.list.array[0]->signedAttrs;
        if (signedAttrs == NULL)
-               return pr_val_err("signedAttrs is NULL.");
+               return pr_err("signedAttrs is NULL.");
        if (signedAttrs->list.array == NULL)
-               return pr_val_err("signedAttrs array is NULL.");
+               return pr_err("signedAttrs array is NULL.");
 
        for (i = 0; i < signedAttrs->list.count; i++) {
                attr = signedAttrs->list.array[i];
                if (!attr)
-                       return pr_val_err("signedAttrs array element %d is NULL.", i);
+                       return pr_err("signedAttrs array element %d is NULL.", i);
                error = oid2arcs(&attr->attrType, &arcs);
                if (error)
                        return error;
@@ -425,9 +425,9 @@ get_content_type_attr(struct SignedData *sdata, OBJECT_IDENTIFIER_t **result)
                free_arcs(&arcs);
                if (equal) {
                        if (attr->attrValues.list.array == NULL)
-                               return pr_val_err("signedAttrs attrValue array is NULL.");
+                               return pr_err("signedAttrs attrValue array is NULL.");
                        if (attr->attrValues.list.array[0] == NULL)
-                               return pr_val_err("signedAttrs attrValue array first element is NULL.");
+                               return pr_err("signedAttrs attrValue array first element is NULL.");
                        return asn1_decode_any(attr->attrValues.list.array[0],
                            &asn_DEF_OBJECT_IDENTIFIER,
                            (void **) result, true);
index 3696db8c4e0fb92ec226e8033be4917d1ce6cbd7..ef5d667444e70efad97d143cc69c22e451e7226e 100644 (file)
@@ -223,7 +223,7 @@ get_rsync_module(struct uri const *url, struct uri *module)
                return true;
        }
 
-       pr_val_err("Url '%s' does not appear to have an rsync module.", str);
+       pr_err("Url '%s' does not appear to have an rsync module.", str);
        return false;
 }
 
@@ -313,7 +313,7 @@ reset_cache_dir(void)
        int tmperr, abserr;
        unsigned int deleted;
 
-       pr_op_debug("Resetting cache...");
+       pr_trc("Resetting cache...");
 
        abserr = 0;
        deleted = 0;
@@ -334,9 +334,9 @@ end:        tmperr = errno;
        if (tmperr)
                abserr = tmperr;
        if (abserr)
-               pr_op_warn("Cannot reset cache: %s", strerror(abserr));
+               pr_wrn("Cannot reset cache: %s", strerror(abserr));
        else
-               pr_op_debug(deleted > 0 ? "Cache reset." : "Cache was empty.");
+               pr_trc(deleted > 0 ? "Cache reset." : "Cache was empty.");
        closedir(dir);
        return abserr;
 }
@@ -359,7 +359,7 @@ lock_cache(void)
        int fd;
        int error;
 
-       pr_op_debug("touch " LOCKFILE);
+       pr_trc("touch " LOCKFILE);
 
        /*
         * Suppose we get SIGTERM in the middle of this function.
@@ -376,7 +376,7 @@ lock_cache(void)
        fd = open(LOCKFILE, O_CREAT | O_EXCL, 0644);
        if (fd < 0) {
                error = errno;
-               pr_op_err("Cannot create lockfile '%s/" LOCKFILE "': %s",
+               pr_err("Cannot create lockfile '%s/" LOCKFILE "': %s",
                    config_get_local_repository(), strerror(error));
                return error;
        }
@@ -389,16 +389,16 @@ lock_cache(void)
 static void
 unlock_cache(void)
 {
-       pr_op_debug("rm " LOCKFILE);
+       pr_trc("rm " LOCKFILE);
 
        if (!lockfile_owned) {
-               pr_op_debug("The cache wasn't locked.");
+               pr_trc("The cache wasn't locked.");
                return;
        }
 
        if (unlink(LOCKFILE) < 0) {
                int error = errno;
-               pr_op_err("Cannot remove lockfile: %s", strerror(error));
+               pr_err("Cannot remove lockfile: %s", strerror(error));
                if (error != ENOENT)
                        return;
        }
@@ -426,10 +426,10 @@ cache_setup1(void)
        if (error)
                return error;
 
-       pr_op_debug("cd %s", cachedir);
+       pr_trc("cd %s", cachedir);
        if (chdir(cachedir) < 0) {
                error = errno;
-               pr_op_err("Cannot cd to %s: %s", cachedir, strerror(error));
+               pr_err("Cannot cd to %s: %s", cachedir, strerror(error));
                return error;
        }
 
@@ -447,9 +447,9 @@ cache_setup2(void)
        error = atexit(cache_atexit);
        if (error) {
                int err2 = errno;
-               pr_op_err("Cannot register cache's exit function.");
-               pr_op_err("Error message attempt 1: %s", strerror(error));
-               pr_op_err("Error message attempt 2: %s", strerror(err2));
+               pr_err("Cannot register cache's exit function.");
+               pr_err("Error message attempt 1: %s", strerror(error));
+               pr_err("Error message attempt 2: %s", strerror(err2));
                return error;
        }
 
@@ -517,13 +517,13 @@ json2node(json_t *json)
 
        error = json_get_uri(json, "http", &http);
        if (error && (error != ENOENT)) {
-               pr_op_debug("http: %s", strerror(error));
+               pr_trc("http: %s", strerror(error));
                return NULL;
        }
 
        error = json_get_uri(json, "rsync", &rsync);
        if (error && (error != ENOENT)) {
-               pr_op_debug("rsync: %s", strerror(error));
+               pr_trc("rsync: %s", strerror(error));
                uri_cleanup(&http);
                return NULL;
        }
@@ -531,7 +531,7 @@ json2node(json_t *json)
        node = pzalloc(sizeof(struct cache_node));
 
        if (!init_node_key(&node->key, &http, &rsync)) {
-               pr_op_debug("JSON node is missing both http and rsync tags.");
+               pr_trc("JSON node is missing both http and rsync tags.");
                uri_cleanup(&rsync);
                uri_cleanup(&http);
                goto nde;
@@ -542,38 +542,38 @@ json2node(json_t *json)
 
        error = json_get_str(json, "path", &path);
        if (error) {
-               pr_op_debug("path: %s", strerror(error));
+               pr_trc("path: %s", strerror(error));
                goto key;
        }
        node->path = pstrdup(path);
 
        error = json_get_ts(json, "attempt", &node->attempt_ts);
        if (error != 0 && error != ENOENT) {
-               pr_op_debug("attempt: %s", strerror(error));
+               pr_trc("attempt: %s", strerror(error));
                goto pth;
        }
 
        error = json_get_ts(json, "success", &node->success_ts);
        if (error != 0 && error != ENOENT) {
-               pr_op_debug("success: %s", strerror(error));
+               pr_trc("success: %s", strerror(error));
                goto pth;
        }
 
        error = json_get_bigint(json, "mftNum", &node->mft.num);
        if (error < 0) {
-               pr_op_debug("mftNum: %s", strerror(error));
+               pr_trc("mftNum: %s", strerror(error));
                goto pth;
        }
 
        error = json_get_ts(json, "mftUpdate", &node->mft.update);
        if (error != 0 && error != ENOENT) {
-               pr_op_debug("mftUpdate: %s", strerror(error));
+               pr_trc("mftUpdate: %s", strerror(error));
                goto mft;
        }
 
        error = json_get_object(json, "rrdp", &rrdp);
        if (error < 0) {
-               pr_op_debug("rrdp: %s", strerror(error));
+               pr_trc("rrdp: %s", strerror(error));
                goto mft;
        }
        if (error == 0 && rrdp_json2state(rrdp, node->path, &node->rrdp))
@@ -596,40 +596,40 @@ check_root_metafile(void)
        char const *file_version;
        int error;
 
-       pr_op_debug("Loading " METAFILE "...");
+       pr_trc("Loading " METAFILE "...");
 
        root = json_load_file(METAFILE, 0, &jerr);
        if (root == NULL) {
                if (json_error_code(&jerr) == json_error_cannot_open_file) {
-                       pr_op_debug(METAFILE " does not exist.");
+                       pr_trc(METAFILE " does not exist.");
                        return ENOENT;
                } else {
-                       pr_op_err("Json parsing failure at %s (%d:%d): %s",
+                       pr_err("Json parsing failure at %s (%d:%d): %s",
                            METAFILE, jerr.line, jerr.column, jerr.text);
                        return EINVAL;
                }
        }
 
        if (json_typeof(root) != JSON_OBJECT) {
-               pr_op_err("The root tag of " METAFILE " is not an object.");
+               pr_err("The root tag of " METAFILE " is not an object.");
                goto fail;
        }
 
        error = json_get_str(root, TAGNAME_VERSION, &file_version);
        if (error) {
                if (error > 0)
-                       pr_op_err(METAFILE " is missing the '"
+                       pr_err(METAFILE " is missing the '"
                            TAGNAME_VERSION "' tag.");
                goto fail;
        }
        if (strcmp(file_version, PACKAGE_VERSION) != 0) {
-               pr_op_err("The cache was written by Fort %s; "
+               pr_err("The cache was written by Fort %s; "
                    "I need to clear it.", file_version);
                goto fail;
        }
 
        json_decref(root);
-       pr_op_debug(METAFILE " loaded.");
+       pr_trc(METAFILE " loaded.");
        return 0;
 
 fail:  json_decref(root);
@@ -650,22 +650,22 @@ collect_meta(struct cache_table *tbl, struct dirent *dir)
 
        wrt = snprintf(filename, 64, "%s/%s.json", tbl->name, dir->d_name);
        if (wrt >= 64)
-               pr_crit("collect_meta: %d %s %s", wrt, tbl->name, dir->d_name);
+               pr_panic("collect_meta: %d %s %s", wrt, tbl->name, dir->d_name);
 
        pr_clutter("%s: Loading...", filename);
 
        root = json_load_file(filename, 0, &jerr);
        if (root == NULL) {
                if (json_error_code(&jerr) == json_error_cannot_open_file)
-                       pr_op_warn("%s: File does not exist.", filename);
+                       pr_wrn("%s: File does not exist.", filename);
                else
-                       pr_op_warn("%s: Json parsing failure at (%d:%d): %s",
+                       pr_wrn("%s: Json parsing failure at (%d:%d): %s",
                            filename, jerr.line, jerr.column, jerr.text);
                return;
        }
 
        if (json_typeof(root) != JSON_OBJECT) {
-               pr_op_warn("%s: Root tag is not an object.", filename);
+               pr_wrn("%s: Root tag is not an object.", filename);
                goto end;
        }
 
@@ -692,7 +692,7 @@ collect_metas(struct cache_table *tbl)
        if (dir == NULL) {
                error = errno;
                if (error != ENOENT)
-                       pr_op_warn("Cannot open %s: %s",
+                       pr_wrn("Cannot open %s: %s",
                            tbl->name, strerror(error));
                return;
        }
@@ -707,7 +707,7 @@ collect_metas(struct cache_table *tbl)
        }
        error = errno;
        if (error)
-               pr_op_warn("Could not finish traversing %s: %s",
+               pr_wrn("Could not finish traversing %s: %s",
                    tbl->name, strerror(error));
 
        closedir(dir);
@@ -824,7 +824,7 @@ provide_node(struct cache_table *tbl, struct uri const *http,
        struct cache_node *node;
 
        if (!init_node_key(&key, http, rsync)) {
-               pr_val_debug("Can't build node identifier: Both HTTP and rsync URLs are NULL.");
+               pr_trc("Can't build node identifier: Both HTTP and rsync URLs are NULL.");
                return NULL;
        }
 
@@ -855,13 +855,13 @@ rm_metadata(struct cache_node *node)
        int error;
 
        filename = str_concat(node->path, ".json");
-       pr_op_debug("rm %s", filename);
+       pr_trc("rm %s", filename);
        if (unlink(filename) < 0) {
                error = errno;
                if (error == ENOENT)
-                       pr_op_debug("%s already doesn't exist.", filename);
+                       pr_trc("%s already doesn't exist.", filename);
                else
-                       pr_op_warn("Cannot rm %s: %s", filename, strerror(errno));
+                       pr_wrn("Cannot rm %s: %s", filename, strerror(errno));
        }
 
        free(filename);
@@ -878,9 +878,9 @@ write_metadata(struct cache_node *node)
                return;
        filename = str_concat(node->path, ".json");
 
-       pr_op_debug("echo \"$json\" > %s", filename);
+       pr_trc("echo \"$json\" > %s", filename);
        if (json_dump_file(json, filename, JSON_INDENT(2)))
-               pr_op_err("Unable to write %s; unknown cause.", filename);
+               pr_err("Unable to write %s; unknown cause.", filename);
 
        free(filename);
        json_decref(json);
@@ -899,10 +899,10 @@ do_refresh(struct cache_table *tbl, struct uri const *uri,
        struct cache_node *node;
        bool downloaded = false;
 
-       pr_val_debug("Trying %s (online)...", uri_str(uri));
+       pr_trc("Trying %s (online)...", uri_str(uri));
 
        if (!tbl->enabled) {
-               pr_val_debug("Protocol disabled.");
+               pr_trc("Protocol disabled.");
                return VV_FAIL;
        }
 
@@ -943,12 +943,12 @@ do_refresh(struct cache_table *tbl, struct uri const *uri,
                break;
        case DLS_ONGOING:
 ongoing:       mutex_unlock(&tbl->lock);
-               pr_val_debug("Refresh ongoing.");
+               pr_trc("Refresh ongoing.");
                return VV_BUSY;
        case DLS_FRESH:
                break;
        default:
-               pr_crit("Unknown node state: %d", node->state);
+               pr_panic("Unknown node state: %d", node->state);
        }
 
        mutex_unlock(&tbl->lock);
@@ -958,11 +958,11 @@ ongoing:  mutex_unlock(&tbl->lock);
                task_wakeup_dormants();
 
        if (node->verdict == VV_FAIL) {
-               pr_val_debug("Refresh failed.");
+               pr_trc("Refresh failed.");
                return VV_FAIL;
        }
 
-       pr_val_debug("Refresh succeeded.");
+       pr_trc("Refresh succeeded.");
        *result = node;
        return VV_CONTINUE;
 }
@@ -1038,11 +1038,11 @@ cache_get_fallback(struct uri const *url, char **result)
         * Mutex not needed here.
         */
 
-       pr_val_debug("Trying %s (offline)...", uri_str(url));
+       pr_trc("Trying %s (offline)...", uri_str(url));
 
        node = find_node(&cache.fallback, uri_str(url), uri_len(url));
        if (!node) {
-               pr_val_debug("Cache data unavailable.");
+               pr_trc("Cache data unavailable.");
                *result = NULL;
                return VV_CONTINUE;
        }
@@ -1221,12 +1221,12 @@ rsync_finished(struct uri const *url, char const *path)
        node = find_node(&cache.rsync, uri_str(url), uri_len(url));
        if (node == NULL) {
                mutex_unlock(&cache.rsync.lock);
-               pr_op_err("rsync '%s -> %s' finished, but cache node does not exist.",
+               pr_err("rsync '%s -> %s' finished, but cache node does not exist.",
                    uri_str(url), path);
                return;
        }
        if (node->state != DLS_ONGOING)
-               pr_op_warn("rsync '%s -> %s' finished, but existing node was not in ONGOING state.",
+               pr_wrn("rsync '%s -> %s' finished, but existing node was not in ONGOING state.",
                    uri_str(url), path);
 
        node->state = DLS_FRESH;
@@ -1340,7 +1340,7 @@ discard_trash(struct cache_commit *commit, struct cache_node *fallback)
 
        dir = opendir(fallback->path);
        if (dir == NULL) {
-               pr_op_err("opendir() error: %s", strerror(errno));
+               pr_err("opendir() error: %s", strerror(errno));
                return;
        }
 
@@ -1369,16 +1369,16 @@ discard_trash(struct cache_commit *commit, struct cache_node *fallback)
                 * "forget" a file, then legitimately relist it without actually
                 * providing it.
                 */
-               pr_op_debug("Removing hard link: %s", file_path);
+               pr_trc("Removing hard link: %s", file_path);
                if (unlink(file_path) < 0)
-                       pr_op_warn("Could not unlink %s: %s",
+                       pr_wrn("Could not unlink %s: %s",
                            file_path, strerror(errno));
 
 next:          free(file_path);
        }
 
        if (errno)
-               pr_op_err("Fallback directory traversal errored: %s",
+               pr_err("Fallback directory traversal errored: %s",
                    strerror(errno));
        closedir(dir);
 }
@@ -1396,7 +1396,7 @@ commit_fallbacks(time_t now)
                STAILQ_REMOVE_HEAD(&commits, lh);
 
                if (uri_str(&commit->caRepository) != NULL) {
-                       pr_op_debug("Creating fallback for %s (%s)",
+                       pr_trc("Creating fallback for %s (%s)",
                            uri_str(&commit->caRepository),
                            uri_str(&commit->rpkiNotify));
 
@@ -1406,11 +1406,11 @@ commit_fallbacks(time_t now)
                        fb->attempt_ts = now;
                        fb->success_ts = now;
 
-                       pr_op_debug("mkdir -f %s", fb->path);
+                       pr_trc("mkdir -f %s", fb->path);
                        if (mkdir(fb->path, CACHE_FILEMODE) < 0) {
                                error = errno;
                                if (error != EEXIST) {
-                                       pr_op_err("Cannot create '%s': %s",
+                                       pr_err("Cannot create '%s': %s",
                                            fb->path, strerror(error));
                                        goto skip;
                                }
@@ -1424,7 +1424,7 @@ commit_fallbacks(time_t now)
                } else { /* TA */
                        struct cache_mapping *map = &commit->files[0];
 
-                       pr_op_debug("Creating fallback for %s",
+                       pr_trc("Creating fallback for %s",
                            uri_str(&map->url));
 
                        fb = provide_node(&cache.fallback, &map->url, NULL);
@@ -1472,7 +1472,7 @@ remove_orphaned_nodes(struct cache_table *table, struct cache_node *node,
     void *arg)
 {
        if (file_stat_errno(node->path) == ENOENT) {
-               pr_op_debug("Missing file; deleting node: %s", node->path);
+               pr_trc("Missing file; deleting node: %s", node->path);
                delete_node(table, node, NULL);
        }
 }
@@ -1490,29 +1490,29 @@ cleanup_cache(void)
        time_t now = time_fatal();
 
        /* Delete the entirety of cache/tmp/. */
-       pr_op_debug("Cleaning up temporal files.");
+       pr_trc("Cleaning up temporal files.");
        file_rm_rf(CACHE_TMPDIR);
 
        /*
         * Ensure valid RPPs and TAs are linked in fallback,
         * by hard-linking the new files.
         */
-       pr_op_debug("Committing fallbacks.");
+       pr_trc("Committing fallbacks.");
        commit_fallbacks(now);
 
        /*
         * Delete refresh nodes that haven't been downloaded in a while,
         * and fallback nodes that haven't been valid in a while.
         */
-       pr_op_debug("Cleaning up abandoned cache files.");
+       pr_trc("Cleaning up abandoned cache files.");
        foreach_node(remove_abandoned, &now);
 
        /* (Paranoid) Delete nodes that are no longer mapped to files. */
-       pr_op_debug("Cleaning up orphaned nodes.");
+       pr_trc("Cleaning up orphaned nodes.");
        foreach_node(remove_orphaned_nodes, NULL);
 
        /* (Paranoid) Delete files that are no longer mapped to nodes. */
-       pr_op_debug("Cleaning up orphaned files.");
+       pr_trc("Cleaning up orphaned files.");
        remove_orphaned_files();
 }
 
index 42ffa0c01baba83a487664f4d3fc25e15bd965ce..9c6d813c179bd939361cf414296716233efe943e 100644 (file)
@@ -25,5 +25,5 @@ cache_tmpfile(char *buf)
 
        written = snprintf(buf, CACHE_TMPFILE_BUFLEN, CACHE_TMPDIR "/%X", next);
        if (written >= CACHE_TMPFILE_BUFLEN)
-               pr_crit("I ran out of temporal directories: %u", next);
+               pr_panic("I ran out of temporal directories: %u", next);
 }
index 0fbef3b1249310c0fb816d12373302d96b9ca8ba..72520b08b95a3d59c7f042f084538764016324ee 100644 (file)
@@ -42,7 +42,7 @@ void
 panic_on_fail(int error, char const *function_name)
 {
        if (error)
-               pr_crit("%s() returned '%s'. "
+               pr_panic("%s() returned '%s'. "
                    "This is too critical for a recovery; I must die now.",
                    function_name, strerror(error));
 }
@@ -69,11 +69,11 @@ rwlock_read_lock(pthread_rwlock_t *lock)
        case 0:
                return error;
        case EAGAIN:
-               pr_op_err_st("There are too many threads; I can't modify the database.");
+               pr_crit("There are too many threads; I can't modify the database.");
                return error;
        }
 
-       pr_crit("pthread_rwlock_rdlock() returned '%s'. "
+       pr_panic("pthread_rwlock_rdlock() returned '%s'. "
            "This is too critical for a recovery; I must die now.",
            strerror(error));
        return EINVAL; /* Warning shutupper */
@@ -90,7 +90,7 @@ rwlock_write_lock(pthread_rwlock_t *lock)
         */
        error = pthread_rwlock_wrlock(lock);
        if (error)
-               pr_crit("pthread_rwlock_wrlock() returned '%s'. "
+               pr_panic("pthread_rwlock_wrlock() returned '%s'. "
                    "This is too critical for a recovery; I must die now.",
                    strerror(error));
 }
@@ -106,7 +106,7 @@ rwlock_unlock(pthread_rwlock_t *lock)
         */
        error = pthread_rwlock_unlock(lock);
        if (error)
-               pr_crit("pthread_rwlock_unlock() returned '%s'. "
+               pr_panic("pthread_rwlock_unlock() returned '%s'. "
                    "This is too critical for a recovery; I must die now.",
                    strerror(error));
 }
@@ -138,7 +138,7 @@ process_file(char const *dir_name, char const *file_name, char const *file_ext,
        fullpath = realpath(tmp, NULL);
        if (fullpath == NULL) {
                error = errno;
-               pr_op_err("Error getting real path for file '%s' at directory '%s': %s",
+               pr_err("Error getting real path for file '%s' at directory '%s': %s",
                    dir_name, file_name, strerror(error));
                free(tmp);
                return error;
@@ -161,7 +161,7 @@ process_dir_files(char const *location, char const *file_ext, bool empty_err,
        dir_loc = opendir(location);
        if (dir_loc == NULL) {
                error = errno;
-               pr_op_err_st("Couldn't open directory '%s': %s",
+               pr_crit("Couldn't open directory '%s': %s",
                    location, strerror(error));
                goto end;
        }
@@ -172,20 +172,20 @@ process_dir_files(char const *location, char const *file_ext, bool empty_err,
                error = process_file(location, dir_ent->d_name, file_ext,
                    &found, cb, arg);
                if (error) {
-                       pr_op_err("The error was at file %s", dir_ent->d_name);
+                       pr_err("The error was at file %s", dir_ent->d_name);
                        goto close_dir;
                }
                errno = 0;
        }
        if (errno) {
-               pr_op_err_st("Error reading dir %s", location);
+               pr_crit("Error reading dir %s", location);
                error = errno;
        }
        if (!error && found == 0)
                error = (empty_err ?
-                   pr_op_err("Location '%s' doesn't have files with extension '%s'",
+                   pr_err("Location '%s' doesn't have files with extension '%s'",
                    location, file_ext) :
-                   pr_op_warn("Location '%s' doesn't have files with extension '%s'",
+                   pr_wrn("Location '%s' doesn't have files with extension '%s'",
                    location, file_ext));
 
 close_dir:
@@ -211,7 +211,7 @@ foreach_file(char const *location, char const *file_ext, bool empty_err,
        error = stat(location, &attr);
        if (error) {
                error = errno;
-               pr_op_err_st("Error reading path '%s': %s", location,
+               pr_crit("Error reading path '%s': %s", location,
                    strerror(error));
                return error;
        }
@@ -229,7 +229,7 @@ time_nonfatal(void)
 
        result = time(NULL);
        if (result == ((time_t)-1)) {
-               pr_val_warn("time(NULL) returned -1: %s", strerror(errno));
+               pr_wrn("time(NULL) returned -1: %s", strerror(errno));
                result = 0;
        }
 
@@ -243,7 +243,7 @@ time_fatal(void)
 
        result = time(NULL);
        if (result == ((time_t)-1))
-               pr_crit("time(NULL) returned -1: %s", strerror(errno));
+               pr_panic("time(NULL) returned -1: %s", strerror(errno));
 
        return result;
 }
@@ -274,12 +274,12 @@ str2time(char const *str, time_t *tt)
        memset(&tm, 0, sizeof(tm));
        consumed = strptime(str, FORT_TS_FORMAT, &tm);
        if (consumed == NULL || (*consumed) != 0)
-               return pr_op_err("String '%s' does not appear to be a timestamp.",
+               return pr_err("String '%s' does not appear to be a timestamp.",
                    str);
        time = timegm(&tm);
        if (time == ((time_t) -1)) {
                error = errno;
-               return pr_op_err("String '%s' does not appear to be a timestamp: %s",
+               return pr_err("String '%s' does not appear to be a timestamp: %s",
                    str, strerror(error));
        }
 
@@ -304,7 +304,7 @@ void
 ts_now(struct timespec *now)
 {
        if (clock_gettime(CLOCK_MONOTONIC, now) < 0)
-               pr_crit("clock_gettime() returned '%s'", strerror(errno));
+               pr_panic("clock_gettime() returned '%s'", strerror(errno));
        ts_normalize(now); /* Probably not needed, but I can't find contracts */
 }
 
index 6bc99a6b923451f8db50c72c43a1e17c24ebc0de..e898f3559f6a1ad89d36f841b9635cd979a98442 100644 (file)
@@ -960,22 +960,22 @@ print_config(void)
 {
        struct option_field const *opt;
 
-       pr_op_info(PACKAGE_STRING);
-       pr_op_info("  libcrypto:     " OPENSSL_VERSION_TEXT);
-       pr_op_info("  jansson:       " JANSSON_VERSION);
-       pr_op_info("  libcurl:       " LIBCURL_VERSION);
-       pr_op_info("  libxml:        " LIBXML_DOTTED_VERSION);
-       pr_op_info("  libmicrohttpd: %x.%x.%x-%x",
+       pr_inf(PACKAGE_STRING);
+       pr_inf("  libcrypto:     " OPENSSL_VERSION_TEXT);
+       pr_inf("  jansson:       " JANSSON_VERSION);
+       pr_inf("  libcurl:       " LIBCURL_VERSION);
+       pr_inf("  libxml:        " LIBXML_DOTTED_VERSION);
+       pr_inf("  libmicrohttpd: %x.%x.%x-%x",
            MHD_VERSION >> 24, (MHD_VERSION >> 16) & 0xFF,
            (MHD_VERSION >> 8) & 0xFF, MHD_VERSION & 0xFF);
 
-       pr_op_info("Configuration {");
+       pr_inf("Configuration {");
 
        FOREACH_OPTION(options, opt, 0xFFFF)
                if (is_rpki_config_field(opt) && opt->type->print != NULL)
                        opt->type->print(opt, get_rpki_config_field(opt));
 
-       pr_op_info("}");
+       pr_inf("}");
 }
 
 static void
@@ -1077,15 +1077,15 @@ validate_config(void)
                return 0;
 
        if (rpki_config.payload != NULL)
-               return pr_op_err("I don't know what '%s' is.",
+               return pr_err("I don't know what '%s' is.",
                    rpki_config.payload);
 
        if (rpki_config.tal == NULL)
-               return pr_op_err("The TAL(s) location (--tal) is mandatory.");
+               return pr_err("The TAL(s) location (--tal) is mandatory.");
 
        /* A file location at --tal isn't valid when --init-tals is set */
        if (!file_is_valid(rpki_config.tal, !rpki_config.init_tals))
-               return pr_op_err("Invalid TAL(s) location.");
+               return pr_err("Invalid TAL(s) location.");
 
        /* Ignore the other checks */
        if (rpki_config.init_tals)
@@ -1095,10 +1095,10 @@ validate_config(void)
            rpki_config.server.interval.refresh ||
            rpki_config.server.interval.expire <
            rpki_config.server.interval.retry)
-               return pr_op_err("Expire interval must be greater than refresh and retry intervals");
+               return pr_err("Expire interval must be greater than refresh and retry intervals");
 
        if (rpki_config.slurm != NULL && !file_is_valid(rpki_config.slurm, true))
-               return pr_op_err("Invalid slurm location.");
+               return pr_err("Invalid slurm location.");
 
        if (rpki_config.http.proxy == NULL) {
                proxy = curl_getenv("https_proxy");
@@ -1157,7 +1157,7 @@ handle_opt(int opt)
        FOREACH_OPTION(options, option, AVAILABILITY_GETOPT) {
                if (option->id == opt) {
                        if (option->deprecated)
-                               pr_op_warn("Warning: '%s' is deprecated.",
+                               pr_wrn("Warning: '%s' is deprecated.",
                                    option->name);
 
                        return is_rpki_config_field(option)
@@ -1167,7 +1167,7 @@ handle_opt(int opt)
                }
        }
 
-       pr_op_err("Unrecognized option: %d", opt);
+       pr_err("Unrecognized option: %d", opt);
        return ESRCH;
 }
 
@@ -1182,7 +1182,7 @@ become_absolute_path(char **_path)
 
        absolute = realpath(relative, NULL);
        if (!absolute)
-               return pr_op_err("Cannot resolve the absolute path of %s: %s",
+               return pr_err("Cannot resolve the absolute path of %s: %s",
                    relative, strerror(errno));
 
        free(relative);
@@ -1241,7 +1241,7 @@ handle_flags_config(int argc, char **argv)
        }
 
        if (rpki_config.daemon) {
-               pr_op_info("Executing as daemon, all logs will be sent to syslog.");
+               pr_inf("Executing as daemon, all logs will be sent to syslog.");
                /* Send all logs to syslog */
                rpki_config.log.output = SYSLOG;
                rpki_config.validation_log.output = SYSLOG;
@@ -1253,7 +1253,7 @@ handle_flags_config(int argc, char **argv)
 end:
        if (error) {
                free_rpki_config();
-               pr_op_err("Try '%s --usage' or '%s --help' for more information.",
+               pr_err("Try '%s --usage' or '%s --help' for more information.",
                    program_name, program_name);
        } else
                print_config();
index e3e4f028aff3aa2235791a59a9083d7eb5c3777d..c6ab008dcabcb6b1f8a019e6c48060c4415c257d 100644 (file)
@@ -10,7 +10,7 @@
 void
 print_bool(struct option_field const *field, void *value)
 {
-       pr_op_info("%s: %s", field->name, DEREFERENCE(value) ? "true" : "false");
+       pr_inf("%s: %s", field->name, DEREFERENCE(value) ? "true" : "false");
 }
 
 int
@@ -31,7 +31,7 @@ parse_argv_bool(struct option_field const *field, char const *str, void *result)
                return 0;
        }
 
-       return pr_op_err("Invalid %s: '%s', must be boolean (true|false)",
+       return pr_err("Invalid %s: '%s', must be boolean (true|false)",
            field->name, str);
 }
 
@@ -40,7 +40,7 @@ parse_json_bool(struct option_field const *opt, struct json_t *json,
     void *result)
 {
        if (!json_is_boolean(json)) {
-               return pr_op_err("The '%s' element is not a JSON boolean.",
+               return pr_err("The '%s' element is not a JSON boolean.",
                    opt->name);
        }
 
index f1012119bbe39a10f0627a36b579ddd61c1f38d9..55489fedb5a461adf8bc07504588767c14f0a777 100644 (file)
@@ -10,7 +10,7 @@
 static void
 print_curloff(struct option_field const *field, void *value)
 {
-       pr_op_info("%s: %" CURL_FORMAT_CURL_OFF_T,
+       pr_inf("%s: %" CURL_FORMAT_CURL_OFF_T,
            field->name, *((curl_off_t *) value));
 }
 
@@ -24,7 +24,7 @@ parse_argv_curloff(struct option_field const *field, char const *str,
 
        if (field->type->has_arg != required_argument || str == NULL ||
                    strlen(str) == 0) {
-               return pr_op_err("Integer options ('%s' in this case) require an argument.",
+               return pr_err("Integer options ('%s' in this case) require an argument.",
                    field->name);
        }
 
@@ -34,13 +34,13 @@ parse_argv_curloff(struct option_field const *field, char const *str,
        if (error || *tmp != '\0') {
                if (!error)
                        error = -EINVAL;
-               pr_op_err("Value '%s' at '%s' is not an integer: %s",
+               pr_err("Value '%s' at '%s' is not an integer: %s",
                    str, field->name, strerror(abs(error)));
                return error;
        }
 
        if (parsed < 0)
-               return pr_op_err("Value of '%s' is negative.", field->name);
+               return pr_err("Value of '%s' is negative.", field->name);
 
        *((curl_off_t *) result) = parsed;
        return 0;
@@ -52,13 +52,13 @@ parse_json_curloff(struct option_field const *opt, json_t *json, void *result)
        json_int_t value;
 
        if (!json_is_integer(json))
-               return pr_op_err("The '%s' element is not a JSON integer.",
+               return pr_err("The '%s' element is not a JSON integer.",
                    opt->name);
 
        value = json_integer_value(json);
 
        if (value < 0)
-               return pr_op_err("Value of '%s' is negative.", opt->name);
+               return pr_err("Value of '%s' is negative.", opt->name);
 
        *((curl_off_t *) result) = value;
        return 0;
index 7c85b8cc52460160974b940ccbba844ff3885d6b..890550b4bc3e616241e5b7147e976087b4a8028a 100644 (file)
@@ -39,7 +39,7 @@ print_file_type(struct option_field const *field, void *value)
                break;
        }
 
-       pr_op_info("%s: %s", field->name, str);
+       pr_inf("%s: %s", field->name, str);
 }
 
 static int
@@ -57,7 +57,7 @@ parse_argv_mode(struct option_field const *field, char const *str,
        else if (strcmp(str, VALUE_CRL) == 0)
                DEREFERENCE(result) = FT_CRL;
        else
-               return pr_op_err("Unknown file type: '%s'", str);
+               return pr_err("Unknown file type: '%s'", str);
 
        return 0;
 }
index b06fc7026e2c6fe11bc55ae1fc9a2bb15e59e8ce..25d27a6fb24d1312badccdb3599207b375ba516b 100644 (file)
@@ -29,7 +29,7 @@ print_filename_format(struct option_field const *field, void *value)
                break;
        }
 
-       pr_op_info("%s: %s", field->name, str);
+       pr_inf("%s: %s", field->name, str);
 }
 
 static int
@@ -43,7 +43,7 @@ parse_argv_filename_format(struct option_field const *field, char const *str,
        else if (strcmp(str, FNF_VALUE_NAME) == 0)
                DEREFERENCE(result) = FNF_NAME;
        else
-               return pr_op_err("Unknown file name format %s: '%s'",
+               return pr_err("Unknown file name format %s: '%s'",
                    field->name, str);
 
        return 0;
index ae0d3ee7176744cf80f8a62cf19f2a3d5d2f2214..763f9d1d00ebf18a127e7a997b5f65b90104e44e 100644 (file)
@@ -12,7 +12,7 @@ static int
 incidences_parse_json(struct option_field const *opt, json_t *json,
     void *_result)
 {
-       pr_op_warn("Incidences are deprecated; please delete them from your configuration.");
+       pr_wrn("Incidences are deprecated; please delete them from your configuration.");
        return 0;
 }
 
index 8402cdaea40072a7809f34bc2cbed7f17069598e..a9638fe551ef8cd4d6c738caf25306a1b5b36c5b 100644 (file)
@@ -64,7 +64,7 @@ print_log_level(struct option_field const *field, void *value)
                break;
        }
 
-       pr_op_info("%s: %s", field->name, str);
+       pr_inf("%s: %s", field->name, str);
 }
 
 static void
@@ -81,7 +81,7 @@ print_log_output(struct option_field const *field, void *value)
                break;
        }
 
-       pr_op_info("%s: %s", field->name, str);
+       pr_inf("%s: %s", field->name, str);
 }
 
 static void
@@ -146,7 +146,7 @@ print_log_facility(struct option_field const *field, void *value)
                break;
        }
 
-       pr_op_info("%s: %s", field->name, str);
+       pr_inf("%s: %s", field->name, str);
 }
 
 static int
@@ -162,7 +162,7 @@ parse_argv_log_level(struct option_field const *field, char const *str,
        else if (strcmp(str, LOG_LEVEL_VALUE_DEBUG) == 0)
                DEREFERENCE_UINT(result) = LOG_DEBUG;
        else
-               return pr_op_err("Unknown %s: '%s'", field->name, str);
+               return pr_err("Unknown %s: '%s'", field->name, str);
 
        return 0;
 }
@@ -176,7 +176,7 @@ parse_argv_log_output(struct option_field const *field, char const *str,
        else if (strcmp(str, LOG_OUTPUT_VALUE_CONSOLE) == 0)
                DEREFERENCE_ENUM(result) = CONSOLE;
        else
-               return pr_op_err("Unknown %s: '%s'", field->name, str);
+               return pr_err("Unknown %s: '%s'", field->name, str);
 
        return 0;
 }
@@ -223,10 +223,10 @@ parse_argv_log_facility(struct option_field const *field, char const *str,
                DEREFERENCE_UINT32(result) = LOG_LOCAL7;
        else if (strcmp(str, LOG_FACILITY_VALUE_KERN) == 0 ||
            strcmp(str, LOG_FACILITY_VALUE_SYSLOG) == 0)
-               return pr_op_err("Unsupported %s: '%s', use another value",
+               return pr_err("Unsupported %s: '%s', use another value",
                    field->name, str);
        else
-               return pr_op_err("Unknown %s: '%s'", field->name, str);
+               return pr_err("Unknown %s: '%s'", field->name, str);
 
        return 0;
 }
index 7eb930fe6c9874a1de6c3e7ca041480ffdbbf5e2..ab9ff2f6c1a80ff182579545b7c9477b1c12a787 100644 (file)
@@ -29,7 +29,7 @@ print_mode(struct option_field const *field, void *value)
                break;
        }
 
-       pr_op_info("%s: %s", field->name, str);
+       pr_inf("%s: %s", field->name, str);
 }
 
 static int
@@ -43,7 +43,7 @@ parse_argv_mode(struct option_field const *field, char const *str,
        else if (strcmp(str, VALUE_PRINT_FILE) == 0)
                DEREFERENCE(result) = PRINT_FILE;
        else
-               return pr_op_err("Unknown mode: '%s'", str);
+               return pr_err("Unknown mode: '%s'", str);
 
        return 0;
 }
index a9c5ff6e1caa8f754129a1d03dbaab087c7562d3..bab8466e3786da25cfd835f24b24a96ba75e37dd 100644 (file)
@@ -25,7 +25,7 @@ print_output_format(struct option_field const *field, void *value)
                break;
        }
 
-       pr_op_info("%s: %s", field->name, str);
+       pr_inf("%s: %s", field->name, str);
 }
 
 static int
@@ -37,7 +37,7 @@ parse_argv_output_format(struct option_field const *field, char const *str,
        else if (strcmp(str, OFM_VALUE_JSON) == 0)
                DEREFERENCE(result) = OFM_JSON;
        else
-               return pr_op_err("Unknown output format %s: '%s'",
+               return pr_err("Unknown output format %s: '%s'",
                    field->name, str);
 
        return 0;
index 44e61c00bb55436ffe8f101d951ad373e397f3fb..502d0812c35e80274fd7dcb0d3032cd79004fd5e 100644 (file)
@@ -18,7 +18,7 @@ __string_free(char **string)
 static void
 string_print(struct option_field const *field, void *value)
 {
-       pr_op_info("%s: %s", field->name, DEREFERENCE(value));
+       pr_inf("%s: %s", field->name, DEREFERENCE(value));
 }
 
 static int
@@ -27,7 +27,7 @@ string_parse_argv(struct option_field const *field, char const *str,
 {
        if (field->type->has_arg != required_argument || str == NULL ||
            strlen(str) == 0) {
-               return pr_op_err("String options ('%s' in this case) require an argument.",
+               return pr_err("String options ('%s' in this case) require an argument.",
                    field->name);
        }
 
@@ -55,7 +55,7 @@ string_parse_json(struct option_field const *opt, json_t *json, void *result)
                        return 0;
                } else {
                        if (string == NULL) {
-                               return pr_op_err(
+                               return pr_err(
                                    "The '%s' field is not allowed to be null.",
                                    opt->name);
                        }
@@ -91,14 +91,14 @@ service_parse_json(struct option_field const *opt, json_t *json, void *result)
        if (json_is_integer(json)) {
                intval = json_integer_value(json);
                if (intval < 1 || 65535 < intval) {
-                       return pr_op_err("'%s' is out of range (1-65535).",
+                       return pr_err("'%s' is out of range (1-65535).",
                            opt->name);
                }
 
                strval = pmalloc(6);
                written = snprintf(strval, 6, "%" JSON_INTEGER_FORMAT, intval);
                if (written < 0 || 6 <= written)
-                       return pr_op_err("Cannot convert '%s' to string: snprintf returned %d",
+                       return pr_err("Cannot convert '%s' to string: snprintf returned %d",
                            opt->name, written);
 
                DEREFERENCE(result) = strval;
@@ -130,7 +130,7 @@ parse_json_string(json_t *json, char const *name, char const **result)
        }
 
        if (!json_is_string(json))
-               return pr_op_err("The '%s' element is not a JSON string.", name);
+               return pr_err("The '%s' element is not a JSON string.", name);
 
        *result = json_string_value(json);
        return 0;
index 323df95ff48e05fdc58ae36733a5395f75372713..ff50f512be1b6a7cda83f6592893fe3743a32923 100644 (file)
@@ -45,12 +45,12 @@ string_array_print(struct option_field const *field, void *_value)
        struct string_array *value = _value;
        size_t i;
 
-       pr_op_info("%s:", field->name);
+       pr_inf("%s:", field->name);
 
        if (value->length == 0)
-               pr_op_info("  <Nothing>");
+               pr_inf("  <Nothing>");
        else for (i = 0; i < value->length; i++)
-               pr_op_info("  %s", value->array[i]);
+               pr_inf("  %s", value->array[i]);
 }
 
 static int
@@ -64,7 +64,7 @@ string_array_parse_json(struct option_field const *opt, json_t *json,
        int error;
 
        if (!json_is_array(json)) {
-               return pr_op_err("The '%s' element is not a JSON array.",
+               return pr_err("The '%s' element is not a JSON array.",
                    opt->name);
        }
 
@@ -75,13 +75,13 @@ string_array_parse_json(struct option_field const *opt, json_t *json,
        }
 
        if (opt->max > 0 && len > opt->max)
-               return pr_op_err("'%s' can have %u elements max; currently it has %lu elements.",
+               return pr_err("'%s' can have %u elements max; currently it has %lu elements.",
                    opt->name, opt->max, len);
 
        for (i = 0; i < len; i++) {
                child = json_array_get(json, i);
                if (!json_is_string(child)) {
-                       return pr_op_err("'%s' array element #%zu is not a string.",
+                       return pr_err("'%s' array element #%zu is not a string.",
                            opt->name, i);
                }
        }
@@ -127,7 +127,7 @@ string_array_parse_argv(struct option_field const *opt, char const *str,
        len = token_count(&tokenizer);
 
        if (opt->max > 0 && len > opt->max)
-               return pr_op_err("'%s' can have %u elements max; currently it has %lu elements.",
+               return pr_err("'%s' can have %u elements max; currently it has %lu elements.",
                    opt->name, opt->max, len);
 
        result->array = pcalloc(len, sizeof(char *));
index fcac29c67f18b74c74e0195133bbcaf6e78178a8..f3a2889e7569589d381f12ec5359516d57fcf0ef 100644 (file)
@@ -19,9 +19,9 @@ print_time(struct option_field const *field, void *value)
 
        error = time2str(tt, str);
        if (error)
-               pr_crit("time2str: %s", strerror(error));
+               pr_panic("time2str: %s", strerror(error));
 
-       pr_op_info("%s: %s", field->name, str);
+       pr_inf("%s: %s", field->name, str);
 }
 
 static int
@@ -29,7 +29,7 @@ parse_argv_time(struct option_field const *field, char const *str,
     void *result)
 {
        if (str == NULL || strlen(str) == 0)
-               return pr_op_err("--%s needs an argument.", field->name);
+               return pr_err("--%s needs an argument.", field->name);
 
        return str2time(str, result);
 }
@@ -38,7 +38,7 @@ static int
 parse_json_time(struct option_field const *opt, json_t *json, void *result)
 {
        if (!json_is_string(json))
-               return pr_op_err("The '%s' element is not a JSON string.",
+               return pr_err("The '%s' element is not a JSON string.",
                    opt->name);
 
        return str2time(json_string_value(json), result);
index b4db53f3ba05e11b5ebe63a008f3713507a48a49..972359ab6d0b177e931bcbb8173fd0988d548e4c 100644 (file)
@@ -9,7 +9,7 @@
 static void
 print_uint(struct option_field const *field, void *value)
 {
-       pr_op_info("%s: %u", field->name, *((unsigned int *) value));
+       pr_inf("%s: %u", field->name, *((unsigned int *) value));
 }
 
 static int
@@ -22,7 +22,7 @@ parse_argv_uint(struct option_field const *field, char const *str,
 
        if (field->type->has_arg != required_argument || str == NULL ||
                    strlen(str) == 0) {
-               return pr_op_err("Integer options ('%s' in this case) require an argument.",
+               return pr_err("Integer options ('%s' in this case) require an argument.",
                    field->name);
        }
 
@@ -32,13 +32,13 @@ parse_argv_uint(struct option_field const *field, char const *str,
        if (error || *tmp != '\0') {
                if (!error)
                        error = EINVAL;
-               pr_op_err("Value '%s' at '%s' is not an unsigned integer: %s",
+               pr_err("Value '%s' at '%s' is not an unsigned integer: %s",
                    str, field->name, strerror(error));
                return error;
        }
 
        if (parsed < field->min || field->max < parsed) {
-               return pr_op_err("Value of '%s' is out of range (%u-%u).",
+               return pr_err("Value of '%s' is out of range (%u-%u).",
                    field->name, field->min, field->max);
        }
 
@@ -52,14 +52,14 @@ parse_json_uint(struct option_field const *opt, json_t *json, void *result)
        json_int_t value;
 
        if (!json_is_integer(json)) {
-               return pr_op_err("The '%s' element is not a JSON integer.",
+               return pr_err("The '%s' element is not a JSON integer.",
                    opt->name);
        }
 
        value = json_integer_value(json);
 
        if (value < opt->min || opt->max < value) {
-               return pr_op_err("Integer '%s' is out of range (%u-%u).",
+               return pr_err("Integer '%s' is out of range (%u-%u).",
                    opt->name, opt->min, opt->max);
        }
 
index a75327895fc04f8b52700280936ae4d0594e7a1d..b424620a195aff6c76851385c311cef993b29897 100644 (file)
@@ -40,14 +40,14 @@ daemonize(daemon_log_cb log_cb)
                error = errno;
                if (error == ENOMEM)
                        enomem_panic();
-               pr_op_err("Cannot get current directory: %s", strerror(error));
+               pr_err("Cannot get current directory: %s", strerror(error));
                return error;
        }
 
        pid = fork();
        if (pid < 0) {
                error = errno;
-               pr_op_err("Couldn't fork to daemonize: %s", strerror(error));
+               pr_err("Couldn't fork to daemonize: %s", strerror(error));
                return error;
        }
 
@@ -61,7 +61,7 @@ daemonize(daemon_log_cb log_cb)
        /* Child goes on from here */
        if (setsid() < 0) {
                error = errno;
-               pr_op_err("Couldn't create new session, ending execution: %s",
+               pr_err("Couldn't create new session, ending execution: %s",
                    strerror(error));
                exit(error);
        }
@@ -78,7 +78,7 @@ daemonize(daemon_log_cb log_cb)
        pid = fork();
        if (pid < 0) {
                error = errno;
-               pr_op_err("Couldn't fork again to daemonize, ending execution: %s",
+               pr_err("Couldn't fork again to daemonize, ending execution: %s",
                    strerror(error));
                exit(error);
        }
@@ -99,7 +99,7 @@ daemonize(daemon_log_cb log_cb)
 
        if (chdir(pwd) < 0) {
                error = errno;
-               pr_op_err("Couldn't chdir() of daemon, ending execution: %s",
+               pr_err("Couldn't chdir() of daemon, ending execution: %s",
                    strerror(error));
                exit(error);
        }
index 39221be353ce418319048441a85dbe3903494d32..3c739ee18f1c8651e8e18b4ca88e103fd44c82d8 100644 (file)
--- a/src/ext.c
+++ b/src/ext.c
@@ -883,16 +883,16 @@ handle_extension(struct extension_handler *handlers, X509_EXTENSION *ext)
         * Also "unknown" is misleading. I think it's only "unknown" if the NID
         * is -1 or something like that.
         */
-       return pr_val_err("Certificate has unknown extension. (Extension NID: %d)",
+       return pr_err("Certificate has unknown extension. (Extension NID: %d)",
            nid);
 dupe:
-       return pr_val_err("Certificate has more than one '%s' extension.",
+       return pr_err("Certificate has more than one '%s' extension.",
            handler->meta->name);
 not_critical:
-       return pr_val_err("Extension '%s' is supposed to be marked critical.",
+       return pr_err("Extension '%s' is supposed to be marked critical.",
            handler->meta->name);
 critical:
-       return pr_val_err("Extension '%s' is not supposed to be marked critical.",
+       return pr_err("Extension '%s' is not supposed to be marked critical.",
            handler->meta->name);
 }
 
@@ -913,7 +913,7 @@ handle_extensions(struct extension_handler *handlers,
 
        for (handler = handlers; handler->meta != NULL; handler++) {
                if (handler->mandatory && !handler->found)
-                       return pr_val_err("Certificate is missing the '%s' extension.",
+                       return pr_err("Certificate is missing the '%s' extension.",
                            handler->meta->name);
        }
 
@@ -923,7 +923,7 @@ handle_extensions(struct extension_handler *handlers,
 int
 cannot_decode(struct extension_metadata const *meta)
 {
-       return pr_val_err("Extension '%s' seems to be malformed. Cannot decode.",
+       return pr_err("Extension '%s' seems to be malformed. Cannot decode.",
            meta->name);
 }
 
@@ -974,21 +974,21 @@ validate_public_key_hash(X509 *cert, ASN1_OCTET_STRING *hash, char const *hash_n
        /* Get the SPK (ask libcrypto) */
        pubkey = X509_get_X509_PUBKEY(cert);
        if (pubkey == NULL)
-               return val_crypto_err("X509_get_X509_PUBKEY() returned NULL");
+               return pr_crypto_err("X509_get_X509_PUBKEY() returned NULL");
 
        ok = X509_PUBKEY_get0_param(NULL, &spk, &spk_len, NULL, pubkey);
        if (!ok)
-               return val_crypto_err("X509_PUBKEY_get0_param() returned %d", ok);
+               return pr_crypto_err("X509_PUBKEY_get0_param() returned %d", ok);
 
        /* FIXME the max limit needs to be a lot less than SIZE_MAX. */
        if (spk_len < 0 || SIZE_MAX < spk_len) {
-               return pr_val_err("The Subject Public Key length (%d) is out of bounds. (0-%zu)",
+               return pr_err("The Subject Public Key length (%d) is out of bounds. (0-%zu)",
                    spk_len, SIZE_MAX);
        }
 
        error = hash_validate(hash_get_sha1(), spk, spk_len, hash->data, hash->length);
        if (error > 0) {
-               pr_val_err("The Subject Public Key's hash does not match the %s.",
+               pr_err("The Subject Public Key's hash does not match the %s.",
                    hash_name);
        }
 
@@ -1002,15 +1002,15 @@ handle_aki(void *ext, void *arg)
        X509 *parent = arg;
 
        if (aki->keyid == NULL) {
-               return pr_val_err("The %s lacks a keyIdentifier.",
+               return pr_err("The %s lacks a keyIdentifier.",
                    ext_aki()->name);
        }
        if (aki->issuer != NULL) {
-               return pr_val_err("The %s contains an authorityCertIssuer.",
+               return pr_err("The %s contains an authorityCertIssuer.",
                    ext_aki()->name);
        }
        if (aki->serial != NULL) {
-               return pr_val_err("The %s contains an authorityCertSerialNumber.",
+               return pr_err("The %s contains an authorityCertSerialNumber.",
                    ext_aki()->name);
        }
 
index a2a349f1564f41ab1c3cbb9232c7b8bd92f9775f..dca6ace9dcb2c1f3a301bce81e5b2e4e05bf060d 100644 (file)
@@ -16,18 +16,18 @@ file_open(char const *file_name, FILE **result, struct stat *stat)
        file = fopen(file_name, "rb");
        if (file == NULL) {
                error = errno;
-               pr_val_err("Could not open file '%s': %s", file_name,
+               pr_err("Could not open file '%s': %s", file_name,
                    strerror(error));
                return error;
        }
 
        if (fstat(fileno(file), stat) == -1) {
                error = errno;
-               pr_val_err("fstat(%s) failed: %s", file_name, strerror(error));
+               pr_err("fstat(%s) failed: %s", file_name, strerror(error));
                goto fail;
        }
        if (!S_ISREG(stat->st_mode)) {
-               error = pr_val_err("'%s' does not seem to be a file.", file_name);
+               error = pr_err("'%s' does not seem to be a file.", file_name);
                goto fail;
        }
 
@@ -48,7 +48,7 @@ file_write(char const *file_name, char const *mode, FILE **result)
        file = fopen(file_name, mode);
        if (file == NULL) {
                error = errno;
-               pr_val_err("Could not open file '%s' for writing: %s",
+               pr_err("Could not open file '%s' for writing: %s",
                    file_name, strerror(error));
                *result = NULL;
                return error;
@@ -73,7 +73,7 @@ write_file(char const *path, void const *bytes, size_t n)
                error = errno;
                if (!error) /* Linux's man page does not mention errno */
                        error = -1;
-               pr_val_err("Cannot write %s: %s", path, strerror(error));
+               pr_err("Cannot write %s: %s", path, strerror(error));
        }
 
        file_close(out);
@@ -83,14 +83,14 @@ write_file(char const *path, void const *bytes, size_t n)
 int
 file_write_txt(char const *path, char const *txt)
 {
-       pr_val_debug("echo 'blah blah' > %s", path);
+       pr_trc("echo 'blah blah' > %s", path);
        return write_file(path, txt, strlen(txt));
 }
 
 int
 file_write_bin(char const *path, unsigned char const *bytes, size_t n)
 {
-       pr_val_debug("echo 'beep boop' > %s", path);
+       pr_trc("echo 'beep boop' > %s", path);
        return write_file(path, bytes, n);
 }
 
@@ -98,7 +98,7 @@ void
 file_close(FILE *file)
 {
        if (fclose(file) == -1)
-               pr_val_err("fclose() failed: %s", strerror(errno));
+               pr_err("fclose() failed: %s", strerror(errno));
 }
 
 /*
@@ -131,7 +131,7 @@ file_load(char const *file_name, struct file_contents *fc, bool is_binary)
                         * code. It literally doesn't say how to get an error
                         * code.
                         */
-                       pr_val_err("File reading error. The error message is (possibly) '%s'",
+                       pr_err("File reading error. The error message is (possibly) '%s'",
                            strerror(error));
                        free(fc->buf);
                        goto end;
@@ -142,7 +142,7 @@ file_load(char const *file_name, struct file_contents *fc, bool is_binary)
                 * less bytes than requested like read() does. It's either
                 * "consumed everything", "EOF reached" or error.
                 */
-               pr_op_err_st("Likely programming error: fread() < file size (fr:%zu bs:%zu EOF:%d)",
+               pr_crit("Likely programming error: fread() < file size (fr:%zu bs:%zu EOF:%d)",
                    fread_result, fc->buflen, feof(file));
                free(fc->buf);
                error = EINVAL;
@@ -178,7 +178,7 @@ file_is_valid(char const *location, bool allow_file)
        bool result;
 
        if (stat(location, &attr) == -1) {
-               pr_op_err("stat(%s) failed: %s", location, strerror(errno));
+               pr_err("stat(%s) failed: %s", location, strerror(errno));
                return false;
        }
 
@@ -187,7 +187,7 @@ file_is_valid(char const *location, bool allow_file)
 
        result = is_file || is_dir;
        if (!result)
-               pr_op_err("'%s' does not seem to be a %s", location,
+               pr_err("'%s' does not seem to be a %s", location,
                    allow_file ? "file or directory" : "directory");
 
        return result;
@@ -201,7 +201,7 @@ file_rm_f(char const *path)
 {
        int error;
 
-       pr_op_debug("rm -f %s", path);
+       pr_trc("rm -f %s", path);
 
        if (remove(path) < 0) {
                error = errno;
@@ -219,7 +219,7 @@ rm(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf)
 {
        if (remove(fpath) < 0) {
                rm_error = errno;
-               pr_op_warn("Cannot remove '%s': %s", fpath, strerror(rm_error));
+               pr_wrn("Cannot remove '%s': %s", fpath, strerror(rm_error));
        }
 
        return 0; /* Remove as much as possible, regardless of error */
@@ -235,7 +235,7 @@ file_rm_rf(char const *path)
 {
        int error;
 
-       pr_op_debug("rm -rf %s", path);
+       pr_trc("rm -rf %s", path);
 
        /* TODO (performance) optimize that 32 */
        rm_error = 0;
@@ -250,7 +250,7 @@ file_rm_rf(char const *path)
                error = errno;
        }
 
-       pr_op_warn("Cannot remove '%s': %s", path, strerror(error));
+       pr_wrn("Cannot remove '%s': %s", path, strerror(error));
        return error;
 }
 
@@ -260,11 +260,11 @@ file_mkdir(char const *path, bool force)
 {
        int error;
 
-       pr_op_debug("mkdir %s%s", force ? "-f " : "", path);
+       pr_trc("mkdir %s%s", force ? "-f " : "", path);
        if (mkdir(path, CACHE_FILEMODE) < 0) {
                error = errno;
                if (!force || error != EEXIST) {
-                       pr_op_err("Cannot create '%s': %s",
+                       pr_err("Cannot create '%s': %s",
                            path, strerror(error));
                        return error;
                }
@@ -276,9 +276,9 @@ file_mkdir(char const *path, bool force)
 void
 file_ln(char const *oldpath, char const *newpath)
 {
-       pr_op_debug("ln %s %s", oldpath, newpath);
+       pr_trc("ln %s %s", oldpath, newpath);
        if (link(oldpath, newpath) < 0)
-               pr_op_warn("Could not hard-link %s to %s: %s",
+               pr_wrn("Could not hard-link %s to %s: %s",
                    newpath, oldpath, strerror(errno));
 }
 
@@ -312,7 +312,7 @@ cseq_next(struct cache_sequence *seq)
                len = snprintf(path, seq->pathlen, "%s/%lX",
                    seq->prefix, seq->next_id);
                if (len < 0) {
-                       pr_val_err("Cannot compute new cache path: Unknown cause.");
+                       pr_err("Cannot compute new cache path: Unknown cause.");
                        return NULL;
                }
                if (len < seq->pathlen) {
index d27f6b64e0a162f7acbc4a50f19e9b073c89ea1c..41d6470359c862dc4188c15efc4bf1d09062d284 100644 (file)
@@ -40,14 +40,14 @@ hash_setup(void)
 #if OPENSSL_VERSION_NUMBER >= 0x30000000L
        sha1.md = EVP_MD_fetch(NULL, "SHA1", NULL);
        if (sha1.md == NULL)
-               return pr_op_err("This version of libcrypto does not seem to support SHA1.");
+               return pr_err("This version of libcrypto does not seem to support SHA1.");
        sha1.size = EVP_MD_get_size(sha1.md);
        sha1.name = EVP_MD_get0_name(sha1.md);
 
        sha256.md = EVP_MD_fetch(NULL, "SHA256", NULL);
        if (sha256.md == NULL) {
                EVP_MD_free(sha1.md);
-               return pr_op_err("This version of libcrypto does not seem to support SHA256.");
+               return pr_err("This version of libcrypto does not seem to support SHA256.");
        }
        sha256.size = EVP_MD_get_size(sha256.md);
        sha256.name = EVP_MD_get0_name(sha256.md);
@@ -55,13 +55,13 @@ hash_setup(void)
 #else
        sha1.md = EVP_get_digestbyname("sha1");
        if (sha1.md == NULL)
-               return pr_op_err("This version of libcrypto does not seem to support SHA1.");
+               return pr_err("This version of libcrypto does not seem to support SHA1.");
        sha1.size = EVP_MD_size(sha1.md);
        sha1.name = EVP_MD_name(sha1.md);
 
        sha256.md = EVP_get_digestbyname("sha256");
        if (sha256.md == NULL)
-               return pr_op_err("This version of libcrypto does not seem to support SHA256.");
+               return pr_err("This version of libcrypto does not seem to support SHA256.");
        sha256.size = EVP_MD_size(sha256.md);
        sha256.name = EVP_MD_name(sha256.md);
 
@@ -114,7 +114,7 @@ hash_file(struct hash_algorithm const *algorithm, char const *filename,
                enomem_panic();
 
        if (!EVP_DigestInit_ex(ctx, algorithm->md, NULL)) {
-               error = val_crypto_err("EVP_DigestInit_ex() failed");
+               error = pr_crypto_err("EVP_DigestInit_ex() failed");
                goto end;
        }
 
@@ -122,24 +122,24 @@ hash_file(struct hash_algorithm const *algorithm, char const *filename,
                consumed = fread(buffer, 1, stat.st_blksize, file);
                error = ferror(file);
                if (error) {
-                       pr_val_err("File reading error. Error message (apparently): %s",
+                       pr_err("File reading error. Error message (apparently): %s",
                           strerror(error));
                        goto end;
                }
 
                if (!EVP_DigestUpdate(ctx, buffer, consumed)) {
-                       error = val_crypto_err("EVP_DigestUpdate() failed");
+                       error = pr_crypto_err("EVP_DigestUpdate() failed");
                        goto end;
                }
 
        } while (!feof(file));
 
        if (!EVP_DigestFinal_ex(ctx, result, &hash_size)) {
-               error = val_crypto_err("EVP_DigestFinal_ex() failed");
+               error = pr_crypto_err("EVP_DigestFinal_ex() failed");
                goto end;
        }
        if (hash_size != algorithm->size) {
-               error = pr_op_err("libcrypto returned a %s hash sized %u bytes.",
+               error = pr_err("libcrypto returned a %s hash sized %u bytes.",
                    algorithm->name, hash_size);
        }
 
@@ -164,7 +164,7 @@ hash_validate_file(struct hash_algorithm const *algorithm, char const *path,
        pr_clutter("Validating file hash: %s", path);
 
        if (expected_len != hash_get_size(algorithm))
-               return pr_val_err("%s string has bogus size: %zu",
+               return pr_err("%s string has bogus size: %zu",
                    hash_get_name(algorithm), expected_len);
 
        error = hash_file(algorithm, path, actual, &actual_len);
@@ -179,7 +179,7 @@ hash_validate_file(struct hash_algorithm const *algorithm, char const *path,
        return 0;
 
 fail:
-       error = pr_val_err("File '%s' does not match its expected hash.", path);
+       error = pr_err("File '%s' does not match its expected hash.", path);
 #ifdef UNIT_TESTING
        size_t i;
        printf("Expected: ");
@@ -208,13 +208,13 @@ hash_buffer(struct hash_algorithm const *algorithm,
            !EVP_DigestUpdate(ctx, content, content_len) ||
            !EVP_DigestFinal_ex(ctx, hash, &actual_len)) {
                EVP_MD_CTX_free(ctx);
-               return val_crypto_err("Buffer hashing failed");
+               return pr_crypto_err("Buffer hashing failed");
        }
 
        EVP_MD_CTX_free(ctx);
 
        if (actual_len != algorithm->size)
-               pr_crit("libcrypto returned a %s hash sized %u bytes.",
+               pr_panic("libcrypto returned a %s hash sized %u bytes.",
                    algorithm->name, actual_len);
 
        return 0;
index cf4c98e0bb53dfedf3a76e463e0e6472ffd9f8ee..f3d7bc73edd3fdb526a094a69aa5f57b26b509de 100644 (file)
@@ -15,7 +15,7 @@ http_init(void)
        CURLcode res;
        res = curl_global_init(CURL_GLOBAL_SSL);
        if (res != CURLE_OK)
-               return pr_op_err("Error initializing global curl (%s)",
+               return pr_err("Error initializing global curl (%s)",
                    curl_easy_strerror(res));
 
        return 0;
@@ -135,7 +135,7 @@ http_easy_init(struct http_handler *handler, curl_off_t ims)
 
        result = curl_easy_init();
        if (result == NULL)
-               return pr_val_err(
+               return pr_err(
                    "curl_easy_init() returned NULL; no error message given."
                );
 
@@ -217,14 +217,14 @@ validate_file_size(struct write_callback_arg *args)
        float ratio;
 
        if (args->error == EFBIG) {
-               pr_val_err("File too big (read: %zu bytes). Rejecting.",
+               pr_err("File too big (read: %zu bytes). Rejecting.",
                    args->total_bytes);
                return EFBIG;
        }
 
        ratio = args->total_bytes / (float) config_get_http_max_file_size();
        if (ratio > 0.4f) {
-               pr_op_warn("File size exceeds 40%% of the configured limit (%zu/%ld bytes).",
+               pr_wrn("File size exceeds 40%% of the configured limit (%zu/%ld bytes).",
                    args->total_bytes, config_get_http_max_file_size());
        }
 
@@ -240,7 +240,7 @@ get_http_response_code(struct http_handler *handler, long *http_code,
        res = curl_easy_getinfo(handler->curl, CURLINFO_RESPONSE_CODE,
            http_code);
        if (res != CURLE_OK) {
-               return pr_op_err_st("curl_easy_getinfo(CURLINFO_RESPONSE_CODE) returned '%s'. "
+               return pr_crit("curl_easy_getinfo(CURLINFO_RESPONSE_CODE) returned '%s'. "
                    "I think this is supposed to be illegal, so I'll have to drop URI '%s'.",
                    curl_err_string(handler, res), uri_str(uri));
        }
@@ -269,12 +269,12 @@ check_same_origin(struct uri const *src, char const *redirect)
 
        errmsg = uri_init(&redirect_url, redirect);
        if (errmsg)
-               return pr_val_err("Cannot parse redirect '%s' as a URI: %s",
+               return pr_err("Cannot parse redirect '%s' as a URI: %s",
                    redirect, errmsg);
 
        error = uri_same_origin(src, &redirect_url)
            ? 0
-           : pr_val_err("%s is redirecting to %s; disallowing because of different origin.",
+           : pr_err("%s is redirecting to %s; disallowing because of different origin.",
                  uri_str(src), uri_str(&redirect_url));
 
        uri_cleanup(&redirect_url);
@@ -303,7 +303,7 @@ http_download(struct uri const *src, char const *dst,
        unsigned int r;
        int error;
 
-       pr_val_info("HTTP GET: %s -> %s", uri_str(src), dst);
+       pr_inf("HTTP GET: %s -> %s", uri_str(src), dst);
 
        error = http_easy_init(&handler, ims);
        if (error)
@@ -326,7 +326,7 @@ http_download(struct uri const *src, char const *dst,
                res = curl_easy_perform(handler.curl); /* write_callback() */
                if (args.file != NULL)
                        file_close(args.file);
-               pr_val_debug("Done. Total bytes transferred: %zu",
+               pr_trc("Done. Total bytes transferred: %zu",
                    args.total_bytes);
 
                args.error = validate_file_size(&args);
@@ -342,7 +342,7 @@ http_download(struct uri const *src, char const *dst,
                }
 
                if (res != CURLE_OK) {
-                       pr_val_err("Error requesting URL: %s. (HTTP code: %ld)",
+                       pr_err("Error requesting URL: %s. (HTTP code: %ld)",
                            curl_err_string(&handler, res), http_code);
 
                        switch (res) {
@@ -362,13 +362,13 @@ http_download(struct uri const *src, char const *dst,
                }
 
                if (http_code >= 400 || http_code == 204) {
-                       pr_val_err("HTTP result code: %ld", http_code);
+                       pr_err("HTTP result code: %ld", http_code);
                        error = handle_http_response_code(http_code);
                        goto end;
                }
                if (http_code == 304) {
                        /* Write callback not called, no file to remove. */
-                       pr_val_debug("Not modified.");
+                       pr_trc("Not modified.");
                        error = 0;
                        goto end;
                }
@@ -381,7 +381,7 @@ http_download(struct uri const *src, char const *dst,
                res = curl_easy_getinfo(handler.curl, CURLINFO_REDIRECT_URL,
                    &redirect);
                if (res != CURLE_OK) {
-                       error = pr_op_err("curl_easy_getinfo(CURLINFO_REDIRECT_URL) returned %u.", res);
+                       error = pr_err("curl_easy_getinfo(CURLINFO_REDIRECT_URL) returned %u.", res);
                        redirect = NULL;
                        goto end;
                }
@@ -390,7 +390,7 @@ http_download(struct uri const *src, char const *dst,
                        break;
                r++;
                if (r > config_get_max_redirs()) {
-                       error = pr_val_err("Too many redirects.");
+                       error = pr_err("Too many redirects.");
                        redirect = NULL;
                        goto end;
                }
@@ -402,7 +402,7 @@ http_download(struct uri const *src, char const *dst,
                redirect = pstrdup(redirect);
        } while (true);
 
-       pr_val_debug("HTTP result code: %ld", http_code);
+       pr_trc("HTTP result code: %ld", http_code);
        error = 0;
        if (changed != NULL)
                *changed = true;
index 41a2d2afdd51848630a80ff7bbd36cc576fe2b71..613a6c17cd4239254ca5bcd0ae9a2411b51d747f 100644 (file)
@@ -62,7 +62,7 @@ set_config_from_file(char *file)
 
        root = json_load_file(file, JSON_REJECT_DUPLICATES, &json_error);
        if (root == NULL) {
-               pr_op_err("JSON error on line %d, column %d: %s",
+               pr_err("JSON error on line %d, column %d: %s",
                    json_error.line, json_error.column, json_error.text);
                return ENOENT;
        }
index aa557e8bb20483c9a245c9f658406326bfb0f807..b6b075429da7ed9722be11bff0a8eada5996b492 100644 (file)
@@ -17,7 +17,7 @@ json_get_str(json_t *parent, char const *name, char const **result)
                return ENOENT;
 
        if (!json_is_string(child))
-               return -pr_op_err("Tag '%s' is not a JSON string.", name);
+               return -pr_err("Tag '%s' is not a JSON string.", name);
 
        *result = json_string_value(child);
        return 0;
@@ -38,7 +38,7 @@ json_get_uri(json_t *parent, char const *name, struct uri *result)
                return error;
        errmsg = uri_init(result, str);
        if (errmsg) {
-               pr_op_err("'%s' does not seem to be a URI: %s", str, errmsg);
+               pr_err("'%s' does not seem to be a URI: %s", str, errmsg);
                return -EINVAL;
        }
 
@@ -57,7 +57,7 @@ json_get_int_t(json_t *parent, char const *name, json_int_t *result)
                return ENOENT;
 
        if (!json_is_integer(child))
-               return -pr_op_err("Tag '%s' is not a JSON integer.", name);
+               return -pr_err("Tag '%s' is not a JSON integer.", name);
 
        *result = json_integer_value(child);
        return 0;
@@ -75,7 +75,7 @@ json_get_int(json_t *parent, char const *name, int *result)
        if (error)
                return error;
        if (json_int < INT_MIN || INT_MAX < json_int)
-               return -pr_op_err("Tag '%s' (%" JSON_INTEGER_FORMAT
+               return -pr_err("Tag '%s' (%" JSON_INTEGER_FORMAT
                    ") is out of range [%d, %d].",
                    name, json_int, INT_MIN, INT_MAX);
 
@@ -95,7 +95,7 @@ json_get_u32(json_t *parent, char const *name, uint32_t *result)
        if (error)
                return error;
        if (json_int < 0 || UINT32_MAX < json_int)
-               return -pr_op_err("Tag '%s' (%" JSON_INTEGER_FORMAT
+               return -pr_err("Tag '%s' (%" JSON_INTEGER_FORMAT
                    ") is out of range [0, %u].",
                    name, json_int, UINT32_MAX);
 
@@ -115,7 +115,7 @@ json_get_ulong(json_t *parent, char const *name, unsigned long *result)
        if (error)
                return error;
        if (json_int < 0 || ULONG_MAX < json_int)
-               return -pr_op_err("Tag '%s' (%" JSON_INTEGER_FORMAT
+               return -pr_err("Tag '%s' (%" JSON_INTEGER_FORMAT
                    ") is out of range [0, %lu].",
                    name, json_int, ULONG_MAX);
 
@@ -135,7 +135,7 @@ json_get_bigint(json_t *parent, char const *name, INTEGER_t *result)
 
        error = asn_str2INTEGER(str, result);
        if (error) {
-               pr_op_err("Tag '%s' (%s) cannot be parsed into an integer: %s",
+               pr_err("Tag '%s' (%s) cannot be parsed into an integer: %s",
                    name, str, strerror(error));
                return -error;
        }
@@ -168,7 +168,7 @@ json_get_array(json_t *parent, char const *name, json_t **array)
                return ENOENT;
 
        if (!json_is_array(child))
-               return -pr_op_err("Tag '%s' is not a JSON array.", name);
+               return -pr_err("Tag '%s' is not a JSON array.", name);
 
        *array = child;
        return 0;
@@ -187,7 +187,7 @@ json_get_object(json_t *parent, char const *name, json_t **obj)
 
        if (!json_is_object(child)) {
                *obj = NULL;
-               return -pr_op_err("Tag '%s' is not a JSON object.", name);
+               return -pr_err("Tag '%s' is not a JSON object.", name);
        }
 
        *obj = child;
@@ -210,7 +210,7 @@ int
 json_add_int(json_t *parent, char const *name, int value)
 {
        if (json_object_set_new(parent, name, json_integer(value)))
-               return pr_op_err(
+               return pr_err(
                    "Cannot convert %s '%d' to json; unknown cause.",
                    name, value
                );
@@ -222,7 +222,7 @@ int
 json_add_ulong(json_t *parent, char const *name, unsigned long value)
 {
        if (json_object_set_new(parent, name, json_integer(value)))
-               return pr_op_err(
+               return pr_err(
                    "Cannot convert %s '%lu' to json; unknown cause.",
                    name, value
                );
@@ -238,7 +238,7 @@ json_add_bigint(json_t *parent, char const *name, INTEGER_t *value)
 
        str = asn_INTEGER2str(value);
        if (!str)
-               return pr_op_err("Cannot convert %s to string.", name);
+               return pr_err("Cannot convert %s to string.", name);
 
        error = json_add_str(parent, name, str);
 
@@ -250,7 +250,7 @@ int
 json_add_str(json_t *parent, char const *name, char const *value)
 {
        if (json_object_set_new(parent, name, json_string(value)))
-               return pr_op_err(
+               return pr_err(
                    "Cannot convert %s '%s' to json; unknown cause.",
                    name, value
                );
@@ -262,7 +262,7 @@ int
 json_add_strn(json_t *parent, char const *name, char const *value, size_t len)
 {
        if (json_object_set_new(parent, name, json_stringn(value, len)))
-               return pr_op_err(
+               return pr_err(
                    "Cannot convert %s '%.*s' to json; unknown cause.",
                    name, (int)len, value
                );
@@ -278,13 +278,13 @@ json_add_ts(json_t *parent, char const *name, time_t value)
 
        error = time2str(value, str);
        if (error) {
-               pr_op_err("Cannot convert timestamp '%s' to json: %s",
+               pr_err("Cannot convert timestamp '%s' to json: %s",
                    name, strerror(error));
                return error;
        }
 
        if (json_object_set_new(parent, name, json_string(str)))
-               return pr_op_err(
+               return pr_err(
                    "Cannot convert timestamp '%s' to json; unknown cause.",
                    name
                );
@@ -299,7 +299,7 @@ json_obj_new(void)
 {
        json_t *json = json_object();
        if (json == NULL)
-               pr_op_err_st("Cannot create JSON object." OOM_PFX);
+               pr_crit("Cannot create JSON object." OOM_PFX);
        return json;
 }
 
@@ -308,7 +308,7 @@ json_array_new(void)
 {
        json_t *json = json_array();
        if (json == NULL)
-               pr_op_err_st("Cannot create JSON array." OOM_PFX);
+               pr_crit("Cannot create JSON array." OOM_PFX);
        return json;
 }
 
@@ -317,7 +317,7 @@ json_int_new(json_int_t value)
 {
        json_t *json = json_integer(value);
        if (json == NULL)
-               pr_op_err_st("Cannot create JSON integer '%lld'."
+               pr_crit("Cannot create JSON integer '%lld'."
                             OOM_PFX, value);
        return json;
 }
@@ -327,7 +327,7 @@ json_str_new(const char *value)
 {
        json_t *json = json_string(value);
        if (json == NULL)
-               pr_op_err_st("Cannot create JSON string '%s'." OOM_PFX, value);
+               pr_crit("Cannot create JSON string '%s'." OOM_PFX, value);
        return json;
 }
 
@@ -336,7 +336,7 @@ json_strn_new(const char *value, size_t len)
 {
        json_t *json = json_stringn(value, len);
        if (json == NULL)
-               pr_op_err_st("Cannot create JSON string '%.*s'."
+               pr_crit("Cannot create JSON string '%.*s'."
                             OOM_PFX, (int)len, value);
        return json;
 }
@@ -351,7 +351,7 @@ json_object_add(json_t *parent, char const *name, json_t *value)
 
        res = json_object_set_new(parent, name, value);
        if (res == -1)
-               pr_op_err_st("Cannot add JSON '%s' to parent; unknown error.",
+               pr_crit("Cannot add JSON '%s' to parent; unknown error.",
                             name);
        return res;
 }
@@ -366,6 +366,6 @@ json_array_add(json_t *array, json_t *node)
 
        res = json_array_append_new(array, node);
        if (res == -1)
-               pr_op_err_st("Cannot add JSON node to array; unknown error.");
+               pr_crit("Cannot add JSON node to array; unknown error.");
        return res;
 }
index 24314041b2f6a38ac65bd6002abbbb348cce5cb0..77295b1f33ee953a4d029dc5085793dad349a284 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -216,18 +216,6 @@ log_teardown(void)
        pthread_mutex_destroy(&logck);
 }
 
-bool
-pr_val_enabled(unsigned int level)
-{
-       return val_config.level >= level;
-}
-
-bool
-pr_op_enabled(unsigned int level)
-{
-       return op_config.level >= level;
-}
-
 static struct level const *
 level2struct(int level)
 {
@@ -399,13 +387,13 @@ end:      unlock_mutex();
        } while (0)
 
 void
-pr_op_debug(const char *format, ...)
+pr_trc(const char *format, ...)
 {
        PR_SIMPLE(LOG_DEBUG, op_config);
 }
 
 void
-pr_op_info(const char *format, ...)
+pr_inf(const char *format, ...)
 {
        PR_SIMPLE(LOG_INFO, op_config);
 }
@@ -415,21 +403,21 @@ pr_op_info(const char *format, ...)
  * validation.)
  */
 int
-pr_op_warn(const char *format, ...)
+pr_wrn(const char *format, ...)
 {
        PR_SIMPLE(LOG_WARNING, op_config);
        return 0;
 }
 
 int
-pr_op_err(const char *format, ...)
+pr_err(const char *format, ...)
 {
        PR_SIMPLE(LOG_ERR, op_config);
        return EINVAL;
 }
 
 int
-pr_op_err_st(const char *format, ...)
+pr_crit(const char *format, ...)
 {
        PR_SIMPLE(LOG_ERR, op_config);
        lock_mutex();
@@ -438,36 +426,6 @@ pr_op_err_st(const char *format, ...)
        return EINVAL;
 }
 
-void
-pr_val_debug(const char *format, ...)
-{
-       PR_SIMPLE(LOG_DEBUG, val_config);
-}
-
-void
-pr_val_info(const char *format, ...)
-{
-       PR_SIMPLE(LOG_INFO, val_config);
-}
-
-/**
- * Always returs 0. (So you can interrupt whatever you're doing without failing
- * validation.)
- */
-int
-pr_val_warn(const char *format, ...)
-{
-       PR_SIMPLE(LOG_WARNING, val_config);
-       return 0;
-}
-
-int
-pr_val_err(const char *format, ...)
-{
-       PR_SIMPLE(LOG_ERR, val_config);
-       return EINVAL;
-}
-
 struct crypto_cb_arg {
        unsigned int stack_size;
        int (*error_fn)(const char *, ...);
@@ -513,29 +471,10 @@ crypto_err(struct log_config *cfg, int (*error_fn)(const char *, ...))
  * Always appends a newline at the end.
  */
 int
-op_crypto_err(const char *format, ...)
+pr_crypto_err(const char *format, ...)
 {
        PR_SIMPLE(LOG_ERR, op_config);
-       return crypto_err(&op_config, pr_op_err);
-}
-
-/**
- * This is like pr_err() and pr_errno(), except meant to log an error made
- * during a libcrypto routine.
- *
- * This differs from usual printf-like functions:
- *
- * - It returns EINVAL, not bytes written.
- * - It prints a newline.
- * - Also prints the cryptolib's error message stack.
- *
- * Always appends a newline at the end.
- */
-int
-val_crypto_err(const char *format, ...)
-{
-       PR_SIMPLE(LOG_ERR, val_config);
-       return crypto_err(&val_config, pr_val_err);
+       return crypto_err(&op_config, pr_err);
 }
 
 __dead void
@@ -578,7 +517,7 @@ done:       exit(ENOMEM);
 }
 
 __dead void
-pr_crit(const char *format, ...)
+pr_panic(const char *format, ...)
 {
        PR_SIMPLE(LOG_ERR, op_config);
        print_stack_trace(NULL);
index d6fa4340630fec44bd43dc7e1680655db0eb4556..fc82c8e7812f807191135042b706a959062ef3a1 100644 (file)
--- a/src/log.h
+++ b/src/log.h
@@ -5,6 +5,8 @@
 #include <stdio.h>
 
 #define PR_COLOR_DBG   "\x1B[36m"      /* Cyan */
+#define PR_COLOR_CLT   "\x1B[34m"      /* Blue */
+#define PR_COLOR_TRC   "\x1B[32m"      /* Green */
 #define PR_COLOR_INF   "\x1B[37m"      /* White */
 #define PR_COLOR_WRN   "\x1B[33m"      /* Yellow */
 #define PR_COLOR_ERR   "\x1B[31m"      /* Red */
 #endif
 #endif
 
-/*
- * I know that the OpenBSD style guide says that we shouldn't declare our own
- * error printing functions, but we kind of need to do it:
- *
- * - It's convoluted to use err() and warn() on libcrypto errors.
- * - I was tasked with using syslog anyway, but the API is kind of limited
- *   (especially since vsyslog() is not portable.)
- * - We want to transparently always print offending file name.
- */
-
 #if __GNUC__
 #define CHECK_FORMAT(str, args) __attribute__((format(printf, str, args)))
 #else
-/*
- * No idea how this looks in other compilers.
- * It's safe to obviate since we're bound to see the warnings every time we use
- * GCC anyway.
- */
 #define CHECK_FORMAT(str, args) /* Nothing */
 #endif
 
@@ -57,65 +44,24 @@ int log_setup(void);
 void log_start(void);
 void log_teardown(void);
 
-/*
- * Check if corresponding logging is enabled. You can use these to short-circuit
- * out of heavy logging code.
- */
-bool pr_val_enabled(unsigned int level);
-bool pr_op_enabled(unsigned int level);
-
 #define pr_clutter_enabled() false
-#define pr_clutter(...) /* pr_op_debug(__VA_ARGS__) */
-
-/* == Operation logs == */
+#define pr_clutter(...)
 
-/* Status reports of no interest to the user. */
-void pr_op_debug(const char *, ...) CHECK_FORMAT(1, 2);
-/* Status reports likely useful to the user. */
-void pr_op_info(const char *, ...) CHECK_FORMAT(1, 2);
-/* Non-errors that suggest a problem. */
-int pr_op_warn(const char *, ...) CHECK_FORMAT(1, 2);
-/* Problematic situations that prevent Fort from doing its job. */
-int pr_op_err(const char *, ...) CHECK_FORMAT(1, 2);
-/* Like pr_op_err(), but it also prints a stack trace */
-int pr_op_err_st(const char *format, ...) CHECK_FORMAT(1, 2);
-/* Like pr_op_err(), except it prints libcrypto's error stack as well. */
-int op_crypto_err(const char *, ...) CHECK_FORMAT(1, 2);
+void pr_trc(const char *, ...) CHECK_FORMAT(1, 2);
+void pr_inf(const char *, ...) CHECK_FORMAT(1, 2);
+int pr_wrn(const char *, ...) CHECK_FORMAT(1, 2);
+int pr_err(const char *, ...) CHECK_FORMAT(1, 2);
+/* Like pr_err(), but also prints libcrypto's error stack */
+int pr_crypto_err(const char *, ...) CHECK_FORMAT(1, 2);
+int pr_crit(const char *format, ...) CHECK_FORMAT(1, 2);
+__dead void pr_panic(const char *, ...) CHECK_FORMAT(1, 2);
+__dead void enomem_panic(void); /* Out of memory */
 
-/* == Validation logs == */
-
-/* Status reports of no interest to the user. */
-void pr_val_debug(const char *, ...) CHECK_FORMAT(1, 2);
-/* Status reports likely useful to the user. */
-void pr_val_info(const char *, ...) CHECK_FORMAT(1, 2);
-/* Issues that did not trigger RPKI object rejection. */
-int pr_val_warn(const char *, ...) CHECK_FORMAT(1, 2);
-/* Problems that trigger RPKI object rejection. */
-int pr_val_err(const char *, ...) CHECK_FORMAT(1, 2);
-/* Like pr_val_err(), except it prints libcrypto's error stack as well. */
-int val_crypto_err(const char *, ...) CHECK_FORMAT(1, 2);
-
-/*
- * Like pr_*_err(), specific to out-of-memory situations.
- * Also terminates the program.
- */
-__dead void enomem_panic(void);
-/* Programming errors */
-__dead void pr_crit(const char *, ...) CHECK_FORMAT(1, 2);
-
-/*
- * Quick and dirty debugging messages.
- *
- * These are not meant to be uploaded; remember to delete them once the bug has
- * been found.
- */
-#define DBG_COLOR "\x1B[32m" /* Green */
-#define DBG_COLOR_RESET "\x1B[0m"
-#define PR_DEBUG \
-    printf(DBG_COLOR "%s:%d (%s())" DBG_COLOR_RESET "\n", \
-        __FILE__, __LINE__, __func__)
-#define PR_DEBUG_MSG(msg, ...) \
-    printf(DBG_COLOR "%s:%d (%s()): " msg DBG_COLOR_RESET "\n", \
+#define PR_DBG(msg, ...) \
+    printf(PR_COLOR_DBG "%s:%d (%s()): " msg PR_COLOR_RST "\n", \
         __FILE__, __LINE__, __func__, ##__VA_ARGS__)
+#define PR_HELLO \
+    printf(PR_COLOR_DBG "%s:%d (%s())" PR_COLOR_RST "\n", \
+        __FILE__, __LINE__, __func__)
 
 #endif /* SRC_LOG_H_ */
index cb0152624dca8324207469f861e290a1f8ae8799..3ebef4124d1f249b5b132c50a7d368f534788ed4 100644 (file)
@@ -24,15 +24,15 @@ fort_standalone(void)
 {
        int error;
 
-       pr_op_info("Updating cache...");
+       pr_inf("Updating cache...");
 
        error = vrps_update(NULL);
        if (error) {
-               pr_op_err("Validation unsuccessful; results unusable.");
+               pr_err("Validation unsuccessful; results unusable.");
                return error;
        }
 
-       pr_op_info("Done.");
+       pr_inf("Done.");
        return 0;
 }
 
@@ -42,7 +42,7 @@ fort_server(void)
        int error;
        bool changed;
 
-       pr_op_info("Main loop: Starting...");
+       pr_inf("Main loop: Starting...");
 
        error = rtr_start();
        if (error)
@@ -50,26 +50,26 @@ fort_server(void)
 
        error = vrps_update(NULL);
        if (error) {
-               pr_op_err("Main loop: Validation unsuccessful; results unusable.");
+               pr_err("Main loop: Validation unsuccessful; results unusable.");
                return error;
        }
 
        rtr_notify();
 
        /* TODO (#133) Stats ready; remove this message in a couple versions. */
-       pr_op_warn("First validation cycle successfully ended, now you can connect your router(s)");
+       pr_wrn("First validation cycle successfully ended, now you can connect your router(s)");
        stats_gauge_set(stat_rtr_ready, 1);
 
        do {
-               pr_op_info("Main loop: Sleeping.");
+               pr_inf("Main loop: Sleeping.");
                sleep(config_get_validation_interval());
-               pr_op_info("Main loop: Time to work!");
+               pr_inf("Main loop: Time to work!");
 
                error = vrps_update(&changed);
                if (error == EINTR)
                        break;
                if (error) {
-                       pr_op_debug("Main loop: %s", strerror(abs(error)));
+                       pr_trc("Main loop: %s", strerror(abs(error)));
                        continue;
                }
                if (changed)
index 2c41dca199c9731d825832c0ac91a0f0649d13b7..f3e1969d1f4a41ef7bb9a12e63eaf4fa74f19fad 100644 (file)
--- a/src/nid.c
+++ b/src/nid.c
@@ -29,13 +29,13 @@ register_oid(const char *oid, const char *sn, const char *ln)
                /* Note: Implicit object registration happens in OBJ_create. */
                nid = OBJ_create(oid, sn, ln);
                if (nid == 0) {
-                       op_crypto_err("Unable to register the %s NID.", sn);
+                       pr_crypto_err("Unable to register the %s NID.", sn);
                        return 0;
                }
-               pr_op_debug("%s registered. Its nid is %d.", sn, nid);
+               pr_trc("%s registered. Its nid is %d.", sn, nid);
 
        } else {
-               pr_op_debug("%s retrieved. Its nid is %d.", sn, nid);
+               pr_trc("%s retrieved. Its nid is %d.", sn, nid);
        }
 
        return nid;
index f81a019161cb06142add9be51f16a66e938304b2..e892b8d03735e9a2fc9a02bead96e7db580648a1 100644 (file)
@@ -16,7 +16,7 @@ asn_cb(struct asn_range const *range, void *arg)
        struct resource_params *params = arg;
 
        if (!resources_contains_asns(params->parent_resources, range))
-               return pr_val_err("BGPsec certificate is not allowed to contain ASN range %u-%u.",
+               return pr_err("BGPsec certificate is not allowed to contain ASN range %u-%u.",
                    range->min, range->max);
 
        return vhandle_router_key(params->ski, range, params->spk);
@@ -50,7 +50,7 @@ handle_bgpsec(X509 *cert, struct resources *parent_resources, struct rpp *pp)
 
        pub_key = X509_get_X509_PUBKEY(cert);
        if (pub_key == NULL) {
-               error = val_crypto_err("X509_get_X509_PUBKEY() returned NULL at BGPsec");
+               error = pr_crypto_err("X509_get_X509_PUBKEY() returned NULL at BGPsec");
                goto revert_resources;
        }
 
@@ -60,7 +60,7 @@ handle_bgpsec(X509 *cert, struct resources *parent_resources, struct rpp *pp)
        tmp = cert_spk;
        cert_spk_len = i2d_X509_PUBKEY(pub_key, &tmp);
        if (cert_spk_len != RK_SPKI_LEN) {
-               error = val_crypto_err("i2d_X509_PUBKEY() returned %d",
+               error = pr_crypto_err("i2d_X509_PUBKEY() returned %d",
                    cert_spk_len);
                goto revert_spk;
        }
index 7e4b416a48a29c428594ac606a7ce9235efe6ad3..b8559d6be1be7d521ce29b19c56df40ce84305b2 100644 (file)
@@ -126,7 +126,7 @@ validate_printable_string(char const *str, char const *what)
 {
        for (; *str != '\0'; str++)
                if (!is_valid_printable_string_char(*str))
-                       return pr_val_err("Invalid character in '%s' PrintableString: 0x%X",
+                       return pr_err("Invalid character in '%s' PrintableString: 0x%X",
                            what, *str);
        return 0;
 }
@@ -170,11 +170,11 @@ spki_cmp(X509_PUBKEY *tal_spki, X509_PUBKEY *cert_spki)
        ok = X509_PUBKEY_get0_param(&tal_alg, &tal_spk, &tal_spk_len, NULL,
            tal_spki);
        if (!ok)
-               return val_crypto_err("X509_PUBKEY_get0_param() 1 returned %d", ok);
+               return pr_crypto_err("X509_PUBKEY_get0_param() 1 returned %d", ok);
        ok = X509_PUBKEY_get0_param(&cert_alg, &cert_spk, &cert_spk_len, NULL,
            cert_spki);
        if (!ok)
-               return val_crypto_err("X509_PUBKEY_get0_param() 2 returned %d", ok);
+               return pr_crypto_err("X509_PUBKEY_get0_param() 2 returned %d", ok);
 
        if (OBJ_cmp(tal_alg, cert_alg) != 0)
                goto root_different_alg_err;
@@ -186,9 +186,9 @@ spki_cmp(X509_PUBKEY *tal_spki, X509_PUBKEY *cert_spki)
        return 0;
 
 root_different_alg_err:
-       return pr_val_err("TAL's public key algorithm is different than the root certificate's public key algorithm.");
+       return pr_err("TAL's public key algorithm is different than the root certificate's public key algorithm.");
 root_different_pk_err:
-       return pr_val_err("TAL's public key is different than the root certificate's public key.");
+       return pr_err("TAL's public key is different than the root certificate's public key.");
 }
 
 /*
@@ -228,12 +228,12 @@ decode_spki(struct tal *tal)
        spki = d2i_X509_PUBKEY(NULL, &cursor, len);
 
        if (spki == NULL) {
-               op_crypto_err("The TAL's public key cannot be decoded.");
+               pr_crypto_err("The TAL's public key cannot be decoded.");
                goto fail;
        }
        if (cursor != origin + len) {
                X509_PUBKEY_free(spki);
-               op_crypto_err("The TAL's public key contains trailing garbage.");
+               pr_crypto_err("The TAL's public key contains trailing garbage.");
                goto fail;
        }
 
@@ -251,7 +251,7 @@ validate_spki(struct tal *tal, X509_PUBKEY *cert_spki)
        int error;
 
        if (tal == NULL)
-               pr_crit("TAL is NULL.");
+               pr_panic("TAL is NULL.");
 
        /*
         * We have a problem at this point:
@@ -301,11 +301,11 @@ validate_subject_public_key(X509_PUBKEY *pubkey)
 
        key = X509_PUBKEY_get0(pubkey);
        if (key == NULL)
-               return val_crypto_err("X509_PUBKEY_get0() returned NULL");
+               return pr_crypto_err("X509_PUBKEY_get0() returned NULL");
 
        key_type = EVP_PKEY_get_base_id(key);
        if (key_type != EVP_PKEY_RSA && key_type != EVP_PKEY_RSA2)
-               return val_crypto_err("The public key type is not RSA: %u",
+               return pr_crypto_err("The public key type is not RSA: %u",
                    key_type);
 
        /*
@@ -341,9 +341,9 @@ validate_subject_public_key(X509_PUBKEY *pubkey)
         * *Shrug*. I'm sorry; it's the best I got.
         */
        if (!EVP_PKEY_get_size_t_param(key, OSSL_PKEY_PARAM_RSA_BITS, &bits))
-               return val_crypto_err("Cannot extract the modulus length from the public key");
+               return pr_crypto_err("Cannot extract the modulus length from the public key");
        if (bits < EXPECTED_BITS)
-               return pr_val_err("Certificate's subjectPublicKey (RSAPublicKey) modulus lengths %zu bits, not %zu bits",
+               return pr_err("Certificate's subjectPublicKey (RSAPublicKey) modulus lengths %zu bits, not %zu bits",
                    bits, EXPECTED_BITS);
        /*
         * I'm going to be a bit lenient with this, because a small amount of
@@ -351,7 +351,7 @@ validate_subject_public_key(X509_PUBKEY *pubkey)
         * (Notice this one's a warning.)
         */
        if (bits > EXPECTED_BITS)
-               pr_val_warn("Certificate's subjectPublicKey (RSAPublicKey) modulus lengths %zu bits, not %zu bits",
+               pr_wrn("Certificate's subjectPublicKey (RSAPublicKey) modulus lengths %zu bits, not %zu bits",
                    bits, EXPECTED_BITS);
 
        /*
@@ -361,9 +361,9 @@ validate_subject_public_key(X509_PUBKEY *pubkey)
         * equal to 65537. The default value is 65537.
         */
        if (!EVP_PKEY_get_size_t_param(key, OSSL_PKEY_PARAM_RSA_E, &exponent))
-               return val_crypto_err("Cannot extract the exponent from the public key");
+               return pr_crypto_err("Cannot extract the exponent from the public key");
        if (exponent != EXPECTED_EXPONENT)
-               return pr_val_err("Certificate's subjectPublicKey (RSAPublicKey) exponent is %zu, not %zu",
+               return pr_err("Certificate's subjectPublicKey (RSAPublicKey) exponent is %zu, not %zu",
                    exponent, EXPECTED_EXPONENT);
 
        return 0;
@@ -381,31 +381,31 @@ validate_subject_public_key(X509_PUBKEY *pubkey)
 
        pkey = X509_PUBKEY_get0(pubkey);
        if (pkey == NULL)
-               return val_crypto_err("The certificate's Subject Public Key is missing or malformed.");
+               return pr_crypto_err("The certificate's Subject Public Key is missing or malformed.");
 
        rsa = EVP_PKEY_get0_RSA(pkey);
        if (rsa == NULL)
-               return val_crypto_err("EVP_PKEY_get0_RSA() returned NULL");
+               return pr_crypto_err("EVP_PKEY_get0_RSA() returned NULL");
 
        modulus = RSA_bits(rsa);
        if (modulus < MODULUS)
-               return pr_val_err("Certificate's subjectPublicKey (RSAPublicKey) modulus is %d bits, not %d bits.",
+               return pr_err("Certificate's subjectPublicKey (RSAPublicKey) modulus is %d bits, not %d bits.",
                    modulus, MODULUS);
        if (modulus > MODULUS)
-               pr_val_warn("Certificate's subjectPublicKey (RSAPublicKey) modulus lengths %d bits, not %d bits",
+               pr_wrn("Certificate's subjectPublicKey (RSAPublicKey) modulus lengths %d bits, not %d bits",
                    modulus, MODULUS);
 
        RSA_get0_key(rsa, NULL, &exp, NULL);
        if (exp == NULL)
-               return pr_val_err("Certificate's subjectPublicKey (RSAPublicKey) exponent isn't set, must be "
+               return pr_err("Certificate's subjectPublicKey (RSAPublicKey) exponent isn't set, must be "
                    EXPONENT " bits.");
 
        exp_str = BN_bn2dec(exp);
        if (exp_str == NULL)
-               return val_crypto_err("Couldn't get subjectPublicKey exponent string");
+               return pr_crypto_err("Couldn't get subjectPublicKey exponent string");
 
        if (strcmp(EXPONENT, exp_str) != 0) {
-               error = pr_val_err("Certificate's subjectPublicKey (RSAPublicKey) exponent is %s, must be "
+               error = pr_err("Certificate's subjectPublicKey (RSAPublicKey) exponent is %s, must be "
                    EXPONENT " bits.", exp_str);
                free(exp_str);
                return error;
@@ -431,11 +431,11 @@ validate_public_key(struct rpki_certificate *cert)
        /* Reminder: X509_PUBKEY is the same as SubjectPublicKeyInfo. */
        pubkey = X509_get_X509_PUBKEY(cert->x509);
        if (pubkey == NULL)
-               return val_crypto_err("X509_get_X509_PUBKEY() returned NULL");
+               return pr_crypto_err("X509_get_X509_PUBKEY() returned NULL");
 
        ok = X509_PUBKEY_get0_param(NULL, NULL, NULL, &pa, pubkey);
        if (!ok)
-               return val_crypto_err("X509_PUBKEY_get0_param() returned %d", ok);
+               return pr_crypto_err("X509_PUBKEY_get0_param() returned %d", ok);
 
        if (cert->type == CERTYPE_BGPSEC)
                return validate_certificate_public_key_algorithm_bgpsec(pa);
@@ -465,9 +465,9 @@ validate_public_key(struct rpki_certificate *cert)
                if (error)
                        return error;
                if ((evppkey = X509_get0_pubkey(cert->x509)) == NULL)
-                       return val_crypto_err("X509_get0_pubkey() returned NULL");
+                       return pr_crypto_err("X509_get0_pubkey() returned NULL");
                if (X509_verify(cert->x509, evppkey) != 1)
-                       return val_crypto_err("Invalid signature.");
+                       return pr_crypto_err("Invalid signature.");
        }
 
        return 0;
@@ -489,7 +489,7 @@ validate_rfc6487(struct rpki_certificate *cert)
 
        /* rfc6487#section-4.1 */
        if (X509_get_version(cert->x509) != 2)
-               return pr_val_err("Certificate version is not v3.");
+               return pr_err("Certificate version is not v3.");
 
        /* rfc6487#section-4.2 */
        /* <Redacted> */
@@ -539,10 +539,10 @@ skip_t(ANY_t *content, struct progress *p, unsigned int tag)
        /* These errors happen when the object is not DER-encoded */
 
        if (content->buf[p->offset] != tag)
-               return pr_val_err("Expected tag 0x%x, got 0x%x.",
+               return pr_err("Expected tag 0x%x, got 0x%x.",
                    tag, content->buf[p->offset]);
        if (p->remaining == 0)
-               return pr_val_err("Buffer seems truncated.");
+               return pr_err("Buffer seems truncated.");
 
        p->offset++;
        p->remaining--;
@@ -562,9 +562,9 @@ skip_tl(ANY_t *content, struct progress *p, unsigned int tag)
        len_len = ber_fetch_length(true, &content->buf[p->offset], p->remaining,
            &value_len);
        if (len_len == -1)
-               return pr_val_err("Could not decipher length (Unknown cause).");
+               return pr_err("Could not decipher length (Unknown cause).");
        if (len_len == 0)
-               return pr_val_err("Buffer seems truncated.");
+               return pr_err("Buffer seems truncated.");
 
        p->offset += len_len;
        p->remaining -= len_len;
@@ -585,9 +585,9 @@ skip_tlv(ANY_t *content, struct progress *p, unsigned int tag)
        skip = ber_skip_length(NULL, is_constructed, &content->buf[p->offset],
            p->remaining);
        if (skip == -1)
-               return pr_val_err("Could not skip length (Unknown cause).");
+               return pr_err("Could not skip length (Unknown cause).");
        if (skip == 0)
-               return pr_val_err("Buffer seems truncated.");
+               return pr_err("Buffer seems truncated.");
 
        p->offset += skip;
        p->remaining -= skip;
@@ -660,9 +660,9 @@ find_signedAttrs(ANY_t *signedData, struct encoded_signedAttrs *result)
        len_len = ber_fetch_length(true, result->buffer,
            p.remaining, &result->size);
        if (len_len == -1)
-               return pr_val_err("Could not decipher length (Unknown cause.)");
+               return pr_err("Could not decipher length (Unknown cause.)");
        if (len_len == 0)
-               return pr_val_err("Buffer seems truncated.");
+               return pr_err("Buffer seems truncated.");
        result->size += len_len;
        return 0;
 }
@@ -685,16 +685,16 @@ validate_signature(X509 *cert, ANY_t *signedData,
 
        public_key = X509_get_X509_PUBKEY(cert);
        if (public_key == NULL)
-               return val_crypto_err("Certificate seems to lack a public key");
+               return pr_crypto_err("Certificate seems to lack a public key");
 
        /* Create the Message Digest Context */
        ctx = EVP_MD_CTX_create();
        if (ctx == NULL)
-               return val_crypto_err("EVP_MD_CTX_create() error");
+               return pr_crypto_err("EVP_MD_CTX_create() error");
 
        if (1 != EVP_DigestVerifyInit(ctx, NULL, EVP_sha256(), NULL,
            X509_PUBKEY_get0(public_key))) {
-               error = val_crypto_err("EVP_DigestVerifyInit() error");
+               error = pr_crypto_err("EVP_DigestVerifyInit() error");
                goto end;
        }
 
@@ -753,19 +753,19 @@ validate_signature(X509 *cert, ANY_t *signedData,
        error = EVP_DigestVerifyUpdate(ctx, &EXPLICIT_SET_OF_TAG,
            sizeof(EXPLICIT_SET_OF_TAG));
        if (1 != error) {
-               error = val_crypto_err("EVP_DigestVerifyInit() error");
+               error = pr_crypto_err("EVP_DigestVerifyInit() error");
                goto end;
        }
 
        error = EVP_DigestVerifyUpdate(ctx, signedAttrs.buffer,
            signedAttrs.size);
        if (1 != error) {
-               error = val_crypto_err("EVP_DigestVerifyInit() error");
+               error = pr_crypto_err("EVP_DigestVerifyInit() error");
                goto end;
        }
 
        if (1 != EVP_DigestVerifyFinal(ctx, signature->buf, signature->size)) {
-               error = val_crypto_err("Signed Object's signature is invalid");
+               error = pr_crypto_err("Signed Object's signature is invalid");
                goto end;
        }
 
@@ -784,17 +784,17 @@ load_certificate(char const *path)
 
        bio = BIO_new(BIO_s_file());
        if (bio == NULL) {
-               val_crypto_err("BIO_new(BIO_s_file()) returned NULL");
+               pr_crypto_err("BIO_new(BIO_s_file()) returned NULL");
                return NULL;
        }
        if (BIO_read_filename(bio, path) <= 0) {
-               val_crypto_err("Error reading certificate");
+               pr_crypto_err("Error reading certificate");
                goto end;
        }
 
        cert = d2i_X509_bio(bio, NULL);
        if (cert == NULL) {
-               val_crypto_err("Error parsing certificate");
+               pr_crypto_err("Error parsing certificate");
                goto end;
        }
 
@@ -894,14 +894,14 @@ build_trusted_stack(struct rpki_certificate *cert)
 
        stack = sk_X509_new_null();
        if (!stack) {
-               val_crypto_err("sk_X509_new_null() returned NULL.");
+               pr_crypto_err("sk_X509_new_null() returned NULL.");
                return NULL;
        }
 
        for (cert = cert->parent; cert != NULL; cert = cert->parent) {
                ret = sk_X509_push(stack, cert->x509);
                if (ret <= 0) {
-                       val_crypto_err("sk_X509_push returned %d.", ret);
+                       pr_crypto_err("sk_X509_push returned %d.", ret);
                        sk_X509_pop_free(stack, X509_free);
                        return NULL;
                }
@@ -918,12 +918,12 @@ build_crl_stack(struct rpki_certificate *cert)
 
        stack = sk_X509_CRL_new_null();
        if (!stack) {
-               val_crypto_err("sk_X509_CRL_new_null() returned NULL.");
+               pr_crypto_err("sk_X509_CRL_new_null() returned NULL.");
                return NULL;
        }
        ok = sk_X509_CRL_push(stack, cert->parent->rpp.crl.obj);
        if (ok != 1) {
-               val_crypto_err("sk_X509_CRL_push() returned %d.", ok);
+               pr_crypto_err("sk_X509_CRL_push() returned %d.", ok);
                return NULL;
        }
 
@@ -953,7 +953,7 @@ complain_crl_stale(X509_CRL *crl)
        lu = asn1time2str(X509_CRL_get0_lastUpdate(crl));
        nu = asn1time2str(X509_CRL_get0_nextUpdate(crl));
 
-       pr_val_err("CRL is stale/expired. (lastUpdate:%s, nextUpdate:%s)",
+       pr_err("CRL is stale/expired. (lastUpdate:%s, nextUpdate:%s)",
            lu, nu);
 
        free(lu);
@@ -982,17 +982,17 @@ validate_chain(struct rpki_certificate *cert)
 
        ctx = X509_STORE_CTX_new();
        if (ctx == NULL)
-               return val_crypto_err("X509_STORE_CTX_new() returned NULL");
+               return pr_crypto_err("X509_STORE_CTX_new() returned NULL");
 
        store = X509_STORE_new();
        if (!store) {
-               error = val_crypto_err("X509_STORE_new() returned NULL");
+               error = pr_crypto_err("X509_STORE_new() returned NULL");
                goto end1;
        }
 
        params = X509_VERIFY_PARAM_new();
        if (params == NULL) {
-               error = val_crypto_err("X509_VERIFY_PARAM_new() returned NULL");
+               error = pr_crypto_err("X509_VERIFY_PARAM_new() returned NULL");
                goto end2;
        }
 
@@ -1005,7 +1005,7 @@ validate_chain(struct rpki_certificate *cert)
        /* Returns 0 or 1 , all callers test ! only. */
        ok = X509_STORE_CTX_init(ctx, store, cert->x509, NULL);
        if (!ok) {
-               error = val_crypto_err("X509_STORE_CTX_init() returned %d", ok);
+               error = pr_crypto_err("X509_STORE_CTX_init() returned %d", ok);
                goto end3;
        }
 
@@ -1038,7 +1038,7 @@ validate_chain(struct rpki_certificate *cert)
        if (ok <= 0) {
                /*
                 * ARRRRGGGGGGGGGGGGG
-                * Do not use val_crypto_err() here; for some reason the proper
+                * Do not use pr_crypto_err() here; for some reason the proper
                 * error code is stored in the context.
                 */
                error = X509_STORE_CTX_get_error(ctx);
@@ -1046,7 +1046,7 @@ validate_chain(struct rpki_certificate *cert)
                        complain_crl_stale(cert->parent->rpp.crl.obj);
                        error = EINVAL;
                } else if (error)
-                       pr_val_err("Certificate validation failed: %s",
+                       pr_err("Certificate validation failed: %s",
                            X509_verify_cert_error_string(error));
                else {
                        /*
@@ -1054,7 +1054,7 @@ validate_chain(struct rpki_certificate *cert)
                         * That said, there's not much to do about !error,
                         * so hope for the best.
                         */
-                       val_crypto_err("Certificate validation failed: %d", ok);
+                       pr_crypto_err("Certificate validation failed: %d", ok);
                        error = EINVAL;
                }
                goto end5;
@@ -1096,17 +1096,17 @@ handle_ip_extension(struct rpki_certificate *cert, X509_EXTENSION *ext)
        case 2:
                family = &blocks->list.array[0]->addressFamily;
                if (get_addr_family(family) != AF_INET) {
-                       error = pr_val_err("First IP address block listed is not v4.");
+                       error = pr_err("First IP address block listed is not v4.");
                        goto end;
                }
                family = &blocks->list.array[1]->addressFamily;
                if (get_addr_family(family) != AF_INET6) {
-                       error = pr_val_err("Second IP address block listed is not v6.");
+                       error = pr_err("Second IP address block listed is not v6.");
                        goto end;
                }
                break;
        default:
-               error = pr_val_err("Got %d IP address blocks; 1 or 2 expected.",
+               error = pr_err("Got %d IP address blocks; 1 or 2 expected.",
                    blocks->list.count);
                goto end;
        }
@@ -1163,9 +1163,9 @@ __convert_resources(struct rpki_certificate *cert,
 
                if (nid == addr_nid) {
                        if (ip_ext_found)
-                               return pr_val_err("Multiple IP extensions found.");
+                               return pr_err("Multiple IP extensions found.");
                        if (!X509_EXTENSION_get_critical(ext))
-                               return pr_val_err("The IP extension is not marked as critical.");
+                               return pr_err("The IP extension is not marked as critical.");
 
                        ip_ext_found = true;
 
@@ -1175,9 +1175,9 @@ __convert_resources(struct rpki_certificate *cert,
 
                } else if (nid == asn_nid) {
                        if (asn_ext_found)
-                               return pr_val_err("Multiple AS extensions found.");
+                               return pr_err("Multiple AS extensions found.");
                        if (!X509_EXTENSION_get_critical(ext))
-                               return pr_val_err("The AS extension is not marked as critical.");
+                               return pr_err("The AS extension is not marked as critical.");
 
                        asn_ext_found = true;
 
@@ -1186,16 +1186,16 @@ __convert_resources(struct rpki_certificate *cert,
                                return error;
 
                } else if (nid == bad_addr_nid) {
-                       return pr_val_err("Certificate has an RFC%s policy, but contains an RFC%s IP extension.",
+                       return pr_err("Certificate has an RFC%s policy, but contains an RFC%s IP extension.",
                            policy_rfc, bad_ext_rfc);
                } else if (nid == bad_asn_nid) {
-                       return pr_val_err("Certificate has an RFC%s policy, but contains an RFC%s ASN extension.",
+                       return pr_err("Certificate has an RFC%s policy, but contains an RFC%s ASN extension.",
                            policy_rfc, bad_ext_rfc);
                }
        }
 
        if (!ip_ext_found && !asn_ext_found)
-               return pr_val_err("Certificate lacks both IP and AS extension.");
+               return pr_err("Certificate lacks both IP and AS extension.");
 
        return 0;
 }
@@ -1225,7 +1225,7 @@ convert_resources(struct rpki_certificate *cert)
                    "8360", "6484");
        }
 
-       pr_crit("Unknown policy: %u", cert->policy);
+       pr_panic("Unknown policy: %u", cert->policy);
        return EINVAL;
 }
 
@@ -1239,12 +1239,12 @@ handle_rpkiManifest(struct uri const *uri, void *arg)
        pr_clutter("rpkiManifest: %s", rm);
 
        if (!uri_is_rsync(uri)) {
-               pr_val_debug("Ignoring non-rsync rpkiManifest '%s'.", rm);
+               pr_trc("Ignoring non-rsync rpkiManifest '%s'.", rm);
                return ENOTSUP;
        }
 
        if (uri_str(&uris->rpkiManifest) != NULL) {
-               pr_val_warn("Ignoring additional rpkiManifest: %s", rm);
+               pr_wrn("Ignoring additional rpkiManifest: %s", rm);
                return 0;
        }
 
@@ -1262,12 +1262,12 @@ handle_caRepository(struct uri const *uri, void *arg)
        pr_clutter("caRepository: %s", cr);
 
        if (!uri_is_rsync(uri)) {
-               pr_val_debug("Ignoring non-rsync caRepository '%s'.", cr);
+               pr_trc("Ignoring non-rsync caRepository '%s'.", cr);
                return ENOTSUP;
        }
 
        if (uri_str(&uris->caRepository) != NULL) {
-               pr_val_warn("Ignoring additional caRepository: %s", cr);
+               pr_wrn("Ignoring additional caRepository: %s", cr);
                return 0;
        }
 
@@ -1285,12 +1285,12 @@ handle_rpkiNotify(struct uri const *uri, void *arg)
        pr_clutter("rpkiNotify: %s", rn);
 
        if (!uri_is_https(uri)) {
-               pr_val_debug("Ignoring non-https rpkiNotify '%s'.", rn);
+               pr_trc("Ignoring non-https rpkiNotify '%s'.", rn);
                return ENOTSUP;
        }
 
        if (uri_str(&uris->rpkiNotify) != NULL) {
-               pr_val_warn("Ignoring additional rpkiNotify: %s", rn);
+               pr_wrn("Ignoring additional rpkiNotify: %s", rn);
                return 0;
        }
 
@@ -1308,12 +1308,12 @@ handle_signedObject(struct uri const *uri, void *arg)
        pr_clutter("signedObject: %s", so);
 
        if (!uri_is_rsync(uri)) {
-               pr_val_debug("Ignoring non-rsync signedObject '%s'.", so);
+               pr_trc("Ignoring non-rsync signedObject '%s'.", so);
                return ENOTSUP;
        }
 
        if (uri_str(&sias->signedObject) != NULL) {
-               pr_val_warn("Ignoring additional signedObject: %s", so);
+               pr_wrn("Ignoring additional signedObject: %s", so);
                return 0;
        }
 
@@ -1334,7 +1334,7 @@ handle_bc(void *ext, void *arg)
 
        return (bc->pathlen == NULL)
            ? 0
-           : pr_val_err("%s extension contains a Path Length Constraint.",
+           : pr_err("%s extension contains a Path Length Constraint.",
                  ext_bc()->name);
 }
 
@@ -1361,7 +1361,7 @@ handle_ski_ee(void *ext, void *arg)
        sid = args->sid;
        if (ski->length != sid->size
            || memcmp(ski->data, sid->buf, sid->size) != 0) {
-               return pr_val_err("The EE certificate's subjectKeyIdentifier does not equal the Signed Object's sid.");
+               return pr_err("The EE certificate's subjectKeyIdentifier does not equal the Signed Object's sid.");
        }
 
        return 0;
@@ -1375,19 +1375,19 @@ handle_aki_ta(void *ext, void *arg)
        int error;
 
        if (aki->keyid == NULL) {
-               return pr_val_err("The '%s' extension lacks a keyIdentifier.",
+               return pr_err("The '%s' extension lacks a keyIdentifier.",
                    ext_aki()->name);
        }
 
        ski = X509_get_ext_d2i(arg, NID_subject_key_identifier, NULL, NULL);
        if (ski == NULL) {
-               pr_val_err("Certificate lacks the '%s' extension.",
+               pr_err("Certificate lacks the '%s' extension.",
                    ext_ski()->name);
                return ESRCH;
        }
 
        error = (ASN1_OCTET_STRING_cmp(aki->keyid, ski) != 0)
-             ? pr_val_err("The '%s' does not equal the '%s'.",
+             ? pr_err("The '%s' does not equal the '%s'.",
                           ext_aki()->name, ext_ski()->name)
              : 0;
 
@@ -1407,7 +1407,7 @@ handle_ku(ASN1_BIT_STRING *ku, unsigned char byte1)
        unsigned char data[2];
 
        if (ku->length != 2 && ku->length != 1) {
-               return pr_val_err("Bogus %s length: %d",
+               return pr_err("Bogus %s length: %d",
                    ext_ku()->name, ku->length);
        }
 
@@ -1415,7 +1415,7 @@ handle_ku(ASN1_BIT_STRING *ku, unsigned char byte1)
        memcpy(data, ku->data, ku->length);
 
        if (data[0] != byte1 || data[1] != 0) {
-               return pr_val_err("Illegal key usage flag string: %d%d%d%d%d%d%d%d%d",
+               return pr_err("Illegal key usage flag string: %d%d%d%d%d%d%d%d%d",
                    !!(data[0] & 0x80u), !!(data[0] & 0x40u),
                    !!(data[0] & 0x20u), !!(data[0] & 0x10u),
                    !!(data[0] & 0x08u), !!(data[0] & 0x04u),
@@ -1449,7 +1449,7 @@ gn2uri(GENERAL_NAME *ad, struct uri *uri)
 
        asn1str = GENERAL_NAME_get0_value(ad, &ptype);
        if (ptype != GEN_URI) {
-               pr_val_debug("Ignoring unknown GENERAL_NAME type: %d", ptype);
+               pr_trc("Ignoring unknown GENERAL_NAME type: %d", ptype);
                return ENOTSUP;
        }
 
@@ -1467,7 +1467,7 @@ gn2uri(GENERAL_NAME *ad, struct uri *uri)
 
        errmsg = uri_init(uri, str);
        if (errmsg)
-               pr_val_warn("Cannot parse GENERAL_NAME '%s' as a URI: %s",
+               pr_wrn("Cannot parse GENERAL_NAME '%s' as a URI: %s",
                    str, errmsg);
 
        free(str);
@@ -1485,7 +1485,7 @@ handle_cdp(void *ext, void *arg)
        char const *error_msg;
 
        if (sk_DIST_POINT_num(crldp) != 1) {
-               return pr_val_err("The %s extension has %d distribution points. (1 expected)",
+               return pr_err("The %s extension has %d distribution points. (1 expected)",
                    ext_cdp()->name, sk_DIST_POINT_num(crldp));
        }
 
@@ -1543,7 +1543,7 @@ handle_cdp(void *ext, void *arg)
        error_msg = "lacks an RSYNC URI";
 
 dist_point_error:
-       return pr_val_err("The %s extension's distribution point %s.",
+       return pr_err("The %s extension's distribution point %s.",
            ext_cdp()->name, error_msg);
 }
 
@@ -1586,7 +1586,7 @@ handle_ad(int nid, struct ad_metadata const *meta, SIGNATURE_INFO_ACCESS *ia,
 
                        if (found) {
                                uri_cleanup(&uri);
-                               return pr_val_err("Extension '%s' has multiple '%s' %s URIs.",
+                               return pr_err("Extension '%s' has multiple '%s' %s URIs.",
                                    meta->ia_name, meta->name, meta->type);
                        }
 
@@ -1602,7 +1602,7 @@ handle_ad(int nid, struct ad_metadata const *meta, SIGNATURE_INFO_ACCESS *ia,
        }
 
        if (meta->required && !found) {
-               pr_val_err("Extension '%s' lacks a '%s' valid %s URI.",
+               pr_err("Extension '%s' lacks a '%s' valid %s URI.",
                    meta->ia_name, meta->name, meta->type);
                return ESRCH;
        }
@@ -1616,7 +1616,7 @@ handle_caIssuers(struct uri const *uri, void *arg)
        struct extension_uris *sias = arg;
 
        if (!uri_is_rsync(uri)) {
-               pr_val_debug("Ignoring non-rsync caIssuers '%s'.", uri_str(uri));
+               pr_trc("Ignoring non-rsync caIssuers '%s'.", uri_str(uri));
                return ENOTSUP;
        }
 
@@ -1677,7 +1677,7 @@ handle_cp(void *ext, void *arg)
        int nid_cp, nid_qt_cps, pqi_num;
 
        if (sk_POLICYINFO_num(cp) != 1) {
-               return pr_val_err("The %s extension has %d policy information's. (1 expected)",
+               return pr_err("The %s extension has %d policy information's. (1 expected)",
                    ext_cp()->name, sk_POLICYINFO_num(cp));
        }
 
@@ -1688,11 +1688,11 @@ handle_cp(void *ext, void *arg)
                if (policy != NULL)
                        *policy = RPKI_POLICY_RFC6484;
        } else if (nid_cp == nid_certPolicyRpkiV2()) {
-               pr_val_debug("Found RFC8360 policy!");
+               pr_trc("Found RFC8360 policy!");
                if (policy != NULL)
                        *policy = RPKI_POLICY_RFC8360;
        } else {
-               return pr_val_err("Invalid certificate policy OID, isn't 'id-cp-ipAddr-asNumber' nor 'id-cp-ipAddr-asNumber-v2'");
+               return pr_err("Invalid certificate policy OID, isn't 'id-cp-ipAddr-asNumber' nor 'id-cp-ipAddr-asNumber-v2'");
        }
 
        /* Exactly one policy qualifier MAY be included (so none is also valid) */
@@ -1703,14 +1703,14 @@ handle_cp(void *ext, void *arg)
        if (pqi_num == 0)
                return 0;
        if (pqi_num != 1) {
-               return pr_val_err("The %s extension has %d policy qualifiers. (none or only 1 expected)",
+               return pr_err("The %s extension has %d policy qualifiers. (none or only 1 expected)",
                    ext_cp()->name, pqi_num);
        }
 
        pqi = sk_POLICYQUALINFO_value(pi->qualifiers, 0);
        nid_qt_cps = OBJ_obj2nid(pqi->pqualid);
        if (nid_qt_cps != NID_id_qt_cps)
-               return pr_val_err("Policy qualifier ID isn't Certification Practice Statement (CPS)");
+               return pr_err("Policy qualifier ID isn't Certification Practice Statement (CPS)");
 
        return 0;
 }
@@ -1720,7 +1720,7 @@ static int
 validate_aia(struct rpki_certificate *cert)
 {
        if (!uri_equals(&cert->parent->map.url, &cert->uris.caIssuers))
-               return pr_val_err("Certificate's caIssuers (%s) does not match parent certificate's URL (%s).",
+               return pr_err("Certificate's caIssuers (%s) does not match parent certificate's URL (%s).",
                    uri_str(&cert->parent->map.url),
                    uri_str(&cert->uris.caIssuers));
 
@@ -1733,12 +1733,12 @@ validate_cdp(struct rpki_certificate *cer)
        struct uri *crl_url = &cer->parent->rpp.crl.map->url;
 
        if (uri_str(&cer->uris.crldp) == NULL)
-               pr_crit("Certificate's CRL Distribution Point was not recorded.");
+               pr_panic("Certificate's CRL Distribution Point was not recorded.");
        if (uri_str(crl_url) == NULL)
-               pr_crit("Manifest's CRL was not recorded.");
+               pr_panic("Manifest's CRL was not recorded.");
 
        if (!uri_equals(&cer->uris.crldp, crl_url)) {
-               return pr_val_err("Certificate's CRL Distribution Point ('%s') does not match manifest's CRL ('%s').",
+               return pr_err("Certificate's CRL Distribution Point ('%s') does not match manifest's CRL ('%s').",
                    uri_str(&cer->uris.crldp), uri_str(crl_url));
        }
 
@@ -1912,7 +1912,7 @@ init_resources(struct rpki_certificate *cert)
         * part is already handled in convert_resources().
         */
        if (cert->type == CERTYPE_TA && resources_empty(cert->resources))
-               return pr_val_err("Trust Anchor certificate does not define any number resources.");
+               return pr_err("Trust Anchor certificate does not define any number resources.");
 
        return 0;
 }
@@ -1923,7 +1923,7 @@ validate_certificate(struct rpki_certificate *cert)
        int error;
 
        if (chain_length(cert) >= config_get_max_cert_depth())
-               return pr_val_err("Certificate chain maximum depth exceeded.");
+               return pr_err("Certificate chain maximum depth exceeded.");
 
        fnstack_push_map(&cert->map);
 
@@ -1951,7 +1951,7 @@ validate_certificate(struct rpki_certificate *cert)
 //                 validation_certstack(state)), rpp_parent);
                goto end;
        default:
-               pr_val_debug("Type: Unknown. Ignoring...");
+               pr_trc("Type: Unknown. Ignoring...");
                goto end;
        }
 
@@ -1993,7 +1993,7 @@ cer_traverse(struct rpki_certificate *ca)
        if (vv == VV_BUSY)
                return VV_BUSY;
        if (vv == VV_FAIL) {
-               pr_val_err("caRepository '%s' could not be refreshed, "
+               pr_err("caRepository '%s' could not be refreshed, "
                    "and there is no fallback in the cache. "
                    "I'm going to have to skip it.",
                    uri_str(&ca->uris.caRepository));
@@ -2005,7 +2005,7 @@ retry:    mft.path = cage_map_file(cage, &mft.url);
        if (!mft.path) {
                if (cage_downgrade(cage))
                        goto retry;
-               pr_val_err("caRepository '%s' is missing a manifest.",
+               pr_err("caRepository '%s' is missing a manifest.",
                    uri_str(&ca->uris.caRepository));
                vv = VV_FAIL;
                goto end;
@@ -2044,10 +2044,10 @@ static int
 validate_signedObject(struct extension_uris const *exts, struct uri const *url)
 {
        if (uri_str(&exts->signedObject) == NULL)
-               pr_crit("Certificate's signedObject was not recorded.");
+               pr_panic("Certificate's signedObject was not recorded.");
 
        if (!uri_equals(&exts->signedObject, url))
-               return pr_val_err("Certificate's signedObject ('%s') does not match the URI of its own signed object (%s).",
+               return pr_err("Certificate's signedObject ('%s') does not match the URI of its own signed object (%s).",
                    uri_str(&exts->signedObject), uri_str(url));
 
        return 0;
index f5e5ae0b5522f1332049b31ccfacf94e91ca4772..d2ed83409ec674166110cb47cf442d0b3515d1a8 100644 (file)
@@ -18,15 +18,15 @@ __crl_load(char const *path, X509_CRL **result)
 
        bio = BIO_new(BIO_s_file());
        if (bio == NULL)
-               return val_crypto_err("BIO_new(BIO_s_file()) returned NULL");
+               return pr_crypto_err("BIO_new(BIO_s_file()) returned NULL");
        if (BIO_read_filename(bio, path) <= 0) {
-               error = val_crypto_err("Error reading CRL");
+               error = pr_crypto_err("Error reading CRL");
                goto end;
        }
 
        crl = d2i_X509_CRL_bio(bio, NULL);
        if (crl == NULL) {
-               error = val_crypto_err("Error parsing CRL");
+               error = pr_crypto_err("Error parsing CRL");
                goto end;
        }
 
@@ -46,13 +46,13 @@ pr_clutter_revoked(ASN1_INTEGER const *serial_int)
 
        serial_bn = ASN1_INTEGER_to_BN(serial_int, NULL);
        if (serial_bn == NULL) {
-               val_crypto_err("Could not parse revoked serial number");
+               pr_crypto_err("Could not parse revoked serial number");
                return;
        }
 
        serial_str = BN_bn2dec(serial_bn);
        if (serial_str == NULL) {
-               val_crypto_err("Could not convert BN to string");
+               pr_crypto_err("Could not convert BN to string");
                goto end;
        }
 
@@ -79,7 +79,7 @@ validate_revoked(X509_CRL *crl)
 
                serial_int = X509_REVOKED_get0_serialNumber(revoked);
                if (serial_int == NULL) {
-                       return pr_val_err("CRL's revoked entry #%d lacks a serial number.",
+                       return pr_err("CRL's revoked entry #%d lacks a serial number.",
                            i + 1);
                }
 
@@ -87,11 +87,11 @@ validate_revoked(X509_CRL *crl)
                        pr_clutter_revoked(serial_int);
 
                if (X509_REVOKED_get0_revocationDate(revoked) == NULL) {
-                       return pr_val_err("CRL's revoked entry #%d lacks a revocation date.",
+                       return pr_err("CRL's revoked entry #%d lacks a revocation date.",
                            i + 1);
                }
                if (X509_REVOKED_get0_extensions(revoked) != NULL) {
-                       return pr_val_err("CRL's revoked entry #%d has extensions.",
+                       return pr_err("CRL's revoked entry #%d has extensions.",
                            i + 1);
                }
        }
@@ -145,7 +145,7 @@ crl_validate(X509_CRL *crl, X509 *parent)
 
        version = X509_CRL_get_version(crl);
        if (version != 1)
-               return pr_val_err("CRL version (%ld) is not v2 (%d).", version, 1);
+               return pr_err("CRL version (%ld) is not v2 (%d).", version, 1);
 
        error = validate_certificate_signature_algorithm(
            X509_CRL_get_signature_nid(crl), "CRL");
index 1a132306593dddd07a49757ad2d2056825132f34..e01233626d70464db55f4b1bb11545dcb3d4c719 100644 (file)
@@ -65,13 +65,13 @@ validate_dates(GeneralizedTime_t *this, GeneralizedTime_t *next,
 
        error = asn_GT2time(this, &thisUpdate);
        if (error)
-               return pr_val_err("Manifest's thisUpdate date is unparseable.");
+               return pr_err("Manifest's thisUpdate date is unparseable.");
        error = asn_GT2time(next, &nextUpdate);
        if (error)
-               return pr_val_err("Manifest's nextUpdate date is unparseable.");
+               return pr_err("Manifest's nextUpdate date is unparseable.");
 
        if (tm_cmp(&thisUpdate, &nextUpdate) > 0) {
-               return pr_val_err(
+               return pr_err(
                    "Manifest's thisUpdate (" TM_FMT ") > nextUpdate ("
                        TM_FMT ").",
                    TM_ARGS(thisUpdate),
@@ -83,21 +83,21 @@ validate_dates(GeneralizedTime_t *this, GeneralizedTime_t *next,
                now_tt = time_fatal();
 
        if (gmtime_r(&now_tt, &now) == NULL)
-               return pr_val_err("gmtime_r(now) error: %s", strerror(errno));
+               return pr_err("gmtime_r(now) error: %s", strerror(errno));
 
        if (tm_cmp(&now, &thisUpdate) < 0) {
-               return pr_val_err(
+               return pr_err(
                    "Manifest is not valid yet. (thisUpdate: " TM_FMT ")",
                    TM_ARGS(thisUpdate));
        }
        if (tm_cmp(&now, &nextUpdate) > 0) {
-               return pr_val_err("Manifest is stale. (nextUpdate: " TM_FMT ")",
+               return pr_err("Manifest is stale. (nextUpdate: " TM_FMT ")",
                    TM_ARGS(nextUpdate));
        }
 
        meta->update = timegm(&thisUpdate);
        if (meta->update == (time_t)-1)
-               return pr_val_err("Cannot convert '" TM_FMT "' to time_t: %s",
+               return pr_err("Cannot convert '" TM_FMT "' to time_t: %s",
                    TM_ARGS(thisUpdate), strerror(errno));
 
        return 0;
@@ -116,9 +116,9 @@ check_more_recent(struct cache_cage *cage, struct mft_meta *current)
                return 0;
 
        if (prev->num.size && INTEGER_cmp(&prev->num, &current->num) > 0)
-               return pr_val_err("The fallback manifest has a higher manifestNumber than the downloaded one.");
+               return pr_err("The fallback manifest has a higher manifestNumber than the downloaded one.");
        if (prev->update && difftime(prev->update, current->update) > 0)
-               return pr_val_err("The fallback manifest is newer than the downloaded one.");
+               return pr_err("The fallback manifest is newer than the downloaded one.");
 
        return 0;
 }
@@ -154,10 +154,10 @@ validate_manifest(struct Manifest *mft, struct cache_cage *cage,
                error = asn_INTEGER2ulong(mft->version, &version);
                if (error) {
                        if (errno) {
-                               pr_val_err("Error casting manifest version: %s",
+                               pr_err("Error casting manifest version: %s",
                                    strerror(errno));
                        }
-                       return pr_val_err("The manifest version isn't a valid unsigned long");
+                       return pr_err("The manifest version isn't a valid unsigned long");
                }
                if (version != 0)
                        return EINVAL;
@@ -168,7 +168,7 @@ validate_manifest(struct Manifest *mft, struct cache_cage *cage,
         * 20 octets."
         */
        if (mft->manifestNumber.size > 20)
-               return pr_val_err("Manifest number is larger than 20 octets");
+               return pr_err("Manifest number is larger than 20 octets");
        INTEGER_move(&meta->num, &mft->manifestNumber);
 
        /* rfc6486#section-4.4.3 */
@@ -238,14 +238,14 @@ validate_mft_filename(IA5String_t *ia5)
        size_t i;
 
        if (ia5->size < 5)
-               return pr_val_err("File name is too short (%zu < 5).", ia5->size);
+               return pr_err("File name is too short (%zu < 5).", ia5->size);
        dot = ia5->size - 4;
        if (ia5->buf[dot] != '.')
-               return pr_val_err("File name is missing three-letter extension.");
+               return pr_err("File name is missing three-letter extension.");
 
        for (i = 0; i < ia5->size; i++)
                if (i != dot && !is_valid_mft_file_chara(ia5->buf[i]))
-                       return pr_val_err("File name contains illegal character #%u",
+                       return pr_err("File name contains illegal character #%u",
                            ia5->buf[i]);
 
        return 0;
@@ -255,7 +255,7 @@ static int
 check_file_and_hash(struct FileAndHash *fah, char const *path)
 {
        if (fah->hash.bits_unused != 0)
-               return pr_val_err("Hash string has unused bits.");
+               return pr_err("Hash string has unused bits.");
 
        /* Includes file exists validation, obv. */
        return hash_validate_file(hash_get_sha256(), path,
@@ -292,7 +292,7 @@ collect_files(struct cache_mapping const *map,
        int error;
 
        if (mft->fileList.list.count == 0)
-               return pr_val_err("Manifest's file list is empty.");
+               return pr_err("Manifest's file list is empty.");
 
        rpp = &parent->rpp;
        error = uri_parent(&map->url, &rpp_url);
@@ -336,7 +336,7 @@ collect_files(struct cache_mapping const *map,
 
                dst->path = cage_map_file(cage, &dst->url);
                if (!dst->path) {
-                       error = pr_val_err(
+                       error = pr_err(
                            "Manifest file '%s' is absent from the cache.",
                            uri_str(&dst->url));
                        goto revert;
@@ -369,13 +369,13 @@ load_crl(struct rpki_certificate *parent)
        for (f = 0; f < rpp->nfiles; f++)
                if (uri_has_extension(&rpp->files[f].url, ".crl")) {
                        if (rpp->crl.map != NULL)
-                               return pr_val_err("Manifest has more than one CRL.");
+                               return pr_err("Manifest has more than one CRL.");
                        rpp->crl.map = &rpp->files[f];
                }
 
        /* rfc6486#section-7 */
        if (rpp->crl.map == NULL)
-               return pr_val_err("Manifest lacks a CRL.");
+               return pr_err("Manifest lacks a CRL.");
 
        return crl_load(rpp->crl.map, parent->x509, &rpp->crl.obj);
 }
index 32a4693790fb44220ea53abf9536437b9d29d512..2602fcab7a6d36ec19f937f60446435e4a16f5a5 100644 (file)
@@ -38,20 +38,20 @@ ____handle_roa_v4(struct resources *parent, unsigned long asn,
                error = asn_INTEGER2ulong(roa_addr->maxLength, &maxlen);
                if (error) {
                        if (errno) {
-                               pr_val_err("Error casting ROA's IPv4 maxLength: %s",
+                               pr_err("Error casting ROA's IPv4 maxLength: %s",
                                    strerror(errno));
                        }
-                       return pr_val_err("The ROA's IPv4 maxLength isn't a valid unsigned long");
+                       return pr_err("The ROA's IPv4 maxLength isn't a valid unsigned long");
                }
                pr_clutter("maxLength: %lu", maxlen);
 
                if (maxlen > 32) {
-                       return pr_val_err("maxLength (%lu) is out of bounds (0-32).",
+                       return pr_err("maxLength (%lu) is out of bounds (0-32).",
                            maxlen);
                }
 
                if (pfx.len > maxlen) {
-                       return pr_val_err("Prefix length (%u) > maxLength (%lu)",
+                       return pr_err("Prefix length (%u) > maxLength (%lu)",
                            pfx.len, maxlen);
                }
 
@@ -60,7 +60,7 @@ ____handle_roa_v4(struct resources *parent, unsigned long asn,
        }
 
        if (!resources_contains_ipv4(parent, &pfx)) {
-               return pr_val_err("ROA is not allowed to advertise %s/%u.",
+               return pr_err("ROA is not allowed to advertise %s/%u.",
                    addr2str4(&pfx.addr, buf), pfx.len);
        }
 
@@ -86,20 +86,20 @@ ____handle_roa_v6(struct resources *parent, unsigned long asn,
                error = asn_INTEGER2ulong(roa_addr->maxLength, &maxlen);
                if (error) {
                        if (errno) {
-                               pr_val_err("Error casting ROA's IPv6 maxLength: %s",
+                               pr_err("Error casting ROA's IPv6 maxLength: %s",
                                    strerror(errno));
                        }
-                       return pr_val_err("The ROA's IPv6 maxLength isn't a valid unsigned long");
+                       return pr_err("The ROA's IPv6 maxLength isn't a valid unsigned long");
                }
                pr_clutter("maxLength: %lu", maxlen);
 
                if (maxlen > 128) {
-                       return pr_val_err("maxLength (%lu) is out of bounds (0-128).",
+                       return pr_err("maxLength (%lu) is out of bounds (0-128).",
                            maxlen);
                }
 
                if (pfx.len > maxlen) {
-                       return pr_val_err("Prefix length (%u) > maxLength (%lu)",
+                       return pr_err("Prefix length (%u) > maxLength (%lu)",
                            pfx.len, maxlen);
                }
 
@@ -108,7 +108,7 @@ ____handle_roa_v6(struct resources *parent, unsigned long asn,
        }
 
        if (!resources_contains_ipv6(parent, &pfx)) {
-               return pr_val_err("ROA is not allowed to advertise %s/%u.",
+               return pr_err("ROA is not allowed to advertise %s/%u.",
                    addr2str6(&pfx.addr, buf), pfx.len);
        }
 
@@ -126,7 +126,7 @@ ____handle_roa(struct resources *parent, unsigned long asn, uint8_t family,
                return ____handle_roa_v6(parent, asn, roa_addr);
        }
 
-       return pr_val_err("Unknown family value: %u", family);
+       return pr_err("Unknown family value: %u", family);
 }
 
 static int
@@ -143,14 +143,14 @@ __handle_roa(struct RouteOriginAttestation *roa, struct resources *parent)
                error = asn_INTEGER2ulong(roa->version, &version);
                if (error) {
                        if (errno) {
-                               pr_val_err("Error casting ROA's version: %s",
+                               pr_err("Error casting ROA's version: %s",
                                    strerror(errno));
                        }
-                       return pr_val_err("The ROA's version isn't a valid long");
+                       return pr_err("The ROA's version isn't a valid long");
                }
                /* rfc6482#section-3.1 */
                if (version != 0) {
-                       return pr_val_err("ROA's version (%lu) is nonzero.",
+                       return pr_err("ROA's version (%lu) is nonzero.",
                            version);
                }
        }
@@ -158,24 +158,24 @@ __handle_roa(struct RouteOriginAttestation *roa, struct resources *parent)
        /* rfc6482#section-3.2 */
        if (asn_INTEGER2ulong(&roa->asId, &asn) != 0) {
                if (errno) {
-                       pr_val_err("Error casting ROA's AS ID value: %s",
+                       pr_err("Error casting ROA's AS ID value: %s",
                            strerror(errno));
                }
-               return pr_val_err("ROA's AS ID couldn't be parsed as unsigned long");
+               return pr_err("ROA's AS ID couldn't be parsed as unsigned long");
        }
 
        if (asn > UINT32_MAX)
-               return pr_val_err("AS value (%lu) is out of range.", asn);
+               return pr_err("AS value (%lu) is out of range.", asn);
 
        /* rfc6482#section-3.3 */
 
        if (roa->ipAddrBlocks.list.array == NULL)
-               return pr_val_err("ipAddrBlocks array is NULL.");
+               return pr_err("ipAddrBlocks array is NULL.");
 
        for (b = 0; b < roa->ipAddrBlocks.list.count; b++) {
                block = roa->ipAddrBlocks.list.array[b];
                if (block == NULL)
-                       return pr_val_err("Address block array element is NULL.");
+                       return pr_err("Address block array element is NULL.");
 
                if (block->addressFamily.size != 2)
                        goto family_error;
@@ -186,7 +186,7 @@ __handle_roa(struct RouteOriginAttestation *roa, struct resources *parent)
                        goto family_error;
 
                if (block->addresses.list.array == NULL)
-                       return pr_val_err("ROA's address list array is NULL.");
+                       return pr_err("ROA's address list array is NULL.");
 
                for (a = 0; a < block->addresses.list.count; a++) {
                        error = ____handle_roa(parent, asn,
@@ -200,7 +200,7 @@ __handle_roa(struct RouteOriginAttestation *roa, struct resources *parent)
        return 0;
 
 family_error:
-       return pr_val_err("ROA's IP family is not v4 or v6.");
+       return pr_err("ROA's IP family is not v4 or v6.");
 }
 
 int
index 2699d7ae3498138472fa60db0f0ceef269422ffd..68fb49f500c274ca97ea45afa52a7eb40d4c54fe 100644 (file)
@@ -36,7 +36,7 @@ validate_eContentType(struct SignedData *sdata, struct oid_arcs const *oid)
        equals = arcs_equal(&arcs, oid);
        free_arcs(&arcs);
        if (!equals) {
-               return pr_val_err("The OID of the SignedObject's encapContentInfo is not '%s'.",
+               return pr_err("The OID of the SignedObject's encapContentInfo is not '%s'.",
                    oid->name);
        }
 
@@ -61,7 +61,7 @@ validate_content_type(struct SignedData *sdata, struct oid_arcs const *oid)
        equals = arcs_equal(&arcs, oid);
        free_arcs(&arcs);
        if (!equals) {
-               return pr_val_err("The OID of the SignedObject's content type attribute is not '%s'.",
+               return pr_err("The OID of the SignedObject's content type attribute is not '%s'.",
                    oid->name);
        }
 
index 819e2db26bf8e5525f50ad59a1116888755531eb..aa4447d40bd2e2d57d1eaeefa494f1cd4794266e 100644 (file)
@@ -74,26 +74,26 @@ read_content(char *fc /* File Content */, struct tal *tal)
                        else
                                uri_cleanup(&url);
                } else {
-                       pr_op_debug("Ignoring URI '%s': %s", fc, error);
+                       pr_trc("Ignoring URI '%s': %s", fc, error);
                }
 
                fc = nl + cr + 1;
                if (*fc == '\0')
-                       return pr_op_err("The TAL seems to be missing the public key.");
+                       return pr_err("The TAL seems to be missing the public key.");
        } while (true);
 
        if (tal->urls.len == 0)
-               return pr_op_err("There seems to be an empty/blank line before the end of the URI section.");
+               return pr_err("There seems to be an empty/blank line before the end of the URI section.");
 
        /* subjectPublicKeyInfo section */
        if (!base64_decode(nl + cr + 1, 0, &tal->spki, &tal->spki_len))
-               return pr_op_err("Cannot decode the public key.");
+               return pr_err("Cannot decode the public key.");
 
        return 0;
 
 /* This label requires fc to make sense */
 premature:
-       return pr_op_err("The TAL seems to end prematurely at line '%s'.", fc);
+       return pr_err("The TAL seems to end prematurely at line '%s'.", fc);
 }
 
 /* @file_path is expected to outlive @tal. */
@@ -142,7 +142,7 @@ static int
 queue_tal(char const *tal_path, void *arg)
 {
        if (task_enqueue_tal(tal_path) < 1) {
-               pr_op_err("Could not enqueue task '%s'; abandoning validation.",
+               pr_err("Could not enqueue task '%s'; abandoning validation.",
                    tal_path);
                return EINVAL;
        }
@@ -235,7 +235,7 @@ traverse_tal(char const *tal_path)
        if (vv != VV_FAIL)
                goto end2;
 
-       pr_op_err("None of the TAL URIs yielded a successful traversal.");
+       pr_err("None of the TAL URIs yielded a successful traversal.");
        vv = VV_FAIL;
 
 end2:  tal_cleanup(&tal);
@@ -299,14 +299,14 @@ perform_standalone_validation(void)
        for (t = 0; t < 5; t++) {
                error = pthread_create(&threads[t], NULL, pick_up_work, NULL);
                if (error)
-                       pr_crit("pthread_create(%zu) failed: %s",
+                       pr_panic("pthread_create(%zu) failed: %s",
                            t, strerror(error));
        }
 
        for (t = 0; t < 5; t++) {
                error = pthread_join(threads[t], NULL);
                if (error)
-                       pr_crit("pthread_join(%zu) failed: %s",
+                       pr_panic("pthread_join(%zu) failed: %s",
                            t, strerror(error));
        }
 
index 0614707eb10af64844e85d3eeafeb6b16a69540b..d3a1e1a62d90612c3a67444a4be83fcc53db89ef 100644 (file)
@@ -79,7 +79,7 @@ analyze_pos(struct utf8_string *string, size_t pos)
 
        next1 = next_chara(string, pos);
        if (next1 == NULL) {
-               pr_val_err("vCard's final newline is incomplete ('\\r').");
+               pr_err("vCard's final newline is incomplete ('\\r').");
                return SA_ERROR;
        }
        if (*next1 != '\n')
@@ -127,7 +127,7 @@ line_next(struct vcard_line *line, OCTET_STRING_t *string8)
        size_t string_pos;
 
        if (string8->size == line->octet_string_offset)
-               return pr_val_err("vCard ends prematurely. (Expected an END line)");
+               return pr_err("vCard ends prematurely. (Expected an END line)");
 
        string.val = string8->buf + line->octet_string_offset;
        string.len = string8->size - line->octet_string_offset;
@@ -154,7 +154,7 @@ line_next(struct vcard_line *line, OCTET_STRING_t *string8)
                }
        }
 
-       return pr_val_err("vCard line does not end with a \\r\\n-style newline.");
+       return pr_err("vCard line does not end with a \\r\\n-style newline.");
 }
 
 static int
@@ -177,7 +177,7 @@ line_validate(struct vcard_line *line, char const *expected)
        return 0;
 
 fail:
-       return pr_val_err("Expected vCard property '%s', got '%s'.",
+       return pr_err("Expected vCard property '%s', got '%s'.",
            expected, line->str.val);
 }
 
@@ -231,7 +231,7 @@ __handle_ghostbusters_vcard(OCTET_STRING_t *vcard, struct vcard_line *line)
                        break;
 
                } else {
-                       return pr_val_err("Unexpected vCard line: '%s'",
+                       return pr_err("Unexpected vCard line: '%s'",
                            line->str.val);
                }
 
@@ -241,12 +241,12 @@ __handle_ghostbusters_vcard(OCTET_STRING_t *vcard, struct vcard_line *line)
        if (error)
                return error;
        if (vcard->size != line->octet_string_offset)
-               return pr_val_err("vCard has content after the END tag.");
+               return pr_err("vCard has content after the END tag.");
 
        if (!fn_found)
-               return pr_val_err("vCard lacks the 'FN' property.");
+               return pr_err("vCard lacks the 'FN' property.");
        if (!useful_found)
-               return pr_val_err("vCard lacks the 'ORG', 'ADR', 'TEL' and/or 'EMAIL' properties.");
+               return pr_err("vCard lacks the 'ORG', 'ADR', 'TEL' and/or 'EMAIL' properties.");
 
        return 0;
 }
index 3b5e10f2a7c5ab2774af3f2ea96446991f358a74..951ef9fe2c7558044f1ec076f4130d035cde0ed9 100644 (file)
@@ -20,9 +20,9 @@ output_setup(void)
        err1 = atexit(output_atexit);
        if (err1) {
                err2 = errno;
-               pr_op_err("Cannot register output's exit function.");
-               pr_op_err("Error message attempt 1: %s", strerror(err1));
-               pr_op_err("Error message attempt 2: %s", strerror(err2));
+               pr_err("Cannot register output's exit function.");
+               pr_err("Error message attempt 1: %s", strerror(err1));
+               pr_err("Error message attempt 2: %s", strerror(err2));
                return err1;
        }
 
@@ -49,7 +49,7 @@ print_roa_csv(struct vrp const *vrp, void *arg)
        char addr_buf[INET6_ADDRSTRLEN];
 
        if (vrp->addr_fam != AF_INET && vrp->addr_fam != AF_INET6)
-               pr_crit("Unknown family type");
+               pr_panic("Unknown family type");
 
        fprintf(arg, "AS%u,%s/%u,%u\n", vrp->asn,
            inet_ntop(vrp->addr_fam, &vrp->prefix, addr_buf, INET6_ADDRSTRLEN),
@@ -70,7 +70,7 @@ print_roa_json(struct vrp const *vrp, void *arg)
                fprintf(out, ",");
 
        if (vrp->addr_fam != AF_INET && vrp->addr_fam != AF_INET6)
-               pr_crit("Unknown family type");
+               pr_panic("Unknown family type");
 
        fprintf(out,
            "\n  { \"asn\": \"AS%u\", \"prefix\": \"%s/%u\", \"maxLength\": %u }",
@@ -90,12 +90,12 @@ print_router_key_csv(struct router_key const *key, void *arg)
        char *buf1, *buf2;
 
        if (!base64url_encode(key->ski, RK_SKI_LEN, &buf1)) {
-               op_crypto_err("Cannot encode SKI.");
+               pr_crypto_err("Cannot encode SKI.");
                return 0; /* Skip it, I guess */
        }
 
        if (!base64url_encode(key->spk, RK_SPKI_LEN, &buf2)) {
-               op_crypto_err("Cannot encode SPK.");
+               pr_crypto_err("Cannot encode SPK.");
                free(buf1);
                return 0; /* Skip it, I guess */
        }
@@ -116,12 +116,12 @@ print_router_key_json(struct router_key const *key, void *arg)
        char *buf1, *buf2;
 
        if (!base64url_encode(key->ski, RK_SKI_LEN, &buf1)) {
-               op_crypto_err("Cannot encode SKI.");
+               pr_crypto_err("Cannot encode SKI.");
                return 0; /* Skip it, I guess */
        }
 
        if (!base64url_encode(key->spk, RK_SPKI_LEN, &buf2)) {
-               op_crypto_err("Cannot encode SPK.");
+               pr_crypto_err("Cannot encode SPK.");
                free(buf1);
                return 0; /* Skip it, I guess */
        }
@@ -167,11 +167,11 @@ print_roas(struct db_table const *db)
        }
 
        if (error)
-               pr_op_err("Error printing ROAs: %s", strerror(error));
+               pr_err("Error printing ROAs: %s", strerror(error));
        if (out != stdout) {
                file_close(out);
                if (!error && rename(".roa", config_get_output_roa()) < 0)
-                       pr_op_err("Cannot move '.roa' to '%s': %s",
+                       pr_err("Cannot move '.roa' to '%s': %s",
                            config_get_output_roa(), strerror(errno));
        }
 }
@@ -201,11 +201,11 @@ print_router_keys(struct db_table const *db)
        }
 
        if (error)
-               pr_op_err("Error printing Router Keys: %s", strerror(error));
+               pr_err("Error printing Router Keys: %s", strerror(error));
        if (out != stdout) {
                file_close(out);
                if (!error && rename(".rk", config_get_output_bgpsec()) < 0)
-                       pr_op_err("Cannot move '.rk' to '%s': %s",
+                       pr_err("Cannot move '.rk' to '%s': %s",
                            config_get_output_bgpsec(), strerror(errno));
        }
 }
index 0b8fecc17ee41b7185165e0c7882745fc2fd444b..adea02de5c333bc5a6b59122e64cb9d748a6adf8 100644 (file)
@@ -32,7 +32,7 @@ __rsync2bio(char const *src, char const *dst)
 
        errmsg = uri_init(&url, src);
        if (errmsg) {
-               pr_op_err("Invalid URI: %s", errmsg);
+               pr_err("Invalid URI: %s", errmsg);
                return NULL;
        }
 
@@ -43,7 +43,7 @@ __rsync2bio(char const *src, char const *dst)
        uri_cleanup(&url);
 
        if (error) {
-               pr_op_err("rsync download failed: %s", strerror(error));
+               pr_err("rsync download failed: %s", strerror(error));
                return NULL;
        }
 
@@ -63,7 +63,7 @@ rsync2bio_tmpdir(char const *src)
        strcpy(buf, TMPDIR);
        tmpdir = mkdtemp(buf);
        if (tmpdir == NULL) {
-               pr_op_err("Unable to create " TMPDIR ": %s", strerror(errno));
+               pr_err("Unable to create " TMPDIR ": %s", strerror(errno));
                return NULL;
        }
 
@@ -77,7 +77,7 @@ rsync2bio_tmpdir(char const *src)
 static BIO *
 rsync2bio_cache(char const *src)
 {
-       pr_op_err("Disabled for now."); // XXX
+       pr_err("Disabled for now."); // XXX
        return NULL;
 
 //     char *dst;
@@ -85,7 +85,7 @@ rsync2bio_cache(char const *src)
 //
 //     dst = url2path(src);
 //     if (!dst) {
-//             pr_op_err("Unparseable rsync URI.");
+//             pr_err("Unparseable rsync URI.");
 //             return NULL;
 //     }
 //
@@ -152,56 +152,56 @@ guess_file_type(BIO **bio, unsigned char *hdrbuf)
 
        res = BIO_read(*bio, hdrbuf, HDRSIZE);
        if (res <= 0) {
-               op_crypto_err("Cannot guess file type; IO error.");
+               pr_crypto_err("Cannot guess file type; IO error.");
                return FT_UNK;
        }
 
        *bio = BIO_new_seq(BIO_new_mem_buf(hdrbuf, res), *bio);
        if ((*bio) == NULL) {
-               op_crypto_err("BIO_new_seq() returned NULL.");
+               pr_crypto_err("BIO_new_seq() returned NULL.");
                return FT_UNK;
        }
 
        if (hdrbuf[0] != 0x30) {
-               pr_op_debug("File doesn't start with a SEQUENCE.");
+               pr_trc("File doesn't start with a SEQUENCE.");
                return FT_UNK;
        }
        ptr = skip_sequence(hdrbuf, hdrbuf + 1);
        if (ptr == NULL) {
-               pr_op_debug("Cannot skip first sequence length.");
+               pr_trc("Cannot skip first sequence length.");
                return FT_UNK;
        }
 
        if (*ptr == 0x06) {
-               pr_op_debug("SEQ containing OID.");
+               pr_trc("SEQ containing OID.");
                return FT_ROA; /* Same parser for mfts and gbrs */
        }
        if (*ptr != 0x30) {
-               pr_op_debug("SEQ containing unexpected: 0x%x", *ptr);
+               pr_trc("SEQ containing unexpected: 0x%x", *ptr);
                return FT_UNK;
        }
 
        ptr = skip_sequence(hdrbuf, ptr + 1);
        if (ptr == NULL) {
-               pr_op_debug("Cannot skip second sequence length.");
+               pr_trc("Cannot skip second sequence length.");
                return FT_UNK;
        }
        ptr = skip_integer(hdrbuf, ptr + 1);
        if (ptr == NULL) {
-               pr_op_debug("Cannot skip version number.");
+               pr_trc("Cannot skip version number.");
                return FT_UNK;
        }
 
        if (*ptr == 0x02) {
-               pr_op_debug("SEQ containing SEQ containing (INT, INT).");
+               pr_trc("SEQ containing SEQ containing (INT, INT).");
                return FT_CER;
        }
        if (*ptr == 0x30) {
-               pr_op_debug("SEQ containing SEQ containing (INT, SEQ).");
+               pr_trc("SEQ containing SEQ containing (INT, SEQ).");
                return FT_CRL;
        }
 
-       pr_op_debug("SEQ containing SEQ containing unexpected: 0x%x", *ptr);
+       pr_trc("SEQ containing SEQ containing unexpected: 0x%x", *ptr);
        return FT_UNK;
 }
 
@@ -217,13 +217,13 @@ bio2ci(BIO *bio)
        do {
                res1 = BIO_read(bio, buffer, BUFFER_SIZE);
                if (res1 <= 0) {
-                       op_crypto_err("IO error.");
+                       pr_crypto_err("IO error.");
                        goto fail;
                }
 
                res2 = ber_decode(&asn_DEF_ContentInfo, (void **)&ci,
                                  buffer, res1);
-               pr_op_debug("Consumed: %zu", res2.consumed);
+               pr_trc("Consumed: %zu", res2.consumed);
 
                switch (res2.code) {
                case RC_OK:
@@ -233,7 +233,7 @@ bio2ci(BIO *bio)
                        break;
 
                case RC_FAIL:
-                       pr_op_err("Unsuccessful parse.");
+                       pr_err("Unsuccessful parse.");
                        goto fail;
                }
        } while (true);
@@ -268,12 +268,12 @@ __print_file(void)
 
        bio = filename2bio(config_get_payload());
        if (bio == NULL)
-               return pr_op_err("BIO_new_*() returned NULL.");
+               return pr_err("BIO_new_*() returned NULL.");
 
        switch (guess_file_type(&bio, hdrbuf)) {
        case FT_UNK:
                BIO_free_all(bio);
-               return pr_op_err("Unrecognized file type.");
+               return pr_err("Unrecognized file type.");
 
        case FT_ROA:
        case FT_MFT:
@@ -290,15 +290,15 @@ __print_file(void)
 
        BIO_free_all(bio);
        if (json == NULL)
-               return pr_op_err("Unable to parse.");
+               return pr_err("Unable to parse.");
 
        errno = 0;
        if (json_dumpf(json, stdout, JSON_INDENT(4)) < 0) {
                error = errno;
                if (error)
-                       pr_op_err("Error writing JSON to file: %s", strerror(error));
+                       pr_err("Error writing JSON to file: %s", strerror(error));
                else
-                       pr_op_err("Unknown error writing JSON to file.");
+                       pr_err("Unknown error writing JSON to file.");
 
        } else {
                error = 0;
index ed64589843e5da53e925466c850c9167a8cafb03..39fe1814e63e586e8166cc9279bc46898498e449 100644 (file)
@@ -82,7 +82,7 @@ set_content_type(struct MHD_Connection *conn, struct MHD_Response *res)
 
        ret = MHD_add_response_header(res, "Content-Type", ct);
        if (ret != MHD_YES) {
-               pr_op_debug("Could not set Content-Type HTTP header.");
+               pr_trc("Could not set Content-Type HTTP header.");
                /* Keep going; maybe the client won't care. */
        }
 }
@@ -94,7 +94,7 @@ send_metrics(struct MHD_Connection *conn)
        struct MHD_Response *res;
        MHD_RESULT ret;
 
-       pr_op_debug("Handling Prometheus request...");
+       pr_trc("Handling Prometheus request...");
 
        stats = stats_export();
 
@@ -111,7 +111,7 @@ send_metrics(struct MHD_Connection *conn)
        ret = MHD_queue_response(conn, MHD_HTTP_OK, res);
        MHD_destroy_response(res);
 
-       pr_op_debug("Prometheus request handled.");
+       pr_trc("Prometheus request handled.");
        return ret;
 }
 
@@ -140,7 +140,7 @@ prometheus_setup(void)
        if (config_get_mode() != SERVER || port == 0)
                return 0;
 
-       pr_op_debug("Starting Prometheus server...");
+       pr_trc("Starting Prometheus server...");
 
        prometheus_daemon = MHD_start_daemon(
            MHD_USE_THREAD_PER_CONNECTION,      /* flags */
@@ -151,9 +151,9 @@ prometheus_setup(void)
        );
 
        if (prometheus_daemon == NULL)
-               return pr_op_err("Could not start Prometheus server; Unknown error");
+               return pr_err("Could not start Prometheus server; Unknown error");
 
-       pr_op_debug("Prometheus server started.");
+       pr_trc("Prometheus server started.");
        return 0;
 }
 
index 5839cdf392177b81523761f5f895180dd8d790f3..1beb01902fe6f427ac0b9291952a543e77be72d1 100644 (file)
@@ -18,7 +18,7 @@ static xmlRelaxNGParserCtxtPtr rngparser;
        va_start(args, msg);                                            \
        vsnprintf(log_msg, LOG_MSG_LEN, msg, args);                     \
        va_end(args);                                                   \
-       pr_val_##level("%s", log_msg);
+       pr_##level("%s", log_msg);
 
 /*
  * Log callbacks for libxml errors
@@ -32,7 +32,7 @@ relax_ng_log_err(void *ctx, const char *msg, ...)
 static void
 relax_ng_log_warn(void *ctx, const char *msg, ...)
 {
-       VLOG_MSG(warn)
+       VLOG_MSG(wrn)
 }
 
 /* Signature changed at libxml2 commit 61034116d0a3c8b295c6137956adc3ae55720. */
@@ -45,7 +45,7 @@ relax_ng_log_warn(void *ctx, const char *msg, ...)
 static void
 relax_ng_log_str_err(void *userData, XMLERROR_PARAMTYPE error)
 {
-       pr_val_err("%s (at line %d)", error->message, error->line);
+       pr_err("%s (at line %d)", error->message, error->line);
 }
 
 /* Initialize global schema to parse RRDP files */
@@ -58,7 +58,7 @@ relax_ng_init(void)
 
        rngparser = xmlRelaxNGNewMemParserCtxt(RRDP_V1_RNG, strlen(RRDP_V1_RNG));
        if (rngparser == NULL) {
-               error = pr_op_err("XML parser init error: xmlRelaxNGNewMemParserCtxt() returned NULL");
+               error = pr_err("XML parser init error: xmlRelaxNGNewMemParserCtxt() returned NULL");
                goto cleanup_parser;
        }
 
@@ -67,7 +67,7 @@ relax_ng_init(void)
 
        schema = xmlRelaxNGParse(rngparser);
        if (schema == NULL) {
-               error = pr_op_err("XML parser init error: xmlRelaxNGParse() returned NULL");
+               error = pr_err("XML parser init error: xmlRelaxNGParse() returned NULL");
                goto free_parser_ctx;
        }
 
@@ -94,17 +94,17 @@ relax_ng_parse(const char *path, xml_read_cb cb, void *arg)
        /* TODO (warning) This uses "XML_CHAR_ENCODING_NONE" */
        reader = xmlNewTextReaderFilename(path);
        if (reader == NULL)
-               return pr_val_err("Unable to open %s (Cause unavailable).", path);
+               return pr_err("Unable to open %s (Cause unavailable).", path);
 
        error = xmlTextReaderRelaxNGSetSchema(reader, schema);
        if (error) {
-               error = pr_val_err("Couldn't set Relax NG schema.");
+               error = pr_err("Couldn't set Relax NG schema.");
                goto free_reader;
        }
 
        rngvalidctx = xmlRelaxNGNewValidCtxt(schema);
        if (rngvalidctx == NULL) {
-               error = pr_val_err("xmlRelaxNGNewValidCtxt() returned NULL");
+               error = pr_err("xmlRelaxNGNewValidCtxt() returned NULL");
                goto free_reader;
        }
 
@@ -113,7 +113,7 @@ relax_ng_parse(const char *path, xml_read_cb cb, void *arg)
 
        error = xmlTextReaderRelaxNGValidateCtxt(reader, rngvalidctx, 0);
        if (error) {
-               error = pr_val_err("Invalid XML document");
+               error = pr_err("Invalid XML document");
                goto free_valid_ctx;
        }
 
@@ -122,7 +122,7 @@ relax_ng_parse(const char *path, xml_read_cb cb, void *arg)
 
        while ((read = xmlTextReaderRead(reader)) == 1) {
                if (xmlTextReaderIsValid(reader) <= 0) {
-                       error = pr_val_err("XML document isn't valid.");
+                       error = pr_err("XML document isn't valid.");
                        goto free_valid_ctx;
                }
 
@@ -132,12 +132,12 @@ relax_ng_parse(const char *path, xml_read_cb cb, void *arg)
        }
 
        if (read < 0) {
-               error = pr_val_err("Error parsing XML document.");
+               error = pr_err("Error parsing XML document.");
                goto free_valid_ctx;
        }
 
        if (xmlTextReaderIsValid(reader) <= 0) {
-               error = pr_val_err("XML document isn't valid.");
+               error = pr_err("XML document isn't valid.");
                goto free_valid_ctx;
        }
 
index 3cf5ca4c07aa3e6b6053a3a8a9eb89ce5f8301cf..1b59ccf4a0a6f18c9b7920d3126dee94607f601c 100644 (file)
@@ -60,7 +60,7 @@ int
 get_addr_family(OCTET_STRING_t *octets)
 {
        if (octets->size != 2) {
-               pr_val_err("Address family has %zu octets. (2 expected.)",
+               pr_err("Address family has %zu octets. (2 expected.)",
                    octets->size);
                return -1;
        }
@@ -75,7 +75,7 @@ get_addr_family(OCTET_STRING_t *octets)
        }
 
 unknown:
-       pr_val_err("Address family has unknown value 0x%02x%02x.", octets->buf[0],
+       pr_err("Address family has unknown value 0x%02x%02x.", octets->buf[0],
            octets->buf[1]);
        return -1;
 }
@@ -84,12 +84,12 @@ static int
 inherit_aors(struct resources *resources, struct resources *parent, int family)
 {
        if (parent == NULL)
-               return pr_val_err("Root certificate is trying to inherit IP resources from a parent.");
+               return pr_err("Root certificate is trying to inherit IP resources from a parent.");
 
        switch (family) {
        case AF_INET:
                if (resources->ip4s != NULL)
-                       return pr_val_err("Certificate inherits IPv4 resources while also defining others of its own.");
+                       return pr_err("Certificate inherits IPv4 resources while also defining others of its own.");
                resources->ip4s = parent->ip4s;
                if (resources->ip4s != NULL)
                        res4_get(resources->ip4s);
@@ -98,7 +98,7 @@ inherit_aors(struct resources *resources, struct resources *parent, int family)
 
        case AF_INET6:
                if (resources->ip6s != NULL)
-                       return pr_val_err("Certificate inherits IPv6 resources while also defining others of its own.");
+                       return pr_err("Certificate inherits IPv6 resources while also defining others of its own.");
                resources->ip6s = parent->ip6s;
                if (resources->ip6s != NULL)
                        res6_get(resources->ip6s);
@@ -106,7 +106,7 @@ inherit_aors(struct resources *resources, struct resources *parent, int family)
                return 0;
        }
 
-       pr_crit("Unknown address family '%d'", family);
+       pr_panic("Unknown address family '%d'", family);
        return EINVAL; /* Warning shutupper */
 }
 
@@ -120,7 +120,7 @@ add_prefix4(struct resources *resources, struct resources *parent,
        enum resource_cmp_result result;
 
        if (parent && (resources->ip4s == parent->ip4s))
-               return pr_val_err("Certificate defines IPv4 prefixes while also inheriting his parent's.");
+               return pr_err("Certificate defines IPv4 prefixes while also inheriting his parent's.");
 
        error = prefix4_decode(addr, &prefix);
        if (error)
@@ -129,10 +129,10 @@ add_prefix4(struct resources *resources, struct resources *parent,
        if (parent && !res4_contains_prefix(parent->ip4s, &prefix)) {
                switch (resources->policy) {
                case RPKI_POLICY_RFC6484:
-                       return pr_val_err("Parent certificate doesn't own IPv4 prefix '%s/%u'.",
+                       return pr_err("Parent certificate doesn't own IPv4 prefix '%s/%u'.",
                            addr2str4(&prefix.addr, buf), prefix.len);
                case RPKI_POLICY_RFC8360:
-                       return pr_val_warn("Certificate is overclaiming the IPv4 prefix '%s/%u'.",
+                       return pr_wrn("Certificate is overclaiming the IPv4 prefix '%s/%u'.",
                            addr2str4(&prefix.addr, buf), prefix.len);
                }
        }
@@ -142,7 +142,7 @@ add_prefix4(struct resources *resources, struct resources *parent,
 
        result = res4_add_prefix(resources->ip4s, &prefix);
        if (result != RCR_OK) {
-               pr_val_err("Cannot add IPv4 prefix '%s/%u' to certificate resources: %s",
+               pr_err("Cannot add IPv4 prefix '%s/%u' to certificate resources: %s",
                    addr2str4(&prefix.addr, buf), prefix.len,
                    sarray_err2str(result));
                return EINVAL;
@@ -162,7 +162,7 @@ add_prefix6(struct resources *resources, struct resources *parent,
        enum resource_cmp_result result;
 
        if (parent && (resources->ip6s == parent->ip6s))
-               return pr_val_err("Certificate defines IPv6 prefixes while also inheriting his parent's.");
+               return pr_err("Certificate defines IPv6 prefixes while also inheriting his parent's.");
 
        error = prefix6_decode(addr, &prefix);
        if (error)
@@ -171,10 +171,10 @@ add_prefix6(struct resources *resources, struct resources *parent,
        if (parent && !res6_contains_prefix(parent->ip6s, &prefix)) {
                switch (resources->policy) {
                case RPKI_POLICY_RFC6484:
-                       return pr_val_err("Parent certificate doesn't own IPv6 prefix '%s/%u'.",
+                       return pr_err("Parent certificate doesn't own IPv6 prefix '%s/%u'.",
                            addr2str6(&prefix.addr, buf), prefix.len);
                case RPKI_POLICY_RFC8360:
-                       return pr_val_warn("Certificate is overclaiming the IPv6 prefix '%s/%u'.",
+                       return pr_wrn("Certificate is overclaiming the IPv6 prefix '%s/%u'.",
                            addr2str6(&prefix.addr, buf), prefix.len);
                }
        }
@@ -184,7 +184,7 @@ add_prefix6(struct resources *resources, struct resources *parent,
 
        result = res6_add_prefix(resources->ip6s, &prefix);
        if (result != RCR_OK) {
-               pr_val_err("Cannot add IPv6 prefix '%s/%u' to certificate resources: %s",
+               pr_err("Cannot add IPv6 prefix '%s/%u' to certificate resources: %s",
                    addr2str6(&prefix.addr, buf), prefix.len,
                    sarray_err2str(result));
                return EINVAL;
@@ -205,7 +205,7 @@ add_prefix(struct resources *resources, struct resources *parent,
                return add_prefix6(resources, parent, addr);
        }
 
-       pr_crit("Unknown address family '%d'", family);
+       pr_panic("Unknown address family '%d'", family);
        return EINVAL; /* Warning shutupper */
 }
 
@@ -220,7 +220,7 @@ add_range4(struct resources *resources, struct resources *parent,
        enum resource_cmp_result result;
 
        if (parent && (resources->ip4s == parent->ip4s))
-               return pr_val_err("Certificate defines IPv4 ranges while also inheriting his parent's.");
+               return pr_err("Certificate defines IPv4 ranges while also inheriting his parent's.");
 
        error = range4_decode(input, &range);
        if (error)
@@ -229,11 +229,11 @@ add_range4(struct resources *resources, struct resources *parent,
        if (parent && !res4_contains_range(parent->ip4s, &range)) {
                switch (resources->policy) {
                case RPKI_POLICY_RFC6484:
-                       return pr_val_err("Parent certificate doesn't own IPv4 range '%s-%s'.",
+                       return pr_err("Parent certificate doesn't own IPv4 range '%s-%s'.",
                            addr2str4(&range.min, buf1),
                            addr2str4(&range.max, buf2));
                case RPKI_POLICY_RFC8360:
-                       return pr_val_warn("Certificate is overclaiming the IPv4 range '%s-%s'.",
+                       return pr_wrn("Certificate is overclaiming the IPv4 range '%s-%s'.",
                            addr2str4(&range.min, buf1),
                            addr2str4(&range.max, buf2));
                }
@@ -244,7 +244,7 @@ add_range4(struct resources *resources, struct resources *parent,
 
        result = res4_add_range(resources->ip4s, &range);
        if (result != RCR_OK) {
-               pr_val_err("Cannot add IPv4 range '%s-%s' to certificate resources: %s",
+               pr_err("Cannot add IPv4 range '%s-%s' to certificate resources: %s",
                    addr2str4(&range.min, buf1),
                    addr2str4(&range.max, buf2),
                    sarray_err2str(result));
@@ -268,7 +268,7 @@ add_range6(struct resources *resources, struct resources *parent,
        enum resource_cmp_result result;
 
        if (parent && (resources->ip6s == parent->ip6s))
-               return pr_val_err("Certificate defines IPv6 ranges while also inheriting his parent's.");
+               return pr_err("Certificate defines IPv6 ranges while also inheriting his parent's.");
 
        error = range6_decode(input, &range);
        if (error)
@@ -277,11 +277,11 @@ add_range6(struct resources *resources, struct resources *parent,
        if (parent && !res6_contains_range(parent->ip6s, &range)) {
                switch (resources->policy) {
                case RPKI_POLICY_RFC6484:
-                       return pr_val_err("Parent certificate doesn't own IPv6 range '%s-%s'.",
+                       return pr_err("Parent certificate doesn't own IPv6 range '%s-%s'.",
                            addr2str6(&range.min, buf1),
                            addr2str6(&range.max, buf2));
                case RPKI_POLICY_RFC8360:
-                       return pr_val_warn("Certificate is overclaiming the IPv6 range '%s-%s'.",
+                       return pr_wrn("Certificate is overclaiming the IPv6 range '%s-%s'.",
                            addr2str6(&range.min, buf1),
                            addr2str6(&range.max, buf2));
                }
@@ -292,7 +292,7 @@ add_range6(struct resources *resources, struct resources *parent,
 
        result = res6_add_range(resources->ip6s, &range);
        if (result != RCR_OK) {
-               pr_val_err("Cannot add IPv6 range '%s-%s' to certificate resources: %s",
+               pr_err("Cannot add IPv6 range '%s-%s' to certificate resources: %s",
                    addr2str6(&range.min, buf1),
                    addr2str6(&range.max, buf2),
                    sarray_err2str(result));
@@ -316,7 +316,7 @@ add_range(struct resources *resources, struct resources *parent,
                return add_range6(resources, parent, range);
        }
 
-       pr_crit("Unknown address family '%d'", family);
+       pr_panic("Unknown address family '%d'", family);
        return EINVAL; /* Warning shutupper */
 }
 
@@ -329,9 +329,9 @@ add_aors(struct resources *resources, struct resources *parent, int family,
        int error;
 
        if (resources->force_inherit)
-               return pr_val_err("Certificate is only allowed to inherit resources, but defines its own IP addresses or ranges.");
+               return pr_err("Certificate is only allowed to inherit resources, but defines its own IP addresses or ranges.");
        if (aors->list.count == 0)
-               return pr_val_err("IP extension's set of IP address records is empty.");
+               return pr_err("IP extension's set of IP address records is empty.");
 
        for (i = 0; i < aors->list.count; i++) {
                aor = aors->list.array[i];
@@ -350,7 +350,7 @@ add_aors(struct resources *resources, struct resources *parent, int family,
                        break;
                case IPAddressOrRange_PR_NOTHING:
                        /* rfc3779#section-2.2.3.7 */
-                       return pr_val_err("Unknown IPAddressOrRange type: %u",
+                       return pr_err("Unknown IPAddressOrRange type: %u",
                            aor->present);
                }
        }
@@ -379,7 +379,7 @@ resources_add_ip(struct resources *resources, struct resources *parent,
        }
 
        /* rfc3779#section-2.2.3.4 */
-       return pr_val_err("Unknown ipAddressChoice type: %u",
+       return pr_err("Unknown ipAddressChoice type: %u",
            obj->ipAddressChoice.present);
 }
 
@@ -387,10 +387,10 @@ static int
 inherit_asiors(struct resources *resources, struct resources *parent)
 {
        if (parent == NULL)
-               return pr_val_err("Root certificate is trying to inherit AS resources from a parent.");
+               return pr_err("Root certificate is trying to inherit AS resources from a parent.");
 
        if (resources->asns != NULL)
-               return pr_val_err("Certificate inherits ASN resources while also defining others of its own.");
+               return pr_err("Certificate inherits ASN resources while also defining others of its own.");
 
        resources->asns = parent->asns;
        if (resources->asns != NULL)
@@ -409,14 +409,14 @@ ASId2u32(ASId_t *as_id, uint32_t *result)
        error = asn_INTEGER2ulong(as_id, &ulong);
        if (error) {
                if (errno) {
-                       pr_val_err("Error converting ASN value: %s",
+                       pr_err("Error converting ASN value: %s",
                            strerror(errno));
                }
-               return pr_val_err("ASN value is not a valid unsigned long");
+               return pr_err("ASN value is not a valid unsigned long");
        }
 
        if (ulong > ASN_MAX) {
-               return pr_val_err("ASN value '%lu' is out of bounds. (0-%lu)",
+               return pr_err("ASN value '%lu' is out of bounds. (0-%lu)",
                    ulong, ASN_MAX);
        }
 
@@ -431,17 +431,17 @@ add_asn(struct resources *resources, struct asn_range const *asns,
        enum resource_cmp_result result;
 
        if (asns->min > asns->max) {
-               return pr_val_err("The ASN range %u-%u is inverted.",
+               return pr_err("The ASN range %u-%u is inverted.",
                    asns->min, asns->max);
        }
 
        if (parent && !rasn_contains(parent->asns, asns)) {
                switch (resources->policy) {
                case RPKI_POLICY_RFC6484:
-                       return pr_val_err("Parent certificate doesn't own ASN range '%u-%u'.",
+                       return pr_err("Parent certificate doesn't own ASN range '%u-%u'.",
                            asns->min, asns->max);
                case RPKI_POLICY_RFC8360:
-                       return pr_val_warn("Certificate is overclaiming the ASN range '%u-%u'.",
+                       return pr_wrn("Certificate is overclaiming the ASN range '%u-%u'.",
                            asns->min, asns->max);
                }
        }
@@ -451,7 +451,7 @@ add_asn(struct resources *resources, struct asn_range const *asns,
 
        result = rasn_add(resources->asns, asns);
        if (result != RCR_OK) {
-               pr_val_err("Cannot add ASN range '%u-%u' to certificate resources: %s",
+               pr_err("Cannot add ASN range '%u-%u' to certificate resources: %s",
                    asns->min, asns->max, sarray_err2str(result));
                return EINVAL;
        }
@@ -471,7 +471,7 @@ add_asior(struct resources *resources, struct resources *parent,
        int error;
 
        if (parent && (resources->asns == parent->asns))
-               return pr_val_err("Certificate defines ASN resources while also inheriting his parent's.");
+               return pr_err("Certificate defines ASN resources while also inheriting his parent's.");
 
        switch (obj->present) {
        case ASIdOrRange_PR_NOTHING:
@@ -494,7 +494,7 @@ add_asior(struct resources *resources, struct resources *parent,
                return add_asn(resources, &asns, parent);
        }
 
-       return pr_val_err("Unknown ASIdOrRange type: %u", obj->present);
+       return pr_err("Unknown ASIdOrRange type: %u", obj->present);
 }
 
 static int
@@ -506,11 +506,11 @@ add_asiors(struct resources *resources, struct resources *parent,
        int error;
 
        if (resources->force_inherit)
-               return pr_val_err("Certificate is only allowed to inherit resources, but defines its own AS numbers.");
+               return pr_err("Certificate is only allowed to inherit resources, but defines its own AS numbers.");
 
        iors = &ids->asnum->choice.asIdsOrRanges;
        if (iors->list.count == 0)
-               return pr_val_err("AS extension's set of AS number records is empty.");
+               return pr_err("AS extension's set of AS number records is empty.");
 
        for (i = 0; i < iors->list.count; i++) {
                error = add_asior(resources, parent, iors->list.array[i]);
@@ -526,14 +526,14 @@ resources_add_asn(struct resources *resources, struct resources *parent,
     struct ASIdentifiers *ids, bool allow_inherit)
 {
        if (ids->asnum == NULL)
-               return pr_val_err("ASN extension lacks 'asnum' element.");
+               return pr_err("ASN extension lacks 'asnum' element.");
        if (ids->rdi != NULL)
-               return pr_val_err("ASN extension has 'rdi' element. (Prohibited by RFC6487)");
+               return pr_err("ASN extension has 'rdi' element. (Prohibited by RFC6487)");
 
        switch (ids->asnum->present) {
        case ASIdentifierChoice_PR_inherit:
                if (!allow_inherit)
-                       return pr_val_err("ASIdentifierChoice %u isn't allowed",
+                       return pr_err("ASIdentifierChoice %u isn't allowed",
                            ids->asnum->present);
                return inherit_asiors(resources, parent);
        case ASIdentifierChoice_PR_asIdsOrRanges:
@@ -542,7 +542,7 @@ resources_add_asn(struct resources *resources, struct resources *parent,
                break;
        }
 
-       return pr_val_err("Unknown ASIdentifierChoice: %u", ids->asnum->present);
+       return pr_err("Unknown ASIdentifierChoice: %u", ids->asnum->present);
 }
 
 bool
index faec03198b8411b1baa039b94e776170139c8605..9c5dd4ac575ba1f9f4f9bb3661523dec127dd626 100644 (file)
@@ -234,14 +234,14 @@ parse_ulong(xmlTextReaderPtr reader, char const *attr, unsigned long *result)
 
        str = xmlTextReaderGetAttribute(reader, BAD_CAST attr);
        if (str == NULL)
-               return pr_val_err("Couldn't find xml attribute '%s'", attr);
+               return pr_err("Couldn't find xml attribute '%s'", attr);
 
        errno = 0;
        *result = strtoul((char const *) str, NULL, 10);
        error = errno;
        xmlFree(str);
        if (error) {
-               pr_val_err("Invalid long value '%s': %s", str, strerror(error));
+               pr_err("Invalid long value '%s': %s", str, strerror(error));
                return error;
        }
 
@@ -283,12 +283,12 @@ parse_string(xmlTextReaderPtr reader, char const *attr)
        if (attr == NULL) {
                result = xmlTextReaderValue(reader);
                if (result == NULL)
-                       pr_val_err("Tag '%s' seems to be empty.",
+                       pr_err("Tag '%s' seems to be empty.",
                            xmlTextReaderConstLocalName(reader));
        } else {
                result = xmlTextReaderGetAttribute(reader, BAD_CAST attr);
                if (result == NULL)
-                       pr_val_err("Tag '%s' is missing attribute '%s'.",
+                       pr_err("Tag '%s' is missing attribute '%s'.",
                            xmlTextReaderConstLocalName(reader), attr);
        }
 
@@ -354,7 +354,7 @@ parse_hash(xmlTextReaderPtr reader, unsigned char **result, size_t *result_len)
 
        xmlFree(xmlattr);
        if (error)
-               return pr_val_err("The '" RRDP_ATTR_HASH "' xml attribute does not appear to be a SHA-256 hash.");
+               return pr_err("The '" RRDP_ATTR_HASH "' xml attribute does not appear to be a SHA-256 hash.");
        return 0;
 }
 
@@ -369,7 +369,7 @@ validate_version(xmlTextReaderPtr reader, unsigned long expected)
                return error;
 
        if (version != expected)
-               return pr_val_err("Invalid version, must be '%lu' and is '%lu'.",
+               return pr_err("Invalid version, must be '%lu' and is '%lu'.",
                    expected, version);
 
        return 0;
@@ -390,7 +390,7 @@ parse_serial(xmlTextReaderPtr reader, struct rrdp_serial *serial)
        if (BN_dec2bn(&serial->num, serial->str) == 0)
                goto fail;
        if (BN_is_negative(serial->num)) {
-               pr_val_err("Serial '%s' is negative.", serial->str);
+               pr_err("Serial '%s' is negative.", serial->str);
                goto fail;
        }
 
@@ -414,7 +414,7 @@ parse_session(xmlTextReaderPtr reader, struct rrdp_session *meta)
         */
        if (!xmlStrEqual(xmlTextReaderConstNamespaceUri(reader),
            BAD_CAST RRDP_NAMESPACE))
-               return pr_val_err("Namespace isn't '%s', current value is '%s'",
+               return pr_err("Namespace isn't '%s', current value is '%s'",
                    RRDP_NAMESPACE, xmlTextReaderConstNamespaceUri(reader));
 
        error = validate_version(reader, 1);
@@ -448,13 +448,13 @@ validate_session(xmlTextReaderPtr reader, struct parser_args *args)
                return error;
 
        if (strcmp(args->session->session_id, actual.session_id) != 0) {
-               error = pr_val_err("File session id [%s] doesn't match notification's session id [%s]",
+               error = pr_err("File session id [%s] doesn't match notification's session id [%s]",
                    args->session->session_id, actual.session_id);
                goto end;
        }
 
        if (BN_cmp(actual.serial.num, args->session->serial.num) != 0) {
-               error = pr_val_err("File serial [%s] doesn't match notification's serial [%s]",
+               error = pr_err("File serial [%s] doesn't match notification's serial [%s]",
                    actual.serial.str, args->session->serial.str);
                goto end;
        }
@@ -485,7 +485,7 @@ parse_file_metadata(xmlTextReaderPtr reader, struct file_metadata *meta)
        errmsg = uri_init(&meta->uri, (char const *)xmlattr);
        xmlFree(xmlattr);
        if (errmsg)
-               return pr_val_err("Cannot parse '%s' as a URI: %s",
+               return pr_err("Cannot parse '%s' as a URI: %s",
                    xmlattr, errmsg);
 
        error = parse_hash(reader, &meta->hash, &meta->hash_len);
@@ -529,7 +529,7 @@ handle_publish(xmlTextReaderPtr reader, struct parser_args *args)
        if (error)
                return error;
        if (xmlTextReaderRead(reader) != 1) {
-               error = pr_val_err(
+               error = pr_err(
                    "Couldn't read publish content of element '%s'",
                    uri_str(&tag.meta.uri)
                );
@@ -546,7 +546,7 @@ handle_publish(xmlTextReaderPtr reader, struct parser_args *args)
        }
        if (!base64_decode((char *)base64_str, 0, &tag.content, &tag.content_len)) {
                xmlFree(base64_str);
-               error = pr_val_err("Cannot decode publish tag's base64.");
+               error = pr_err("Cannot decode publish tag's base64.");
                goto end;
        }
        xmlFree(base64_str);
@@ -561,7 +561,7 @@ handle_publish(xmlTextReaderPtr reader, struct parser_args *args)
        if (file) {
                if (tag.meta.hash == NULL) {
                        // XXX watch out for this in the log before release
-                       error = pr_val_err("RRDP desync: "
+                       error = pr_err("RRDP desync: "
                            "<publish> is attempting to create '%s', "
                            "but the file is already cached.",
                            uri_str(&tag.meta.uri));
@@ -579,7 +579,7 @@ handle_publish(xmlTextReaderPtr reader, struct parser_args *args)
                 */
                if (remove(file->map.path) < 0) {
                        error = errno;
-                       pr_val_err("Cannot delete %s: %s",
+                       pr_err("Cannot delete %s: %s",
                            file->map.path, strerror(error));
                        if (error != ENOENT)
                                goto end;
@@ -588,7 +588,7 @@ handle_publish(xmlTextReaderPtr reader, struct parser_args *args)
        } else {
                if (tag.meta.hash != NULL) {
                        // XXX watch out for this in the log before release
-                       error = pr_val_err("RRDP desync: "
+                       error = pr_err("RRDP desync: "
                            "<publish> is attempting to overwrite '%s', "
                            "but the file is absent in the cache.",
                            uri_str(&tag.meta.uri));
@@ -623,7 +623,7 @@ handle_withdraw(xmlTextReaderPtr reader, struct parser_args *args)
        if (!is_known_extension(&tag.meta.uri))
                goto end; /* Mirror rsync filters */
        if (!tag.meta.hash) {
-               error = pr_val_err("Withdraw '%s' is missing a hash.",
+               error = pr_err("Withdraw '%s' is missing a hash.",
                    uri_str(&tag.meta.uri));
                goto end;
        }
@@ -633,7 +633,7 @@ handle_withdraw(xmlTextReaderPtr reader, struct parser_args *args)
        file = state_find_file(args->state, &tag.meta.uri);
 
        if (!file) {
-               error = pr_val_err("Broken RRDP: "
+               error = pr_err("Broken RRDP: "
                    "<withdraw> is attempting to delete unknown file '%s'.",
                    uri_str(&tag.meta.uri));
                goto end;
@@ -644,7 +644,7 @@ handle_withdraw(xmlTextReaderPtr reader, struct parser_args *args)
                goto end;
 
        if (remove(file->map.path) < 0) {
-               pr_val_warn("Cannot delete %s: %s", file->map.path,
+               pr_wrn("Cannot delete %s: %s", file->map.path,
                    strerror(errno));
                /* It's fine; keep going. */
        }
@@ -668,11 +668,11 @@ parse_notification_snapshot(xmlTextReaderPtr reader,
                return error;
 
        if (!notif->snapshot.hash)
-               return pr_val_err("Snapshot '%s' is missing a hash.",
+               return pr_err("Snapshot '%s' is missing a hash.",
                    uri_str(&notif->snapshot.uri));
 
        if (!uri_same_origin(notif->url, &notif->snapshot.uri))
-               return pr_val_err("Notification '%s' and Snapshot '%s' are not hosted by the same origin.",
+               return pr_err("Notification '%s' and Snapshot '%s' are not hosted by the same origin.",
                    uri_str(notif->url), uri_str(&notif->snapshot.uri));
 
        return 0;
@@ -694,13 +694,13 @@ parse_notification_delta(xmlTextReaderPtr reader,
                goto srl;
 
        if (!delta.meta.hash) {
-               error = pr_val_err("Delta '%s' is missing a hash.",
+               error = pr_err("Delta '%s' is missing a hash.",
                    uri_str(&delta.meta.uri));
                goto mta;
        }
 
        if (!uri_same_origin(notif->url, &delta.meta.uri)) {
-               error = pr_val_err("Notification %s and Delta %s are not hosted by the same origin.",
+               error = pr_err("Notification %s and Delta %s are not hosted by the same origin.",
                    uri_str(notif->url), uri_str(&delta.meta.uri));
                goto mta;
        }
@@ -723,24 +723,24 @@ swap_until_sorted(struct notification_delta *deltas, array_index i,
        while (true) {
                if (BN_cmp(deltas[i].serial.num, min) < 0) {
                        char *str = BN_bn2dec(min);
-                       pr_val_err(
+                       pr_err(
                            "Deltas: Serial '%s' is out of bounds. (min:%s)",
                            deltas[i].serial.str, str);
                        OPENSSL_free(str);
                        return EINVAL;
                }
                if (BN_cmp(max->num, deltas[i].serial.num) < 0)
-                       return pr_val_err(
+                       return pr_err(
                            "Deltas: Serial '%s' is out of bounds. (max:%s)",
                            deltas[i].serial.str, max->str);
 
                if (!BN_sub(target_slot, deltas[i].serial.num, min))
-                       return val_crypto_err("BN_sub() returned error.");
+                       return pr_crypto_err("BN_sub() returned error.");
                _target_slot = BN_get_word(target_slot);
                if (i == _target_slot)
                        return 0;
                if (BN_cmp(deltas[_target_slot].serial.num, deltas[i].serial.num) == 0) {
-                       return pr_val_err("Deltas: Serial '%s' is not unique.",
+                       return pr_err("Deltas: Serial '%s' is not unique.",
                            deltas[i].serial.str);
                }
 
@@ -774,14 +774,14 @@ sort_deltas(struct update_notification *notif)
        max_serial = &notif->session.serial;
        min_serial = BN_dup(max_serial->num);
        if (min_serial == NULL)
-               return val_crypto_err("BN_dup() returned NULL.");
+               return pr_crypto_err("BN_dup() returned NULL.");
        if (!BN_sub_word(min_serial, deltas->len - 1)) {
-               error = pr_val_err("Could not subtract %s - %zu; unknown cause.",
+               error = pr_err("Could not subtract %s - %zu; unknown cause.",
                    notif->session.serial.str, deltas->len - 1);
                goto end;
        }
        if (BN_is_negative(min_serial)) {
-               error = pr_val_err("Too many deltas (%zu) for serial %s. (Negative serials not implemented.)",
+               error = pr_err("Too many deltas (%zu) for serial %s. (Negative serials not implemented.)",
                    deltas->len, max_serial->str);
                goto end;
        }
@@ -819,7 +819,7 @@ xml_read_notif(xmlTextReaderPtr reader, void *arg)
                        return parse_session(reader, &notif->session);
                }
 
-               return pr_val_err("Unexpected '%s' element", name);
+               return pr_err("Unexpected '%s' element", name);
 
        case XML_READER_TYPE_END_ELEMENT:
                if (xmlStrEqual(name, BAD_CAST RRDP_ELEM_NOTIFICATION))
@@ -861,7 +861,7 @@ xml_read_snapshot(xmlTextReaderPtr reader, void *arg)
                else if (xmlStrEqual(name, BAD_CAST RRDP_ELEM_SNAPSHOT))
                        error = validate_session(reader, arg);
                else
-                       return pr_val_err("Unexpected '%s' element", name);
+                       return pr_err("Unexpected '%s' element", name);
                if (error)
                        return error;
                break;
@@ -890,7 +890,7 @@ validate_session_desync(struct rrdp_state *old_notif,
        size_t delta_threshold;
 
        if (strcmp(old_notif->session.session_id, new_notif->session.session_id) != 0) {
-               pr_val_debug("The Notification's session ID changed.");
+               pr_trc("The Notification's session ID changed.");
                return EINVAL;
        }
 
@@ -905,7 +905,7 @@ validate_session_desync(struct rrdp_state *old_notif,
 
                new_delta = &new_notif->deltas.array[i].meta;
                if (memcmp(old_delta->bytes, new_delta->hash, RRDP_HASH_LEN) != 0) {
-                       pr_val_debug("Notification delta hash does not match cached delta hash; RRDP session desynchronization detected.");
+                       pr_trc("Notification delta hash does not match cached delta hash; RRDP session desynchronization detected.");
                        return EINVAL;
                }
 
@@ -931,7 +931,7 @@ handle_snapshot(struct update_notification *new, struct rrdp_state *state)
        int error;
 
        url = &new->snapshot.uri;
-       pr_val_debug("Processing snapshot '%s'.", uri_str(url));
+       pr_trc("Processing snapshot '%s'.", uri_str(url));
        fnstack_push(uri_str(url));
 
        error = dl_tmp(url, tmppath);
@@ -965,7 +965,7 @@ xml_read_delta(xmlTextReaderPtr reader, void *arg)
                else if (xmlStrEqual(name, BAD_CAST RRDP_ELEM_DELTA))
                        error = validate_session(reader, arg);
                else
-                       return pr_val_err("Unexpected '%s' element", name);
+                       return pr_err("Unexpected '%s' element", name);
                if (error)
                        return error;
                break;
@@ -1006,7 +1006,7 @@ handle_delta(struct update_notification *notif,
 
        url = &delta->meta.uri;
 
-       pr_val_debug("Processing delta '%s'.", uri_str(url));
+       pr_trc("Processing delta '%s'.", uri_str(url));
        fnstack_push(uri_str(url));
 
        error = dl_tmp(url, tmppath);
@@ -1030,30 +1030,30 @@ handle_deltas(struct update_notification *notif, struct rrdp_state *state)
        int error;
 
        if (notif->deltas.len == 0) {
-               pr_val_warn("There's no delta list to process.");
+               pr_wrn("There's no delta list to process.");
                return ENOENT;
        }
 
        old = &state->session.serial;
        new = &notif->session.serial;
 
-       pr_val_debug("Handling RRDP delta serials %s-%s.", old->str, new->str);
+       pr_trc("Handling RRDP delta serials %s-%s.", old->str, new->str);
 
        diff_bn = BN_create();
        if (!BN_sub(diff_bn, new->num, old->num)) {
                BN_free(diff_bn);
-               return pr_val_err("Could not subtract %s - %s; unknown cause.",
+               return pr_err("Could not subtract %s - %s; unknown cause.",
                    new->str, old->str);
        }
        if (BN_is_negative(diff_bn)) {
                BN_free(diff_bn);
-               return pr_val_err("Cached delta's serial [%s] is larger than Notification's current serial [%s].",
+               return pr_err("Cached delta's serial [%s] is larger than Notification's current serial [%s].",
                   old->str, new->str);
        }
        diff = BN_get_word(diff_bn);
        BN_free(diff_bn);
        if (diff > config_get_rrdp_delta_threshold() || diff > notif->deltas.len)
-               return pr_val_err("Cached RPP is too old. (Cached serial: %s; current serial: %s)",
+               return pr_err("Cached RPP is too old. (Cached serial: %s; current serial: %s)",
                    old->str, new->str);
 
        for (d = notif->deltas.len - diff; d < notif->deltas.len; d++) {
@@ -1119,17 +1119,17 @@ update_notif(struct rrdp_state *old, struct update_notification *new)
 
        diff_bn = BN_create();
        if (!BN_sub(diff_bn, new->session.serial.num, old->session.serial.num))
-               return val_crypto_err("OUCH! libcrypto cannot subtract %s - %s",
+               return pr_crypto_err("OUCH! libcrypto cannot subtract %s - %s",
                    new->session.serial.str, old->session.serial.str);
        if (BN_is_negative(diff_bn))
                /* The validation was the BN_cmp() in the caller. */
-               pr_crit("%s - %s < 0 despite validations.",
+               pr_panic("%s - %s < 0 despite validations.",
                    new->session.serial.str, old->session.serial.str);
 
        diff = BN_get_word(diff_bn);
        if (diff > new->deltas.len)
                /* Should be <= because it was already compared to the delta threshold. */
-               pr_crit("%lu > %zu despite validations.",
+               pr_panic("%lu > %zu despite validations.",
                    diff, new->deltas.len);
 
        BN_free(old->session.serial.num);
@@ -1172,7 +1172,7 @@ dl_notif(struct uri const *url, time_t mtim, bool *changed,
        if (error)
                return error;
        if (!(*changed)) {
-               pr_val_debug("The Notification has not changed.");
+               pr_trc("The Notification has not changed.");
                return 0;
        }
 
@@ -1181,7 +1181,7 @@ dl_notif(struct uri const *url, time_t mtim, bool *changed,
                return error;
 
        if (remove(tmppath) < 0) {
-               pr_val_warn("Can't remove notification's temporal file: %s",
+               pr_wrn("Can't remove notification's temporal file: %s",
                   strerror(errno));
                update_notification_cleanup(new);
                /* Nonfatal; fall through */
@@ -1207,7 +1207,7 @@ rrdp_update(struct uri const *notif, char const *path, time_t mtim,
        int error;
 
        fnstack_push(uri_str(notif));
-       pr_val_debug("Processing notification.");
+       pr_trc("Processing notification.");
 
        error = dl_notif(notif, mtim, changed, &new);
        if (error)
@@ -1215,12 +1215,12 @@ rrdp_update(struct uri const *notif, char const *path, time_t mtim,
        if (!(*changed))
                goto end;
 
-       pr_val_debug("New session/serial: %s/%s",
+       pr_trc("New session/serial: %s/%s",
            new.session.session_id,
            new.session.serial.str);
 
        if ((*state) == NULL) {
-               pr_val_debug("This is a new Notification.");
+               pr_trc("This is a new Notification.");
 
                old = pzalloc(sizeof(struct rrdp_state));
                /* session postponed! */
@@ -1247,7 +1247,7 @@ rrdp_update(struct uri const *notif, char const *path, time_t mtim,
        old = *state;
        serial_cmp = BN_cmp(old->session.serial.num, new.session.serial.num);
        if (serial_cmp < 0) {
-               pr_val_debug("The Notification's serial changed.");
+               pr_trc("The Notification's serial changed.");
 
                error = validate_session_desync(old, &new);
                if (error)
@@ -1269,17 +1269,17 @@ rrdp_update(struct uri const *notif, char const *path, time_t mtim,
                goto reset_notif;
 
        } else if (serial_cmp > 0) {
-               pr_val_debug("Cached serial is higher than notification serial.");
+               pr_trc("Cached serial is higher than notification serial.");
                goto end;
 
        } else {
-               pr_val_debug("The Notification changed, but the session ID and serial didn't, and no session desync was detected.");
+               pr_trc("The Notification changed, but the session ID and serial didn't, and no session desync was detected.");
                *changed = false;
                goto end;
        }
 
 snapshot_fallback:
-       pr_val_debug("Falling back to snapshot.");
+       pr_trc("Falling back to snapshot.");
        error = handle_snapshot(&new, old);
        if (error)
                goto clean_notif;
@@ -1452,7 +1452,7 @@ json2serial(json_t *parent, struct rrdp_serial *serial)
        serial->num = BN_create();
        serial->str = pstrdup(str);
        if (!BN_dec2bn(&serial->num, serial->str)) {
-               pr_op_err("Not a serial number: %s", serial->str);
+               pr_err("Not a serial number: %s", serial->str);
                BN_free(serial->num);
                free(serial->str);
                return -EINVAL;
@@ -1476,7 +1476,7 @@ json2files(json_t *jparent, char *parent, struct rrdp_state *state)
 
        error = json_get_object(jparent, "files", &jfiles);
        if (error < 0) {
-               pr_op_debug("files: %s", strerror(error));
+               pr_trc("files: %s", strerror(error));
                return error;
        }
        if (error > 0)
@@ -1487,12 +1487,12 @@ json2files(json_t *jparent, char *parent, struct rrdp_state *state)
 
        json_object_foreach(jfiles, jkey, jvalue) {
                if (!json_is_string(jvalue)) {
-                       pr_op_warn("RRDP file URL '%s' is not a string.", jkey);
+                       pr_wrn("RRDP file URL '%s' is not a string.", jkey);
                        continue;
                }
                errmsg = uri_init(&url, jkey);
                if (errmsg) {
-                       pr_op_warn("Cannot parse '%s' as a URI: %s", jkey, errmsg);
+                       pr_wrn("Cannot parse '%s' as a URI: %s", jkey, errmsg);
                        continue;
                }
 
@@ -1500,14 +1500,14 @@ json2files(json_t *jparent, char *parent, struct rrdp_state *state)
 
                path = json_string_value(jvalue);
                if (strncmp(path, parent, parent_len) != 0 || path[parent_len] != '/') {
-                       pr_op_warn("RRDP path '%s' is not child of '%s'.",
+                       pr_wrn("RRDP path '%s' is not child of '%s'.",
                            path, parent);
                        uri_cleanup(&url);
                        continue;
                }
 
                if (hex2ulong(path + parent_len + 1, &id) != 0) {
-                       pr_op_warn("RRDP file '%s' is not a hexadecimal number.", path);
+                       pr_wrn("RRDP file '%s' is not a hexadecimal number.", path);
                        uri_cleanup(&url);
                        continue;
                }
@@ -1519,7 +1519,7 @@ json2files(json_t *jparent, char *parent, struct rrdp_state *state)
        }
 
        if (HASH_COUNT(state->files) == 0) {
-               pr_op_warn("RRDP cage does not index any files.");
+               pr_wrn("RRDP cage does not index any files.");
                return EINVAL;
        }
 
@@ -1535,16 +1535,16 @@ json2dh(json_t *json, struct rrdp_hash **dh)
 
        str = json_string_value(json);
        if (str == NULL)
-               return pr_op_err("Hash is not a string.");
+               return pr_err("Hash is not a string.");
 
        if (strlen(str) != 2 * RRDP_HASH_LEN)
-               return pr_op_err("Hash is not %d characters long.",
+               return pr_err("Hash is not %d characters long.",
                    2 * RRDP_HASH_LEN);
 
        hash = pmalloc(sizeof(struct rrdp_hash));
        if (str2hex(str, hash->bytes) != 0) {
                free(hash);
-               return pr_op_err("Malformed hash: %s", str);
+               return pr_err("Malformed hash: %s", str);
        }
 
        *dh = hash;
@@ -1606,22 +1606,22 @@ rrdp_json2state(json_t *json, char *path, struct rrdp_state **result)
 
        error = json2session(json, &state->session.session_id);
        if (error < 0) {
-               pr_op_debug("session: %s", strerror(error));
+               pr_trc("session: %s", strerror(error));
                goto fail;
        }
        error = json2serial(json, &state->session.serial);
        if (error < 0) {
-               pr_op_debug("serial: %s", strerror(error));
+               pr_trc("serial: %s", strerror(error));
                goto fail;
        }
        error = json2files(json, path, state);
        if (error) {
-               pr_op_debug("files: %s", strerror(error));
+               pr_trc("files: %s", strerror(error));
                goto fail;
        }
        error = json2dhs(json, state);
        if (error) {
-               pr_op_debug("delta hashes: %s", strerror(error));
+               pr_trc("delta hashes: %s", strerror(error));
                goto fail;
        }
 
index ca32ee7875e95fee6d5fded861acc02ed1d990dd..4eba80f075743c5833d1761ced7193c462d96c09 100644 (file)
@@ -118,7 +118,7 @@ notify_parent(struct rsync_task *task)
        asn_enc_rval_t result;
 
        if (pssk.wr == -1) {
-               pr_op_err(RSP "Cannot message parent process: "
+               pr_err(RSP "Cannot message parent process: "
                    "The socket is closed.");
                return;
        }
@@ -129,14 +129,14 @@ notify_parent(struct rsync_task *task)
         */
 
        if (RsyncRequest_init(&req, &task->url, task->path) < 0) {
-               pr_op_err(RSP "Cannot message parent process: "
+               pr_err(RSP "Cannot message parent process: "
                    "The request object cannot be created");
                return;
        }
 
        result = der_encode(&asn_DEF_RsyncRequest, &req, write_cb, NULL);
        if (result.encoded == -1) {
-               pr_op_err(RSP "Cannot message parent process: Unknown error");
+               pr_err(RSP "Cannot message parent process: Unknown error");
                /* TODO (asn1) Do this if the error was I/O:
                 * close(spsk.wr);
                 * spsk.wr = -1;
@@ -145,7 +145,7 @@ notify_parent(struct rsync_task *task)
                 */
        }
 
-       pr_op_debug(RSP "Parent notified; sent %zd bytes.", result.encoded);
+       pr_trc(RSP "Parent notified; sent %zd bytes.", result.encoded);
        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RsyncRequest, &req);
 }
 
@@ -201,13 +201,13 @@ create_pipes(int fds[2][2])
 
        if (pipe(fds[0]) < 0) {
                error = errno;
-               pr_op_err_st(RSP "Piping rsync stderr: %s", strerror(error));
+               pr_crit(RSP "Piping rsync stderr: %s", strerror(error));
                return error;
        }
 
        if (pipe(fds[1]) < 0) {
                error = errno;
-               pr_op_err_st(RSP "Piping rsync stdout: %s", strerror(error));
+               pr_crit(RSP "Piping rsync stdout: %s", strerror(error));
                close(fds[0][0]);
                close(fds[0][1]);
                return error;
@@ -283,7 +283,7 @@ fork_rsync(struct rsync_task *task)
        task->pid = fork();
        if (task->pid < 0) {
                error = errno;
-               pr_op_err_st(RSP "Couldn't spawn the rsync process: %s",
+               pr_crit(RSP "Couldn't spawn the rsync process: %s",
                    strerror(error));
                close(STDERR_READ(fork_fds));
                close(STDOUT_READ(fork_fds));
@@ -332,11 +332,11 @@ post_task(struct cache_mapping *map, struct rsync_tasks *tasks,
 
        if (tasks->a >= config_rsync_max()) {
                LIST_INSERT_HEAD(&tasks->queued, task, lh);
-               pr_op_debug(RSP "Queued task %d: %s -> %s",
+               pr_trc(RSP "Queued task %d: %s -> %s",
                    task->pid, uri_str(&task->url), task->path);
        } else {
                activate_task(tasks, task, now);
-               pr_op_debug(RSP "Got new task %d: %s -> %s",
+               pr_trc(RSP "Got new task %d: %s -> %s",
                    task->pid, uri_str(&task->url), task->path);
        }
 }
@@ -401,11 +401,11 @@ handle_parent_fd(struct pollfd *pfd, struct rsync_tasks *tasks,
                return;
 
        if (pfd->revents & POLLNVAL) {
-               pr_op_err(RSP "bad parent fd: %i", pfd->fd);
+               pr_err(RSP "bad parent fd: %i", pfd->fd);
                rstream_close(&pssk.rd, false);
 
        } else if (pfd->revents & POLLERR) {
-               pr_op_err(RSP "Generic error during parent fd poll.");
+               pr_err(RSP "Generic error during parent fd poll.");
                rstream_close(&pssk.rd, true);
 
        } else if (pfd->revents & (POLLIN | POLLHUP)) {
@@ -433,9 +433,9 @@ log_buffer(char const *buffer, ssize_t read, bool is_error)
                        continue;
                }
                if (is_error)
-                       pr_op_err("[RSYNC exec] %s", cur);
+                       pr_err("[RSYNC exec] %s", cur);
                else
-                       pr_op_debug("[RSYNC exec] %s", cur);
+                       pr_trc("[RSYNC exec] %s", cur);
                cur = tmp + 1;
        }
        free(cpy);
@@ -456,7 +456,7 @@ log_rsync_output(struct pollfd *pfd, size_t p)
                error = errno;
                if (error == EINTR)
                        return 0; /* Dunno; retry */
-               pr_op_err(RSP "rsync buffer read error: %s", strerror(error));
+               pr_err(RSP "rsync buffer read error: %s", strerror(error));
                goto down; /* Error */
        }
 
@@ -473,17 +473,17 @@ static int
 handle_rsync_fd(struct pollfd *pfd, size_t p)
 {
        if (pfd->fd == -1) {
-               pr_op_debug(RSP "File descriptor already closed.");
+               pr_trc(RSP "File descriptor already closed.");
                return 1;
        }
 
        if (pfd->revents & POLLNVAL) {
-               pr_op_err(RSP "rsync bad fd: %i", pfd->fd);
+               pr_err(RSP "rsync bad fd: %i", pfd->fd);
                return 1;
        }
 
        if (pfd->revents & POLLERR) {
-               pr_op_err(RSP "Generic error during rsync poll.");
+               pr_err(RSP "Generic error during rsync poll.");
                close(pfd->fd);
                return 1;
        }
@@ -503,19 +503,19 @@ wait_subprocess(char const *name, pid_t pid)
 again: status = 0;
        if (waitpid(pid, &status, 0) < 0) {
                error = errno;
-               pr_op_err("Could not wait for %s: %s", name, strerror(error));
+               pr_err("Could not wait for %s: %s", name, strerror(error));
                return error;
        }
 
        if (WIFEXITED(status)) {
                /* Happy path (but also sad path sometimes) */
                error = WEXITSTATUS(status);
-               pr_op_debug("%s ended. Result: %d", name, error);
+               pr_trc("%s ended. Result: %d", name, error);
                return error ? EIO : 0;
        }
 
        if (WIFSIGNALED(status)) {
-               pr_op_warn("%s interrupted by signal %d (%s).",
+               pr_wrn("%s interrupted by signal %d (%s).",
                    name, WTERMSIG(status), strsignal(WTERMSIG(status)));
                return EINTR;
        }
@@ -530,12 +530,12 @@ again:    status = 0;
                 * they never retry. But that contradicts all documentation,
                 * yet seems to be accurate to reality.
                 */
-               pr_op_debug("%s has resumed.", name);
+               pr_trc("%s has resumed.", name);
                goto again;
        }
 
        /* Dead code */
-       return pr_op_err("Unknown waitpid() status; giving up %s.", name);
+       return pr_err("Unknown waitpid() status; giving up %s.", name);
 }
 
 static void
@@ -557,7 +557,7 @@ activate_queued(struct rsync_tasks *tasks, struct timespec *now)
        if (task == NULL)
                return;
 
-       pr_op_debug(RSP "Activating queued task %s -> %s.",
+       pr_trc(RSP "Activating queued task %s -> %s.",
            uri_str(&task->url), task->path);
        LIST_REMOVE(task, lh);
        activate_task(tasks, task, now);
@@ -574,7 +574,7 @@ maybe_expire(struct rsync_tasks *tasks, struct rsync_task *task,
        if (ts_cmp(&epoch, &task->expiration) < 0)
                return false;
 
-       pr_op_debug(RSP "Task %d ran out of time.", task->pid);
+       pr_trc(RSP "Task %d ran out of time.", task->pid);
        kill_subprocess(task);
        wait_subprocess("rsync", task->pid);
        finish_task(tasks, task);
@@ -621,7 +621,7 @@ spawner_run(void)
                                expiration = task->expiration;
 
                timeout = ts_delta(&now, &expiration);
-               pr_op_debug(RSP "Timeout decided: %dms", timeout);
+               pr_trc(RSP "Timeout decided: %dms", timeout);
                events = poll(pfds, pfds_count, timeout);
                if (events < 0) {
                        error = errno;
@@ -632,32 +632,32 @@ spawner_run(void)
                ts_now(&now);
 
                if (events == 0) { /* Timeout */
-                       pr_op_debug(RSP "Woke up because of timeout.");
+                       pr_trc(RSP "Woke up because of timeout.");
                        LIST_FOREACH_SAFE(task, &tasks.active, lh, tmp)
                                maybe_expire(&tasks, task, &now);
                        goto cont;
                }
 
-               pr_op_debug(RSP "Woke up because of input.");
+               pr_trc(RSP "Woke up because of input.");
                p = 1;
                LIST_FOREACH_SAFE(task, &tasks.active, lh, tmp) {
                        if (maybe_expire(&tasks, task, &now))
                                continue;
 
                        if (handle_rsync_fd(&pfds[p], p)) {
-                               pr_op_debug(RSP "Task %d: Stdout closed.",
+                               pr_trc(RSP "Task %d: Stdout closed.",
                                    task->pid);
                                task->stdoutfd = -1;
                        }
                        p++;
                        if (handle_rsync_fd(&pfds[p], p)) {
-                               pr_op_debug(RSP "Task %d: Stderr closed.",
+                               pr_trc(RSP "Task %d: Stderr closed.",
                                    task->pid);
                                task->stderrfd = -1;
                        }
                        p++;
                        if (task->stdoutfd == -1 && task->stderrfd == -1) {
-                               pr_op_debug(RSP "Both stdout & stderr are closed; ending task %d.",
+                               pr_trc(RSP "Both stdout & stderr are closed; ending task %d.",
                                    task->pid);
                                wait_subprocess("rsync", task->pid);
                                finish_task(&tasks, task);
@@ -668,7 +668,7 @@ spawner_run(void)
 
 cont:          free(pfds);
        } while ((pssk.rd.fd != -1 || tasks.a > 0));
-       pr_op_debug(RSP "The parent stream is closed and there are no rsync tasks running. Cleaning up...");
+       pr_trc(RSP "The parent stream is closed and there are no rsync tasks running. Cleaning up...");
 
        LIST_FOREACH_SAFE(task, &tasks.active, lh, tmp) {
                kill_subprocess(task);
@@ -695,19 +695,19 @@ nonblock_pipe(int *fds)
 
        if (pipe(fds) < 0) {
                error = errno;
-               pr_op_warn("Cannot create pipe: %s", strerror(error));
+               pr_wrn("Cannot create pipe: %s", strerror(error));
                return error;
        }
 
        flags = fcntl(fds[RDFD], F_GETFL);
        if (flags < 0) {
                error = errno;
-               pr_op_warn("Cannot retrieve pipe flags: %s", strerror(error));
+               pr_wrn("Cannot retrieve pipe flags: %s", strerror(error));
                goto cancel;
        }
        if (fcntl(fds[RDFD], F_SETFL, flags | O_NONBLOCK) < 0) {
                error = errno;
-               pr_op_warn("Cannot enable O_NONBLOCK: %s", strerror(error));
+               pr_wrn("Cannot enable O_NONBLOCK: %s", strerror(error));
                goto cancel;
        }
 
@@ -779,7 +779,7 @@ rsync_setup(char const *program, ...)
        if (nonblock_pipe(parent2spawner) != 0)
                goto fail1;
        if (pipe(spawner2parent) < 0) {
-               pr_op_warn("Cannot create pipe: %s", strerror(errno));
+               pr_wrn("Cannot create pipe: %s", strerror(errno));
                goto fail2;
        }
 
@@ -788,7 +788,7 @@ rsync_setup(char const *program, ...)
 
        spawner = fork();
        if (spawner < 0) {
-               pr_op_warn("Cannot fork rsync spawner: %s", strerror(errno));
+               pr_wrn("Cannot fork rsync spawner: %s", strerror(errno));
                goto fail3;
        }
 
@@ -804,7 +804,7 @@ rsync_setup(char const *program, ...)
 
        error = pthread_create(&srt, NULL, rcv_spawner_responses, NULL);
        if (error) {
-               pr_op_warn("Cannot start rsync spawner listener thread: %s",
+               pr_wrn("Cannot start rsync spawner listener thread: %s",
                    strerror(error));
                spsk_cleanup();
                goto fail1;
@@ -816,7 +816,7 @@ fail3:      close(spawner2parent[RDFD]);
        close(spawner2parent[WRFD]);
 fail2: close(parent2spawner[RDFD]);
        close(parent2spawner[WRFD]);
-fail1: pr_op_warn("rsync will not be available.");
+fail1: pr_wrn("rsync will not be available.");
        pssk.rd.fd = pssk.wr = -1;
 }
 
index 004ec2928ce17a6339d49ba585c3a873f9accaed..94775aee8e806422b82028c22fe92d486cf3538b 100644 (file)
@@ -78,7 +78,7 @@ add_roa(struct db_table *table, struct hashable_roa *new)
        mutex_unlock(&table->lock);
 
        if (error) {
-               pr_val_err("ROA couldn't be added to hash table: %s",
+               pr_err("ROA couldn't be added to hash table: %s",
                    strerror(error));
                return error;
        }
@@ -110,7 +110,7 @@ add_router_key(struct db_table *table, struct hashable_key *new)
        mutex_unlock(&table->lock);
 
        if (error) {
-               pr_val_err("Router Key couldn't be added to hash table: %s",
+               pr_err("Router Key couldn't be added to hash table: %s",
                    strerror(error));
                return error;
        }
index 4dd4cd01d10a33362890574ead7bc6cf3d6e0984..eb23b2b1dc12f2fcf4c000ec1909638fce472377 100644 (file)
@@ -98,7 +98,7 @@ get_deltas_array4(struct deltas *deltas, int op)
                return &deltas->v4.removes;
        }
 
-       pr_crit("Unknown delta operation: %d", op);
+       pr_panic("Unknown delta operation: %d", op);
        return NULL; /* Warning shutupper */
 }
 
@@ -112,7 +112,7 @@ get_deltas_array6(struct deltas *deltas, int op)
                return &deltas->v6.removes;
        }
 
-       pr_crit("Unknown delta operation: %d", op);
+       pr_panic("Unknown delta operation: %d", op);
        return NULL; /* Warning shutupper */
 }
 
@@ -143,7 +143,7 @@ deltas_add_roa(struct deltas *deltas, struct vrp const *vrp, int op,
                return;
        }
 
-       pr_crit("Unknown protocol: [%u %s/%u-%u %u] %c %u/%u "
+       pr_panic("Unknown protocol: [%u %s/%u-%u %u] %c %u/%u "
            "(Please report this output to https://github.com/NICMx/FORT-validator/issues/89)",
            vrp->asn,
            addr2str6(&vrp->prefix.v6, buffer),
@@ -174,7 +174,7 @@ deltas_add_router_key(struct deltas *deltas, struct router_key const *key,
                return;
        }
 
-       pr_crit("Unknown delta operation: %d", op);
+       pr_panic("Unknown delta operation: %d", op);
 }
 
 bool
index 8679bbc28ae961f890c5b70d365b73871b063c1a..5f9fcd431b071cac6c751f10344306db5401d57f 100644 (file)
@@ -105,7 +105,7 @@ vrps_init(void)
 
        error = pthread_rwlock_init(&state_lock, NULL);
        if (error) {
-               pr_op_err("state pthread_rwlock_init() errored: %s",
+               pr_err("state pthread_rwlock_init() errored: %s",
                    strerror(error));
                darray_destroy(state.deltas);
                return error;
@@ -235,13 +235,13 @@ vrps_update(bool *changed)
        }
        rwlock_unlock(&state_lock);
 
-       pr_op_info("Validation finished:");
-       pr_op_info("- Valid ROAs: %u", roas);
-       pr_op_info("- Valid Router Keys: %u", rks);
+       pr_inf("Validation finished:");
+       pr_inf("- Valid ROAs: %u", roas);
+       pr_inf("- Valid Router Keys: %u", rks);
        if (config_get_mode() == SERVER)
-               pr_op_info("- Serial: %u", serial);
+               pr_inf("- Serial: %u", serial);
        if (start != ((time_t) -1) && finish != ((time_t) -1))
-               pr_op_info("- Real execution time: %.0lfs", difftime(finish, start));
+               pr_inf("- Real execution time: %.0lfs", difftime(finish, start));
 
        return error;
 }
index 8330c12718ba4c4c816e9d509c1eaec7fab13e27..61f23e70bc8cc7e49cbcc2dd72b0f076747f15c9 100644 (file)
@@ -64,7 +64,7 @@ handle_serial_query_pdu(struct rtr_request *request)
        enum vrps_foreach_delta_since_result result;
        int error;
 
-       pr_op_debug("Serial Query. Request version/session/serial: %u/%u/%u",
+       pr_trc("Serial Query. Request version/session/serial: %u/%u/%u",
            request->pdu.rtr_version,
            request->pdu.obj.sq.session_id,
            request->pdu.obj.sq.serial_number);
index a3d218d24ce1a667fffa2d1b2362bfc7f196fba3..fa5a30bfa6df3502f4f1b3cc2089a1406d268076 100644 (file)
@@ -31,12 +31,12 @@ print_poll_failure(struct pollfd *pfd)
         * levels (see apply_pollfds()), so we'll just whine on debug.
         */
 
-       pr_op_debug("poll() returned revents '0x%02x'. This means", pfd->revents);
+       pr_trc("poll() returned revents '0x%02x'. This means", pfd->revents);
        if (pfd->revents & POLLHUP) {
-               pr_op_debug("- 0x%02x: Peer hung up.", POLLHUP);
+               pr_trc("- 0x%02x: Peer hung up.", POLLHUP);
        }
        if (pfd->revents & POLLERR) {
-               pr_op_debug("- 0x%02x: Read end was closed, or generic error.",
+               pr_trc("- 0x%02x: Read end was closed, or generic error.",
                    POLLERR);
        }
        if (pfd->revents & POLLNVAL) {
@@ -44,7 +44,7 @@ print_poll_failure(struct pollfd *pfd)
                 * In our case, this is perfectly normal. The main polling
                 * thread closed it while we were trying to write. Whatever.
                 */
-               pr_op_debug("- 0x%02x: File Descriptor not open.", POLLNVAL);
+               pr_trc("- 0x%02x: File Descriptor not open.", POLLNVAL);
        }
 
        /* Interrupt handler thread, but no need to raise alarms. */
@@ -68,16 +68,16 @@ send_response(int fd, uint8_t pdu_type, unsigned char *data, size_t data_len)
                pfd.revents = 0;
                error = poll(&pfd, 1, -1);
                if (error < 0)
-                       return pr_op_err_st("poll() error: %s", strerror(errno));
+                       return pr_crit("poll() error: %s", strerror(errno));
                if (error == 0)
-                       return pr_op_err_st("poll() returned 0, even though there's no timeout.");
+                       return pr_crit("poll() returned 0, even though there's no timeout.");
                if (pfd.revents & (POLLHUP | POLLERR | POLLNVAL))
                        return print_poll_failure(&pfd);
        } while (!(pfd.revents & POLLOUT));
 
        if (write(fd, data, data_len) < 0) {
                error = errno;
-               pr_op_debug("Error sending %s to client: %s",
+               pr_trc("Error sending %s to client: %s",
                    pdutype2str(pdu_type), strerror(error));
                return error;
        }
index 6ae299157962e20477bde8d3501a8b9f60500c8b..8e76fb828650fbd9d9766c50c664e42e639b4dc5 100644 (file)
@@ -102,17 +102,17 @@ update_buffer(struct pdu_stream *in /* "in"put stream */)
                if (consumed == -1) {
                        error = errno;
                        if (error == EAGAIN || error == EWOULDBLOCK) {
-                               pr_op_debug("Reached stream limit for now.");
+                               pr_trc("Reached stream limit for now.");
                                return BS_WOULD_BLOCK;
                        } else {
-                               pr_op_err("Client socket read interrupted: %s",
+                               pr_err("Client socket read interrupted: %s",
                                    strerror(error));
                                return BS_ERROR;
                        }
                }
 
                if (consumed == 0) {
-                       pr_op_debug("Client '%s' closed the socket.",
+                       pr_trc("Client '%s' closed the socket.",
                            in->addr);
                        return BS_EOS;
                }
@@ -123,7 +123,7 @@ update_buffer(struct pdu_stream *in /* "in"put stream */)
         * big PDU that either lengths exactly RTRPDU_MAX_LEN2, or is too big
         * for us to to allow it.
         */
-       pr_op_debug("Stream limit not reached yet.");
+       pr_trc("Stream limit not reached yet.");
        return BS_KEEP_READING;
 }
 
@@ -273,7 +273,7 @@ validate_rtr_version(struct pdu_stream *stream, struct pdu_header *header,
                }
        }
 
-       pr_crit("Unknown RTR version %u", stream->rtr_version);
+       pr_panic("Unknown RTR version %u", stream->rtr_version);
 
 unsupported:
        return err_pdu_send_unsupported_proto_version(
@@ -297,7 +297,7 @@ load_serial_query(struct pdu_stream *stream, struct pdu_header *hdr,
        size_t length;
 
        if (hdr->len != RTRPDU_SERIAL_QUERY_LEN) {
-               pr_op_err("%s: Header length is not %u: %u",
+               pr_err("%s: Header length is not %u: %u",
                    stream->addr, RTRPDU_SERIAL_QUERY_LEN, hdr->len);
                return err_pdu_send_invalid_request(
                        stream->fd, stream->rtr_version, &result->pdu.raw,
@@ -307,11 +307,11 @@ load_serial_query(struct pdu_stream *stream, struct pdu_header *hdr,
 
        length = get_length(stream);
        if (length < RTRPDU_SERIAL_QUERY_LEN) {
-               pr_op_debug("PDU fragmented after hdr (%zu)", length);
+               pr_trc("PDU fragmented after hdr (%zu)", length);
                return EAGAIN;
        }
 
-       pr_op_debug("Received a Serial Query from %s.", stream->addr);
+       pr_trc("Received a Serial Query from %s.", stream->addr);
 
        result->pdu.obj.sq.session_id = hdr->m.session_id;
        stream->start += RTR_HDR_LEN;
@@ -327,7 +327,7 @@ load_reset_query(struct pdu_stream *stream, struct pdu_header *hdr,
        size_t length;
 
        if (hdr->len != RTRPDU_RESET_QUERY_LEN) {
-               pr_op_err("%s: Header length is not %u: %u",
+               pr_err("%s: Header length is not %u: %u",
                    stream->addr, RTRPDU_RESET_QUERY_LEN, hdr->len);
                return err_pdu_send_invalid_request(
                        stream->fd, stream->rtr_version, &result->pdu.raw,
@@ -337,11 +337,11 @@ load_reset_query(struct pdu_stream *stream, struct pdu_header *hdr,
 
        length = get_length(stream);
        if (length < RTRPDU_RESET_QUERY_LEN) {
-               pr_op_debug("PDU fragmented after hdr (%zu)", length);
+               pr_trc("PDU fragmented after hdr (%zu)", length);
                return EAGAIN;
        }
 
-       pr_op_debug("Received a Reset Query from %s.", stream->addr);
+       pr_trc("Received a Reset Query from %s.", stream->addr);
 
        stream->start += RTR_HDR_LEN;
        return 0;
@@ -352,10 +352,10 @@ handle_error_report_pdu(uint16_t errcode, char const *errmsg,
     char const *client_addr)
 {
        if (errmsg != NULL) {
-               pr_op_err("RTR client %s responded with error PDU '%s' ('%s'). Closing socket.",
+               pr_err("RTR client %s responded with error PDU '%s' ('%s'). Closing socket.",
                    client_addr, err_pdu_to_string(errcode), errmsg);
        } else {
-               pr_op_err("RTR client %s responded with error PDU '%s'. Closing socket.",
+               pr_err("RTR client %s responded with error PDU '%s'. Closing socket.",
                    client_addr, err_pdu_to_string(errcode));
        }
 }
@@ -370,26 +370,26 @@ load_error_report(struct pdu_stream *stream, struct pdu_header *hdr)
        int error;
 
        if (hdr->len > RTRPDU_ERROR_REPORT_MAX_LEN) {
-               return pr_op_err(
+               return pr_err(
                        "%s: Error Report PDU is too big (%u bytes).",
                        stream->addr, hdr->len
                );
        }
        if (hdr->len < RTR_HDR_LEN + 8) { /* hdr + errpdu len + errmsg len */
-               return pr_op_err(
+               return pr_err(
                        "%s: Error Report PDU is too small (%u bytes).",
                        stream->addr, hdr->len
                );
        }
 
-       pr_op_debug("Received an Error Report from %s.", stream->addr);
+       pr_trc("Received an Error Report from %s.", stream->addr);
 
        /* Header */
        stream->start += RTR_HDR_LEN;
 
        /* Error PDU length */
        if (get_length(stream) < 4) {
-               pr_op_debug("Fragmented on error PDU length.");
+               pr_trc("Fragmented on error PDU length.");
                error = EAGAIN;
                goto revert_hdr;
        }
@@ -400,14 +400,14 @@ load_error_report(struct pdu_stream *stream, struct pdu_header *hdr)
                 * We truncate PDUs larger than RTRPDU_MAX_LEN, so we couldn't
                 * have sent this PDU. Looks like someone is messing with us.
                 */
-               error = pr_op_err(
+               error = pr_err(
                        "%s: Error Report PDU's embedded PDU is too big (%u bytes).",
                        stream->addr, errpdu_len
                );
                goto revert_errpdu_len;
        }
        if (hdr->len < RTR_HDR_LEN + 8 + errpdu_len) {
-               error = pr_op_err(
+               error = pr_err(
                        "%s: Invalid Length of Encapsulated PDU (%u); PDU length is %u.",
                        stream->addr, errpdu_len, hdr->len
                );
@@ -416,7 +416,7 @@ load_error_report(struct pdu_stream *stream, struct pdu_header *hdr)
 
        /* Error PDU */
        if (get_length(stream) < errpdu_len) {
-               pr_op_debug("Fragmented on error PDU.");
+               pr_trc("Fragmented on error PDU.");
                error = EAGAIN;
                goto revert_errpdu_len;
        }
@@ -425,14 +425,14 @@ load_error_report(struct pdu_stream *stream, struct pdu_header *hdr)
 
        /* Error msg length */
        if (get_length(stream) < 4) {
-               pr_op_debug("Fragmented on error message length.");
+               pr_trc("Fragmented on error message length.");
                error = EAGAIN;
                goto revert_errpdu;
        }
        errmsg_len = read_uint32(stream->start);
        stream->start += 4;
        if (hdr->len != rtrpdu_error_report_len(errpdu_len, errmsg_len)) {
-               error = pr_op_err(
+               error = pr_err(
                        "%s: Error Report PDU is malformed; header length is %u, but effective length is %u + %u + %u + %u + %u.",
                        stream->addr, hdr->len,
                        RTR_HDR_LEN, 4, errpdu_len, 4, errmsg_len
@@ -528,7 +528,7 @@ again:
 
                /* Read header. */
                if (remainder < RTR_HDR_LEN) {
-                       pr_op_debug("PDU fragmented on header (%zu)", remainder);
+                       pr_trc("PDU fragmented on header (%zu)", remainder);
                        break; /* PDU is fragmented */
                }
                read_hdr(stream, &hdr);
@@ -540,7 +540,7 @@ again:
 
                /* Validate length; Needs raw. */
                if (hdr.len > RTRPDU_MAX_LEN2) {
-                       pr_op_err("%s: Header length too big: %u > %u",
+                       pr_err("%s: Header length too big: %u > %u",
                             stream->addr, hdr.len, RTRPDU_MAX_LEN2);
                        err_pdu_send_invalid_request(
                                stream->fd,
@@ -555,7 +555,7 @@ again:
 
                /* Validate version; Needs raw. */
                if (validate_rtr_version(stream, &hdr, &raw) != 0) {
-                       pr_op_err("%s: Bad RTR version: %u",
+                       pr_err("%s: Bad RTR version: %u",
                            stream->addr, hdr.version);
                        goto fail;
                }
@@ -574,7 +574,7 @@ again:
                        error = load_error_report(stream, &hdr);
                        break;
                default:
-                       pr_op_err("%s: Unknown PDU type: %u",
+                       pr_err("%s: Unknown PDU type: %u",
                            stream->addr, hdr.version);
                        err_pdu_send_unsupported_pdu_type(stream->fd,
                            stream->rtr_version, &request_tmp->pdu.raw);
@@ -605,7 +605,7 @@ again:
        case BS_KEEP_READING:
                goto again;
        case BS_ERROR:
-               pr_crit("This should have been catched earlier.");
+               pr_panic("This should have been catched earlier.");
        }
 
 fail:
index b0b02db5f2599c23e18f05d496674021e8ea1c0e..849bfca7fababdf2c2c26bc83f978ce4b6ad10d0 100644 (file)
@@ -92,7 +92,7 @@ parse_address(char const *full_address, char **address, char **service)
        }
 
        if (*(ptr + 1) == '\0')
-               return pr_op_err("Invalid server address '%s', can't end with '#'",
+               return pr_err("Invalid server address '%s', can't end with '#'",
                    full_address);
 
        tmp_addr_len = strlen(full_address) - strlen(ptr);
@@ -126,7 +126,7 @@ init_addrinfo(char const *hostname, char const *service,
 
        error = getaddrinfo(hostname, service, &hints, result);
        if (error) {
-               pr_op_err("Could not infer a bindable address out of address '%s' and port '%s': %s",
+               pr_err("Could not infer a bindable address out of address '%s' and port '%s': %s",
                    (hostname != NULL) ? hostname : "any", service,
                    gai_strerror(error));
                return error;
@@ -193,7 +193,7 @@ set_nonblock(int fd)
        flags = fcntl(fd, F_GETFL);
        if (flags == -1) {
                error = errno;
-               pr_op_err_st("fcntl() to get flags failed: %s", strerror(error));
+               pr_crit("fcntl() to get flags failed: %s", strerror(error));
                return error;
        }
 
@@ -201,7 +201,7 @@ set_nonblock(int fd)
 
        if (fcntl(fd, F_SETFL, flags) == -1) {
                error = errno;
-               pr_op_err_st("fcntl() to set flags failed: %s", strerror(error));
+               pr_crit("fcntl() to set flags failed: %s", strerror(error));
                return error;
        }
 
@@ -229,7 +229,7 @@ create_server_socket(struct server_init_ctx *ctx, char const *hostname, char con
 #ifdef __linux__
                if (is_wildcard(ai->ai_addr)) {
                        if (ctx->wildcard_found)
-                               pr_op_warn("You have more than one wildcard address in server.address, and you're on Linux.\n"
+                               pr_wrn("You have more than one wildcard address in server.address, and you're on Linux.\n"
                                    "On Linux, :: implies 0.0.0.0 by default, and you can't bind to 0.0.0.0 twice.\n"
                                    "The socket bind is probably going to fail.\n"
                                    "If you meant to bind to any address on both IPv4 and IPv6, you only need '::'.");
@@ -239,7 +239,7 @@ create_server_socket(struct server_init_ctx *ctx, char const *hostname, char con
 
                server.fd = -1;
                server.addr = get_best_printable(ai, ctx->input_addr);
-               pr_op_info("[%s]:%s: Setting up socket...", server.addr, port);
+               pr_inf("[%s]:%s: Setting up socket...", server.addr, port);
 
                server.fd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
                if (server.fd < 0) {
@@ -271,7 +271,7 @@ create_server_socket(struct server_init_ctx *ctx, char const *hostname, char con
                        goto fail;
                }
 
-               pr_op_info("[%s]:%s: Success.", server.addr, port);
+               pr_inf("[%s]:%s: Success.", server.addr, port);
                server_arraylist_add(&servers, &server);
        }
 
@@ -279,7 +279,7 @@ create_server_socket(struct server_init_ctx *ctx, char const *hostname, char con
        return 0;
 
 fail:
-       pr_op_err("[%s]:%s: %s: %s", server.addr, port, errmsg, strerror(err));
+       pr_err("[%s]:%s: %s: %s", server.addr, port, errmsg, strerror(err));
        if (server.fd != -1)
                close(server.fd);
        free(server.addr);
@@ -346,7 +346,7 @@ handle_client_request(void *arg)
                break;
        default:
                /* Should have been catched during constructor */
-               pr_crit("Unexpected PDU type: %u", request->pdu.type);
+               pr_panic("Unexpected PDU type: %u", request->pdu.type);
        }
 
        if (request->eos)
@@ -407,12 +407,12 @@ handle_accept_result(int client_fd, int err)
        if (err == EWOULDBLOCK)
                goto retry;
 
-       pr_op_info("Client connection attempt not accepted: %s. Quitting...",
+       pr_inf("Client connection attempt not accepted: %s. Quitting...",
            strerror(err));
        return AV_SERVER_ERROR;
 
 retry:
-       pr_op_info("Client connection attempt not accepted: %s. Retrying...",
+       pr_inf("Client connection attempt not accepted: %s. Retrying...",
            strerror(err));
        return AV_CLIENT_ERROR;
 }
@@ -446,7 +446,7 @@ accept_new_client(struct pollfd const *server_fd)
 
        client_arraylist_add(&clients, &client);
 
-       pr_op_info("Client accepted [FD: %d]: %s", fd, addr);
+       pr_inf("Client accepted [FD: %d]: %s", fd, addr);
        return AV_SUCCESS;
 }
 
@@ -476,7 +476,7 @@ print_poll_failure(struct pollfd *pfd, char const *what, char const *addr)
 
        if (pfd->revents & POLLHUP) {
                /* Normal; we don't have control over the client. */
-               pr_op_info("%s '%s' down: Peer hung up. (Revents 0x%02x)",
+               pr_inf("%s '%s' down: Peer hung up. (Revents 0x%02x)",
                    what, addr, pfd->revents);
        }
        if (pfd->revents & POLLERR) {
@@ -493,7 +493,7 @@ print_poll_failure(struct pollfd *pfd, char const *what, char const *addr)
                 *
                 * Warning it is.
                 */
-               pr_op_warn("%s '%s' down: Generic error. (Revents 0x%02x)",
+               pr_wrn("%s '%s' down: Generic error. (Revents 0x%02x)",
                    what, addr, pfd->revents);
        }
        if (pfd->revents & POLLNVAL) {
@@ -502,7 +502,7 @@ print_poll_failure(struct pollfd *pfd, char const *what, char const *addr)
                 * We're the main polling thread, so nobody else should be
                 * closing sockets on us.
                 */
-               pr_op_err("%s '%s' down: File Descriptor closed. (Revents 0x%02x)",
+               pr_err("%s '%s' down: File Descriptor closed. (Revents 0x%02x)",
                    what, addr, pfd->revents);
        }
 }
@@ -588,7 +588,7 @@ fddb_poll(void)
                error = errno;
                switch (error) {
                case EINTR:
-                       pr_op_info("poll() was interrupted by some signal.");
+                       pr_inf("poll() was interrupted by some signal.");
                        goto stop;
                case ENOMEM:
                        enomem_panic();
@@ -596,7 +596,7 @@ fddb_poll(void)
                        goto retry;
                case EFAULT:
                case EINVAL:
-                       pr_crit("poll() error: %s", strerror(error));
+                       pr_panic("poll() error: %s", strerror(error));
                }
        }
 
@@ -716,7 +716,7 @@ void rtr_stop(void)
        stop_server_thread = true;
        error = pthread_join(server_thread, NULL);
        if (error)
-               pr_op_err("pthread_join() failed: %s", strerror(error));
+               pr_err("pthread_join() failed: %s", strerror(error));
 
        thread_pool_destroy(request_handlers);
 
@@ -734,10 +734,10 @@ rtr_notify(void)
        case GLSNR_OK:
                break;
        case GLSNR_UNDER_CONSTRUCTION:
-               pr_op_info("Can't notify RTR clients: Database under construction");
+               pr_inf("Can't notify RTR clients: Database under construction");
                return;
        case GLSNR_CANT_LOCK:
-               pr_op_info("Can't notify RTR clients: Too many simultaneous read locks");
+               pr_inf("Can't notify RTR clients: Too many simultaneous read locks");
                return;
        }
 
index f592268414e8d8fc66d2465be41fc74feac054e4..199b0d257a68d7a759aaa88847c067ffaaf4203e 100644 (file)
--- a/src/sig.c
+++ b/src/sig.c
@@ -83,7 +83,7 @@ register_signal_handlers(void)
 
        for (i = 0; cleanups[i]; i++)
                if (sigaction(cleanups[i], &action, NULL) < 0)
-                       pr_op_err("'%s' signal action registration failure: %s",
+                       pr_err("'%s' signal action registration failure: %s",
                            strsignal(cleanups[i]), strerror(errno));
 
        /*
@@ -106,6 +106,6 @@ register_signal_handlers(void)
         */
        action.sa_handler = SIG_IGN;
        if (sigaction(SIGPIPE, &action, NULL) < 0)
-               pr_op_err("SIGPIPE action registration failure: %s",
+               pr_err("SIGPIPE action registration failure: %s",
                    strerror(errno));
 }
index 824060237d5b99a9804bc31c44517a3fddfff4e8..72991839b86e84c37cc6452ebe3e9aa4612761d2 100644 (file)
@@ -438,21 +438,21 @@ print_prefix_data(struct slurm_prefix *prefix, void *arg)
 {
        char addr_buf[INET6_ADDRSTRLEN];
 
-       pr_op_info("    {");
+       pr_inf("    {");
        if (prefix->data_flag & SLURM_COM_FLAG_ASN)
-               pr_op_info("      ASN: %u", prefix->vrp.asn);
+               pr_inf("      ASN: %u", prefix->vrp.asn);
 
        if (prefix->data_flag & SLURM_PFX_FLAG_PREFIX) {
-               pr_op_info("      Prefix: %s/%u",
+               pr_inf("      Prefix: %s/%u",
                    inet_ntop(prefix->vrp.addr_fam, &prefix->vrp.prefix,
                        addr_buf, INET6_ADDRSTRLEN),
                    prefix->vrp.prefix_length);
        }
 
        if (prefix->data_flag & SLURM_PFX_FLAG_MAX_LENGTH)
-               pr_op_info("      Max prefix length: %u",
+               pr_inf("      Max prefix length: %u",
                    prefix->vrp.max_prefix_length);
-       pr_op_info("    }");
+       pr_inf("    }");
 
        return 0;
 }
@@ -463,19 +463,19 @@ print_bgpsec_data(struct slurm_bgpsec *bgpsec, void *arg)
        char *pad = "     ";
        char *buf;
 
-       pr_op_info("    {");
+       pr_inf("    {");
        if (bgpsec->data_flag & SLURM_COM_FLAG_ASN)
-               pr_op_info("%s ASN: %u", pad, bgpsec->asn);
+               pr_inf("%s ASN: %u", pad, bgpsec->asn);
 
        if (bgpsec->data_flag & SLURM_BGPS_FLAG_SKI) {
                do {
                        if (!base64url_encode(bgpsec->ski, RK_SKI_LEN, &buf)) {
-                               op_crypto_err("Cannot encode SKI.");
-                               pr_op_info("%s SKI: <error encoding value>",
+                               pr_crypto_err("Cannot encode SKI.");
+                               pr_inf("%s SKI: <error encoding value>",
                                    pad);
                                break;
                        }
-                       pr_op_info("%s SKI: %s", pad, buf);
+                       pr_inf("%s SKI: %s", pad, buf);
                        free(buf);
                } while (0);
        }
@@ -484,16 +484,16 @@ print_bgpsec_data(struct slurm_bgpsec *bgpsec, void *arg)
                do {
                        if (!base64url_encode(bgpsec->router_public_key,
                            RK_SPKI_LEN, &buf)) {
-                               op_crypto_err("Cannot encode routerPublicKey.");
-                               pr_op_info("%s Router public key: <error encoding value>",
+                               pr_crypto_err("Cannot encode routerPublicKey.");
+                               pr_inf("%s Router public key: <error encoding value>",
                                    pad);
                                break;
                        }
-                       pr_op_info("%s Router public key: %s", pad, buf);
+                       pr_inf("%s Router public key: %s", pad, buf);
                        free(buf);
                } while (0);
        }
-       pr_op_info("    }");
+       pr_inf("    }");
 
        return 0;
 }
@@ -501,24 +501,24 @@ print_bgpsec_data(struct slurm_bgpsec *bgpsec, void *arg)
 void
 db_slurm_log(struct db_slurm *db)
 {
-       pr_op_info("SLURM loaded at %s", asctime(localtime(&db->loaded_date)));
-       pr_op_info("Validation output filters {");
-       pr_op_info("  Prefix filters {");
+       pr_inf("SLURM loaded at %s", asctime(localtime(&db->loaded_date)));
+       pr_inf("Validation output filters {");
+       pr_inf("  Prefix filters {");
        foreach_filter_prefix(&db->lists, print_prefix_data, NULL);
-       pr_op_info("  }");
-       pr_op_info("  BGPsec filters {");
+       pr_inf("  }");
+       pr_inf("  BGPsec filters {");
        foreach_filter_bgpsec(&db->lists, print_bgpsec_data, NULL);
-       pr_op_info("  }");
-       pr_op_info("}");
+       pr_inf("  }");
+       pr_inf("}");
 
-       pr_op_info("Locally added assertions {");
-       pr_op_info("  Prefix assertions {");
+       pr_inf("Locally added assertions {");
+       pr_inf("  Prefix assertions {");
        foreach_assertion_prefix(&db->lists, print_prefix_data, NULL);
-       pr_op_info("  }");
-       pr_op_info("  BGPsec assertions {");
+       pr_inf("  }");
+       pr_inf("  BGPsec assertions {");
        foreach_assertion_bgpsec(&db->lists, print_bgpsec_data, NULL);
-       pr_op_info("  }");
-       pr_op_info("}");
+       pr_inf("  }");
+       pr_inf("}");
 }
 
 void
index 6062762d4b135850c8c6267927d6d7c4f39f147f..33d5927c83d9d3e82ae5d7f9468409a864d15e74 100644 (file)
@@ -89,7 +89,7 @@ slurm_pfx_assertions_add(struct slurm_prefix *prefix, void *arg)
                    vrp.max_prefix_length);
        }
 
-       pr_crit("Unknown addr family type: %u", vrp.addr_fam);
+       pr_panic("Unknown addr family type: %u", vrp.addr_fam);
        return EINVAL; /* Warning shutupper */
 }
 
@@ -137,7 +137,7 @@ __slurm_load_checksums(char const *location, void *arg)
 
        if (hash_file(hash_get_sha256(), location, csum->csum, &csum->csum_len) != 0) {
                free(csum);
-               return pr_op_err("Calculating slurm hash");
+               return pr_err("Calculating slurm hash");
        }
 
        list = arg;
@@ -212,7 +212,7 @@ update_slurm(struct db_slurm **slurm)
        struct db_slurm *new_slurm = NULL;
        int error;
 
-       pr_op_info("Checking if there are new or modified SLURM files");
+       pr_inf("Checking if there are new or modified SLURM files");
 
        error = slurm_load_checksums(&new_csums);
        if (error)
@@ -225,13 +225,13 @@ update_slurm(struct db_slurm **slurm)
        if (*slurm != NULL) {
                db_slurm_get_csum_list(*slurm, &old_csums);
                if (are_csum_lists_equals(&new_csums, &old_csums)) {
-                       pr_op_info("Applying same old SLURM, no changes found.");
+                       pr_inf("Applying same old SLURM, no changes found.");
                        destroy_local_csum_list(&new_csums);
                        return 0;
                }
        }
 
-       pr_op_info("Applying configured SLURM");
+       pr_inf("Applying configured SLURM");
 
        error = load_slurm_files(&new_csums, &new_slurm);
 
@@ -244,10 +244,10 @@ update_slurm(struct db_slurm **slurm)
 
        if (error) {
                /* Fall back to previous iteration's SLURM */
-               pr_op_info("Error '%s' loading SLURM. The validation will continue regardless.",
+               pr_inf("Error '%s' loading SLURM. The validation will continue regardless.",
                    strerror(error));
                if (*slurm != NULL) {
-                       pr_op_info("A previous valid version of the SLURM exists and will be applied.");
+                       pr_inf("A previous valid version of the SLURM exists and will be applied.");
                        db_slurm_log(*slurm);
                }
 
index 71decdfa52039a5abe117b93cbbe1ad6f581167e..dfe7c0ee5c489be2ef4299ac816b46ed6a71cff2 100644 (file)
@@ -27,7 +27,7 @@
 #define ROUTER_PUBLIC_KEY              "routerPublicKey"
 #define COMMENT                                "comment"
 
-#define COMPLAIN_REQUIRED(name) pr_op_err("SLURM member '" name "' is required")
+#define COMPLAIN_REQUIRED(name) pr_err("SLURM member '" name "' is required")
 
 static int handle_json(json_t *, struct db_slurm *);
 
@@ -45,7 +45,7 @@ slurm_parse(char const *location, void *arg)
            &json_error);
        if (json_root == NULL)
                /* File wasn't read or has a content error */
-               return pr_op_err("SLURM JSON error on line %d, column %d: %s",
+               return pr_err("SLURM JSON error on line %d, column %d: %s",
                    json_error.line, json_error.column, json_error.text);
 
        error = handle_json(json_root, arg);
@@ -65,7 +65,7 @@ set_asn(json_t *object, bool is_assertion, uint32_t *result, uint8_t *flag,
                return error;
        if (error > 0)
                /* Optional for filters */
-               return is_assertion ? pr_op_err("ASN is required") : 0;
+               return is_assertion ? pr_err("ASN is required") : 0;
 
        *flag = *flag | SLURM_COM_FLAG_ASN;
        (*members_loaded)++;
@@ -108,7 +108,7 @@ set_prefix(json_t *object, bool is_assertion, struct slurm_prefix *result,
                return error;
        if (str_prefix == NULL) {
                return is_assertion
-                   ? pr_op_err("SLURM assertion prefix is required")
+                   ? pr_err("SLURM assertion prefix is required")
                    : 0; /* Optional for filters */
        }
 
@@ -170,7 +170,7 @@ set_max_prefix_length(json_t *object, bool is_assertion, uint8_t addr_fam,
        /* Filters */
        if (!is_assertion)
                return (error == 0)
-                   ? pr_op_err("Prefix filter can't have a max prefix length")
+                   ? pr_err("Prefix filter can't have a max prefix length")
                    : 0;
 
        /* Assertions */
@@ -179,7 +179,7 @@ set_max_prefix_length(json_t *object, bool is_assertion, uint8_t addr_fam,
 
        max = (addr_fam == AF_INET) ? 32 : 128;
        if (max < u32)
-               return pr_op_err("Max prefix length (%u) is out of range [0, %u].",
+               return pr_err("Max prefix length (%u) is out of range [0, %u].",
                    u32, max);
 
        *flag = *flag | SLURM_PFX_FLAG_MAX_LENGTH;
@@ -198,7 +198,7 @@ validate_base64url_encoded(const char *encoded)
         * without trailing '=' (Section 5 of [RFC4648])"
         */
        if (strrchr(encoded, '=') != NULL)
-               return pr_op_err_st("The base64 encoded value has trailing '='");
+               return pr_crit("The base64 encoded value has trailing '='");
 
        /*
         * IMHO there's an error at RFC 8416 regarding the use of base64
@@ -230,7 +230,7 @@ set_ski(json_t *object, bool is_assertion, struct slurm_bgpsec *result,
                return error;
        if (str_encoded == NULL)
                return is_assertion
-                   ? pr_op_err("SLURM assertion " SKI " is required")
+                   ? pr_err("SLURM assertion " SKI " is required")
                    : 0; /* Optional for filters */
 
        error = validate_base64url_encoded(str_encoded);
@@ -238,12 +238,12 @@ set_ski(json_t *object, bool is_assertion, struct slurm_bgpsec *result,
                return error;
 
        if (!base64url_decode(str_encoded, &result->ski, &ski_len))
-               return pr_op_err("The " SKI " could not be decoded.");
+               return pr_err("The " SKI " could not be decoded.");
 
        /* Validate that's at least 20 octects long */
        if (ski_len != RK_SKI_LEN) {
                free(result->ski);
-               return pr_op_err("The decoded SKI must be 20 octets long");
+               return pr_err("The decoded SKI must be 20 octets long");
        }
 
        result->data_flag = result->data_flag | SLURM_BGPS_FLAG_SKI;
@@ -270,16 +270,16 @@ validate_router_spki(unsigned char *data, size_t len)
 
        spki = d2i_X509_PUBKEY(NULL, &cursor, len);
        if (spki == NULL)
-               return op_crypto_err("Not a valid router public key");
+               return pr_crypto_err("Not a valid router public key");
        if (cursor != origin + len) {
                X509_PUBKEY_free(spki);
-               return op_crypto_err("Router public key contains trailing garbage.");
+               return pr_crypto_err("Router public key contains trailing garbage.");
        }
 
        ok = X509_PUBKEY_get0_param(&alg, NULL, NULL, &pa, spki);
        if (!ok) {
                X509_PUBKEY_free(spki);
-               return op_crypto_err("X509_PUBKEY_get0_param() returned %d", ok);
+               return pr_crypto_err("X509_PUBKEY_get0_param() returned %d", ok);
        }
 
        error = validate_certificate_public_key_algorithm_bgpsec(pa);
@@ -302,19 +302,19 @@ set_router_pub_key(json_t *object, bool is_assertion,
        /* Filters */
        if (!is_assertion)
                return (error == 0)
-                   ? pr_op_err("BGPsec filter can't have a router public key")
+                   ? pr_err("BGPsec filter can't have a router public key")
                    : 0;
 
        /* Assertions */
        if (encoded == NULL)
-               return pr_op_err("SLURM assertion " ROUTER_PUBLIC_KEY " is required.");
+               return pr_err("SLURM assertion " ROUTER_PUBLIC_KEY " is required.");
 
        error = validate_base64url_encoded(encoded);
        if (error)
                return error;
 
        if (!base64url_decode(encoded, &result->router_public_key, &spk_len))
-               return pr_op_err("The " ROUTER_PUBLIC_KEY " could not be decoded.");
+               return pr_err("The " ROUTER_PUBLIC_KEY " could not be decoded.");
 
        /*
         * Validate that "is the full ASN.1 DER encoding of the
@@ -351,7 +351,7 @@ load_single_prefix(json_t *object, struct db_slurm *db, bool is_assertion)
        int error;
 
        if (!json_is_object(object))
-               return pr_op_err("Not a valid JSON object");
+               return pr_err("Not a valid JSON object");
 
        init_slurm_prefix(&result);
        member_count = 0;
@@ -377,17 +377,17 @@ load_single_prefix(json_t *object, struct db_slurm *db, bool is_assertion)
 
        /* A single comment isn't valid */
        if (result.data_flag == SLURM_COM_FLAG_COMMENT)
-               return pr_op_err("Single comments aren't valid");
+               return pr_err("Single comments aren't valid");
 
        /* A filter must have ASN and/or prefix */
        if (!is_assertion) {
                if ((result.data_flag &
                    (SLURM_COM_FLAG_ASN | SLURM_PFX_FLAG_PREFIX)) == 0)
-                       return pr_op_err("Prefix filter must have an asn and/or prefix");
+                       return pr_err("Prefix filter must have an asn and/or prefix");
 
                /* Validate expected members */
                if (!json_valid_members_count(object, member_count))
-                       return pr_op_err("Prefix filter has unknown members (see RFC 8416 section 3.3.1)");
+                       return pr_err("Prefix filter has unknown members (see RFC 8416 section 3.3.1)");
 
                return db_slurm_add_prefix_filter(db, &result);
        }
@@ -399,11 +399,11 @@ load_single_prefix(json_t *object, struct db_slurm *db, bool is_assertion)
 
        if ((result.data_flag & SLURM_PFX_FLAG_MAX_LENGTH) > 0 &&
            result.vrp.prefix_length > result.vrp.max_prefix_length)
-               return pr_op_err("Prefix length is greater than max prefix length");
+               return pr_err("Prefix length is greater than max prefix length");
 
        /* Validate expected members */
        if (!json_valid_members_count(object, member_count))
-               return pr_op_err("Prefix assertion has unknown members (see RFC 8416 section 3.4.1)");
+               return pr_err("Prefix assertion has unknown members (see RFC 8416 section 3.4.1)");
 
        return db_slurm_add_prefix_assertion(db, &result);
 }
@@ -419,13 +419,13 @@ load_prefix_array(json_t *array, struct db_slurm *db, bool is_assertion)
                if (!error)
                        continue;
                if (error == EEXIST)
-                       pr_op_err(
+                       pr_err(
                            "The prefix %s element \"%s\", covers or is covered by another assertion/filter; SLURM loading will be stopped. %s",
                            (is_assertion ? "assertion" : "filter"),
                            json_dumps(element, 0),
                            "TIP: More than 1 SLURM files were found, check if the prefix is contained in multiple files (see RFC 8416 section 4.2).");
                else
-                       pr_op_err(
+                       pr_err(
                            "Error at prefix %s, element \"%s\", SLURM loading will be stopped",
                            (is_assertion ? "assertions" : "filters"),
                            json_dumps(element, 0));
@@ -453,7 +453,7 @@ load_single_bgpsec(json_t *object, struct db_slurm *db, bool is_assertion)
        int error;
 
        if (!json_is_object(object))
-               return pr_op_err("Not a valid JSON object");
+               return pr_err("Not a valid JSON object");
 
        init_slurm_bgpsec(&result);
        member_count = 0;
@@ -478,7 +478,7 @@ load_single_bgpsec(json_t *object, struct db_slurm *db, bool is_assertion)
 
        /* A single comment isn't valid */
        if (result.data_flag == SLURM_COM_FLAG_COMMENT) {
-               error = pr_op_err("Single comments aren't valid");
+               error = pr_err("Single comments aren't valid");
                goto release_router_key;
        }
 
@@ -486,13 +486,13 @@ load_single_bgpsec(json_t *object, struct db_slurm *db, bool is_assertion)
        if (!is_assertion) {
                if ((result.data_flag &
                    (SLURM_COM_FLAG_ASN | SLURM_BGPS_FLAG_SKI)) == 0) {
-                       error = pr_op_err("BGPsec filter must have an asn and/or SKI");
+                       error = pr_err("BGPsec filter must have an asn and/or SKI");
                        goto release_router_key;
                }
 
                /* Validate expected members */
                if (!json_valid_members_count(object, member_count)) {
-                       error = pr_op_err("BGPsec filter has unknown members (see RFC 8416 section 3.3.2)");
+                       error = pr_err("BGPsec filter has unknown members (see RFC 8416 section 3.3.2)");
                        goto release_router_key;
                }
 
@@ -505,7 +505,7 @@ load_single_bgpsec(json_t *object, struct db_slurm *db, bool is_assertion)
 
        /* Validate expected members */
        if (!json_valid_members_count(object, member_count)) {
-               error = pr_op_err("BGPsec assertion has unknown members (see RFC 8416 section 3.4.2)");
+               error = pr_err("BGPsec assertion has unknown members (see RFC 8416 section 3.4.2)");
                goto release_router_key;
        }
 
@@ -533,13 +533,13 @@ load_bgpsec_array(json_t *array, struct db_slurm *db, bool is_assertion)
                if (!error)
                        continue;
                if (error == EEXIST)
-                       pr_op_err(
+                       pr_err(
                            "The ASN at bgpsec %s element \"%s\", is duplicated in another assertion/filter; SLURM loading will be stopped. %s",
                            (is_assertion ? "assertion" : "filter"),
                            json_dumps(element, 0),
                            "TIP: More than 1 SLURM files were found, check if the ASN is contained in multiple files (see RFC 8416 section 4.2).");
                else
-                       pr_op_err(
+                       pr_err(
                            "Error at bgpsec %s, element \"%s\", SLURM loading will be stopped",
                            (is_assertion ? "assertions" : "filters"),
                            json_dumps(element, 0));
@@ -564,7 +564,7 @@ load_version(json_t *root)
 
        /* Validate data */
        if (version != 1)
-               return pr_op_err("'" SLURM_VERSION "' must be 1");
+               return pr_err("'" SLURM_VERSION "' must be 1");
 
        return 0;
 }
@@ -596,7 +596,7 @@ load_filters(json_t *root, struct db_slurm *db)
 
        expected_members = 2;
        if (!json_valid_members_count(filters, expected_members))
-               return pr_op_err(
+               return pr_err(
                    "SLURM '%s' must contain only %lu members (RFC 8416 section 3.2)",
                    VALIDATION_OUTPUT_FILTERS,
                    expected_members);
@@ -636,7 +636,7 @@ load_assertions(json_t *root, struct db_slurm *db)
 
        expected_members = 2;
        if (!json_valid_members_count(assertions, expected_members))
-               return pr_op_err(
+               return pr_err(
                    "SLURM '%s' must contain only %lu members (RFC 8416 section 3.2)",
                    LOCALLY_ADDED_ASSERTIONS,
                    expected_members);
@@ -655,7 +655,7 @@ handle_json(json_t *root, struct db_slurm *db)
        int error;
 
        if (!json_is_object(root))
-               return pr_op_err("The root of the SLURM is not a JSON object.");
+               return pr_err("The root of the SLURM is not a JSON object.");
 
        error = load_version(root);
        if (error)
@@ -674,7 +674,7 @@ handle_json(json_t *root, struct db_slurm *db)
 
        expected_members = 3;
        if (!json_valid_members_count(root, expected_members))
-               return pr_op_err(
+               return pr_err(
                    "SLURM root must have only %lu members (RFC 8416 section 3.2)",
                    expected_members);
 
index 5816ff036649846ef32b04a3badfddba5a352fc7..4c2c378a2273e156dcd72eb96eaa65d211dfbf73 100644 (file)
@@ -119,7 +119,7 @@ stats_set_tal_vrps(char const *tal_path, char const *proto, unsigned int value)
            (int)talen, ta, proto);
        if (chars < 0 || keylen <= chars) {
                free(key);
-               pr_op_warn("Cannot create valid_vrps_total stat: %d", chars);
+               pr_wrn("Cannot create valid_vrps_total stat: %d", chars);
                return;
        }
 
@@ -182,6 +182,6 @@ stats_export(void)
 
 cancel:
        free(buf.str);
-       pr_op_err("Cannot create Prometheus response: Too many stats");
+       pr_err("Cannot create Prometheus response: Too many stats");
        return NULL;
 }
index a7d5d07569448e16f9fcda5a229ad36e8ad10240..ad0e5f7c0ce5875f7ff00267e4b18a080ea02c3b 100644 (file)
@@ -70,7 +70,7 @@ stream_full_write(int fd, unsigned char const *buf, size_t len)
                if (wr < 0)
                        return errno;
                if (wr > len)
-                       pr_crit("wr > len: %zd > %zu", wr, len);
+                       pr_panic("wr > len: %zd > %zu", wr, len);
                len -= wr;
                offset += wr;
        } while (len > 0);
index ad0fb8f3a75245b5c0195df25be4052e46bf2fd3..81795fd6ac72fa85960fc723220f04dd6a22b43b 100644 (file)
@@ -32,7 +32,7 @@ task_name(struct validation_task *task)
                return task->u.tal;
        }
 
-       pr_crit("Unknown task type: %u", task->type);
+       pr_panic("Unknown task type: %u", task->type);
        return NULL;
 }
 
@@ -233,40 +233,40 @@ task_dequeue(struct validation_task *prev)
        if (prev) {
                ntasks--;
                if (ntasks < 0)
-                       pr_crit("active < 0: %d", ntasks);
+                       pr_panic("active < 0: %d", ntasks);
        }
 
        while (ntasks > 0) {
-               pr_op_debug("task_dequeue(): %u existing tasks.", ntasks);
+               pr_trc("task_dequeue(): %u existing tasks.", ntasks);
 
                task = STAILQ_FIRST(&waiting);
                if (task != NULL) {
                        STAILQ_REMOVE_HEAD(&waiting, lh);
                        mutex_unlock(&lock);
-                       pr_op_debug("task_dequeue(): Claimed task '%s'.",
+                       pr_trc("task_dequeue(): Claimed task '%s'.",
                            task_name(task));
                        return task;
                }
 
-               pr_op_debug("task_dequeue(): Sleeping...");
+               pr_trc("task_dequeue(): Sleeping...");
                timeout.tv_sec = time_fatal() + 10;
                error = pthread_cond_timedwait(&awakener, &lock, &timeout);
                switch (error) {
                case 0:
-                       pr_op_debug("task_dequeue(): Woke up by cond.");
+                       pr_trc("task_dequeue(): Woke up by cond.");
                        break;
                case ETIMEDOUT:
-                       pr_op_debug("task_dequeue(): Woke up by timeout.");
+                       pr_trc("task_dequeue(): Woke up by timeout.");
                        break;
                case EINTR:
-                       pr_op_debug("task_dequeue(): Interrupted by signal.");
+                       pr_trc("task_dequeue(): Interrupted by signal.");
                        goto end;
                default:
                        panic_on_fail(error, "pthread_cond_wait");
                }
        }
 
-       pr_op_debug("task_dequeue(): No more tasks; done.");
+       pr_trc("task_dequeue(): No more tasks; done.");
        panic_on_fail(pthread_cond_broadcast(&awakener),
            "pthread_cond_broadcast");
 end:   mutex_unlock(&lock);
index 17eff19511ab2fc30ec93a5e407e2ffaa8316203..4f0a79d469c50f28add83a478f328e67a1a36704 100644 (file)
@@ -85,7 +85,7 @@ struct thread_pool {
 static void
 wait_for_parent_signal(struct thread_pool *pool, unsigned int thread_id)
 {
-       pr_op_debug("Thread %s.%u: Waiting for work...", pool->name, thread_id);
+       pr_trc("Thread %s.%u: Waiting for work...", pool->name, thread_id);
        panic_on_fail(pthread_cond_wait(&pool->parent2worker, &pool->lock),
            "pthread_cond_wait");
 }
@@ -145,10 +145,10 @@ task_queue_pull(struct thread_pool *pool, unsigned int thread_id)
        task = TAILQ_LAST(&pool->queue, task_queue);
        if (task != NULL) {
                TAILQ_REMOVE(&pool->queue, task, next);
-               pr_op_debug("Thread %s.%u: Claimed task '%s'", pool->name,
+               pr_trc("Thread %s.%u: Claimed task '%s'", pool->name,
                    thread_id, task->name);
        } else {
-               pr_op_debug("Thread %s.%u: Claimed nothing", pool->name,
+               pr_trc("Thread %s.%u: Claimed nothing", pool->name,
                    thread_id);
        }
 
@@ -160,7 +160,7 @@ static void
 task_queue_push(struct thread_pool *pool, struct thread_pool_task *task)
 {
        TAILQ_INSERT_HEAD(&pool->queue, task, next);
-       pr_op_debug("Pool '%s': Pushed task '%s'", pool->name, task->name);
+       pr_trc("Pool '%s': Pushed task '%s'", pool->name, task->name);
 }
 
 /*
@@ -200,7 +200,7 @@ tasks_poll(void *arg)
 
                if (task != NULL) {
                        task->cb(task->arg);
-                       pr_op_debug("Thread %s.%u: Task '%s' ended", pool->name,
+                       pr_trc("Thread %s.%u: Task '%s' ended", pool->name,
                            thread_id, task->name);
                        task_destroy(task);
                }
@@ -216,7 +216,7 @@ tasks_poll(void *arg)
        }
 
        mutex_unlock(&pool->lock);
-       pr_op_debug("Thread %s.%u: Returning.", pool->name, thread_id);
+       pr_trc("Thread %s.%u: Returning.", pool->name, thread_id);
        return NULL;
 }
 
@@ -227,7 +227,7 @@ thread_pool_attr_create(pthread_attr_t *attr)
 
        error = pthread_attr_init(attr);
        if (error) {
-               pr_op_err_st("pthread_attr_init() failed: %s", strerror(error));
+               pr_crit("pthread_attr_init() failed: %s", strerror(error));
                return error;
        }
 
@@ -235,7 +235,7 @@ thread_pool_attr_create(pthread_attr_t *attr)
        error = pthread_attr_setstacksize(attr, 1024 * 1024 * 2);
        if (error) {
                pthread_attr_destroy(attr);
-               pr_op_err_st("pthread_attr_setstacksize() failed: %s",
+               pr_crit("pthread_attr_setstacksize() failed: %s",
                    strerror(error));
                return error;
        }
@@ -274,12 +274,12 @@ spawn_threads(struct thread_pool *pool)
                error = pthread_create(&pool->thread_ids[i], &attr, tasks_poll,
                    pool);
                if (error) {
-                       pr_op_err_st("pthread_create() failed: %s",
+                       pr_crit("pthread_create() failed: %s",
                            strerror(error));
                        goto end;
                }
 
-               pr_op_debug("Pool '%s': Thread #%u spawned", pool->name, i + 1);
+               pr_trc("Pool '%s': Thread #%u spawned", pool->name, i + 1);
        }
 
 end:
@@ -299,7 +299,7 @@ thread_pool_create(char const *name, unsigned int threads,
        /* Init locking */
        error = pthread_mutex_init(&result->lock, NULL);
        if (error) {
-               pr_op_err_st("pthread_mutex_init() failed: %s",
+               pr_crit("pthread_mutex_init() failed: %s",
                    strerror(error));
                goto free_tmp;
        }
@@ -307,7 +307,7 @@ thread_pool_create(char const *name, unsigned int threads,
        /* Init conditional to signal pending work */
        error = pthread_cond_init(&result->parent2worker, NULL);
        if (error) {
-               pr_op_err_st("pthread_cond_init(p2w) failed: %s",
+               pr_crit("pthread_cond_init(p2w) failed: %s",
                    strerror(error));
                goto free_mutex;
        }
@@ -315,7 +315,7 @@ thread_pool_create(char const *name, unsigned int threads,
        /* Init conditional to signal no pending work */
        error = pthread_cond_init(&result->worker2parent, NULL);
        if (error) {
-               pr_op_err_st("pthread_cond_init(w2p) failed: %s",
+               pr_crit("pthread_cond_init(w2p) failed: %s",
                    strerror(error));
                goto free_working_cond;
        }
@@ -354,7 +354,7 @@ thread_pool_destroy(struct thread_pool *pool)
        struct thread_pool_task *tmp;
        unsigned int t;
 
-       pr_op_debug("Destroying thread pool '%s'.", pool->name);
+       pr_trc("Destroying thread pool '%s'.", pool->name);
 
        /* Remove all pending work and send the signal to stop it */
        mutex_lock(&pool->lock);
@@ -377,7 +377,7 @@ thread_pool_destroy(struct thread_pool *pool)
        pthread_mutex_destroy(&pool->lock);
        free(pool);
 
-       pr_op_debug("Destroyed.");
+       pr_trc("Destroyed.");
 }
 
 /*
@@ -424,17 +424,17 @@ thread_pool_wait(struct thread_pool *pool)
 
        /* If the pool has to stop, the wait will happen during the joins. */
        while (!pool->stop) {
-               pr_op_debug("- Active workers: %u", pool->working_count);
-               pr_op_debug("- Task queue: %s",
+               pr_trc("- Active workers: %u", pool->working_count);
+               pr_trc("- Task queue: %s",
                    TAILQ_EMPTY(&pool->queue) ? "Empty" : "Not Empty");
 
                if (pool->working_count == 0 && TAILQ_EMPTY(&pool->queue)) {
-                       pr_op_debug("Pool '%s': All work has been completed.",
+                       pr_trc("Pool '%s': All work has been completed.",
                            pool->name);
                        break;
                }
 
-               pr_op_debug("Pool '%s': Waiting for tasks to be completed",
+               pr_trc("Pool '%s': Waiting for tasks to be completed",
                    pool->name);
                wait_for_worker_signal(pool);
        }
index ed0b7a9bfe23efcdaba983dc90500235b3fd90cb..45de81e64d19d4c2274f54bad1d4e410b4e4ecd5 100644 (file)
@@ -35,7 +35,7 @@ thvar_init(void)
         */
        error = pthread_key_create(&filenames_key, fnstack_discard);
        if (error) {
-               pr_op_err(
+               pr_err(
                    "Cannot initialize the file name stack thread variable: %s",
                    strerror(error));
                return error;
@@ -59,7 +59,7 @@ fnstack_init(void)
 
        error = pthread_setspecific(filenames_key, files);
        if (error)
-               pr_op_err("pthread_setspecific() failed: %s", strerror(error));
+               pr_err("pthread_setspecific() failed: %s", strerror(error));
 }
 
 void
@@ -76,12 +76,12 @@ fnstack_cleanup(void)
 
        error = pthread_setspecific(filenames_key, NULL);
        if (error)
-               pr_op_err("pthread_setspecific() failed: %s", strerror(error));
+               pr_err("pthread_setspecific() failed: %s", strerror(error));
 }
 
 /*
  * Call this function every time you're about to start processing a new file.
- * Any pr_op_err()s and friends will now include the new file name.
+ * Any pr_err()s and friends will now include the new file name.
  * Use fnstack_pop() to revert back to the previously stacked file name.
  * @file is not cloned; it's expected to outlive the push/pop operation.
  *
@@ -91,11 +91,11 @@ fnstack_cleanup(void)
  *     test_fnstack(void)
  *     {
  *             fnstack_push("text.txt");
- *             pr_val_info("Message 1");
+ *             pr_inf("Message 1");
  *             fnstack_push("image.png");
- *             pr_val_info("Message 2");
+ *             pr_inf("Message 2");
  *             fnstack_pop();
- *             pr_val_info("Message 3");
+ *             pr_inf("Message 3");
  *             fnstack_pop();
  *     }
  *
index b07e0a567066e0884cb5944539f2de9a7c5bc75a..ecd824a1a628a8706e8a7a24402075d9d64a14ef 100644 (file)
@@ -164,11 +164,11 @@ prefix4_decode(IPAddress_t const *str, struct ipv4_prefix *result)
        int len;
 
        if (str->size > 4) {
-               return pr_val_err("IPv4 address has too many octets. (%zu)",
+               return pr_err("IPv4 address has too many octets. (%zu)",
                    str->size);
        }
        if (str->bits_unused < 0 || 7 < str->bits_unused) {
-               return pr_val_err("Bit string IPv4 address's unused bits count (%d) is out of range (0-7).",
+               return pr_err("Bit string IPv4 address's unused bits count (%d) is out of range (0-7).",
                    str->bits_unused);
        }
 
@@ -177,14 +177,14 @@ prefix4_decode(IPAddress_t const *str, struct ipv4_prefix *result)
        len = 8 * str->size - str->bits_unused;
 
        if (len < 0 || 32 < len) {
-               return pr_val_err("IPv4 prefix length (%d) is out of bounds (0-32).",
+               return pr_err("IPv4 prefix length (%d) is out of bounds (0-32).",
                    len);
        }
 
        result->len = len;
 
        if ((result->addr.s_addr & be32_suffix_mask(result->len)) != 0) {
-               return pr_val_err("IPv4 prefix '%s/%u' has enabled suffix bits.",
+               return pr_err("IPv4 prefix '%s/%u' has enabled suffix bits.",
                    addr2str4(&result->addr, buf), result->len);
        }
 
@@ -202,11 +202,11 @@ prefix6_decode(IPAddress_t const *str, struct ipv6_prefix *result)
        int len;
 
        if (str->size > 16) {
-               return pr_val_err("IPv6 address has too many octets. (%zu)",
+               return pr_err("IPv6 address has too many octets. (%zu)",
                    str->size);
        }
        if (str->bits_unused < 0 || 7 < str->bits_unused) {
-               return pr_val_err("Bit string IPv6 address's unused bits count (%d) is out of range (0-7).",
+               return pr_err("Bit string IPv6 address's unused bits count (%d) is out of range (0-7).",
                    str->bits_unused);
        }
 
@@ -215,7 +215,7 @@ prefix6_decode(IPAddress_t const *str, struct ipv6_prefix *result)
        len = 8 * str->size - str->bits_unused;
 
        if (len < 0 || 128 < len) {
-               return pr_val_err("IPv6 prefix length (%d) is out of bounds (0-128).",
+               return pr_err("IPv6 prefix length (%d) is out of bounds (0-128).",
                    len);
        }
 
@@ -224,7 +224,7 @@ prefix6_decode(IPAddress_t const *str, struct ipv6_prefix *result)
        memset(&suffix, 0, sizeof(suffix));
        ipv6_suffix_mask(result->len, &suffix);
        if (addr6_bitwise_and(&result->addr, &suffix)) {
-               return pr_val_err("IPv6 prefix '%s/%u' has enabled suffix bits.",
+               return pr_err("IPv6 prefix '%s/%u' has enabled suffix bits.",
                    addr2str6(&result->addr, buf), result->len);
        }
 
@@ -238,7 +238,7 @@ check_order4(struct ipv4_range *result)
        char buf2[INET_ADDRSTRLEN];
 
        if (ntohl(result->min.s_addr) > ntohl(result->max.s_addr)) {
-               return pr_val_err("The IPv4 range '%s-%s' is inverted.",
+               return pr_err("The IPv4 range '%s-%s' is inverted.",
                    addr2str4(&result->min, buf1),
                    addr2str4(&result->max, buf2));
        }
@@ -268,7 +268,7 @@ check_encoding4(struct ipv4_range *range)
                if (((MIN & mask) != 0) || ((MAX & mask) == 0))
                        return 0;
 
-       return pr_val_err("IPAddressRange '%s-%s' is a range, but should have been encoded as a prefix.",
+       return pr_err("IPAddressRange '%s-%s' is a range, but should have been encoded as a prefix.",
            addr2str4(&range->min, buf1), addr2str4(&range->max, buf2));
 }
 
@@ -311,7 +311,7 @@ check_order6(struct ipv6_range *result)
                min = addr6_get_quadrant(&result->min, quadrant);
                max = addr6_get_quadrant(&result->max, quadrant);
                if (min > max) {
-                       return pr_val_err("The IPv6 range '%s-%s' is inverted.",
+                       return pr_err("The IPv6 range '%s-%s' is inverted.",
                            addr2str6(&result->min, buf1),
                            addr2str6(&result->max, buf2));
                } else if (min < max) {
@@ -327,7 +327,7 @@ pr_bad_encoding(struct ipv6_range *range)
 {
        char buf1[INET6_ADDRSTRLEN];
        char buf2[INET6_ADDRSTRLEN];
-       return pr_val_err("IPAddressRange %s-%s is a range, but should have been encoded as a prefix.",
+       return pr_err("IPAddressRange %s-%s is a range, but should have been encoded as a prefix.",
            addr2str6(&range->min, buf1),
            addr2str6(&range->max, buf2));
 }
@@ -415,11 +415,11 @@ prefix4_parse(const char *str, struct ipv4_prefix *result)
        int error;
 
        if (str == NULL)
-               return pr_val_err("Can't parse NULL IPv4 prefix");
+               return pr_err("Can't parse NULL IPv4 prefix");
 
        error = str2addr4(str, &result->addr);
        if (error)
-               return pr_val_err("Invalid IPv4 prefix '%s'", str);
+               return pr_err("Invalid IPv4 prefix '%s'", str);
 
        return 0;
 }
@@ -430,11 +430,11 @@ prefix6_parse(const char *str, struct ipv6_prefix *result)
        int error;
 
        if (str == NULL)
-               return pr_val_err("Can't parse NULL IPv6 prefix");
+               return pr_err("Can't parse NULL IPv6 prefix");
 
        error = str2addr6(str, &result->addr);
        if (error)
-               return pr_val_err("Invalid IPv6 prefix '%s'", str);
+               return pr_err("Invalid IPv6 prefix '%s'", str);
 
        return 0;
 }
@@ -446,18 +446,18 @@ prefix_length_parse(const char *text, uint8_t *dst, uint8_t max_value)
        int error;
 
        if (text == NULL)
-               return pr_val_err("Can't decode NULL prefix length");
+               return pr_err("Can't decode NULL prefix length");
 
        errno = 0;
        len = strtoul(text, NULL, 10);
        error = errno;
        if (error) {
-               return pr_val_err("Invalid prefix length '%s': %s", text,
+               return pr_err("Invalid prefix length '%s': %s", text,
                    strerror(error));
        }
        /* An underflow or overflow will be considered here */
        if (max_value < len)
-               return pr_val_err("Prefix length (%lu) is out of range (0-%u).",
+               return pr_err("Prefix length (%lu) is out of range (0-%u).",
                    len, max_value);
 
        *dst = (uint8_t) len;
@@ -470,7 +470,7 @@ ipv4_prefix_validate(struct ipv4_prefix *prefix)
        char buffer[INET_ADDRSTRLEN];
 
        if ((prefix->addr.s_addr & be32_suffix_mask(prefix->len)) != 0)
-               return pr_val_err("IPv4 prefix %s/%u has enabled suffix bits.",
+               return pr_err("IPv4 prefix %s/%u has enabled suffix bits.",
                    addr2str4(&prefix->addr, buffer), prefix->len);
 
        return 0;
@@ -488,7 +488,7 @@ ipv6_prefix_validate(struct ipv6_prefix *prefix)
 
        for (i = 0; i < 16; i++)
                if (prefix->addr.s6_addr[i] & suffix.s6_addr[i])
-                       return pr_val_err("IPv6 prefix %s/%u has enabled suffix bits.",
+                       return pr_err("IPv6 prefix %s/%u has enabled suffix bits.",
                            addr2str6(&prefix->addr, buffer), prefix->len);
 
        return 0;
index 1cc5d759958645fb85c7e4c24ab1718d55b26f5f..9d5964cb0a6276d0acd011337185a58c53a2b2bf 100644 (file)
@@ -57,17 +57,17 @@ bioseq_setup(void)
 
        type = BIO_get_new_index();
        if (type == -1)
-               return op_crypto_err("BIO_get_new_index() returned -1.");
+               return pr_crypto_err("BIO_get_new_index() returned -1.");
 
        method = BIO_meth_new(type | BIO_TYPE_FILTER, "seq");
        if (method == NULL)
-               return op_crypto_err("BIO_meth_new() returned NULL.");
+               return pr_crypto_err("BIO_meth_new() returned NULL.");
 
        if (!BIO_meth_set_read(method, bioseq_read) ||
            !BIO_meth_set_destroy(method, bioseq_destroy)) {
                BIO_meth_free(method);
                method = NULL;
-               return op_crypto_err("BIO_meth_set_*() returned 0.");
+               return pr_crypto_err("BIO_meth_set_*() returned 0.");
        }
 
        return 0;
index 4ad35992ffe66321513856a88712a8108051f142..76820fdae764d8eada6462d0db6e186f38b628bd 100644 (file)
@@ -16,7 +16,7 @@ map_get_printable(struct cache_mapping const *map, enum filename_format format)
                return path_filename(uri_str(&map->url));
        }
 
-       pr_crit("Unknown file name format: %u", format);
+       pr_panic("Unknown file name format: %u", format);
        return NULL;
 }
 
index 11419440b05443ad563506b327ed3fffa1909099..58cbd425ff3ba9b3ae97ad130a8c0fb25d66bf34 100644 (file)
@@ -29,7 +29,7 @@ name2string(X509_NAME_ENTRY *name, char **_result)
 
        data = X509_NAME_ENTRY_get_data(name);
        if (data == NULL)
-               return val_crypto_err("X509_NAME_ENTRY_get_data() returned NULL");
+               return pr_crypto_err("X509_NAME_ENTRY_get_data() returned NULL");
 
        result = pmalloc(data->length + 1);
        memcpy(result, data->data, data->length);
@@ -66,7 +66,7 @@ x509_name_decode(X509_NAME *name, char const *what,
                        error = name2string(entry, &result->serialNumber);
                        break;
                default:
-                       error = pr_val_err("The '%s' name has an unknown attribute. (NID: %d)",
+                       error = pr_err("The '%s' name has an unknown attribute. (NID: %d)",
                            what, nid);
                        break;
                }
@@ -76,7 +76,7 @@ x509_name_decode(X509_NAME *name, char const *what,
        }
 
        if (result->commonName == NULL) {
-               error = pr_val_err("The '%s' name lacks a commonName attribute.",
+               error = pr_err("The '%s' name lacks a commonName attribute.",
                    what);
                goto fail;
        }
@@ -169,7 +169,7 @@ validate_issuer_name(X509_NAME *issuer, X509 *parent)
                parent_serial = x509_name_serialNumber(parent_subject);
                child_serial = x509_name_serialNumber(child_issuer);
 
-               error = pr_val_err("Issuer name ('%s%s%s') does not equal issuer certificate's name ('%s%s%s').",
+               error = pr_err("Issuer name ('%s%s%s') does not equal issuer certificate's name ('%s%s%s').",
                    x509_name_commonName(child_issuer),
                    (child_serial != NULL) ? "/" : "",
                    (child_serial != NULL) ? child_serial : "",
index 2871558b4cc6c612ea1c0d52af6888d8c88ed57c..79d48a29a08a05c02dd841d937707f9a85e7f276 100644 (file)
@@ -94,7 +94,7 @@ compare(struct sorted_array *sarray, void const *new)
                return RCR_EINTERSECTION;
        }
 
-       pr_crit("Unknown comparison value: %u", cmp);
+       pr_panic("Unknown comparison value: %u", cmp);
 }
 
 enum resource_cmp_result
@@ -159,7 +159,7 @@ sarray_contains(struct sorted_array const *sarray, void const *elem)
                        return false;
                }
 
-               pr_crit("Unknown comparison value: %u", cmp);
+               pr_panic("Unknown comparison value: %u", cmp);
        }
 
        return false;
index 91f68116dc9e7a627712dbaeac9c104f1a024250..1e6737e2cd155a9004bbd258efaa2d43349e22c7 100644 (file)
@@ -23,7 +23,7 @@ str_concat(char const *s1, char const *s2)
 
        written = snprintf(result, n, "%s%s", s1, s2);
        if (written != n - 1)
-               pr_crit("str_concat: %zu %d %s %s", n, written, s1, s2);
+               pr_panic("str_concat: %zu %d %s %s", n, written, s1, s2);
 
        return result;
 }
@@ -64,7 +64,7 @@ ia5s2string(ASN1_IA5STRING *ia5, char **result)
 
        /* Implementation-aware */
        if (ia5->flags & ASN1_STRING_FLAG_BITS_LEFT) {
-               pr_val_warn("CRL URI IA5String has unused bits.");
+               pr_wrn("CRL URI IA5String has unused bits.");
                return EINVAL;
        }
 
@@ -73,7 +73,7 @@ ia5s2string(ASN1_IA5STRING *ia5, char **result)
        len = ASN1_STRING_length(ia5);
        for (i = 0; i < len; i++)
                if (data[i] == 0) {
-                       pr_val_warn("Null character found in IA5String index %zu. (Length: %zu)",
+                       pr_wrn("Null character found in IA5String index %zu. (Length: %zu)",
                            i, len);
                        return EINVAL;
                }
@@ -95,11 +95,11 @@ BN2string(BIGNUM *bn, char **_result)
 
        bio = BIO_new(BIO_s_mem());
        if (bio == NULL)
-               return val_crypto_err("Cannot create a BIO.");
+               return pr_crypto_err("Cannot create a BIO.");
 
        if (BN_print(bio, bn) == 0) {
                BIO_free(bio);
-               return val_crypto_err("Unable to print the BIGNUM into a BIO");
+               return pr_crypto_err("Unable to print the BIGNUM into a BIO");
        }
 
        written = BIO_number_written(bio);
index 50d02bdb38f126d1b3cb2cebd751ad962d891e58..c9c2b46ed2f51534973cadd5243d6f6392be8a33 100644 (file)
@@ -830,7 +830,7 @@ url_normalize(unsigned char const *url, int flags, char **result)
                        case '#':
                                goto frag;
                        default:
-                               pr_crit("Unhandled character after query: %c",
+                               pr_panic("Unhandled character after query: %c",
                                    cursor[0]);
                        }
                        break;
@@ -846,7 +846,7 @@ frag:                       if (meta && !meta->allow_fragment)
                        break;
 
                default:
-                       pr_crit("Unhandled character after path: %c",
+                       pr_panic("Unhandled character after path: %c",
                            cursor[0]);
                }
        }
index ae2f31a5496aafb5851ad272196a1b03a7de9584..be09e2454c8481ef0439cdc6e9b6bfc0566a57df 100644 (file)
@@ -19,7 +19,7 @@ vrp_equals(struct vrp const *a, struct vrp const *b)
                return addr6_equals(&a->prefix.v6, &b->prefix.v6);
        }
 
-       pr_crit("Unknown address family: %u", a->addr_fam);
+       pr_panic("Unknown address family: %u", a->addr_fam);
        return false; /* Warning shutupper */
 }
 
@@ -39,7 +39,7 @@ vrp_prefix_cov(struct vrp const *a, struct vrp const *b)
                    && (a->prefix_length <= b->prefix_length);
        }
 
-       pr_crit("Unknown address family: %u", a->addr_fam);
+       pr_panic("Unknown address family: %u", a->addr_fam);
        return false; /* Warning shutupper */
 }
 
index 2151f2db6ee6cff1a832864ab3bddef6910878b3..06aeefad79a0428fc6b1e18097f19952d70c4490 100644 (file)
@@ -400,13 +400,13 @@ get_days_ago(int days)
        tt_now = time_fatal();
        if (localtime_r(&tt_now, &tm) == NULL) {
                error = errno;
-               pr_crit("localtime_r(tt, &tm) returned error: %s",
+               pr_panic("localtime_r(tt, &tm) returned error: %s",
                    strerror(error));
        }
        tm.tm_mday -= days;
        last_week = mktime(&tm);
        if (last_week == (time_t) -1)
-               pr_crit("mktime(tm) returned (time_t) -1.");
+               pr_panic("mktime(tm) returned (time_t) -1.");
 
        return last_week;
 }
@@ -443,11 +443,11 @@ new_iteration(bool outdate)
 {
        epoch = outdate ? get_days_ago(30) : get_days_ago(1);
 
-       pr_op_debug("--- Unfreshening... ---");
+       pr_trc("--- Unfreshening... ---");
        foreach_node(unfreshen, NULL);
        ck_assert_int_eq(0, nftw(".", nftw_unfreshen, 32, FTW_PHYS));
 
-       pr_op_debug("---- Tree now stale. ----");
+       pr_trc("---- Tree now stale. ----");
        cache_print();
 }
 
index b7bdc41cbe99ec978728eaed9dd7ee8023ceca0e..7d4676eb7379bf4eb12765ef196e02ad0b39565e 100644 (file)
@@ -23,7 +23,7 @@ print_monotime(void)
 {
        struct timespec now;
        if (clock_gettime(CLOCK_MONOTONIC, &now) < 0)
-               pr_crit("clock_gettime() returned '%s'", strerror(errno));
+               pr_panic("clock_gettime() returned '%s'", strerror(errno));
        printf("%ld.%.3ld ", now.tv_sec, now.tv_nsec / 1000000);
 }
 
@@ -57,17 +57,11 @@ print_monotime(void)
                return result;                                          \
        }
 
-MOCK_VOID_PRINT(pr_op_debug, PR_COLOR_DBG)
-MOCK_VOID_PRINT(pr_op_info, PR_COLOR_INF)
-MOCK_INT_PRINT(pr_op_warn, PR_COLOR_WRN, 0)
-MOCK_INT_PRINT(pr_op_err, PR_COLOR_ERR, EINVAL)
-MOCK_INT_PRINT(pr_op_err_st, PR_COLOR_ERR, EINVAL)
-MOCK_INT_PRINT(op_crypto_err, PR_COLOR_ERR, EINVAL)
-
-MOCK_VOID_PRINT(pr_val_debug, PR_COLOR_DBG)
-MOCK_VOID_PRINT(pr_val_info, PR_COLOR_INF)
-MOCK_INT_PRINT(pr_val_warn, PR_COLOR_WRN, 0)
-MOCK_INT_PRINT(pr_val_err, PR_COLOR_ERR, EINVAL)
+MOCK_VOID_PRINT(pr_trc, PR_COLOR_DBG)
+MOCK_VOID_PRINT(pr_inf, PR_COLOR_INF)
+MOCK_INT_PRINT(pr_wrn, PR_COLOR_WRN, 0)
+MOCK_INT_PRINT(pr_err, PR_COLOR_ERR, EINVAL)
+MOCK_INT_PRINT(pr_crit, PR_COLOR_ERR, EINVAL)
 
 struct crypto_cb_arg {
        unsigned int stack_size;
@@ -102,10 +96,10 @@ crypto_err(int (*error_fn)(const char *, ...))
 }
 
 int
-val_crypto_err(const char *format, ...)
+pr_crypto_err(const char *format, ...)
 {
        MOCK_PRINT(PR_COLOR_ERR);
-       return crypto_err(pr_val_err);
+       return crypto_err(pr_err);
 }
 
 void
@@ -115,10 +109,10 @@ enomem_panic(void)
 }
 
 void
-pr_crit(const char *format, ...)
+pr_panic(const char *format, ...)
 {
        va_list args;
-       fprintf(stderr, "pr_crit() called! ");
+       fprintf(stderr, "pr_panic() called! ");
        va_start(args, format);
        vfprintf(stderr, format, args);
        va_end(args);
@@ -200,7 +194,7 @@ touch_file(char const *file)
        int fd;
        int error;
 
-       pr_op_debug("touch %s", file);
+       pr_trc("touch %s", file);
 
        fd = open(file, O_WRONLY | O_CREAT, CACHE_FILEMODE);
        if (fd < 0) {
index bb4796327850c86a5371a05c472bb5f980f86202..e642a07941a19c386e422a122f9ecd887ac275b4 100644 (file)
@@ -428,7 +428,7 @@ disable_sigpipe(void)
 {
        struct sigaction action = { .sa_handler = SIG_IGN };
        if (sigaction(SIGPIPE, &action, NULL) == -1)
-               pr_crit("Cannot disable SIGPIPE: %s", strerror(errno));
+               pr_panic("Cannot disable SIGPIPE: %s", strerror(errno));
 }
 
 static void
@@ -437,7 +437,7 @@ init_content(void)
        size_t i;
 
        if (sizeof(content) % STR64LEN != 0)
-               pr_crit("content's length isn't divisible by str64's length");
+               pr_panic("content's length isn't divisible by str64's length");
        for (i = 0; i < (sizeof(content) / STR64LEN); i++)
                memcpy(content + 64 * i, STR64, STR64LEN);
 }
index 1390e34fb1418c653ab5cea03d4d8cf50f3362cf..9083b6174139d8c3d43907127de02d3ae35e93a6 100644 (file)
@@ -121,7 +121,7 @@ MOCK_UINT(config_get_deltas_lifetime, 5, void)
 int
 send_cache_reset_pdu(int fd, uint8_t version)
 {
-       pr_op_info("    Server sent Cache Reset.");
+       pr_inf("    Server sent Cache Reset.");
        ck_assert_int_eq(pop_expected_pdu(), PDU_TYPE_CACHE_RESET);
        return 0;
 }
@@ -129,7 +129,7 @@ send_cache_reset_pdu(int fd, uint8_t version)
 int
 send_cache_response_pdu(int fd, uint8_t version)
 {
-       pr_op_info("    Server sent Cache Response.");
+       pr_inf("    Server sent Cache Response.");
        ck_assert_int_eq(pop_expected_pdu(), PDU_TYPE_CACHE_RESPONSE);
        return 0;
 }
@@ -155,7 +155,7 @@ send_prefix_pdu(int fd, uint8_t version, struct vrp const *vrp, uint8_t flags)
         * we'll just check `M + N` contiguous Prefix PDUs.
         */
        uint8_t pdu_type = pop_expected_pdu();
-       pr_op_info("    Server sent Prefix PDU.");
+       pr_inf("    Server sent Prefix PDU.");
 
        switch (vrp->addr_fam) {
        case AF_INET:
@@ -185,7 +185,7 @@ send_router_key_pdu(int fd, uint8_t version,
         * we'll just check `M + N` contiguous Prefix PDUs.
         */
        uint8_t pdu_type = pop_expected_pdu();
-       pr_op_info("    Server sent Router Key PDU.");
+       pr_inf("    Server sent Router Key PDU.");
        printf("%s asn%u RK\n", flags2str(flags), router_key->as);
        ck_assert_msg(pdu_type == PDU_TYPE_ROUTER_KEY,
            "Server sent a Router Key. Expected PDU type was %d.", pdu_type);
@@ -195,7 +195,7 @@ send_router_key_pdu(int fd, uint8_t version,
 int
 send_end_of_data_pdu(int fd, uint8_t version, serial_t end_serial)
 {
-       pr_op_info("    Server sent End of Data.");
+       pr_inf("    Server sent End of Data.");
        ck_assert_int_eq(pop_expected_pdu(), PDU_TYPE_END_OF_DATA);
        return 0;
 }
@@ -204,7 +204,7 @@ int
 send_error_report_pdu(int fd, uint8_t version, uint16_t code,
     struct rtr_buffer const *request, char *message)
 {
-       pr_op_info("    Server sent Error Report %u: '%s'", code, message);
+       pr_inf("    Server sent Error Report %u: '%s'", code, message);
        ck_assert_int_eq(pop_expected_pdu(), PDU_TYPE_ERROR_REPORT);
        return 0;
 }
@@ -216,7 +216,7 @@ START_TEST(test_start_or_restart)
 {
        struct rtr_request request;
 
-       pr_op_info("-- Start or Restart --");
+       pr_inf("-- Start or Restart --");
 
        /* Init */
        init_db_full();
@@ -243,7 +243,7 @@ START_TEST(test_typical_exchange)
 {
        struct rtr_request request;
 
-       pr_op_info("-- Typical Exchange --");
+       pr_inf("-- Typical Exchange --");
 
        /* Init */
        init_db_full();
@@ -309,7 +309,7 @@ START_TEST(test_no_incremental_update_available)
 {
        struct rtr_request request;
 
-       pr_op_info("-- No Incremental Update Available --");
+       pr_inf("-- No Incremental Update Available --");
 
        /* Init */
        init_db_full();
@@ -334,7 +334,7 @@ START_TEST(test_cache_has_no_data_available)
 {
        struct rtr_request request;
 
-       pr_op_info("-- Cache Has No Data Available --");
+       pr_inf("-- Cache Has No Data Available --");
 
        /* Init */
        ck_assert_int_eq(0, vrps_init());
@@ -368,7 +368,7 @@ START_TEST(test_bad_session_id)
 {
        struct rtr_request request;
 
-       pr_op_info("-- Bad Session ID --");
+       pr_inf("-- Bad Session ID --");
 
        /* Init */
        init_db_full();