]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
rename struct ct to ct_helper
authorFlorian Westphal <fw@strlen.de>
Wed, 24 May 2017 18:10:44 +0000 (20:10 +0200)
committerFlorian Westphal <fw@strlen.de>
Sun, 16 Jul 2017 18:14:43 +0000 (20:14 +0200)
Its misleading, this structure holds members for ct_helper object
infrastructure, rename it.

Signed-off-by: Florian Westphal <fw@strlen.de>
include/rule.h
src/netlink.c
src/parser_bison.y
src/rule.c

index 7424b21c6e019de0dbc42a03c90671660a5e86cb..24c73d85f83befaaad81c373e3a2fb9d5150a7df 100644 (file)
@@ -263,8 +263,8 @@ struct quota {
        uint32_t        flags;
 };
 
-struct ct {
-       char helper_name[16];
+struct ct_helper {
+       char name[16];
        uint16_t l3proto;
        uint8_t l4proto;
 };
@@ -287,7 +287,7 @@ struct obj {
        union {
                struct counter          counter;
                struct quota            quota;
-               struct ct               ct;
+               struct ct_helper        ct_helper;
        };
 };
 
index 880502cde20c6abea77f39bfbbdf60d78e94240c..b9731a91b9bfddbe9308f97e0c32c3daa8c03eec 100644 (file)
@@ -319,12 +319,12 @@ alloc_nftnl_obj(const struct handle *h, struct obj *obj)
                break;
        case NFT_OBJECT_CT_HELPER:
                nftnl_obj_set_str(nlo, NFTNL_OBJ_CT_HELPER_NAME,
-                                 obj->ct.helper_name);
+                                 obj->ct_helper.name);
                nftnl_obj_set_u8(nlo, NFTNL_OBJ_CT_HELPER_L4PROTO,
-                                 obj->ct.l4proto);
-               if (obj->ct.l3proto)
+                                 obj->ct_helper.l4proto);
+               if (obj->ct_helper.l3proto)
                        nftnl_obj_set_u16(nlo, NFTNL_OBJ_CT_HELPER_L3PROTO,
-                                         obj->ct.l3proto);
+                                         obj->ct_helper.l3proto);
                break;
        default:
                BUG("Unknown type %d\n", obj->type);
@@ -1832,10 +1832,10 @@ static struct obj *netlink_delinearize_obj(struct netlink_ctx *ctx,
                        nftnl_obj_get_u32(nlo, NFTNL_OBJ_QUOTA_FLAGS);
                break;
        case NFT_OBJECT_CT_HELPER:
-               snprintf(obj->ct.helper_name, sizeof(obj->ct.helper_name), "%s",
+               snprintf(obj->ct_helper.name, sizeof(obj->ct_helper.name), "%s",
                         nftnl_obj_get_str(nlo, NFTNL_OBJ_CT_HELPER_NAME));
-               obj->ct.l3proto = nftnl_obj_get_u16(nlo, NFTNL_OBJ_CT_HELPER_L3PROTO);
-               obj->ct.l4proto = nftnl_obj_get_u8(nlo, NFTNL_OBJ_CT_HELPER_L4PROTO);
+               obj->ct_helper.l3proto = nftnl_obj_get_u16(nlo, NFTNL_OBJ_CT_HELPER_L3PROTO);
+               obj->ct_helper.l4proto = nftnl_obj_get_u8(nlo, NFTNL_OBJ_CT_HELPER_L4PROTO);
                break;
        }
        obj->type = type;
index 71c5c77c06e82897f863bc457b6697003fa43e0a..74b2ac7b29352cd1fd5067971808790b24ba4034 100644 (file)
@@ -2708,14 +2708,14 @@ ct_l4protoname          :       TCP     { $$ = IPPROTO_TCP; }
 
 ct_config              :       TYPE    QUOTED_STRING   PROTOCOL        ct_l4protoname  stmt_seperator
                        {
-                               struct ct *ct;
+                               struct ct_helper *ct;
                                int ret;
 
-                               ct = &$<obj>0->ct;
+                               ct = &$<obj>0->ct_helper;
 
-                               ret = snprintf(ct->helper_name, sizeof(ct->helper_name), "%s", $2);
-                               if (ret <= 0 || ret >= (int)sizeof(ct->helper_name)) {
-                                       erec_queue(error(&@2, "invalid name '%s', max length is %u\n", $2, (int)sizeof(ct->helper_name)), state->msgs);
+                               ret = snprintf(ct->name, sizeof(ct->name), "%s", $2);
+                               if (ret <= 0 || ret >= (int)sizeof(ct->name)) {
+                                       erec_queue(error(&@2, "invalid name '%s', max length is %u\n", $2, (int)sizeof(ct->name)), state->msgs);
                                        YYERROR;
                                }
 
@@ -2723,7 +2723,7 @@ ct_config         :       TYPE    QUOTED_STRING   PROTOCOL        ct_l4protoname  stmt_seperator
                        }
                        |       L3PROTOCOL      family_spec_explicit    stmt_seperator
                        {
-                               $<obj>0->ct.l3proto = $2;
+                               $<obj>0->ct_helper.l3proto = $2;
                        }
                        ;
 
index f65674c0e2d4bb26e4cbb82537f0821c2cf55c84..ee510fe0123bed3094da3bc666b8b3839ef51782 100644 (file)
@@ -1258,9 +1258,9 @@ static void obj_print_data(const struct obj *obj,
                break;
        case NFT_OBJECT_CT_HELPER: {
                printf("ct helper %s {\n", obj->handle.obj);
-               printf("\t\ttype \"%s\" protocol ", obj->ct.helper_name);
-               print_proto_name_proto(obj->ct.l4proto);
-               printf("\t\tl3proto %s", family2str(obj->ct.l3proto));
+               printf("\t\ttype \"%s\" protocol ", obj->ct_helper.name);
+               print_proto_name_proto(obj->ct_helper.l4proto);
+               printf("\t\tl3proto %s", family2str(obj->ct_helper.l3proto));
                break;
                }
        default: