Whamcloud - gitweb
LU-6245 libcfs: move cfs_ip_addr_* function from kernel libcfs to LNet
[fs/lustre-release.git] / libcfs / libcfs / util / string.c
index f4c6f45..e5ef108 100644 (file)
@@ -431,63 +431,3 @@ cfs_expr_list_free_list(struct list_head *list)
                cfs_expr_list_free(el);
        }
 }
-
-int
-cfs_ip_addr_parse(char *str, int len, struct list_head *list)
-{
-       struct cfs_expr_list    *el;
-       struct cfs_lstr         src;
-       int                     rc;
-       int                     i;
-
-       src.ls_str = str;
-       src.ls_len = len;
-       i = 0;
-
-       while (src.ls_str != NULL) {
-               struct cfs_lstr res;
-
-               if (!cfs_gettok(&src, '.', &res)) {
-                       rc = -EINVAL;
-                       goto out;
-               }
-
-               rc = cfs_expr_list_parse(res.ls_str, res.ls_len, 0, 255, &el);
-               if (rc != 0)
-                       goto out;
-
-               list_add_tail(&el->el_link, list);
-               i++;
-       }
-
-       if (i == 4)
-               return 0;
-
-       rc = -EINVAL;
- out:
-       cfs_expr_list_free_list(list);
-
-       return rc;
-}
-
-/**
- * Matches address (\a addr) against address set encoded in \a list.
- *
- * \retval 1 if \a addr matches
- * \retval 0 otherwise
- */
-int
-cfs_ip_addr_match(__u32 addr, struct list_head *list)
-{
-       struct cfs_expr_list *el;
-       int i = 0;
-
-       list_for_each_entry_reverse(el, list, el_link) {
-               if (!cfs_expr_list_match(addr & 0xff, el))
-                       return 0;
-               addr >>= 8;
-               i++;
-       }
-
-       return i == 4;
-}