]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
draft-faltstrom-uri-08 defines LONG_STR, yay!
authorWillem Toorop <willem@nlnetlabs.nl>
Thu, 18 Jul 2013 14:16:43 +0000 (16:16 +0200)
committerWillem Toorop <willem@nlnetlabs.nl>
Thu, 18 Jul 2013 14:16:43 +0000 (16:16 +0200)
host2str.c
ldns/rdata.h
ldns/str2host.h
rdata.c
rr.c
str2host.c
wire2host.c

index 86b7f1e83116e4b7b3b597b5a95a6646474a0ac2..a79df2c2cd0b9dd5fe7f43fc47798ed6f89a7d89 100644 (file)
@@ -1241,34 +1241,6 @@ ldns_rdf2buffer_str_long_str(ldns_buffer *output, const ldns_rdf *rdf)
        return ldns_buffer_status(output);
 }
 
-ldns_status
-ldns_rdf2buffer_str_multi_str(ldns_buffer *output, const ldns_rdf *rdf)
-{
-       size_t pos = 0;
-       if (ldns_rdf_size(rdf) < pos + 1) {
-                       return LDNS_STATUS_WIRE_RDATA_ERR;
-       }
-       ldns_buffer_printf(output, "\"");
-       while (pos < ldns_rdf_size(rdf)) {
-               if (ldns_rdf_size(rdf) < pos + 1) {
-                       return LDNS_STATUS_WIRE_RDATA_ERR;
-               }
-               if (ldns_rdf_size(rdf) < pos + 1 + ldns_rdf_data(rdf)[pos]) {
-                       return LDNS_STATUS_WIRE_RDATA_ERR;
-               }
-               ldns_characters2buffer_str(output,
-                                ldns_rdf_data(rdf)[pos],
-                               &ldns_rdf_data(rdf)[pos + 1]);
-               /* 
-                * if (ldns_rdf_data(rdf)[pos] < 255)
-                *      break;
-                */
-               pos += 1 + ldns_rdf_data(rdf)[pos];
-       }
-       ldns_buffer_printf(output, "\"");
-       return ldns_buffer_status(output);
-}
-
 ldns_status
 ldns_rdf2buffer_str_fmt(ldns_buffer *buffer,
                const ldns_output_format* fmt, const ldns_rdf *rdf)
@@ -1383,9 +1355,6 @@ ldns_rdf2buffer_str_fmt(ldns_buffer *buffer,
                case LDNS_RDF_TYPE_LONG_STR:
                        res = ldns_rdf2buffer_str_long_str(buffer, rdf);
                        break;
-               case LDNS_RDF_TYPE_MULTI_STR:
-                       res = ldns_rdf2buffer_str_multi_str(buffer, rdf);
-                       break;
                }
        } else {
                /** This will write mangled RRs */
index 8f7be8c2d74197db2a84a61b516669aff85263c7..e327eec050c164ba420b9743d3e023802c12eafc 100644 (file)
@@ -128,15 +128,6 @@ enum ldns_enum_rdf_type
         */
        LDNS_RDF_TYPE_LONG_STR,
 
-       /** A <character-string> encoding of the value field as specified in
-        *  section 5.1 of [RFC1035], encoded as a sequence of one or more 
-        *  <character-string> (as specified in section 3.3 of [RFC1035]),
-        *  where all but the last <character-string> are filled up to the 
-        *  maximum length of 255 octets.
-        * For URI.
-        */
-       LDNS_RDF_TYPE_MULTI_STR,
-
        /* Aliases */
        LDNS_RDF_TYPE_BITMAP = LDNS_RDF_TYPE_NSEC
 };
index e6cee37a18740325bfebcbdd6094af2ca85d04a4..bd7884a54f93c509c13586c49bb4923796d51287 100644 (file)
@@ -285,18 +285,6 @@ ldns_status ldns_str2rdf_tag(ldns_rdf **rd, const char *str);
  */
 ldns_status ldns_str2rdf_long_str(ldns_rdf **rd, const char *str);
 
-/**
- * Convert A <character-string> encoding of the value field as specified in
- * section 5.1 of [RFC1035], encoded as a sequence of one or more 
- * <character-string> (as specified in section 3.3 of [RFC1035]),
- * where all but the last <character-string> are filled up to the 
- * maximum length of 255 octets.
- * \param[in] rd the rdf where to put the data
- * \param[in] str the string to be converted
- * \return ldns_status
- */
-ldns_status ldns_str2rdf_multi_str(ldns_rdf **rd, const char *str);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/rdata.c b/rdata.c
index d68503194b84da2416396ac3267d1793b02d33bb..5b53c4a980d6222cced1f421c3cac9905af574a4 100644 (file)
--- a/rdata.c
+++ b/rdata.c
@@ -351,9 +351,6 @@ ldns_rdf_new_frm_str(ldns_rdf_type type, const char *str)
        case LDNS_RDF_TYPE_LONG_STR:
                status = ldns_str2rdf_long_str(&rdf, str);
                break;
