diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-12-02 10:57:36 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-12-11 15:22:17 +0000 |
| commit | 13dbd03bf7ca0a245cfdfd2d8c8b73e486bbaa7b (patch) | |
| tree | a5dacd038d0ebfa8f3515b42ecb45656f59b933f /tools/syz-declextract/testdata/netlink.c | |
| parent | 60f80647a03647bdf6c736952d6216b0ba32580e (diff) | |
pkg/declextract: emit more netlink families
Emit families w/o policy, emit duplicate commands.
Diffstat (limited to 'tools/syz-declextract/testdata/netlink.c')
| -rw-r--r-- | tools/syz-declextract/testdata/netlink.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/syz-declextract/testdata/netlink.c b/tools/syz-declextract/testdata/netlink.c index 355b84f1f..dc6ea4388 100644 --- a/tools/syz-declextract/testdata/netlink.c +++ b/tools/syz-declextract/testdata/netlink.c @@ -28,6 +28,10 @@ const struct nla_policy foo_genl_policy[] = { [NETLINK_FOO_ATTR7] = { .len = sizeof(var) }, }; +const struct nla_policy foo_dump_genl_policy[] = { + [NETLINK_FOO_ATTR1] = { .type = NLA_U32 }, +}; + const struct nla_policy genl_policy_reject_all[] = { { .type = NLA_REJECT }, { .type = NLA_REJECT }, @@ -47,7 +51,13 @@ static const struct genl_ops foo_ops[] = { { .cmd = NETLINK_FOO_CMD_BAR, .flags = GENL_UNS_ADMIN_PERM, + .doit = bar_cmd, + }, + { + .cmd = NETLINK_FOO_CMD_BAR, + .flags = GENL_UNS_ADMIN_PERM, .dumpit = bar_cmd, + .policy = foo_dump_genl_policy, }, }; @@ -85,3 +95,20 @@ struct genl_family bar_family = { struct genl_family noops_family = { .name = "NOOPS", }; + +enum netlink_nopolicy_cmds { + NETLINK_NOPOLICY_CMD, +}; + +static const struct genl_ops nopolicy_ops[] = { + { + .cmd = NETLINK_NOPOLICY_CMD, + .doit = foo_cmd, + }, +}; + +struct genl_family nopolicy_family = { + .name = "nopolicy", + .ops = nopolicy_ops, + .n_ops = ARRAY_SIZE(nopolicy_ops), +}; |
