Skip to content

Commit d0b8df3

Browse files
committed
Also fix duplicate #include headers in ethtool-user.cpp. And regenerate all code.
1 parent 689d045 commit d0b8df3

File tree

10 files changed

+106
-116
lines changed

10 files changed

+106
-116
lines changed

generated/ethtool-user.cpp

Lines changed: 83 additions & 88 deletions
Large diffs are not rendered by default.

generated/ethtool-user.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,8 @@
1919

2020
#include "ynl.hpp"
2121

22-
#include <linux/ethtool_netlink_generated.h>
23-
#include <linux/ethtool.h>
24-
#include <linux/ethtool.h>
25-
#include <linux/ethtool.h>
26-
#include <linux/ethtool.h>
27-
#include <linux/ethtool.h>
2822
#include <linux/ethtool.h>
23+
#include <linux/ethtool_netlink_generated.h>
2924

3025
namespace ynl_cpp {
3126
const struct ynl_family& get_ynl_ethtool_family();

generated/mptcp_pm-user.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ int mptcp_pm_get_addr_rsp_parse(const struct nlmsghdr *nlh,
259259
return YNL_PARSE_CB_ERROR;
260260

261261
parg.rsp_policy = &mptcp_pm_address_nest;
262-
parg.data = &dst->addr;
262+
parg.data = &dst->addr.emplace();
263263
if (mptcp_pm_address_parse(&parg, attr))
264264
return YNL_PARSE_CB_ERROR;
265265
}

generated/net_shaper-user.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,15 @@ int net_shaper_get_rsp_parse(const struct nlmsghdr *nlh,
236236
return YNL_PARSE_CB_ERROR;
237237

238238
parg.rsp_policy = &net_shaper_handle_nest;
239-
parg.data = &dst->parent;
239+
parg.data = &dst->parent.emplace();
240240
if (net_shaper_handle_parse(&parg, attr))
241241
return YNL_PARSE_CB_ERROR;
242242
} else if (type == NET_SHAPER_A_HANDLE) {
243243
if (ynl_attr_validate(yarg, attr))
244244
return YNL_PARSE_CB_ERROR;
245245

246246
parg.rsp_policy = &net_shaper_handle_nest;
247-
parg.data = &dst->handle;
247+
parg.data = &dst->handle.emplace();
248248
if (net_shaper_handle_parse(&parg, attr))
249249
return YNL_PARSE_CB_ERROR;
250250
} else if (type == NET_SHAPER_A_METRIC) {
@@ -417,7 +417,7 @@ int net_shaper_group_rsp_parse(const struct nlmsghdr *nlh,
417417
return YNL_PARSE_CB_ERROR;
418418

419419
parg.rsp_policy = &net_shaper_handle_nest;
420-
parg.data = &dst->handle;
420+
parg.data = &dst->handle.emplace();
421421
if (net_shaper_handle_parse(&parg, attr))
422422
return YNL_PARSE_CB_ERROR;
423423
}

generated/netdev-user.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ int netdev_page_pool_get_rsp_parse(const struct nlmsghdr *nlh,
631631
return YNL_PARSE_CB_ERROR;
632632

633633
parg.rsp_policy = &netdev_io_uring_provider_info_nest;
634-
parg.data = &dst->io_uring;
634+
parg.data = &dst->io_uring.emplace();
635635
if (netdev_io_uring_provider_info_parse(&parg, attr))
636636
return YNL_PARSE_CB_ERROR;
637637
}
@@ -713,7 +713,7 @@ int netdev_page_pool_stats_get_rsp_parse(const struct nlmsghdr *nlh,
713713
return YNL_PARSE_CB_ERROR;
714714

715715
parg.rsp_policy = &netdev_page_pool_info_nest;
716-
parg.data = &dst->info;
716+
parg.data = &dst->info.emplace();
717717
if (netdev_page_pool_info_parse(&parg, attr))
718718
return YNL_PARSE_CB_ERROR;
719719
} else if (type == NETDEV_A_PAGE_POOL_STATS_ALLOC_FAST) {
@@ -859,15 +859,15 @@ int netdev_queue_get_rsp_parse(const struct nlmsghdr *nlh,
859859
return YNL_PARSE_CB_ERROR;
860860

861861
parg.rsp_policy = &netdev_io_uring_provider_info_nest;
862-
parg.data = &dst->io_uring;
862+
parg.data = &dst->io_uring.emplace();
863863
if (netdev_io_uring_provider_info_parse(&parg, attr))
864864
return YNL_PARSE_CB_ERROR;
865865
} else if (type == NETDEV_A_QUEUE_XSK) {
866866
if (ynl_attr_validate(yarg, attr))
867867
return YNL_PARSE_CB_ERROR;
868868

869869
parg.rsp_policy = &netdev_xsk_info_nest;
870-
parg.data = &dst->xsk;
870+
parg.data = &dst->xsk.emplace();
871871
if (netdev_xsk_info_parse(&parg, attr))
872872
return YNL_PARSE_CB_ERROR;
873873
}

generated/ovpn-user.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -551,15 +551,15 @@ int ovpn_keyconf_parse(struct ynl_parse_arg *yarg, const struct nlattr *nested)
551551
return YNL_PARSE_CB_ERROR;
552552

553553
parg.rsp_policy = &ovpn_keydir_nest;
554-
parg.data = &dst->encrypt_dir;
554+
parg.data = &dst->encrypt_dir.emplace();
555555
if (ovpn_keydir_parse(&parg, attr))
556556
return YNL_PARSE_CB_ERROR;
557557
} else if (type == OVPN_A_KEYCONF_DECRYPT_DIR) {
558558
if (ynl_attr_validate(yarg, attr))
559559
return YNL_PARSE_CB_ERROR;
560560

561561
parg.rsp_policy = &ovpn_keydir_nest;
562-
parg.data = &dst->decrypt_dir;
562+
parg.data = &dst->decrypt_dir.emplace();
563563
if (ovpn_keydir_parse(&parg, attr))
564564
return YNL_PARSE_CB_ERROR;
565565
}
@@ -634,7 +634,7 @@ int ovpn_peer_get_rsp_parse(const struct nlmsghdr *nlh,
634634
return YNL_PARSE_CB_ERROR;
635635

636636
parg.rsp_policy = &ovpn_peer_nest;
637-
parg.data = &dst->peer;
637+
parg.data = &dst->peer.emplace();
638638
if (ovpn_peer_parse(&parg, attr))
639639
return YNL_PARSE_CB_ERROR;
640640
}
@@ -768,7 +768,7 @@ int ovpn_key_get_rsp_parse(const struct nlmsghdr *nlh,
768768
return YNL_PARSE_CB_ERROR;
769769

770770
parg.rsp_policy = &ovpn_keyconf_nest;
771-
parg.data = &dst->keyconf;
771+
parg.data = &dst->keyconf.emplace();
772772
if (ovpn_keyconf_parse(&parg, attr))
773773
return YNL_PARSE_CB_ERROR;
774774
}

generated/psp-user.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ int psp_rx_assoc_rsp_parse(const struct nlmsghdr *nlh,
382382
return YNL_PARSE_CB_ERROR;
383383

384384
parg.rsp_policy = &psp_keys_nest;
385-
parg.data = &dst->rx_key;
385+
parg.data = &dst->rx_key.emplace();
386386
if (psp_keys_parse(&parg, attr))
387387
return YNL_PARSE_CB_ERROR;
388388
}

generated/tcp_metrics-user.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ int tcp_metrics_get_rsp_parse(const struct nlmsghdr *nlh,
178178
return YNL_PARSE_CB_ERROR;
179179

180180
parg.rsp_policy = &tcp_metrics_metrics_nest;
181-
parg.data = &dst->vals;
181+
parg.data = &dst->vals.emplace();
182182
if (tcp_metrics_metrics_parse(&parg, attr))
183183
return YNL_PARSE_CB_ERROR;
184184
} else if (type == TCP_METRICS_ATTR_FOPEN_MSS) {

generated/team-user.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ int team_item_option_parse(struct ynl_parse_arg *yarg,
265265
return YNL_PARSE_CB_ERROR;
266266

267267
parg.rsp_policy = &team_attr_option_nest;
268-
parg.data = &dst->option;
268+
parg.data = &dst->option.emplace();
269269
if (team_attr_option_parse(&parg, attr))
270270
return YNL_PARSE_CB_ERROR;
271271
}
@@ -291,7 +291,7 @@ int team_item_port_parse(struct ynl_parse_arg *yarg,
291291
return YNL_PARSE_CB_ERROR;
292292

293293
parg.rsp_policy = &team_attr_port_nest;
294-
parg.data = &dst->port;
294+
parg.data = &dst->port.emplace();
295295
if (team_attr_port_parse(&parg, attr))
296296
return YNL_PARSE_CB_ERROR;
297297
}
@@ -369,7 +369,7 @@ int team_options_set_rsp_parse(const struct nlmsghdr *nlh,
369369
return YNL_PARSE_CB_ERROR;
370370

371371
parg.rsp_policy = &team_item_option_nest;
372-
parg.data = &dst->list_option;
372+
parg.data = &dst->list_option.emplace();
373373
if (team_item_option_parse(&parg, attr))
374374
return YNL_PARSE_CB_ERROR;
375375
}
@@ -431,7 +431,7 @@ int team_options_get_rsp_parse(const struct nlmsghdr *nlh,
431431
return YNL_PARSE_CB_ERROR;
432432

433433
parg.rsp_policy = &team_item_option_nest;
434-
parg.data = &dst->list_option;
434+
parg.data = &dst->list_option.emplace();
435435
if (team_item_option_parse(&parg, attr))
436436
return YNL_PARSE_CB_ERROR;
437437
}
@@ -491,7 +491,7 @@ int team_port_list_get_rsp_parse(const struct nlmsghdr *nlh,
491491
return YNL_PARSE_CB_ERROR;
492492

493493
parg.rsp_policy = &team_item_port_nest;
494-
parg.data = &dst->list_port;
494+
parg.data = &dst->list_port.emplace();
495495
if (team_item_port_parse(&parg, attr))
496496
return YNL_PARSE_CB_ERROR;
497497
}

ynl-gen-cpp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2267,11 +2267,11 @@ def main():
22672267
cw.nl()
22682268
cw.p("#include <array>")
22692269
cw.nl()
2270-
headers = [parsed.uapi_header]
2270+
headers = {parsed.uapi_header}
22712271
for definition in parsed["definitions"]:
22722272
if "header" in definition:
2273-
headers.append(definition["header"])
2274-
for one in headers:
2273+
headers.add(definition["header"])
2274+
for one in sorted(headers):
22752275
cw.p(f"#include <{one}>")
22762276
cw.nl()
22772277

0 commit comments

Comments
 (0)