本文整理汇总了C++中ERR_TRACE函数的典型用法代码示例。如果您正苦于以下问题:C++ ERR_TRACE函数的具体用法?C++ ERR_TRACE怎么用?C++ ERR_TRACE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ERR_TRACE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: player_hit
int player_hit(struct player *p, struct game *g) {
if (player_remove(p, g)) {
ERR_TRACE();
return -1;
}
if (!p->lives) {
player_respawn(p);
if (player_add(p, g)) {
ERR_TRACE();
return -1;
}
} else {
if (!--p->lives) {
SDLNet_TCP_Send(p->client->s, "\11", 1);
player_free(p);
} else {
player_respawn(p);
if (player_add(p, g)) {
ERR_TRACE();
return -1;
}
}
}
return 0;
}
示例2: 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);
}
示例3: bubble_pop
/**
* Pop the bubble splitting it into two bubbles.
* No children are created if the bubble was too small.
*/
int bubble_pop(struct bubble *b, struct game *g) {
if (b->l <= 1) {
bubble_destroy(b);
return 0;
}
double radius = cpCircleShapeGetRadius(&b->shape);
cpVect pos = cpBodyGetPos(&b->body);
cpVect vel = cpBodyGetVel(&b->body);
bubble_remove(b, g);
bubble_destroy(b);
b = bubble_init(b, pos.x, pos.y, vel.x + 5, vel.y + 5,
radius / 2, b->l - 1);
if (!b) {
ERR_TRACE();
return -1;
}
//b->events = b->events;
if (bubble_add(b, g)) {
ERR_TRACE();
return -1;
}
struct bubble *c = bubble_create(pos.x, pos.y, vel.x - 5, vel.y + 5,
radius / 2, b->l - 1);
if (!c) {
ERR_TRACE();
return -1;
}
//c->events = b->events;
if (bubble_add(c, g)) {
ERR_TRACE();
return -1;
}
return 0;
}
示例4: udp_accept_connection
void udp_accept_connection(void)
{
struct sockaddr_in cli_addr;
socklen_t cli_len;
char *buffer;
size_t length;
int ret;
journal("Listening for connection...\n");
ret = recvfrom(sockfd, NULL, 0, 0, (struct sockaddr *)(&cli_addr), &cli_len);
if (unlikely(ret)) {
int errsave = errno;
ERR_TRACE();
journal("Unable to read from socket: %s.\n", strerror(errsave));
CHECK_SOCKET_ERROR(errsave);
}
cli_len = sizeof(cli_addr);
ret = get_quote_of_the_day(&buffer, &length);
if (unlikely(ret)) {
return;
}
ret = sendto(sockfd, buffer, length, 0, (struct sockaddr *)(&cli_addr), cli_len);
if (unlikely(ret < 0)) {
ERR_TRACE();
journal("Unable to write to UDP socket: %s.\n", strerror(errno));
return;
}
}
示例5: 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);
}
示例6: 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);
}
示例7: 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);
}
示例8: 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);
}
示例9: 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);
}
示例10: 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);
}
示例11: 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);
}
示例12: 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);
}
示例13: 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);
}
示例14: 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);
}
示例15: _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);
}