]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
src: rename set_keytype_alloc() to set_datatype_alloc()
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 27 Feb 2017 22:16:09 +0000 (23:16 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 27 Feb 2017 23:33:02 +0000 (00:33 +0100)
This function can be used either side of the map, so rename it to
something generic.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/datatype.h
src/datatype.c
src/evaluate.c
src/netlink.c
src/rule.c

index 3ce3a888f0635c8972916f7879747deccefee710..b78d76f78f76cc43f562e52c668c85614ab4dd35 100644 (file)
@@ -254,8 +254,8 @@ concat_subtype_lookup(uint32_t type, unsigned int n)
 }
 
 extern const struct datatype *
-set_keytype_alloc(const struct datatype *orig_dtype, unsigned int byteorder);
-extern void set_keytype_destroy(const struct datatype *dtype);
+set_datatype_alloc(const struct datatype *orig_dtype, unsigned int byteorder);
+extern void set_datatype_destroy(const struct datatype *dtype);
 
 extern void time_print(uint64_t seconds);
 extern struct error_record *time_parse(const struct location *loc,
index 64b8b8845b1064bfdef58f13efb70344aa39c300..6b1dd4a09abbc0867ce79a7b0f3cc2aa8d9262a9 100644 (file)
@@ -1029,8 +1029,8 @@ void concat_type_destroy(const struct datatype *dtype)
        dtype_free(dtype);
 }
 
-const struct datatype *set_keytype_alloc(const struct datatype *orig_dtype,
-                                        unsigned int byteorder)
+const struct datatype *set_datatype_alloc(const struct datatype *orig_dtype,
+                                         unsigned int byteorder)
 {
        struct datatype *dtype;
 
@@ -1044,7 +1044,7 @@ const struct datatype *set_keytype_alloc(const struct datatype *orig_dtype,
        return dtype;
 }
 
-void set_keytype_destroy(const struct datatype *dtype)
+void set_datatype_destroy(const struct datatype *dtype)
 {
        if (dtype->flags & DTYPE_F_CLONE)
                dtype_free(dtype);
index 21f1a475d5e997cc339e99c79bef83ddefe999a5..07a611804a9015a34bad8e6781195fc170551148 100644 (file)
@@ -73,7 +73,7 @@ static struct expr *implicit_set_declaration(struct eval_ctx *ctx,
        set = set_alloc(&expr->location);
        set->flags      = NFT_SET_ANONYMOUS | expr->set_flags;
        set->handle.set = xstrdup(name),
-       set->keytype    = set_keytype_alloc(keytype, keybyteorder);
+       set->keytype    = set_datatype_alloc(keytype, keybyteorder);
        set->keylen     = keylen;
        set->init       = expr;
 
index 1f33982258920d358bd220b413ce902335b03115..60d86d61c50489f0b99e1fab2d402f876bec1f12 100644 (file)
@@ -1189,7 +1189,7 @@ static struct set *netlink_delinearize_set(struct netlink_ctx *ctx,
        set->handle.table  = xstrdup(nftnl_set_get_str(nls, NFTNL_SET_TABLE));
        set->handle.set    = xstrdup(nftnl_set_get_str(nls, NFTNL_SET_NAME));
 
-       set->keytype = set_keytype_alloc(keytype, byteorder);
+       set->keytype = set_datatype_alloc(keytype, byteorder);
        set->keylen  = nftnl_set_get_u32(nls, NFTNL_SET_KEY_LEN) * BITS_PER_BYTE;
        set->flags   = nftnl_set_get_u32(nls, NFTNL_SET_FLAGS);
 
index b47076f000ee1c9384ae2b9dfc92abbb33e6a5ea..6045747710db43c88bc985a352b569f30a7bc966 100644 (file)
@@ -210,7 +210,7 @@ void set_free(struct set *set)
        if (set->init != NULL)
                expr_free(set->init);
        handle_free(&set->handle);
-       set_keytype_destroy(set->keytype);
+       set_datatype_destroy(set->keytype);
        xfree(set);
 }