diff --git a/home/nipa/nipa_out/857012/ynl/old-code/ethtool-user.c b/home/nipa/nipa_out/857012/ynl/new-code/ethtool-user.c index ba3e482b7e41..c604667cf091 100644 --- a/home/nipa/nipa_out/857012/ynl/old-code/ethtool-user.c +++ b/home/nipa/nipa_out/857012/ynl/new-code/ethtool-user.c @@ -638,6 +638,10 @@ struct ynl_policy_attr ethtool_pse_policy[ETHTOOL_A_PSE_MAX + 1] = { [ETHTOOL_A_C33_PSE_ADMIN_STATE] = { .name = "c33-pse-admin-state", .type = YNL_PT_U32, }, [ETHTOOL_A_C33_PSE_ADMIN_CONTROL] = { .name = "c33-pse-admin-control", .type = YNL_PT_U32, }, [ETHTOOL_A_C33_PSE_PW_D_STATUS] = { .name = "c33-pse-pw-d-status", .type = YNL_PT_U32, }, + [ETHTOOL_A_C33_PSE_PW_STATUS_MSG] = { .name = "c33-pse-pw-status-msg", .type = YNL_PT_BINARY,}, + [ETHTOOL_A_C33_PSE_PW_CLASS] = { .name = "c33-pse-pw-class", .type = YNL_PT_U32, }, + [ETHTOOL_A_C33_PSE_ACTUAL_PW] = { .name = "c33-pse-actual-pw", .type = YNL_PT_U32, }, + [ETHTOOL_A_C33_PSE_PW_LIMIT] = { .name = "c33-pse-pw-limit", .type = YNL_PT_U32, }, }; struct ynl_policy_nest ethtool_pse_nest = { @@ -5498,6 +5502,7 @@ void ethtool_pse_get_req_free(struct ethtool_pse_get_req *req) void ethtool_pse_get_rsp_free(struct ethtool_pse_get_rsp *rsp) { ethtool_header_free(&rsp->header); + free(rsp->c33_pse_pw_status_msg); free(rsp); } @@ -5553,6 +5558,31 @@ int ethtool_pse_get_rsp_parse(const struct nlmsghdr *nlh, return YNL_PARSE_CB_ERROR; dst->_present.c33_pse_pw_d_status = 1; dst->c33_pse_pw_d_status = ynl_attr_get_u32(attr); + } else if (type == ETHTOOL_A_C33_PSE_PW_STATUS_MSG) { + unsigned int len; + + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + + len = ynl_attr_data_len(attr); + dst->_present.c33_pse_pw_status_msg_len = len; + dst->c33_pse_pw_status_msg = malloc(len); + memcpy(dst->c33_pse_pw_status_msg, ynl_attr_data(attr), len); + } else if (type == ETHTOOL_A_C33_PSE_PW_CLASS) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.c33_pse_pw_class = 1; + dst->c33_pse_pw_class = ynl_attr_get_u32(attr); + } else if (type == ETHTOOL_A_C33_PSE_ACTUAL_PW) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.c33_pse_actual_pw = 1; + dst->c33_pse_actual_pw = ynl_attr_get_u32(attr); + } else if (type == ETHTOOL_A_C33_PSE_PW_LIMIT) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.c33_pse_pw_limit = 1; + dst->c33_pse_pw_limit = ynl_attr_get_u32(attr); } } @@ -5606,6 +5636,7 @@ void ethtool_pse_get_list_free(struct ethtool_pse_get_list *rsp) next = rsp->next; ethtool_header_free(&rsp->obj.header); + free(rsp->obj.c33_pse_pw_status_msg); free(rsp); } } @@ -5646,6 +5677,7 @@ ethtool_pse_get_dump(struct ynl_sock *ys, struct ethtool_pse_get_req_dump *req) void ethtool_pse_set_req_free(struct ethtool_pse_set_req *req) { ethtool_header_free(&req->header); + free(req->c33_pse_pw_status_msg); free(req); } @@ -5672,6 +5704,14 @@ int ethtool_pse_set(struct ynl_sock *ys, struct ethtool_pse_set_req *req) ynl_attr_put_u32(nlh, ETHTOOL_A_C33_PSE_ADMIN_CONTROL, req->c33_pse_admin_control); if (req->_present.c33_pse_pw_d_status) ynl_attr_put_u32(nlh, ETHTOOL_A_C33_PSE_PW_D_STATUS, req->c33_pse_pw_d_status); + if (req->_present.c33_pse_pw_status_msg_len) + ynl_attr_put(nlh, ETHTOOL_A_C33_PSE_PW_STATUS_MSG, req->c33_pse_pw_status_msg, req->_present.c33_pse_pw_status_msg_len); + if (req->_present.c33_pse_pw_class) + ynl_attr_put_u32(nlh, ETHTOOL_A_C33_PSE_PW_CLASS, req->c33_pse_pw_class); + if (req->_present.c33_pse_actual_pw) + ynl_attr_put_u32(nlh, ETHTOOL_A_C33_PSE_ACTUAL_PW, req->c33_pse_actual_pw); + if (req->_present.c33_pse_pw_limit) + ynl_attr_put_u32(nlh, ETHTOOL_A_C33_PSE_PW_LIMIT, req->c33_pse_pw_limit); err = ynl_exec(ys, nlh, &yrs); if (err < 0) diff --git a/home/nipa/nipa_out/857012/ynl/old-code/ethtool-user.h b/home/nipa/nipa_out/857012/ynl/new-code/ethtool-user.h index 20088a1862bf..77013fb21f2d 100644 --- a/home/nipa/nipa_out/857012/ynl/old-code/ethtool-user.h +++ b/home/nipa/nipa_out/857012/ynl/new-code/ethtool-user.h @@ -4694,6 +4694,10 @@ struct ethtool_pse_get_rsp { __u32 c33_pse_admin_state:1; __u32 c33_pse_admin_control:1; __u32 c33_pse_pw_d_status:1; + __u32 c33_pse_pw_status_msg_len; + __u32 c33_pse_pw_class:1; + __u32 c33_pse_actual_pw:1; + __u32 c33_pse_pw_limit:1; } _present; struct ethtool_header header; @@ -4703,6 +4707,10 @@ struct ethtool_pse_get_rsp { __u32 c33_pse_admin_state; __u32 c33_pse_admin_control; __u32 c33_pse_pw_d_status; + void *c33_pse_pw_status_msg; + __u32 c33_pse_pw_class; + __u32 c33_pse_actual_pw; + __u32 c33_pse_pw_limit; }; void ethtool_pse_get_rsp_free(struct ethtool_pse_get_rsp *rsp); @@ -4778,6 +4786,10 @@ struct ethtool_pse_set_req { __u32 c33_pse_admin_state:1; __u32 c33_pse_admin_control:1; __u32 c33_pse_pw_d_status:1; + __u32 c33_pse_pw_status_msg_len; + __u32 c33_pse_pw_class:1; + __u32 c33_pse_actual_pw:1; + __u32 c33_pse_pw_limit:1; } _present; struct ethtool_header header; @@ -4787,6 +4799,10 @@ struct ethtool_pse_set_req { __u32 c33_pse_admin_state; __u32 c33_pse_admin_control; __u32 c33_pse_pw_d_status; + void *c33_pse_pw_status_msg; + __u32 c33_pse_pw_class; + __u32 c33_pse_actual_pw; + __u32 c33_pse_pw_limit; }; static inline struct ethtool_pse_set_req *ethtool_pse_set_req_alloc(void) @@ -4864,6 +4880,37 @@ ethtool_pse_set_req_set_c33_pse_pw_d_status(struct ethtool_pse_set_req *req, req->_present.c33_pse_pw_d_status = 1; req->c33_pse_pw_d_status = c33_pse_pw_d_status; } +static inline void +ethtool_pse_set_req_set_c33_pse_pw_status_msg(struct ethtool_pse_set_req *req, + const void *c33_pse_pw_status_msg, + size_t len) +{ + free(req->c33_pse_pw_status_msg); + req->_present.c33_pse_pw_status_msg_len = len; + req->c33_pse_pw_status_msg = malloc(req->_present.c33_pse_pw_status_msg_len); + memcpy(req->c33_pse_pw_status_msg, c33_pse_pw_status_msg, req->_present.c33_pse_pw_status_msg_len); +} +static inline void +ethtool_pse_set_req_set_c33_pse_pw_class(struct ethtool_pse_set_req *req, + __u32 c33_pse_pw_class) +{ + req->_present.c33_pse_pw_class = 1; + req->c33_pse_pw_class = c33_pse_pw_class; +} +static inline void +ethtool_pse_set_req_set_c33_pse_actual_pw(struct ethtool_pse_set_req *req, + __u32 c33_pse_actual_pw) +{ + req->_present.c33_pse_actual_pw = 1; + req->c33_pse_actual_pw = c33_pse_actual_pw; +} +static inline void +ethtool_pse_set_req_set_c33_pse_pw_limit(struct ethtool_pse_set_req *req, + __u32 c33_pse_pw_limit) +{ + req->_present.c33_pse_pw_limit = 1; + req->c33_pse_pw_limit = c33_pse_pw_limit; +} /* * Set Power Sourcing Equipment params.