-       case LDNS_RDF_TYPE_MULTI_STR:
-               status = ldns_str2rdf_multi_str(&rdf, str);
-               break;
        case LDNS_RDF_TYPE_NONE:
        default:
                /* default default ??? */
diff --git a/rr.c b/rr.c
index 0ecc6970c3ef8942d91c4b2814cb19a714137018..ed22735902bb4091d77fc48193796e0f37af4fe8 100644 (file)
--- a/rr.c
+++ b/rr.c
@@ -92,8 +92,7 @@ INLINE bool
 ldns_rdf_type_maybe_quoted(ldns_rdf_type rdf_type)
 {
        return  rdf_type == LDNS_RDF_TYPE_STR ||
-               rdf_type == LDNS_RDF_TYPE_LONG_STR ||
-               rdf_type == LDNS_RDF_TYPE_MULTI_STR;
+               rdf_type == LDNS_RDF_TYPE_LONG_STR;
 }
 
 /*
@@ -1985,7 +1984,7 @@ static const ldns_rdf_type type_eui64_wireformat[] = {
 static const ldns_rdf_type type_uri_wireformat[] = {
        LDNS_RDF_TYPE_INT16,
        LDNS_RDF_TYPE_INT16,
-       LDNS_RDF_TYPE_MULTI_STR
+       LDNS_RDF_TYPE_LONG_STR
 };
 static const ldns_rdf_type type_caa_wireformat[] = {
        LDNS_RDF_TYPE_INT8,
index d5bfd5bc889525ed424abc2998945db11c0bb658..623f06dd4e499c3ca61f4c06c74b9bb06f0be75d 100644 (file)
@@ -1485,50 +1485,3 @@ ldns_str2rdf_long_str(ldns_rdf **rd, const char *str)
        return LDNS_STATUS_OK;
 }
 
-ldns_status
-ldns_str2rdf_multi_str(ldns_rdf **rd, const char *str)
-{
-       uint8_t *data, *dp, ch = 0;
-       size_t length;
-
-       /* Worst case space requirement. We'll realloc to actual size later. */
-       dp = data = LDNS_XMALLOC(uint8_t, strlen(str) + strlen(str) / 255 + 1);
-       if (! data) {
-               return LDNS_STATUS_MEM_ERR;
-       }
-
-       /* Fill data with length byte (255) followed by 255 chars, repeatedly */
-       *dp++ = 255;
-       while (parse_char(&ch, &str)) {
-               *dp++ = ch;
-               if ((dp - data) % 256 == 0) {
-                       *dp++ = 255;
-               }
-               if (dp - data > LDNS_MAX_RDFLEN) {
-                       LDNS_FREE(data);
-                       return LDNS_STATUS_INVALID_STR;
-               }
-       }
-       if (! str) {
-               return LDNS_STATUS_SYNTAX_BAD_ESCAPE;
-       }
-       length = (size_t)(dp - data);
-
-       /* Fix last length byte */
-       data[length / 256 * 256] = (uint8_t)(length % 256 - 1);
-
-       /* Lose the overmeasure */
-       data = LDNS_XREALLOC(dp = data, uint8_t, length);
-       if (! data) {
-               LDNS_FREE(dp);
-               return LDNS_STATUS_MEM_ERR;
-       }
-
-       /* Create rdf */
-       *rd = ldns_rdf_new(LDNS_RDF_TYPE_MULTI_STR, length, data);
-       if (! *rd) {
-               LDNS_FREE(data);
-               return LDNS_STATUS_MEM_ERR;
-       }
-       return LDNS_STATUS_OK;
-}
index 9ba2c3fbd882ea2544355dae4329cd29226be4f4..593fdd669043acd6d8b37826c6db17f207b88a97 100644 (file)
@@ -311,16 +311,6 @@ ldns_wire2rdf(ldns_rr *rr, const uint8_t *wire, size_t max, size_t *pos)
                        cur_rdf_length = ((size_t) wire[*pos]) + 1;
                        break;
 
-               case LDNS_RDF_TYPE_MULTI_STR:
-                       cur_rdf_length = 0;
-                       while (*pos + cur_rdf_length < end) {
-                               str_sz = wire[*pos + cur_rdf_length];
-                               cur_rdf_length += str_sz + 1;
-                               if (str_sz < 255) {
-                                       break;
-                               }
-                       }
-                       break;
                case LDNS_RDF_TYPE_INT16_DATA:
                        if (*pos + 2 > end) {
                                return LDNS_STATUS_PACKET_OVERFLOW;