sd-netlink: support NLMSG_DONE
This commit is contained in:
parent
4e8f0ef921
commit
2be081ffd6
|
@ -144,6 +144,8 @@ int nlmsg_type_to_genl_family(sd_netlink *nl, uint16_t type, sd_genl_family *ret
|
|||
|
||||
if (type == NLMSG_ERROR)
|
||||
*ret = SD_GENL_ERROR;
|
||||
else if (type == NLMSG_DONE)
|
||||
*ret = SD_GENL_DONE;
|
||||
else if (type == GENL_ID_CTRL)
|
||||
*ret = SD_GENL_ID_CTRL;
|
||||
else {
|
||||
|
|
|
@ -991,7 +991,7 @@ static const NLTypeSystem genl_macsec_device_type_system = {
|
|||
static const NLType genl_families[] = {
|
||||
[SD_GENL_ID_CTRL] = { .type = NETLINK_TYPE_NESTED, .type_system = &genl_ctrl_id_ctrl_type_system },
|
||||
[SD_GENL_WIREGUARD] = { .type = NETLINK_TYPE_NESTED, .type_system = &genl_wireguard_type_system },
|
||||
[SD_GENL_FOU] = { .type = NETLINK_TYPE_NESTED, .type_system = &genl_fou_cmds_type_system},
|
||||
[SD_GENL_FOU] = { .type = NETLINK_TYPE_NESTED, .type_system = &genl_fou_cmds_type_system },
|
||||
[SD_GENL_L2TP] = { .type = NETLINK_TYPE_NESTED, .type_system = &genl_l2tp_tunnel_session_type_system },
|
||||
[SD_GENL_MACSEC] = { .type = NETLINK_TYPE_NESTED, .type_system = &genl_macsec_device_type_system },
|
||||
};
|
||||
|
@ -1004,6 +1004,7 @@ const NLTypeSystem genl_family_type_system_root = {
|
|||
|
||||
static const NLType genl_types[] = {
|
||||
[SD_GENL_ERROR] = { .type = NETLINK_TYPE_NESTED, .type_system = &empty_type_system, .size = sizeof(struct nlmsgerr) },
|
||||
[SD_GENL_DONE] = { .type = NETLINK_TYPE_NESTED, .type_system = &empty_type_system },
|
||||
[SD_GENL_ID_CTRL] = { .type = NETLINK_TYPE_NESTED, .type_system = &genl_get_family_type_system, .size = sizeof(struct genlmsghdr) },
|
||||
};
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ typedef struct sd_netlink_slot sd_netlink_slot;
|
|||
|
||||
typedef enum sd_gen_family {
|
||||
SD_GENL_ERROR,
|
||||
SD_GENL_DONE,
|
||||
SD_GENL_ID_CTRL,
|
||||
SD_GENL_WIREGUARD,
|
||||
SD_GENL_FOU,
|
||||
|
|
Loading…
Reference in New Issue