]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove unused tmpl_pair_list_name()
authorNick Porter <nick@portercomputing.co.uk>
Wed, 8 Feb 2023 13:45:05 +0000 (13:45 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 9 Feb 2023 18:41:42 +0000 (12:41 -0600)
src/lib/server/tmpl.h
src/lib/server/tmpl_tokenize.c

index 3eee2a34362e6dc766524493ca8b4f7c0ee2a3e7..e7ee89d19e49c37283c86784dd14839d01247ddb 100644 (file)
@@ -1080,8 +1080,6 @@ TALLOC_CTX                *tmpl_list_ctx(request_t *request, fr_dict_attr_t const *list);
 
 fr_slen_t              tmpl_attr_list_from_substr(fr_dict_attr_t const **da_p, fr_sbuff_t *in) CC_HINT(nonnull);
 
-size_t                 tmpl_pair_list_name(fr_dict_attr_t const **out, char const *name, fr_dict_attr_t const *default_list) CC_HINT(nonnull(1,2));
-
 tmpl_t                 *tmpl_init_printf(tmpl_t *vpt, tmpl_type_t type, fr_token_t quote, char const *fmt, ...) CC_HINT(nonnull(1,4));
 
 tmpl_t                 *tmpl_init_shallow(tmpl_t *vpt, tmpl_type_t type, fr_token_t quote,
index 29ffd129911fa357d58d23f9db542892bac7a45c..9186073c990642ef6bc1216d2d8d59fce54d6c38 100644 (file)
@@ -410,80 +410,6 @@ fr_slen_t tmpl_attr_list_from_substr(fr_dict_attr_t const **da_p, fr_sbuff_t *in
        return 0;
 }
 
-/** Resolve attribute name to a #pair_list_t value.
- *
- * Check the name string for #pair_list_t qualifiers and write a #pair_list_t value
- * for that list to out. This value may be passed to #tmpl_pair_list, along with the current
- * #request_t, to get a pointer to the actual list in the #request_t.
- *
- * If we can't find a string that looks like a request qualifier, set out to def, and
- * return 0.
- *
- * @note #tmpl_pair_list_name should be called before passing a name string that may
- *     contain qualifiers to #fr_dict_attr_by_name.
- *
- * @param[out] out Where to write the list qualifier.
- * @param[in] name String containing list qualifiers to parse.
- * @param[in] def the list to return if no qualifiers were found.
- * @return 0 if no valid list qualifier could be found, else the number of bytes consumed.
- *     The caller may then advanced the name pointer by the value returned, to get the
- *     start of the attribute name (if any).
- *
- * @see pair_list
- * @see tmpl_pair_list
- */
-size_t tmpl_pair_list_name(fr_dict_attr_t const **out, char const *name, fr_dict_attr_t const *def)
-{
-       char const *p = name;
-       char const *q;
-       size_t ret = 0;
-
-       /*
-        *      Try and determine the end of the token
-        */
-       for (q = p; fr_dict_attr_allowed_chars[(uint8_t) *q]; q++);
-
-       switch (*q) {
-       /*
-        *      It's a bareword made up entirely of dictionary chars
-        *      check and see if it's a list qualifier, and if it's
-        *      not, return the def and say we couldn't parse
-        *      anything.
-        */
-       case '\0':
-               ret = tmpl_attr_list_from_substr(out, &FR_SBUFF_IN(p, (q - p)));
-               if (ret > 0) return ret;
-               *out = def;
-               return 0;
-
-       /*
-        *      It may be a list qualifier delimiter
-        */
-       case '.':
-       {
-               char const *d = q + 1;
-
-               if (isdigit((uint8_t) *d)) {
-                       while (isdigit((uint8_t) *d)) d++;
-
-                       if (!fr_dict_attr_allowed_chars[(uint8_t) *d]) {
-                               *out = def;
-                               return 0;
-                       }
-               }
-
-               ret = tmpl_attr_list_from_substr(out, &FR_SBUFF_IN(p, (q - p)));
-               if (ret == 0) return 0;
-
-               return (q + 1) - name; /* Consume the list and delimiter */
-       }
-
-       default:
-               *out = def;
-               return 0;
-       }
-}
-
  /** Allocate a new request reference and add it to the end of the attribute reference list
  *
  */