本文整理汇总了C++中ERR_TRACE函数的典型用法代码示例。如果您正苦于以下问题:C++ ERR_TRACE函数的具体用法?C++ ERR_TRACE怎么用?C++ ERR_TRACE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ERR_TRACE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:tjhsstgeek,项目名称:MultiBT,代码行数:25,代码来源:player.c
示例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);
}
开发者ID:platinasystems,项目名称:freeipmi,代码行数:60,代码来源:ipmi-firmware-firewall-command-discovery-cmds-api.c
示例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;
}
开发者ID:tjhsstgeek,项目名称:MultiBT,代码行数:38,代码来源:bubble.c
示例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;
}
}
开发者ID:ammongit,项目名称:qotd,代码行数:31,代码来源:network.c
示例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);
}
开发者ID:platinasystems,项目名称:freeipmi,代码行数:60,代码来源:ipmi-chassis-cmds-api.c
示例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);
}
开发者ID:chu11,项目名称:freeipmi-mirror,代码行数:60,代码来源:ipmi-sel-cmds-api.c
示例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);
}
开发者ID:platinasystems,项目名称:freeipmi,代码行数:60,代码来源:ipmi-sol-cmds-api.c
示例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);
}
开发者ID:chu11,项目名称:freeipmi-mirror,代码行数:59,代码来源:ipmi-fru-inventory-device-cmds-api.c
示例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);
}
开发者ID:platinasystems,项目名称:freeipmi,代码行数:58,代码来源:ipmi-chassis-cmds-api.c
示例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);
}
开发者ID:chu11,项目名称:freeipmi-mirror,代码行数:58,代码来源:ipmi-dcmi-cmds-api.c
示例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);
}
开发者ID:chu11,项目名称:freeipmi-mirror,代码行数:58,代码来源:ipmi-sel-cmds-api.c
示例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);
}
开发者ID:chu11,项目名称:freeipmi-mirror,代码行数:58,代码来源:ipmi-dcmi-cmds-api.c
示例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);
}
开发者ID:chu11,项目名称:freeipmi-mirror,代码行数:58,代码来源:ipmi-dcmi-cmds-api.c
示例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);
}
开发者ID:chu11,项目名称:freeipmi-mirror,代码行数:56,代码来源:ipmi-dcmi-cmds-api.c
示例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);
}
开发者ID:chu11,项目名称:freeipmi-mirror,代码行数:55,代码来源:ipmi-dcmi-cmds-api.c
示例16: 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);
}
开发者ID:NodePrime,项目名称:freeipmi,代码行数:54,代码来源:ipmi-device-global-cmds-api.c
示例17: ipmi_sdr_cache_record_count
int
ipmi_sdr_cache_record_count (ipmi_sdr_ctx_t ctx, uint16_t *record_count)
{
if (!ctx || ctx->magic != IPMI_SDR_CTX_MAGIC)
{
ERR_TRACE (ipmi_sdr_ctx_errormsg (ctx), ipmi_sdr_ctx_errnum (ctx));
return (-1);
}
if (!record_count)
{
SDR_SET_ERRNUM (ctx, IPMI_SDR_ERR_PARAMETERS);
return (-1);
}
if (ctx->operation != IPMI_SDR_OPERATION_READ_CACHE)
{
SDR_SET_ERRNUM (ctx, IPMI_SDR_ERR_CACHE_READ_INITIALIZATION);
return (-1);
}
*record_count = ctx->record_count;
ctx->errnum = IPMI_SDR_ERR_SUCCESS;
return (0);
}
开发者ID:NodePrime,项目名称:freeipmi,代码行数:25,代码来源:ipmi-sdr-cache-read.c
示例18: ipmi_sdr_stats_compile
int
ipmi_sdr_stats_compile (ipmi_sdr_ctx_t ctx)
{
int rv = -1;
if (!ctx || ctx->magic != IPMI_SDR_CTX_MAGIC)
{
ERR_TRACE (ipmi_sdr_ctx_errormsg (ctx), ipmi_sdr_ctx_errnum (ctx));
return (-1);
}
if (ctx->operation != IPMI_SDR_OPERATION_READ_CACHE)
{
SDR_SET_ERRNUM (ctx, IPMI_SDR_ERR_CACHE_READ_INITIALIZATION);
return (-1);
}
if (ctx->stats_compiled)
goto out;
if (ipmi_sdr_cache_iterate (ctx,
_sdr_stat_callback,
NULL) < 0)
goto cleanup;
ctx->stats_compiled = 1;
out:
rv = 0;
ctx->errnum = IPMI_SDR_ERR_SUCCESS;
cleanup:
return (rv);
}
开发者ID:NodePrime,项目名称:freeipmi,代码行数:33,代码来源:ipmi-sdr-stats.c
示例19: ipmi_openipmi_ctx_io_init
int
ipmi_openipmi_ctx_io_init (ipmi_openipmi_ctx_t ctx)
{
unsigned int addr = IPMI_SLAVE_ADDRESS_BMC;
char *driver_device;
int flags;
if (!ctx || ctx->magic != IPMI_OPENIPMI_CTX_MAGIC)
{
ERR_TRACE (ipmi_openipmi_ctx_errormsg (ctx), ipmi_openipmi_ctx_errnum (ctx));
return (-1);
}
if (ctx->io_init)
goto out;
if (ctx->driver_device)
driver_device = ctx->driver_device;
else
driver_device = IPMI_OPENIPMI_DRIVER_DEVICE_DEFAULT;
if ((ctx->device_fd = open (driver_device,
O_RDWR)) < 0)
{
OPENIPMI_ERRNO_TO_OPENIPMI_ERRNUM (ctx, errno);
goto cleanup;
}
flags = fcntl(ctx->device_fd, F_GETFD);
if (flags < 0)
{
OPENIPMI_ERRNO_TO_OPENIPMI_ERRNUM (ctx, errno);
goto cleanup;
}
flags |= FD_CLOEXEC;
if (fcntl(ctx->device_fd, F_SETFD, flags) < 0)
{
OPENIPMI_ERRNO_TO_OPENIPMI_ERRNUM (ctx, errno);
goto cleanup;
}
if (ioctl (ctx->device_fd,
IPMICTL_SET_MY_ADDRESS_CMD,
&addr) < 0)
{
OPENIPMI_ERRNO_TO_OPENIPMI_ERRNUM (ctx, errno);
goto cleanup;
}
ctx->io_init = 1;
out:
ctx->errnum = IPMI_OPENIPMI_ERR_SUCCESS;
return (0);
cleanup:
/* ignore potential error, error path */
close (ctx->device_fd);
ctx->device_fd = -1;
return (-1);
}
开发者ID:chu11,项目名称:freeipmi-mirror,代码行数:60,代码来源:ipmi-openipmi-driver.c
示例20: ipmi_sdr_cache_sdr_version
int
ipmi_sdr_cache_sdr_version (ipmi_sdr_ctx_t ctx, uint8_t *sdr_version)
{
if (!ctx || ctx->magic != IPMI_SDR_CTX_MAGIC)
{
ERR_TRACE (ipmi_sdr_ctx_errormsg (ctx), ipmi_sdr_ctx_errnum (ctx));
return (-1);
}
if (!sdr_version)
{
SDR_SET_ERRNUM (ctx, IPMI_SDR_ERR_PARAMETERS);
return (-1);
}
if (ctx->operation != IPMI_SDR_OPERATION_READ_CACHE)
{
SDR_SET_ERRNUM (ctx, IPMI_SDR_ERR_CACHE_READ_INITIALIZATION);
return (-1);
}
*sdr_version = ctx->sdr_version;
ctx->errnum = IPMI_SDR_ERR_SUCCESS;
return (0);
}
开发者ID:NodePrime,项目名称:freeipmi,代码行数:25,代码来源:ipmi-sdr-cache-read.c
注:本文中的ERR_TRACE函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论