aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2025-01-16 01:01:53 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2025-01-16 07:22:19 +0000
commit90b1df4f4df937bca4b18563e6e15288de7484ac (patch)
treeeffa7cc722c397253847c35fd8be791670940cb4
parentc3df2fa9a7554e00f34f1cbcf8be6c8ccf9ccd8a (diff)
netlink: small cleanup of generic snl(3)
- Add const qualifiers for the family/group name pointers. - Break & tab long lines. No functional changes.
-rw-r--r--sys/netlink/netlink_snl_generic.h31
1 files changed, 23 insertions, 8 deletions
diff --git a/sys/netlink/netlink_snl_generic.h b/sys/netlink/netlink_snl_generic.h
index e2dc4d1bfffe..bdbefb914259 100644
--- a/sys/netlink/netlink_snl_generic.h
+++ b/sys/netlink/netlink_snl_generic.h
@@ -62,7 +62,7 @@ static struct snl_field_parser snl_fp_genl[] = {};
struct snl_genl_ctrl_mcast_group {
uint32_t mcast_grp_id;
- char *mcast_grp_name;
+ const char *mcast_grp_name;
};
struct snl_genl_ctrl_mcast_groups {
@@ -72,25 +72,40 @@ struct snl_genl_ctrl_mcast_groups {
#define _OUT(_field) offsetof(struct snl_genl_ctrl_mcast_group, _field)
static struct snl_attr_parser _nla_p_getmc[] = {
- { .type = CTRL_ATTR_MCAST_GRP_NAME, .off = _OUT(mcast_grp_name), .cb = snl_attr_get_string },
- { .type = CTRL_ATTR_MCAST_GRP_ID, .off = _OUT(mcast_grp_id), .cb = snl_attr_get_uint32 },
+ {
+ .type = CTRL_ATTR_MCAST_GRP_NAME,
+ .off = _OUT(mcast_grp_name),
+ .cb = snl_attr_get_string,
+ },
+ {
+ .type = CTRL_ATTR_MCAST_GRP_ID,
+ .off = _OUT(mcast_grp_id),
+ .cb = snl_attr_get_uint32,
+ },
};
#undef _OUT
SNL_DECLARE_ATTR_PARSER_EXT(_genl_ctrl_mc_parser,
- sizeof(struct snl_genl_ctrl_mcast_group),
- _nla_p_getmc, NULL);
+ sizeof(struct snl_genl_ctrl_mcast_group), _nla_p_getmc, NULL);
struct _getfamily_attrs {
uint16_t family_id;
- char *family_name;
+ const char *family_name;
struct snl_genl_ctrl_mcast_groups mcast_groups;
};
#define _IN(_field) offsetof(struct genlmsghdr, _field)
#define _OUT(_field) offsetof(struct _getfamily_attrs, _field)
static struct snl_attr_parser _nla_p_getfam[] = {
- { .type = CTRL_ATTR_FAMILY_ID , .off = _OUT(family_id), .cb = snl_attr_get_uint16 },
- { .type = CTRL_ATTR_FAMILY_NAME, .off = _OUT(family_name), .cb = snl_attr_get_string },
+ {
+ .type = CTRL_ATTR_FAMILY_ID,
+ .off = _OUT(family_id),
+ .cb = snl_attr_get_uint16,
+ },
+ {
+ .type = CTRL_ATTR_FAMILY_NAME,
+ .off = _OUT(family_name),
+ .cb = snl_attr_get_string,
+ },
{
.type = CTRL_ATTR_MCAST_GROUPS,
.off = _OUT(mcast_groups),