diff --git a/home/nipa/nipa_out/909377/ynl/old-code/ethtool-user.c b/home/nipa/nipa_out/909377/ynl/new-code/ethtool-user.c index 92fe355323b2..715f74d117f9 100644 --- a/home/nipa/nipa_out/909377/ynl/old-code/ethtool-user.c +++ b/home/nipa/nipa_out/909377/ynl/new-code/ethtool-user.c @@ -8,7 +8,7 @@ #include #include "ethtool-user.h" #include "ynl.h" -#include +#include #include @@ -134,7 +134,7 @@ static const char * const ethtool_c33_pse_ext_state_strmap[] = { [8] = "short-detected", }; -const char *ethtool_c33_pse_ext_state_str(int value) +const char *ethtool_c33_pse_ext_state_str(enum c33_pse_ext_state value) { if (value < 0 || value >= (int)YNL_ARRAY_SIZE(ethtool_c33_pse_ext_state_strmap)) return NULL; @@ -153,8 +153,22 @@ const char *ethtool_phy_upstream_type_str(int value) return ethtool_phy_upstream_type_strmap[value]; } +static const char * const ethtool_tcp_data_split_strmap[] = { + [0] = "unknown", + [1] = "disabled", + [2] = "enabled", +}; + +const char *ethtool_tcp_data_split_str(enum ethtool_tcp_data_split value) +{ + if (value < 0 || value >= (int)YNL_ARRAY_SIZE(ethtool_tcp_data_split_strmap)) + return NULL; + return ethtool_tcp_data_split_strmap[value]; +} + /* Policies */ const struct ynl_policy_attr ethtool_header_policy[ETHTOOL_A_HEADER_MAX + 1] = { + [ETHTOOL_A_HEADER_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_HEADER_DEV_INDEX] = { .name = "dev-index", .type = YNL_PT_U32, }, [ETHTOOL_A_HEADER_DEV_NAME] = { .name = "dev-name", .type = YNL_PT_NUL_STR, }, [ETHTOOL_A_HEADER_FLAGS] = { .name = "flags", .type = YNL_PT_U32, }, @@ -167,6 +181,7 @@ const struct ynl_policy_nest ethtool_header_nest = { }; const struct ynl_policy_attr ethtool_pause_stat_policy[ETHTOOL_A_PAUSE_STAT_MAX + 1] = { + [ETHTOOL_A_PAUSE_STAT_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_PAUSE_STAT_PAD] = { .name = "pad", .type = YNL_PT_IGNORE, }, [ETHTOOL_A_PAUSE_STAT_TX_FRAMES] = { .name = "tx-frames", .type = YNL_PT_U64, }, [ETHTOOL_A_PAUSE_STAT_RX_FRAMES] = { .name = "rx-frames", .type = YNL_PT_U64, }, @@ -178,6 +193,7 @@ const struct ynl_policy_nest ethtool_pause_stat_nest = { }; const struct ynl_policy_attr ethtool_ts_stat_policy[ETHTOOL_A_TS_STAT_MAX + 1] = { + [ETHTOOL_A_TS_STAT_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_TS_STAT_TX_PKTS] = { .name = "tx-pkts", .type = YNL_PT_UINT, }, [ETHTOOL_A_TS_STAT_TX_LOST] = { .name = "tx-lost", .type = YNL_PT_UINT, }, [ETHTOOL_A_TS_STAT_TX_ERR] = { .name = "tx-err", .type = YNL_PT_UINT, }, @@ -189,6 +205,7 @@ const struct ynl_policy_nest ethtool_ts_stat_nest = { }; const struct ynl_policy_attr ethtool_cable_test_tdr_cfg_policy[ETHTOOL_A_CABLE_TEST_TDR_CFG_MAX + 1] = { + [ETHTOOL_A_CABLE_TEST_TDR_CFG_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_CABLE_TEST_TDR_CFG_FIRST] = { .name = "first", .type = YNL_PT_U32, }, [ETHTOOL_A_CABLE_TEST_TDR_CFG_LAST] = { .name = "last", .type = YNL_PT_U32, }, [ETHTOOL_A_CABLE_TEST_TDR_CFG_STEP] = { .name = "step", .type = YNL_PT_U32, }, @@ -201,6 +218,7 @@ const struct ynl_policy_nest ethtool_cable_test_tdr_cfg_nest = { }; const struct ynl_policy_attr ethtool_fec_stat_policy[ETHTOOL_A_FEC_STAT_MAX + 1] = { + [ETHTOOL_A_FEC_STAT_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_FEC_STAT_PAD] = { .name = "pad", .type = YNL_PT_IGNORE, }, [ETHTOOL_A_FEC_STAT_CORRECTED] = { .name = "corrected", .type = YNL_PT_BINARY,}, [ETHTOOL_A_FEC_STAT_UNCORR] = { .name = "uncorr", .type = YNL_PT_BINARY,}, @@ -212,17 +230,19 @@ const struct ynl_policy_nest ethtool_fec_stat_nest = { .table = ethtool_fec_stat_policy, }; -const struct ynl_policy_attr ethtool_c33_pse_pw_limit_policy[ETHTOOL_A_C33_PSE_PW_LIMIT_MAX + 1] = { +const struct ynl_policy_attr ethtool_c33_pse_pw_limit_policy[__ETHTOOL_A_C33_PSE_PW_LIMIT_MAX + 1] = { + [ETHTOOL_A_C33_PSE_PW_LIMIT_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_C33_PSE_PW_LIMIT_MIN] = { .name = "min", .type = YNL_PT_U32, }, [ETHTOOL_A_C33_PSE_PW_LIMIT_MAX] = { .name = "max", .type = YNL_PT_U32, }, }; const struct ynl_policy_nest ethtool_c33_pse_pw_limit_nest = { - .max_attr = ETHTOOL_A_C33_PSE_PW_LIMIT_MAX, + .max_attr = __ETHTOOL_A_C33_PSE_PW_LIMIT_MAX, .table = ethtool_c33_pse_pw_limit_policy, }; const struct ynl_policy_attr ethtool_mm_stat_policy[ETHTOOL_A_MM_STAT_MAX + 1] = { + [ETHTOOL_A_MM_STAT_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_MM_STAT_PAD] = { .name = "pad", .type = YNL_PT_IGNORE, }, [ETHTOOL_A_MM_STAT_REASSEMBLY_ERRORS] = { .name = "reassembly-errors", .type = YNL_PT_U64, }, [ETHTOOL_A_MM_STAT_SMD_ERRORS] = { .name = "smd-errors", .type = YNL_PT_U64, }, @@ -238,6 +258,7 @@ const struct ynl_policy_nest ethtool_mm_stat_nest = { }; const struct ynl_policy_attr ethtool_irq_moderation_policy[ETHTOOL_A_IRQ_MODERATION_MAX + 1] = { + [ETHTOOL_A_IRQ_MODERATION_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_IRQ_MODERATION_USEC] = { .name = "usec", .type = YNL_PT_U32, }, [ETHTOOL_A_IRQ_MODERATION_PKTS] = { .name = "pkts", .type = YNL_PT_U32, }, [ETHTOOL_A_IRQ_MODERATION_COMPS] = { .name = "comps", .type = YNL_PT_U32, }, @@ -249,6 +270,7 @@ const struct ynl_policy_nest ethtool_irq_moderation_nest = { }; const struct ynl_policy_attr ethtool_cable_result_policy[ETHTOOL_A_CABLE_RESULT_MAX + 1] = { + [ETHTOOL_A_CABLE_RESULT_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_CABLE_RESULT_PAIR] = { .name = "pair", .type = YNL_PT_U8, }, [ETHTOOL_A_CABLE_RESULT_CODE] = { .name = "code", .type = YNL_PT_U8, }, [ETHTOOL_A_CABLE_RESULT_SRC] = { .name = "src", .type = YNL_PT_U32, }, @@ -260,6 +282,7 @@ const struct ynl_policy_nest ethtool_cable_result_nest = { }; const struct ynl_policy_attr ethtool_cable_fault_length_policy[ETHTOOL_A_CABLE_FAULT_LENGTH_MAX + 1] = { + [ETHTOOL_A_CABLE_FAULT_LENGTH_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_CABLE_FAULT_LENGTH_PAIR] = { .name = "pair", .type = YNL_PT_U8, }, [ETHTOOL_A_CABLE_FAULT_LENGTH_CM] = { .name = "cm", .type = YNL_PT_U32, }, [ETHTOOL_A_CABLE_FAULT_LENGTH_SRC] = { .name = "src", .type = YNL_PT_U32, }, @@ -271,6 +294,7 @@ const struct ynl_policy_nest ethtool_cable_fault_length_nest = { }; const struct ynl_policy_attr ethtool_bitset_bit_policy[ETHTOOL_A_BITSET_BIT_MAX + 1] = { + [ETHTOOL_A_BITSET_BIT_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_BITSET_BIT_INDEX] = { .name = "index", .type = YNL_PT_U32, }, [ETHTOOL_A_BITSET_BIT_NAME] = { .name = "name", .type = YNL_PT_NUL_STR, }, [ETHTOOL_A_BITSET_BIT_VALUE] = { .name = "value", .type = YNL_PT_FLAG, }, @@ -282,6 +306,7 @@ const struct ynl_policy_nest ethtool_bitset_bit_nest = { }; const struct ynl_policy_attr ethtool_tunnel_udp_entry_policy[ETHTOOL_A_TUNNEL_UDP_ENTRY_MAX + 1] = { + [ETHTOOL_A_TUNNEL_UDP_ENTRY_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_TUNNEL_UDP_ENTRY_PORT] = { .name = "port", .type = YNL_PT_U16, }, [ETHTOOL_A_TUNNEL_UDP_ENTRY_TYPE] = { .name = "type", .type = YNL_PT_U32, }, }; @@ -292,6 +317,7 @@ const struct ynl_policy_nest ethtool_tunnel_udp_entry_nest = { }; const struct ynl_policy_attr ethtool_string_policy[ETHTOOL_A_STRING_MAX + 1] = { + [ETHTOOL_A_STRING_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_STRING_INDEX] = { .name = "index", .type = YNL_PT_U32, }, [ETHTOOL_A_STRING_VALUE] = { .name = "value", .type = YNL_PT_NUL_STR, }, }; @@ -302,6 +328,7 @@ const struct ynl_policy_nest ethtool_string_nest = { }; const struct ynl_policy_attr ethtool_profile_policy[ETHTOOL_A_PROFILE_MAX + 1] = { + [ETHTOOL_A_PROFILE_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_PROFILE_IRQ_MODERATION] = { .name = "irq-moderation", .type = YNL_PT_NEST, .nest = ðtool_irq_moderation_nest, }, }; @@ -311,6 +338,7 @@ const struct ynl_policy_nest ethtool_profile_nest = { }; const struct ynl_policy_attr ethtool_cable_nest_policy[ETHTOOL_A_CABLE_NEST_MAX + 1] = { + [ETHTOOL_A_CABLE_NEST_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_CABLE_NEST_RESULT] = { .name = "result", .type = YNL_PT_NEST, .nest = ðtool_cable_result_nest, }, [ETHTOOL_A_CABLE_NEST_FAULT_LENGTH] = { .name = "fault-length", .type = YNL_PT_NEST, .nest = ðtool_cable_fault_length_nest, }, }; @@ -321,6 +349,7 @@ const struct ynl_policy_nest ethtool_cable_nest_nest = { }; const struct ynl_policy_attr ethtool_bitset_bits_policy[ETHTOOL_A_BITSET_BITS_MAX + 1] = { + [ETHTOOL_A_BITSET_BITS_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_BITSET_BITS_BIT] = { .name = "bit", .type = YNL_PT_NEST, .nest = ðtool_bitset_bit_nest, }, }; @@ -330,6 +359,7 @@ const struct ynl_policy_nest ethtool_bitset_bits_nest = { }; const struct ynl_policy_attr ethtool_strings_policy[ETHTOOL_A_STRINGS_MAX + 1] = { + [ETHTOOL_A_STRINGS_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_STRINGS_STRING] = { .name = "string", .type = YNL_PT_NEST, .nest = ðtool_string_nest, }, }; @@ -339,6 +369,7 @@ const struct ynl_policy_nest ethtool_strings_nest = { }; const struct ynl_policy_attr ethtool_bitset_policy[ETHTOOL_A_BITSET_MAX + 1] = { + [ETHTOOL_A_BITSET_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_BITSET_NOMASK] = { .name = "nomask", .type = YNL_PT_FLAG, }, [ETHTOOL_A_BITSET_SIZE] = { .name = "size", .type = YNL_PT_U32, }, [ETHTOOL_A_BITSET_BITS] = { .name = "bits", .type = YNL_PT_NEST, .nest = ðtool_bitset_bits_nest, }, @@ -352,6 +383,7 @@ const struct ynl_policy_nest ethtool_bitset_nest = { }; const struct ynl_policy_attr ethtool_stringset_policy[ETHTOOL_A_STRINGSET_MAX + 1] = { + [ETHTOOL_A_STRINGSET_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_STRINGSET_ID] = { .name = "id", .type = YNL_PT_U32, }, [ETHTOOL_A_STRINGSET_COUNT] = { .name = "count", .type = YNL_PT_U32, }, [ETHTOOL_A_STRINGSET_STRINGS] = { .name = "strings", .type = YNL_PT_NEST, .nest = ðtool_strings_nest, }, @@ -363,6 +395,7 @@ const struct ynl_policy_nest ethtool_stringset_nest = { }; const struct ynl_policy_attr ethtool_tunnel_udp_table_policy[ETHTOOL_A_TUNNEL_UDP_TABLE_MAX + 1] = { + [ETHTOOL_A_TUNNEL_UDP_TABLE_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_TUNNEL_UDP_TABLE_SIZE] = { .name = "size", .type = YNL_PT_U32, }, [ETHTOOL_A_TUNNEL_UDP_TABLE_TYPES] = { .name = "types", .type = YNL_PT_NEST, .nest = ðtool_bitset_nest, }, [ETHTOOL_A_TUNNEL_UDP_TABLE_ENTRY] = { .name = "entry", .type = YNL_PT_NEST, .nest = ðtool_tunnel_udp_entry_nest, }, @@ -374,6 +407,7 @@ const struct ynl_policy_nest ethtool_tunnel_udp_table_nest = { }; const struct ynl_policy_attr ethtool_stringsets_policy[ETHTOOL_A_STRINGSETS_MAX + 1] = { + [ETHTOOL_A_STRINGSETS_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_STRINGSETS_STRINGSET] = { .name = "stringset", .type = YNL_PT_NEST, .nest = ðtool_stringset_nest, }, }; @@ -383,6 +417,7 @@ const struct ynl_policy_nest ethtool_stringsets_nest = { }; const struct ynl_policy_attr ethtool_tunnel_udp_policy[ETHTOOL_A_TUNNEL_UDP_MAX + 1] = { + [ETHTOOL_A_TUNNEL_UDP_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_TUNNEL_UDP_TABLE] = { .name = "table", .type = YNL_PT_NEST, .nest = ðtool_tunnel_udp_table_nest, }, }; @@ -392,6 +427,7 @@ const struct ynl_policy_nest ethtool_tunnel_udp_nest = { }; const struct ynl_policy_attr ethtool_strset_policy[ETHTOOL_A_STRSET_MAX + 1] = { + [ETHTOOL_A_STRSET_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_STRSET_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_STRSET_STRINGSETS] = { .name = "stringsets", .type = YNL_PT_NEST, .nest = ðtool_stringsets_nest, }, [ETHTOOL_A_STRSET_COUNTS_ONLY] = { .name = "counts-only", .type = YNL_PT_FLAG, }, @@ -403,6 +439,7 @@ const struct ynl_policy_nest ethtool_strset_nest = { }; const struct ynl_policy_attr ethtool_linkinfo_policy[ETHTOOL_A_LINKINFO_MAX + 1] = { + [ETHTOOL_A_LINKINFO_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_LINKINFO_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_LINKINFO_PORT] = { .name = "port", .type = YNL_PT_U8, }, [ETHTOOL_A_LINKINFO_PHYADDR] = { .name = "phyaddr", .type = YNL_PT_U8, }, @@ -417,6 +454,7 @@ const struct ynl_policy_nest ethtool_linkinfo_nest = { }; const struct ynl_policy_attr ethtool_linkmodes_policy[ETHTOOL_A_LINKMODES_MAX + 1] = { + [ETHTOOL_A_LINKMODES_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_LINKMODES_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_LINKMODES_AUTONEG] = { .name = "autoneg", .type = YNL_PT_U8, }, [ETHTOOL_A_LINKMODES_OURS] = { .name = "ours", .type = YNL_PT_NEST, .nest = ðtool_bitset_nest, }, @@ -435,6 +473,7 @@ const struct ynl_policy_nest ethtool_linkmodes_nest = { }; const struct ynl_policy_attr ethtool_linkstate_policy[ETHTOOL_A_LINKSTATE_MAX + 1] = { + [ETHTOOL_A_LINKSTATE_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_LINKSTATE_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_LINKSTATE_LINK] = { .name = "link", .type = YNL_PT_U8, }, [ETHTOOL_A_LINKSTATE_SQI] = { .name = "sqi", .type = YNL_PT_U32, }, @@ -450,6 +489,7 @@ const struct ynl_policy_nest ethtool_linkstate_nest = { }; const struct ynl_policy_attr ethtool_debug_policy[ETHTOOL_A_DEBUG_MAX + 1] = { + [ETHTOOL_A_DEBUG_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_DEBUG_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_DEBUG_MSGMASK] = { .name = "msgmask", .type = YNL_PT_NEST, .nest = ðtool_bitset_nest, }, }; @@ -460,6 +500,7 @@ const struct ynl_policy_nest ethtool_debug_nest = { }; const struct ynl_policy_attr ethtool_wol_policy[ETHTOOL_A_WOL_MAX + 1] = { + [ETHTOOL_A_WOL_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_WOL_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_WOL_MODES] = { .name = "modes", .type = YNL_PT_NEST, .nest = ðtool_bitset_nest, }, [ETHTOOL_A_WOL_SOPASS] = { .name = "sopass", .type = YNL_PT_BINARY,}, @@ -471,6 +512,7 @@ const struct ynl_policy_nest ethtool_wol_nest = { }; const struct ynl_policy_attr ethtool_features_policy[ETHTOOL_A_FEATURES_MAX + 1] = { + [ETHTOOL_A_FEATURES_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_FEATURES_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_FEATURES_HW] = { .name = "hw", .type = YNL_PT_NEST, .nest = ðtool_bitset_nest, }, [ETHTOOL_A_FEATURES_WANTED] = { .name = "wanted", .type = YNL_PT_NEST, .nest = ðtool_bitset_nest, }, @@ -484,6 +526,7 @@ const struct ynl_policy_nest ethtool_features_nest = { }; const struct ynl_policy_attr ethtool_privflags_policy[ETHTOOL_A_PRIVFLAGS_MAX + 1] = { + [ETHTOOL_A_PRIVFLAGS_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_PRIVFLAGS_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_PRIVFLAGS_FLAGS] = { .name = "flags", .type = YNL_PT_NEST, .nest = ðtool_bitset_nest, }, }; @@ -494,6 +537,7 @@ const struct ynl_policy_nest ethtool_privflags_nest = { }; const struct ynl_policy_attr ethtool_rings_policy[ETHTOOL_A_RINGS_MAX + 1] = { + [ETHTOOL_A_RINGS_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_RINGS_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_RINGS_RX_MAX] = { .name = "rx-max", .type = YNL_PT_U32, }, [ETHTOOL_A_RINGS_RX_MINI_MAX] = { .name = "rx-mini-max", .type = YNL_PT_U32, }, @@ -518,6 +562,7 @@ const struct ynl_policy_nest ethtool_rings_nest = { }; const struct ynl_policy_attr ethtool_channels_policy[ETHTOOL_A_CHANNELS_MAX + 1] = { + [ETHTOOL_A_CHANNELS_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_CHANNELS_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_CHANNELS_RX_MAX] = { .name = "rx-max", .type = YNL_PT_U32, }, [ETHTOOL_A_CHANNELS_TX_MAX] = { .name = "tx-max", .type = YNL_PT_U32, }, @@ -535,6 +580,7 @@ const struct ynl_policy_nest ethtool_channels_nest = { }; const struct ynl_policy_attr ethtool_coalesce_policy[ETHTOOL_A_COALESCE_MAX + 1] = { + [ETHTOOL_A_COALESCE_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_COALESCE_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_COALESCE_RX_USECS] = { .name = "rx-usecs", .type = YNL_PT_U32, }, [ETHTOOL_A_COALESCE_RX_MAX_FRAMES] = { .name = "rx-max-frames", .type = YNL_PT_U32, }, @@ -573,6 +619,7 @@ const struct ynl_policy_nest ethtool_coalesce_nest = { }; const struct ynl_policy_attr ethtool_pause_policy[ETHTOOL_A_PAUSE_MAX + 1] = { + [ETHTOOL_A_PAUSE_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_PAUSE_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_PAUSE_AUTONEG] = { .name = "autoneg", .type = YNL_PT_U8, }, [ETHTOOL_A_PAUSE_RX] = { .name = "rx", .type = YNL_PT_U8, }, @@ -587,6 +634,7 @@ const struct ynl_policy_nest ethtool_pause_nest = { }; const struct ynl_policy_attr ethtool_eee_policy[ETHTOOL_A_EEE_MAX + 1] = { + [ETHTOOL_A_EEE_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_EEE_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_EEE_MODES_OURS] = { .name = "modes-ours", .type = YNL_PT_NEST, .nest = ðtool_bitset_nest, }, [ETHTOOL_A_EEE_MODES_PEER] = { .name = "modes-peer", .type = YNL_PT_NEST, .nest = ðtool_bitset_nest, }, @@ -602,6 +650,7 @@ const struct ynl_policy_nest ethtool_eee_nest = { }; const struct ynl_policy_attr ethtool_tsinfo_policy[ETHTOOL_A_TSINFO_MAX + 1] = { + [ETHTOOL_A_TSINFO_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_TSINFO_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_TSINFO_TIMESTAMPING] = { .name = "timestamping", .type = YNL_PT_NEST, .nest = ðtool_bitset_nest, }, [ETHTOOL_A_TSINFO_TX_TYPES] = { .name = "tx-types", .type = YNL_PT_NEST, .nest = ðtool_bitset_nest, }, @@ -616,6 +665,7 @@ const struct ynl_policy_nest ethtool_tsinfo_nest = { }; const struct ynl_policy_attr ethtool_cable_test_policy[ETHTOOL_A_CABLE_TEST_MAX + 1] = { + [ETHTOOL_A_CABLE_TEST_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_CABLE_TEST_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, }; @@ -625,6 +675,7 @@ const struct ynl_policy_nest ethtool_cable_test_nest = { }; const struct ynl_policy_attr ethtool_cable_test_ntf_policy[ETHTOOL_A_CABLE_TEST_NTF_MAX + 1] = { + [ETHTOOL_A_CABLE_TEST_NTF_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_CABLE_TEST_NTF_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_CABLE_TEST_NTF_STATUS] = { .name = "status", .type = YNL_PT_U8, }, [ETHTOOL_A_CABLE_TEST_NTF_NEST] = { .name = "nest", .type = YNL_PT_NEST, .nest = ðtool_cable_nest_nest, }, @@ -636,6 +687,7 @@ const struct ynl_policy_nest ethtool_cable_test_ntf_nest = { }; const struct ynl_policy_attr ethtool_cable_test_tdr_policy[ETHTOOL_A_CABLE_TEST_TDR_MAX + 1] = { + [ETHTOOL_A_CABLE_TEST_TDR_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_CABLE_TEST_TDR_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_CABLE_TEST_TDR_CFG] = { .name = "cfg", .type = YNL_PT_NEST, .nest = ðtool_cable_test_tdr_cfg_nest, }, }; @@ -646,6 +698,7 @@ const struct ynl_policy_nest ethtool_cable_test_tdr_nest = { }; const struct ynl_policy_attr ethtool_cable_test_tdr_ntf_policy[ETHTOOL_A_CABLE_TEST_TDR_NTF_MAX + 1] = { + [ETHTOOL_A_CABLE_TEST_TDR_NTF_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_CABLE_TEST_TDR_NTF_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_CABLE_TEST_TDR_NTF_STATUS] = { .name = "status", .type = YNL_PT_U8, }, [ETHTOOL_A_CABLE_TEST_TDR_NTF_NEST] = { .name = "nest", .type = YNL_PT_NEST, .nest = ðtool_cable_nest_nest, }, @@ -657,6 +710,7 @@ const struct ynl_policy_nest ethtool_cable_test_tdr_ntf_nest = { }; const struct ynl_policy_attr ethtool_tunnel_info_policy[ETHTOOL_A_TUNNEL_INFO_MAX + 1] = { + [ETHTOOL_A_TUNNEL_INFO_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_TUNNEL_INFO_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_TUNNEL_INFO_UDP_PORTS] = { .name = "udp-ports", .type = YNL_PT_NEST, .nest = ðtool_tunnel_udp_nest, }, }; @@ -667,6 +721,7 @@ const struct ynl_policy_nest ethtool_tunnel_info_nest = { }; const struct ynl_policy_attr ethtool_fec_policy[ETHTOOL_A_FEC_MAX + 1] = { + [ETHTOOL_A_FEC_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_FEC_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_FEC_MODES] = { .name = "modes", .type = YNL_PT_NEST, .nest = ðtool_bitset_nest, }, [ETHTOOL_A_FEC_AUTO] = { .name = "auto", .type = YNL_PT_U8, }, @@ -680,6 +735,7 @@ const struct ynl_policy_nest ethtool_fec_nest = { }; const struct ynl_policy_attr ethtool_module_eeprom_policy[ETHTOOL_A_MODULE_EEPROM_MAX + 1] = { + [ETHTOOL_A_MODULE_EEPROM_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_MODULE_EEPROM_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_MODULE_EEPROM_OFFSET] = { .name = "offset", .type = YNL_PT_U32, }, [ETHTOOL_A_MODULE_EEPROM_LENGTH] = { .name = "length", .type = YNL_PT_U32, }, @@ -695,6 +751,7 @@ const struct ynl_policy_nest ethtool_module_eeprom_nest = { }; const struct ynl_policy_attr ethtool_phc_vclocks_policy[ETHTOOL_A_PHC_VCLOCKS_MAX + 1] = { + [ETHTOOL_A_PHC_VCLOCKS_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_PHC_VCLOCKS_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_PHC_VCLOCKS_NUM] = { .name = "num", .type = YNL_PT_U32, }, [ETHTOOL_A_PHC_VCLOCKS_INDEX] = { .name = "index", .type = YNL_PT_BINARY,}, @@ -706,6 +763,7 @@ const struct ynl_policy_nest ethtool_phc_vclocks_nest = { }; const struct ynl_policy_attr ethtool_module_policy[ETHTOOL_A_MODULE_MAX + 1] = { + [ETHTOOL_A_MODULE_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_MODULE_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_MODULE_POWER_MODE_POLICY] = { .name = "power-mode-policy", .type = YNL_PT_U8, }, [ETHTOOL_A_MODULE_POWER_MODE] = { .name = "power-mode", .type = YNL_PT_U8, }, @@ -717,6 +775,7 @@ const struct ynl_policy_nest ethtool_module_nest = { }; const struct ynl_policy_attr ethtool_pse_policy[ETHTOOL_A_PSE_MAX + 1] = { + [ETHTOOL_A_PSE_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_PSE_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_PODL_PSE_ADMIN_STATE] = { .name = "podl-pse-admin-state", .type = YNL_PT_U32, }, [ETHTOOL_A_PODL_PSE_ADMIN_CONTROL] = { .name = "podl-pse-admin-control", .type = YNL_PT_U32, }, @@ -738,6 +797,7 @@ const struct ynl_policy_nest ethtool_pse_nest = { }; const struct ynl_policy_attr ethtool_rss_policy[ETHTOOL_A_RSS_MAX + 1] = { + [ETHTOOL_A_RSS_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_RSS_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_RSS_CONTEXT] = { .name = "context", .type = YNL_PT_U32, }, [ETHTOOL_A_RSS_HFUNC] = { .name = "hfunc", .type = YNL_PT_U32, }, @@ -753,6 +813,7 @@ const struct ynl_policy_nest ethtool_rss_nest = { }; const struct ynl_policy_attr ethtool_plca_policy[ETHTOOL_A_PLCA_MAX + 1] = { + [ETHTOOL_A_PLCA_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_PLCA_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_PLCA_VERSION] = { .name = "version", .type = YNL_PT_U16, }, [ETHTOOL_A_PLCA_ENABLED] = { .name = "enabled", .type = YNL_PT_U8, }, @@ -770,6 +831,7 @@ const struct ynl_policy_nest ethtool_plca_nest = { }; const struct ynl_policy_attr ethtool_mm_policy[ETHTOOL_A_MM_MAX + 1] = { + [ETHTOOL_A_MM_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_MM_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_MM_PMAC_ENABLED] = { .name = "pmac-enabled", .type = YNL_PT_U8, }, [ETHTOOL_A_MM_TX_ENABLED] = { .name = "tx-enabled", .type = YNL_PT_U8, }, @@ -789,6 +851,7 @@ const struct ynl_policy_nest ethtool_mm_nest = { }; const struct ynl_policy_attr ethtool_module_fw_flash_policy[ETHTOOL_A_MODULE_FW_FLASH_MAX + 1] = { + [ETHTOOL_A_MODULE_FW_FLASH_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_MODULE_FW_FLASH_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_MODULE_FW_FLASH_FILE_NAME] = { .name = "file-name", .type = YNL_PT_NUL_STR, }, [ETHTOOL_A_MODULE_FW_FLASH_PASSWORD] = { .name = "password", .type = YNL_PT_U32, }, @@ -804,6 +867,7 @@ const struct ynl_policy_nest ethtool_module_fw_flash_nest = { }; const struct ynl_policy_attr ethtool_phy_policy[ETHTOOL_A_PHY_MAX + 1] = { + [ETHTOOL_A_PHY_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, }, [ETHTOOL_A_PHY_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_PHY_INDEX] = { .name = "index", .type = YNL_PT_U32, }, [ETHTOOL_A_PHY_DRVNAME] = { .name = "drvname", .type = YNL_PT_NUL_STR, }, diff --git a/home/nipa/nipa_out/909377/ynl/old-code/ethtool-user.h b/home/nipa/nipa_out/909377/ynl/new-code/ethtool-user.h index bde5d7750368..786349f2833b 100644 --- a/home/nipa/nipa_out/909377/ynl/old-code/ethtool-user.h +++ b/home/nipa/nipa_out/909377/ynl/new-code/ethtool-user.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include struct ynl_sock; @@ -23,8 +23,9 @@ const char *ethtool_stringset_str(enum ethtool_stringset value); const char *ethtool_header_flags_str(enum ethtool_header_flags value); const char * ethtool_module_fw_flash_status_str(enum ethtool_module_fw_flash_status value); -const char *ethtool_c33_pse_ext_state_str(int value); +const char *ethtool_c33_pse_ext_state_str(enum c33_pse_ext_state value); const char *ethtool_phy_upstream_type_str(int value); +const char *ethtool_tcp_data_split_str(enum ethtool_tcp_data_split value); /* Common nested types */ struct ethtool_header { @@ -2472,7 +2473,7 @@ struct ethtool_rings_get_rsp { __u32 rx_jumbo; __u32 tx; __u32 rx_buf_len; - __u8 tcp_data_split; + enum ethtool_tcp_data_split tcp_data_split; __u32 cqe_size; __u8 tx_push; __u8 rx_push; @@ -2594,7 +2595,7 @@ struct ethtool_rings_set_req { __u32 rx_jumbo; __u32 tx; __u32 rx_buf_len; - __u8 tcp_data_split; + enum ethtool_tcp_data_split tcp_data_split; __u32 cqe_size; __u8 tx_push; __u8 rx_push; @@ -2706,7 +2707,7 @@ ethtool_rings_set_req_set_rx_buf_len(struct ethtool_rings_set_req *req, } static inline void ethtool_rings_set_req_set_tcp_data_split(struct ethtool_rings_set_req *req, - __u8 tcp_data_split) + enum ethtool_tcp_data_split tcp_data_split) { req->_present.tcp_data_split = 1; req->tcp_data_split = tcp_data_split; @@ -5451,7 +5452,7 @@ struct ethtool_pse_get_rsp { __u32 c33_pse_pw_d_status; __u32 c33_pse_pw_class; __u32 c33_pse_actual_pw; - int c33_pse_ext_state; + enum c33_pse_ext_state c33_pse_ext_state; __u32 c33_pse_ext_substate; __u32 c33_pse_avail_pw_limit; unsigned int n_c33_pse_pw_limit_ranges;