]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
datatype: rename "dtype_clone()" to datatype_clone()
authorThomas Haller <thaller@redhat.com>
Fri, 8 Sep 2023 17:34:47 +0000 (19:34 +0200)
committerFlorian Westphal <fw@strlen.de>
Fri, 8 Sep 2023 18:11:44 +0000 (20:11 +0200)
The struct is called "datatype" and related functions have the fitting
"datatype_" prefix. Rename.

Also rename the internal "dtype_alloc()" to "datatype_alloc()".

This is a follow up to commit 01a13882bb59 ('src: add reference counter
for dynamic datatypes'), which started adding "datatype_*()" functions.

Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
include/datatype.h
src/datatype.c
src/evaluate.c
src/payload.c

index 9ce7359cd3404ffcaba199fd9209879d9ac7406a..6146eda1d2ecb7351f92203d82bf519a725d5380 100644 (file)
@@ -177,7 +177,7 @@ extern const struct datatype *datatype_lookup_byname(const char *name);
 extern struct datatype *datatype_get(const struct datatype *dtype);
 extern void datatype_set(struct expr *expr, const struct datatype *dtype);
 extern void datatype_free(const struct datatype *dtype);
-struct datatype *dtype_clone(const struct datatype *orig_dtype);
+struct datatype *datatype_clone(const struct datatype *orig_dtype);
 
 struct parse_ctx {
        struct symbol_tables    *tbl;
index ba1192c8359577eb6fefb4ae1adc73dbdda492d9..1531a5d2a601c9cab25a00d332184ae3c51ff2c7 100644 (file)
@@ -1199,7 +1199,7 @@ static struct error_record *concat_type_parse(struct parse_ctx *ctx,
                     sym->dtype->desc);
 }
 
-static struct datatype *dtype_alloc(void)
+static struct datatype *datatype_alloc(void)
 {
        struct datatype *dtype;
 
@@ -1230,7 +1230,7 @@ void datatype_set(struct expr *expr, const struct datatype *dtype)
        expr->dtype = datatype_get(dtype);
 }
 
-struct datatype *dtype_clone(const struct datatype *orig_dtype)
+struct datatype *datatype_clone(const struct datatype *orig_dtype)
 {
        struct datatype *dtype;
 
@@ -1286,7 +1286,7 @@ const struct datatype *concat_type_alloc(uint32_t type)
        }
        strncat(desc, ")", sizeof(desc) - strlen(desc) - 1);
 
-       dtype           = dtype_alloc();
+       dtype           = datatype_alloc();
        dtype->type     = type;
        dtype->size     = size;
        dtype->subtypes = subtypes;
@@ -1306,7 +1306,7 @@ const struct datatype *set_datatype_alloc(const struct datatype *orig_dtype,
        if (orig_dtype != &integer_type)
                return orig_dtype;
 
-       dtype = dtype_clone(orig_dtype);
+       dtype = datatype_clone(orig_dtype);
        dtype->byteorder = byteorder;
 
        return dtype;
index 7e0c8260e72e17802978b030c9acfd0460db5369..922ce42114a5dfc851376deb1f99eaaa561dbe2c 100644 (file)
@@ -1519,7 +1519,7 @@ static int expr_evaluate_concat(struct eval_ctx *ctx, struct expr **expr)
                if (!key && i->dtype->type == TYPE_INTEGER) {
                        struct datatype *clone;
 
-                       clone = dtype_clone(i->dtype);
+                       clone = datatype_clone(i->dtype);
                        clone->size = i->len;
                        clone->byteorder = i->byteorder;
                        clone->refcnt = 1;
@@ -4547,7 +4547,7 @@ static int set_expr_evaluate_concat(struct eval_ctx *ctx, struct expr **expr)
                    i->dtype->type == TYPE_INTEGER) {
                        struct datatype *dtype;
 
-                       dtype = dtype_clone(i->dtype);
+                       dtype = datatype_clone(i->dtype);
                        dtype->size = i->len;
                        dtype->byteorder = i->byteorder;
                        dtype->refcnt = 1;
index 0afffb2338ef5d064002c9aef6c5e94107c9f1f7..179ddcbdd3fe8e4122c0cbcf9edcaf9b5b024a44 100644 (file)
@@ -251,7 +251,7 @@ static struct expr *payload_expr_parse_udata(const struct nftnl_udata *attr)
                expr->payload.offset = offset;
                expr->payload.is_raw = true;
                expr->len = len;
-               dtype = dtype_clone(&xinteger_type);
+               dtype = datatype_clone(&xinteger_type);
                dtype->size = len;
                dtype->byteorder = BYTEORDER_BIG_ENDIAN;
                dtype->refcnt = 1;