本文整理匯總了C++中API_SET_ERRNUM函數的典型用法代碼示例。如果您正苦於以下問題:C++ API_SET_ERRNUM函數的具體用法?C++ API_SET_ERRNUM怎麽用?C++ API_SET_ERRNUM使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了API_SET_ERRNUM函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: ipmi_cmd_set_sol_configuration_parameters_sol_retry
int
ipmi_cmd_set_sol_configuration_parameters_sol_retry (ipmi_ctx_t ctx,
uint8_t channel_number,
uint8_t retry_count,
uint8_t retry_interval,
fiid_obj_t obj_cmd_rs)
{
fiid_obj_t obj_cmd_rq = NULL;
int rv = -1;
if (!ctx || ctx->magic != IPMI_CTX_MAGIC)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
return (-1);
}
/* remaining parameter checks in fill function */
if (!fiid_obj_valid (obj_cmd_rs))
{
API_SET_ERRNUM (ctx, IPMI_ERR_PARAMETERS);
return (-1);
}
if (FIID_OBJ_TEMPLATE_COMPARE (obj_cmd_rs,
tmpl_cmd_set_sol_configuration_parameters_rs) < 0)
{
API_FIID_OBJECT_ERROR_TO_API_ERRNUM (ctx, obj_cmd_rs);
return (-1);
}
if (!(obj_cmd_rq = fiid_obj_create (tmpl_cmd_set_sol_configuration_parameters_sol_retry_rq)))
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (fill_cmd_set_sol_configuration_parameters_sol_retry (channel_number,
retry_count,
retry_interval,
obj_cmd_rq) < 0)
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (api_ipmi_cmd (ctx,
IPMI_BMC_IPMB_LUN_BMC,
IPMI_NET_FN_TRANSPORT_RQ,
obj_cmd_rq,
obj_cmd_rs) < 0)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
goto cleanup;
}
rv = 0;
cleanup:
fiid_obj_destroy (obj_cmd_rq);
return (rv);
}
示例2: ipmi_cmd_set_system_boot_options_service_partition_scan
int
ipmi_cmd_set_system_boot_options_service_partition_scan (ipmi_ctx_t ctx,
uint8_t parameter_valid,
uint8_t service_partition_discovered,
uint8_t service_partition_scan,
fiid_obj_t obj_cmd_rs)
{
fiid_obj_t obj_cmd_rq = NULL;
int rv = -1;
if (!ctx || ctx->magic != IPMI_CTX_MAGIC)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
return (-1);
}
/* remaining parameter checks in fill function */
if (!fiid_obj_valid (obj_cmd_rs))
{
API_SET_ERRNUM (ctx, IPMI_ERR_PARAMETERS);
return (-1);
}
if (FIID_OBJ_TEMPLATE_COMPARE (obj_cmd_rs,
tmpl_cmd_set_system_boot_options_rs) < 0)
{
API_FIID_OBJECT_ERROR_TO_API_ERRNUM (ctx, obj_cmd_rs);
return (-1);
}
if (!(obj_cmd_rq = fiid_obj_create (tmpl_cmd_set_system_boot_options_service_partition_scan_rq)))
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (fill_cmd_set_system_boot_options_service_partition_scan (parameter_valid,
service_partition_discovered,
service_partition_scan,
obj_cmd_rq) < 0)
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (api_ipmi_cmd (ctx,
IPMI_BMC_IPMB_LUN_BMC,
IPMI_NET_FN_CHASSIS_RQ,
obj_cmd_rq,
obj_cmd_rs) < 0)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
goto cleanup;
}
rv = 0;
cleanup:
fiid_obj_destroy (obj_cmd_rq);
return (rv);
}
示例3: ipmi_cmd_set_auxiliary_log_status
int
ipmi_cmd_set_auxiliary_log_status (ipmi_ctx_t ctx,
uint8_t log_type,
const void *log_data,
unsigned int log_data_len,
fiid_obj_t obj_cmd_rs)
{
fiid_obj_t obj_cmd_rq = NULL;
int rv = -1;
if (!ctx || ctx->magic != IPMI_CTX_MAGIC)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
return (-1);
}
/* remaining parameter checks in fill function */
if (!fiid_obj_valid (obj_cmd_rs))
{
API_SET_ERRNUM (ctx, IPMI_ERR_PARAMETERS);
return (-1);
}
if (FIID_OBJ_TEMPLATE_COMPARE (obj_cmd_rs,
tmpl_cmd_set_auxiliary_log_status_rs) < 0)
{
API_FIID_OBJECT_ERROR_TO_API_ERRNUM (ctx, obj_cmd_rs);
return (-1);
}
if (!(obj_cmd_rq = fiid_obj_create (tmpl_cmd_set_auxiliary_log_status_rq)))
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (fill_cmd_set_auxiliary_log_status (log_type,
log_data,
log_data_len,
obj_cmd_rq) < 0)
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (api_ipmi_cmd (ctx,
IPMI_BMC_IPMB_LUN_BMC,
IPMI_NET_FN_STORAGE_RQ,
obj_cmd_rq,
obj_cmd_rs) < 0)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
goto cleanup;
}
rv = 0;
cleanup:
fiid_obj_destroy (obj_cmd_rq);
return (rv);
}
示例4: ipmi_cmd_get_oem_netfn_iana_support
int
ipmi_cmd_get_oem_netfn_iana_support (ipmi_ctx_t ctx,
uint8_t channel_number,
uint8_t net_fn,
uint8_t list_index,
fiid_obj_t obj_cmd_rs)
{
fiid_obj_t obj_cmd_rq = NULL;
int rv = -1;
if (!ctx || ctx->magic != IPMI_CTX_MAGIC)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
return (-1);
}
/* remaining parameter checks in fill function */
if (!fiid_obj_valid (obj_cmd_rs))
{
API_SET_ERRNUM (ctx, IPMI_ERR_PARAMETERS);
return (-1);
}
if (FIID_OBJ_TEMPLATE_COMPARE (obj_cmd_rs,
tmpl_cmd_get_oem_netfn_iana_support_rs) < 0)
{
API_FIID_OBJECT_ERROR_TO_API_ERRNUM (ctx, obj_cmd_rs);
return (-1);
}
if (!(obj_cmd_rq = fiid_obj_create (tmpl_cmd_get_oem_netfn_iana_support_rq)))
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (fill_cmd_get_oem_netfn_iana_support (channel_number,
net_fn,
list_index,
obj_cmd_rq) < 0)
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (api_ipmi_cmd (ctx,
IPMI_BMC_IPMB_LUN_BMC,
IPMI_NET_FN_APP_RQ,
obj_cmd_rq,
obj_cmd_rs) < 0)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
goto cleanup;
}
rv = 0;
cleanup:
fiid_obj_destroy (obj_cmd_rq);
return (rv);
}
示例5: _api_ipmi_cmd_post
static int
_api_ipmi_cmd_post (ipmi_ctx_t ctx, fiid_obj_t obj_cmd_rs)
{
int ret;
assert (ctx
&& ctx->magic == IPMI_CTX_MAGIC
&& fiid_obj_valid (obj_cmd_rs));
if (ctx->flags & IPMI_FLAGS_NO_LEGAL_CHECK)
{
uint64_t val;
/* Do not check completion code if data not available
* (i.e. FIID_ERR_DATA_NOT_AVAILABLE completion code).
*
* Fallthrough to normal error if it's an alternate fiid error
* (invalid packet, field not found, etc.)
*/
if (FIID_OBJ_GET (obj_cmd_rs, "comp_code", &val) < 0)
{
if (fiid_obj_errnum (obj_cmd_rs) == FIID_ERR_DATA_NOT_AVAILABLE)
goto skip_comp_code_check;
}
}
if ((ret = ipmi_check_completion_code_success (obj_cmd_rs)) < 0)
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
return (-1);
}
if (!ret)
{
API_BAD_RESPONSE_TO_API_ERRNUM (ctx, obj_cmd_rs);
return (-1);
}
skip_comp_code_check:
if (!(ctx->flags & IPMI_FLAGS_NO_VALID_CHECK)
&& !(ctx->flags & IPMI_FLAGS_NO_LEGAL_CHECK))
{
if ((ret = fiid_obj_packet_valid (obj_cmd_rs)) < 0)
{
API_FIID_OBJECT_ERROR_TO_API_ERRNUM (ctx, obj_cmd_rs);
return (-1);
}
if (!ret)
{
API_SET_ERRNUM (ctx, IPMI_ERR_IPMI_ERROR);
return (-1);
}
}
return (0);
}
示例6: ipmi_cmd_read_fru_data
int
ipmi_cmd_read_fru_data (ipmi_ctx_t ctx,
uint8_t fru_device_id,
uint16_t fru_inventory_offset_to_read,
uint8_t count_to_read,
fiid_obj_t obj_cmd_rs)
{
fiid_obj_t obj_cmd_rq = NULL;
int rv = -1;
if (!ctx || ctx->magic != IPMI_CTX_MAGIC)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
return (-1);
}
if (!fiid_obj_valid (obj_cmd_rs))
{
API_SET_ERRNUM (ctx, IPMI_ERR_PARAMETERS);
return (-1);
}
if (FIID_OBJ_TEMPLATE_COMPARE (obj_cmd_rs,
tmpl_cmd_read_fru_data_rs) < 0)
{
API_FIID_OBJECT_ERROR_TO_API_ERRNUM (ctx, obj_cmd_rs);
return (-1);
}
if (!(obj_cmd_rq = fiid_obj_create (tmpl_cmd_read_fru_data_rq)))
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (fill_cmd_read_fru_data (fru_device_id,
fru_inventory_offset_to_read,
count_to_read,
obj_cmd_rq) < 0)
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (api_ipmi_cmd (ctx,
IPMI_BMC_IPMB_LUN_BMC,
IPMI_NET_FN_STORAGE_RQ,
obj_cmd_rq,
obj_cmd_rs) < 0)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
goto cleanup;
}
rv = 0;
cleanup:
fiid_obj_destroy (obj_cmd_rq);
return (rv);
}
示例7: ipmi_cmd_chassis_identify
int
ipmi_cmd_chassis_identify (ipmi_ctx_t ctx,
const uint8_t *identify_interval,
const uint8_t *force_identify,
fiid_obj_t obj_cmd_rs)
{
fiid_obj_t obj_cmd_rq = NULL;
int rv = -1;
if (!ctx || ctx->magic != IPMI_CTX_MAGIC)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
return (-1);
}
/* remaining parameter checks in fill function */
if (!fiid_obj_valid (obj_cmd_rs))
{
API_SET_ERRNUM (ctx, IPMI_ERR_PARAMETERS);
return (-1);
}
if (FIID_OBJ_TEMPLATE_COMPARE (obj_cmd_rs,
tmpl_cmd_chassis_identify_rs) < 0)
{
API_FIID_OBJECT_ERROR_TO_API_ERRNUM (ctx, obj_cmd_rs);
return (-1);
}
if (!(obj_cmd_rq = fiid_obj_create (tmpl_cmd_chassis_identify_rq)))
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (fill_cmd_chassis_identify (identify_interval,
force_identify,
obj_cmd_rq) < 0)
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (api_ipmi_cmd (ctx,
IPMI_BMC_IPMB_LUN_BMC,
IPMI_NET_FN_CHASSIS_RQ,
obj_cmd_rq,
obj_cmd_rs) < 0)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
goto cleanup;
}
rv = 0;
cleanup:
fiid_obj_destroy (obj_cmd_rq);
return (rv);
}
示例8: ipmi_cmd_clear_sel
int
ipmi_cmd_clear_sel (ipmi_ctx_t ctx,
uint16_t reservation_id,
uint8_t operation,
fiid_obj_t obj_cmd_rs)
{
fiid_obj_t obj_cmd_rq = NULL;
int rv = -1;
if (!ctx || ctx->magic != IPMI_CTX_MAGIC)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
return (-1);
}
/* remaining parameter checks in fill function */
if (!fiid_obj_valid (obj_cmd_rs))
{
API_SET_ERRNUM (ctx, IPMI_ERR_PARAMETERS);
return (-1);
}
if (FIID_OBJ_TEMPLATE_COMPARE (obj_cmd_rs,
tmpl_cmd_clear_sel_rs) < 0)
{
API_FIID_OBJECT_ERROR_TO_API_ERRNUM (ctx, obj_cmd_rs);
return (-1);
}
if (!(obj_cmd_rq = fiid_obj_create (tmpl_cmd_clear_sel_rq)))
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (fill_cmd_clear_sel (reservation_id,
operation,
obj_cmd_rq) < 0)
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (api_ipmi_cmd (ctx,
IPMI_BMC_IPMB_LUN_BMC,
IPMI_NET_FN_STORAGE_RQ,
obj_cmd_rq,
obj_cmd_rs) < 0)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
goto cleanup;
}
rv = 0;
cleanup:
fiid_obj_destroy (obj_cmd_rq);
return (rv);
}
示例9: ipmi_cmd_dcmi_get_management_controller_identifier_string
int
ipmi_cmd_dcmi_get_management_controller_identifier_string (ipmi_ctx_t ctx,
uint8_t offset_to_read,
uint8_t number_of_bytes_to_read,
fiid_obj_t obj_cmd_rs)
{
fiid_obj_t obj_cmd_rq = NULL;
int rv = -1;
if (!ctx || ctx->magic != IPMI_CTX_MAGIC)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
return (-1);
}
/* remaining parameter checks in fill function */
if (!fiid_obj_valid (obj_cmd_rs))
{
API_SET_ERRNUM (ctx, IPMI_ERR_PARAMETERS);
return (-1);
}
if (FIID_OBJ_TEMPLATE_COMPARE (obj_cmd_rs,
tmpl_cmd_dcmi_get_management_controller_identifier_string_rs) < 0)
{
API_FIID_OBJECT_ERROR_TO_API_ERRNUM (ctx, obj_cmd_rs);
return (-1);
}
if (!(obj_cmd_rq = fiid_obj_create (tmpl_cmd_dcmi_get_management_controller_identifier_string_rq)))
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (fill_cmd_dcmi_get_management_controller_identifier_string (offset_to_read,
number_of_bytes_to_read,
obj_cmd_rq) < 0)
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (api_ipmi_cmd (ctx,
IPMI_BMC_IPMB_LUN_BMC,
IPMI_NET_FN_GROUP_EXTENSION_RQ,
obj_cmd_rq,
obj_cmd_rs) < 0)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
goto cleanup;
}
rv = 0;
cleanup:
fiid_obj_destroy (obj_cmd_rq);
return (rv);
}
示例10: ipmi_cmd_dcmi_set_dcmi_configuration_parameters_dhcp_timing_3
int
ipmi_cmd_dcmi_set_dcmi_configuration_parameters_dhcp_timing_3 (ipmi_ctx_t ctx,
uint8_t set_selector,
uint16_t server_contact_retry_interval,
fiid_obj_t obj_cmd_rs)
{
fiid_obj_t obj_cmd_rq = NULL;
int rv = -1;
if (!ctx || ctx->magic != IPMI_CTX_MAGIC)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
return (-1);
}
/* technically, user can input anything for activate, but only 0x01 will do anything */
if (!fiid_obj_valid (obj_cmd_rs))
{
API_SET_ERRNUM (ctx, IPMI_ERR_PARAMETERS);
return (-1);
}
if (FIID_OBJ_TEMPLATE_COMPARE (obj_cmd_rs,
tmpl_cmd_dcmi_set_dcmi_configuration_parameters_rs) < 0)
{
API_FIID_OBJECT_ERROR_TO_API_ERRNUM (ctx, obj_cmd_rs);
return (-1);
}
if (!(obj_cmd_rq = fiid_obj_create (tmpl_cmd_dcmi_set_dcmi_configuration_parameters_dhcp_timing_3_rq)))
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (fill_cmd_dcmi_set_dcmi_configuration_parameters_dhcp_timing_3 (set_selector,
server_contact_retry_interval,
obj_cmd_rq) < 0)
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (api_ipmi_cmd (ctx,
IPMI_BMC_IPMB_LUN_BMC,
IPMI_NET_FN_GROUP_EXTENSION_RQ,
obj_cmd_rq,
obj_cmd_rs) < 0)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
goto cleanup;
}
rv = 0;
cleanup:
fiid_obj_destroy (obj_cmd_rq);
return (rv);
}
示例11: ipmi_cmd_dcmi_get_thermal_limit
int
ipmi_cmd_dcmi_get_thermal_limit (ipmi_ctx_t ctx,
uint8_t entity_id,
uint8_t entity_instance,
fiid_obj_t obj_cmd_rs)
{
fiid_obj_t obj_cmd_rq = NULL;
int rv = -1;
if (!ctx || ctx->magic != IPMI_CTX_MAGIC)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
return (-1);
}
/* remaining parameter checks in fill function */
if (!fiid_obj_valid (obj_cmd_rs))
{
API_SET_ERRNUM (ctx, IPMI_ERR_PARAMETERS);
return (-1);
}
if (FIID_OBJ_TEMPLATE_COMPARE (obj_cmd_rs,
tmpl_cmd_dcmi_get_thermal_limit_rs) < 0)
{
API_FIID_OBJECT_ERROR_TO_API_ERRNUM (ctx, obj_cmd_rs);
return (-1);
}
if (!(obj_cmd_rq = fiid_obj_create (tmpl_cmd_dcmi_get_thermal_limit_rq)))
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (fill_cmd_dcmi_get_thermal_limit (entity_id,
entity_instance,
obj_cmd_rq) < 0)
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (api_ipmi_cmd (ctx,
IPMI_BMC_IPMB_LUN_BMC,
IPMI_NET_FN_GROUP_EXTENSION_RQ,
obj_cmd_rq,
obj_cmd_rs) < 0)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
goto cleanup;
}
rv = 0;
cleanup:
fiid_obj_destroy (obj_cmd_rq);
return (rv);
}
示例12: ipmi_cmd_dcmi_get_dcmi_configuration_parameters_dhcp_timing_3
int
ipmi_cmd_dcmi_get_dcmi_configuration_parameters_dhcp_timing_3 (ipmi_ctx_t ctx,
uint8_t set_selector,
fiid_obj_t obj_cmd_rs)
{
fiid_obj_t obj_cmd_rq = NULL;
int rv = -1;
if (!ctx || ctx->magic != IPMI_CTX_MAGIC)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
return (-1);
}
if (!fiid_obj_valid (obj_cmd_rs))
{
API_SET_ERRNUM (ctx, IPMI_ERR_PARAMETERS);
return (-1);
}
if (FIID_OBJ_TEMPLATE_COMPARE (obj_cmd_rs,
tmpl_cmd_dcmi_get_dcmi_configuration_parameters_dhcp_timing_3_rs) < 0)
{
API_FIID_OBJECT_ERROR_TO_API_ERRNUM (ctx, obj_cmd_rs);
return (-1);
}
if (!(obj_cmd_rq = fiid_obj_create (tmpl_cmd_dcmi_get_dcmi_configuration_parameters_rq)))
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (fill_cmd_dcmi_get_dcmi_configuration_parameters (IPMI_DCMI_CONFIGURATION_PARAMETER_DHCP_TIMING_3,
set_selector,
obj_cmd_rq) < 0)
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (api_ipmi_cmd (ctx,
IPMI_BMC_IPMB_LUN_BMC,
IPMI_NET_FN_GROUP_EXTENSION_RQ,
obj_cmd_rq,
obj_cmd_rs) < 0)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
goto cleanup;
}
rv = 0;
cleanup:
fiid_obj_destroy (obj_cmd_rq);
return (rv);
}
示例13: _ipmi_cmd_dcmi_get_dcmi_capability_info_common
static int
_ipmi_cmd_dcmi_get_dcmi_capability_info_common (ipmi_ctx_t ctx,
fiid_obj_t obj_cmd_rs,
fiid_field_t *tmpl_cmd_rs_expected,
uint8_t parameter_selector)
{
fiid_obj_t obj_cmd_rq = NULL;
int rv = -1;
if (!ctx || ctx->magic != IPMI_CTX_MAGIC)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
return (-1);
}
/* remaining parameter checks in fill function */
if (!fiid_obj_valid (obj_cmd_rs))
{
API_SET_ERRNUM (ctx, IPMI_ERR_PARAMETERS);
return (-1);
}
if (FIID_OBJ_TEMPLATE_COMPARE (obj_cmd_rs, tmpl_cmd_rs_expected) < 0)
{
API_FIID_OBJECT_ERROR_TO_API_ERRNUM (ctx, obj_cmd_rs);
return (-1);
}
if (!(obj_cmd_rq = fiid_obj_create (tmpl_cmd_dcmi_get_dcmi_capability_info_rq)))
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (fill_cmd_dcmi_get_dcmi_capability_info (parameter_selector, obj_cmd_rq) < 0)
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (api_ipmi_cmd (ctx,
IPMI_BMC_IPMB_LUN_BMC,
IPMI_NET_FN_GROUP_EXTENSION_RQ,
obj_cmd_rq,
obj_cmd_rs) < 0)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
goto cleanup;
}
rv = 0;
cleanup:
fiid_obj_destroy (obj_cmd_rq);
return (rv);
}
示例14: ipmi_cmd_get_device_guid
int
ipmi_cmd_get_device_guid (ipmi_ctx_t ctx, fiid_obj_t obj_cmd_rs)
{
fiid_obj_t obj_cmd_rq = NULL;
int rv = -1;
if (!ctx || ctx->magic != IPMI_CTX_MAGIC)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
return (-1);
}
if (!fiid_obj_valid (obj_cmd_rs))
{
API_SET_ERRNUM (ctx, IPMI_ERR_PARAMETERS);
return (-1);
}
if ((FIID_OBJ_TEMPLATE_COMPARE (obj_cmd_rs,
tmpl_cmd_get_device_guid_rs) < 0)
&& (FIID_OBJ_TEMPLATE_COMPARE (obj_cmd_rs,
tmpl_cmd_get_device_guid_format_rs) < 0))
{
API_FIID_OBJECT_ERROR_TO_API_ERRNUM (ctx, obj_cmd_rs);
return (-1);
}
if (!(obj_cmd_rq = fiid_obj_create (tmpl_cmd_get_device_guid_rq)))
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (fill_cmd_get_device_guid (obj_cmd_rq) < 0)
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (api_ipmi_cmd (ctx,
IPMI_BMC_IPMB_LUN_BMC,
IPMI_NET_FN_APP_RQ,
obj_cmd_rq,
obj_cmd_rs) < 0)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
goto cleanup;
}
rv = 0;
cleanup:
fiid_obj_destroy (obj_cmd_rq);
return (rv);
}
示例15: ipmi_cmd_dcmi_set_power_limit
int
ipmi_cmd_dcmi_set_power_limit (ipmi_ctx_t ctx,
uint8_t exception_actions,
uint16_t power_limit_requested,
uint32_t correction_time_limit,
uint16_t management_application_statistics_sampling_period,
fiid_obj_t obj_cmd_rs)
{
fiid_obj_t obj_cmd_rq = NULL;
int rv = -1;
if (!ctx || ctx->magic != IPMI_CTX_MAGIC)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
return (-1);
}
/* remaining parameter checks in fill function */
if (!fiid_obj_valid (obj_cmd_rs))
{
API_SET_ERRNUM (ctx, IPMI_ERR_PARAMETERS);
return (-1);
}
if (FIID_OBJ_TEMPLATE_COMPARE (obj_cmd_rs,
tmpl_cmd_dcmi_set_power_limit_rs) < 0)
{
API_FIID_OBJECT_ERROR_TO_API_ERRNUM (ctx, obj_cmd_rs);
return (-1);
}
if (!(obj_cmd_rq = fiid_obj_create (tmpl_cmd_dcmi_set_power_limit_rq)))
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (fill_cmd_dcmi_set_power_limit (exception_actions,
power_limit_requested,
correction_time_limit,
management_application_statistics_sampling_period,
obj_cmd_rq) < 0)
{
API_ERRNO_TO_API_ERRNUM (ctx, errno);
goto cleanup;
}
if (api_ipmi_cmd (ctx,
IPMI_BMC_IPMB_LUN_BMC,
IPMI_NET_FN_GROUP_EXTENSION_RQ,
obj_cmd_rq,
obj_cmd_rs) < 0)
{
ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx));
goto cleanup;
}
rv = 0;
cleanup:
fiid_obj_destroy (obj_cmd_rq);
return (rv);
}