m->hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
- type_get_type_system(genl_cmd_type, &type_system);
+ type_system = type_get_type_system(genl_cmd_type);
r = type_system_get_type(type_system, &nl_type, cmd);
if (r < 0)
m->hdr->nlmsg_len = size;
m->hdr->nlmsg_type = nlmsg_type;
- type_get_type_system(nl_type, &m->containers[0].type_system);
+ m->containers[0].type_system = type_get_type_system(nl_type);
*(struct genlmsghdr *) NLMSG_DATA(m->hdr) = (struct genlmsghdr) {
.cmd = cmd,
m->hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
- type_get_type_system(nl_type, &m->containers[0].type_system);
+ m->containers[0].type_system = type_get_type_system(nl_type);
m->hdr->nlmsg_len = size;
m->hdr->nlmsg_type = type;
size = type_get_size(nl_type);
if (type == NETLINK_TYPE_NESTED) {
- const NLTypeSystem *type_system;
-
- type_get_type_system(nl_type, &type_system);
-
- m->containers[0].type_system = type_system;
+ m->containers[0].type_system = type_get_type_system(nl_type);
if (sd_netlink_message_is_error(m))
r = netlink_message_parse_error(m);
return type->size;
}
-void type_get_type_system(const NLType *nl_type, const NLTypeSystem **ret) {
+const NLTypeSystem *type_get_type_system(const NLType *nl_type) {
assert(nl_type);
- assert(ret);
assert(nl_type->type == NETLINK_TYPE_NESTED);
assert(nl_type->type_system);
-
- *ret = nl_type->type_system;
+ return nl_type->type_system;
}
-void type_get_type_system_union(const NLType *nl_type, const NLTypeSystemUnion **ret) {
+const NLTypeSystemUnion *type_get_type_system_union(const NLType *nl_type) {
assert(nl_type);
- assert(ret);
assert(nl_type->type == NETLINK_TYPE_UNION);
assert(nl_type->type_system_union);
-
- *ret = nl_type->type_system_union;
+ return nl_type->type_system_union;
}
uint16_t type_system_get_count(const NLTypeSystem *type_system) {
return -EOPNOTSUPP;
*ret = nl_type;
-
return 0;
}
if (r < 0)
return r;
- type_get_type_system(nl_type, ret);
+ *ret = type_get_type_system(nl_type);
return 0;
}
if (r < 0)
return r;
- type_get_type_system_union(nl_type, ret);
+ *ret = type_get_type_system_union(nl_type);
return 0;
}
assert(type < type_system_union->num);
*ret = &type_system_union->type_systems[type];
-
return 0;
}
return -EOPNOTSUPP;
*ret = type_system;
-
return 0;
}
uint16_t type_get_type(const NLType *type);
size_t type_get_size(const NLType *type);
-void type_get_type_system(const NLType *type, const NLTypeSystem **ret);
-void type_get_type_system_union(const NLType *type, const NLTypeSystemUnion **ret);
+const NLTypeSystem *type_get_type_system(const NLType *type);
+const NLTypeSystemUnion *type_get_type_system_union(const NLType *type);
const NLTypeSystem* type_system_get_root(int protocol);
uint16_t type_system_get_count(const NLTypeSystem *type_system);
m->hdr->nlmsg_flags = NLM_F_REQUEST | flags;
- type_get_type_system(nl_type, &m->containers[0].type_system);
+ m->containers[0].type_system = type_get_type_system(nl_type);
r = type_system_get_type_system(m->containers[0].type_system,
&m->containers[0].type_system,