📄 ipmiif.h.in
字号:
the length of the buffer and the function will set it tot he actual length. */int ipmi_entity_get_multi_record_data(ipmi_entity_t *entity, unsigned int num, unsigned char *data, unsigned int *length);/* For the given entity, iterate over all the children of the entity, calling the given handler with each child. The children will not change while this is happening. */typedef void (*ipmi_entity_iterate_child_cb)(ipmi_entity_t *ent, ipmi_entity_t *child, void *cb_data);void ipmi_entity_iterate_children(ipmi_entity_t *ent, ipmi_entity_iterate_child_cb handler, void *cb_data);/* Iterate over the parents of the given entitiy. FIXME - can an entity have more than one parent? */typedef void (*ipmi_entity_iterate_parent_cb)(ipmi_entity_t *ent, ipmi_entity_t *parent, void *cb_data);void ipmi_entity_iterate_parents(ipmi_entity_t *ent, ipmi_entity_iterate_parent_cb handler, void *cb_data);/* Iterate over all the sensors of an entity. */typedef void (*ipmi_entity_iterate_sensor_cb)(ipmi_entity_t *ent, ipmi_sensor_t *sensor, void *cb_data);void ipmi_entity_iterate_sensors(ipmi_entity_t *ent, ipmi_entity_iterate_sensor_cb handler, void *cb_data);/* Iterate over all the controls of an entity. */typedef void (*ipmi_entity_iterate_control_cb)(ipmi_entity_t *ent, ipmi_control_t *control, void *cb_data);void ipmi_entity_iterate_controls(ipmi_entity_t *ent, ipmi_entity_iterate_control_cb handler, void *cb_data);/* Set the handle to monitor the presence of an entity. Only one handler may be specified, add a NULL handler to remove the current handler. If the presence change was due to a system event, then the event field will not be NULL and will point to the event that cause the presence change. This is so the user can delete the event from the SEL. *//* THIS CALL IS DEPRECATED. Please use the add and remove versions of this function.*/typedef void (*ipmi_entity_presence_cb)(ipmi_entity_t *entity, int present, void *cb_data, ipmi_event_t *event);int ipmi_entity_set_presence_handler(ipmi_entity_t *ent, ipmi_entity_presence_cb handler, void *cb_data);/* Add a handler to monitor the presence of an entity. This call allows multiple handlers to be attached to the entity. It should return IPMI_EVENT_HANDLED if it handled the event, or IPMI_EVENT_NOT_HANDLED if it didn't handle the event. "Handling" the event means that is will manage the event (delete it when it is time). If no sensor handles the event, then it will be delivered to the "main" unhandled event handler for the domain. */typedef int (*ipmi_entity_presence_change_cb)(ipmi_entity_t *entity, int present, void *cb_data, ipmi_event_t *event);int ipmi_entity_add_presence_handler(ipmi_entity_t *ent, ipmi_entity_presence_change_cb handler, void *cb_data);int ipmi_entity_remove_presence_handler(ipmi_entity_t *ent, ipmi_entity_presence_change_cb handler, void *cb_data);/* Detect if the presence of an entity has changed. If "force" is zero, then it will only do this if OpenIPMI has some reason to think the presence has changed. If "force" is non-zero, it will force OpenIPMI to detect the current presence of the entity. */int ipmi_detect_entity_presence_change(ipmi_entity_t *entity, int force);/* Type of entities. Note that you will never see EAR and DREAR entities, so don't worry about those. */enum ipmi_dlr_type_e { IPMI_ENTITY_UNKNOWN = 0, IPMI_ENTITY_MC, IPMI_ENTITY_FRU, IPMI_ENTITY_GENERIC, IPMI_ENTITY_EAR, IPMI_ENTITY_DREAR };/* Get information about an entity. Most of this is IPMI specific. *//* The entity type. Depending on the return value from this, different field will be valid as marked below. */enum ipmi_dlr_type_e ipmi_entity_get_type(ipmi_entity_t *ent);/* These are valid for all entities. */int ipmi_entity_get_is_fru(ipmi_entity_t *ent);ipmi_domain_t *ipmi_entity_get_domain(ipmi_entity_t *ent);int ipmi_entity_get_entity_id(ipmi_entity_t *ent);int ipmi_entity_get_entity_instance(ipmi_entity_t *ent);/* If the entity instance is 0x60 or greater, then the channel and address are also important since the entity is device-relative. */int ipmi_entity_get_device_channel(ipmi_entity_t *ent);int ipmi_entity_get_device_address(ipmi_entity_t *ent);int ipmi_entity_get_presence_sensor_always_there(ipmi_entity_t *ent);int ipmi_entity_get_is_child(ipmi_entity_t *ent);int ipmi_entity_get_is_parent(ipmi_entity_t *ent);/* Valid for all entities except unknown. */int ipmi_entity_get_channel(ipmi_entity_t *ent);int ipmi_entity_get_lun(ipmi_entity_t *ent);int ipmi_entity_get_oem(ipmi_entity_t *ent);/* Valid for FRU and Generic */int ipmi_entity_get_access_address(ipmi_entity_t *ent);int ipmi_entity_get_private_bus_id(ipmi_entity_t *ent);int ipmi_entity_get_device_type(ipmi_entity_t *ent);int ipmi_entity_get_device_modifier(ipmi_entity_t *ent);/* Valid for MC and Generic */int ipmi_entity_get_slave_address(ipmi_entity_t *ent);/* Valid for FRU only. */int ipmi_entity_get_is_logical_fru(ipmi_entity_t *ent);int ipmi_entity_get_fru_device_id(ipmi_entity_t *ent);/* Valid for MC only */int ipmi_entity_get_ACPI_system_power_notify_required(ipmi_entity_t *ent);int ipmi_entity_get_ACPI_device_power_notify_required(ipmi_entity_t *ent);int ipmi_entity_get_controller_logs_init_agent_errors(ipmi_entity_t *ent);int ipmi_entity_get_log_init_agent_errors_accessing(ipmi_entity_t *ent);int ipmi_entity_get_global_init(ipmi_entity_t *ent);int ipmi_entity_get_chassis_device(ipmi_entity_t *ent);int ipmi_entity_get_bridge(ipmi_entity_t *ent);int ipmi_entity_get_IPMB_event_generator(ipmi_entity_t *ent);int ipmi_entity_get_IPMB_event_receiver(ipmi_entity_t *ent);int ipmi_entity_get_FRU_inventory_device(ipmi_entity_t *ent);int ipmi_entity_get_SEL_device(ipmi_entity_t *ent);int ipmi_entity_get_SDR_repository_device(ipmi_entity_t *ent);int ipmi_entity_get_sensor_device(ipmi_entity_t *ent);/* Valid for Generic only */int ipmi_entity_get_address_span(ipmi_entity_t *ent);/* Get the string name for the entity ID. */char *ipmi_entity_get_entity_id_string(ipmi_entity_t *ent);/* The ID from the SDR. */int ipmi_entity_get_id_length(ipmi_entity_t *ent);enum ipmi_str_type_e ipmi_entity_get_id_type(ipmi_entity_t *ent);int ipmi_entity_get_id(ipmi_entity_t *ent, char *id, int length);/* Is the entity currently present? Note that this value can change dynamically, so an "_id_" function is provided, too, that takes an entity id as well as an entity. Note that this call returns an error can fail if the entity has ceased to exist. */int ipmi_entity_is_present(ipmi_entity_t *ent);int ipmi_entity_id_is_present(ipmi_entity_id_t id, int *present);/* A generic callback for entities. */typedef void (*ipmi_entity_cb)(ipmi_entity_t *ent, int err, void *cb_data);typedef void (*ipmi_entity_val_cb)(ipmi_entity_t *ent, int err, int val, void *cb_data);typedef void (*ipmi_entity_time_cb)(ipmi_entity_t *ent, int err, ipmi_timeout_t val, void *cb_data);/* Register a handler that will be called fru information is added, deleted, or modified. If you call this in the entity added callback for the domain, you are guaranteed to get this set before any fru exist. The "add/remove" function allow multiple handlers to be added. The "set" function is deprecated and should not be used. */typedef void (*ipmi_entity_fru_cb)(enum ipmi_update_e op, ipmi_entity_t *ent, void *cb_data);int ipmi_entity_set_fru_update_handler(ipmi_entity_t *ent, ipmi_entity_fru_cb handler, void *cb_data);int ipmi_entity_add_fru_update_handler(ipmi_entity_t *ent, ipmi_entity_fru_cb handler, void *cb_data);int ipmi_entity_remove_fru_update_handler(ipmi_entity_t *ent, ipmi_entity_fru_cb handler, void *cb_data);/* Register a handler that will be called when a sensor that monitors this entity is added, deleted, or modified. If you call this in the entity added callback for the domain, you are guaranteed to get this set before any sensors exist. The "add/remove" function allow multiple handlers to be added. The "set" function is deprecated and should not be used. */typedef void (*ipmi_entity_sensor_cb)(enum ipmi_update_e op, ipmi_entity_t *ent, ipmi_sensor_t *sensor, void *cb_data);int ipmi_entity_set_sensor_update_handler(ipmi_entity_t *ent, ipmi_entity_sensor_cb handler, void *cb_data);int ipmi_entity_add_sensor_update_handler(ipmi_entity_t *ent, ipmi_entity_sensor_cb handler, void *cb_data);int ipmi_entity_remove_sensor_update_handler(ipmi_entity_t *ent, ipmi_entity_sensor_cb handler, void *cb_data);/* Register a handler that will be called when an control on this entity is added, deleted, or modified. If you call this in the entity added callback for the domain, you are guaranteed to get this set before any sensors exist. The "add/remove" function allow multiple handlers to be added. The "set" function is deprecated and should not be used. */typedef void (*ipmi_entity_control_cb)(enum ipmi_update_e op, ipmi_entity_t *ent, ipmi_control_t *control, void *cb_data);int ipmi_entity_set_control_update_handler(ipmi_entity_t *ent, ipmi_entity_control_cb handler, void *cb_data);int ipmi_entity_add_control_update_handler(ipmi_entity_t *ent, ipmi_entity_control_cb handler, void *cb_data);int ipmi_entity_remove_control_update_handler(ipmi_entity_t *ent, ipmi_entity_control_cb handler, void *cb_data);/* Hot-swap is done on entities. We have a hot-swap model defined here that controls basic hot-swap operation on an entity. *//* The hot-swap states correspond exactly to the ATCA state machine states, although unlike ATCA not all states may be used in all hot-swap state machines. The states are: NOT_PRESENT - the entity is not physically present in the system. INACTIVE - The entity is present, but turned off. ACTIVATION_REQUESTED - Something has requested that the entity be activated. ACTIVATION_IN_PROGRESS - The activation is in progress, but has not yet completed. ACTIVE - The device is operational. DEACTIVATION_REQUESTED - Something has requested that the entity be deactivated. DEACTIVATION_IN_PROGRESS - The device is being deactivated, but has not yet completed. OUT_OF_CON - The board is (probably) installed, but cannot be communicated with. The basic state machine goes in order of the states, except that INACTIVE normally occurs afer DEACTIVATION_IN_PROGRESS. States may be skipped if the state machine does not implement them; the simplest state machine would only have NOT_PRESENT and ACTIVE. NOT_PRESENT can occur after any state on an unmanaged extraction. DEACTIVATION_IN_PROGRESS or INACTIVE can also occur after any state, except that DEACTIVATION_IN_PROGRESS cannot occur after NOT_PRESENT The state machine may also go from DEACTIVATION_REQUESTED to ACTIVE if the deactivation was aborted.*/enum ipmi_hot_swap_states { IPMI_HOT_SWAP_NOT_PRESENT = 0, IPMI_HOT_SWAP_INACTIVE = 1, IPMI_HOT_SWAP_ACTIVATION_REQUESTED = 2, IPMI_HOT_SWAP_ACTIVATION_IN_PROGRESS = 3, IPMI_HOT_SWAP_ACTIVE = 4, IPMI_HOT_SWAP_DEACTIVATION_REQUESTED = 5, IPMI_HOT_SWAP_DEACTIVATION_IN_PROGRESS = 6, IPMI_HOT_SWAP_OUT_OF_CON = 7,};/* Get a string name for the hot swap state. */char *ipmi_hot_swap_state_name(enum ipmi_hot_swap_states state);/* Does the entity implement a hot-swap state machine? */int ipmi_entity_hot_swappable(ipmi_entity_t *ent);/* Register to receive the hot-swap state when it changes. the
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -