📄 ipmi_mc.h
字号:
/* Get the IPMI slave address of the given MC. */unsigned ipmi_mc_get_address(ipmi_mc_t *mc);/* Get the MC's full IPMI address. */void ipmi_mc_get_ipmi_address(ipmi_mc_t *mc, ipmi_addr_t *addr, unsigned int *addr_len);/* Get the channel for the given MC. */unsigned ipmi_mc_get_channel(ipmi_mc_t *mc);void ipmi_mc_set_sel_rescan_time(ipmi_mc_t *mc, unsigned int seconds);unsigned int ipmi_mc_get_sel_rescan_time(ipmi_mc_t *mc);int _ipmi_create_mc(ipmi_domain_t *domain, ipmi_addr_t *addr, unsigned int addr_len, ipmi_mc_t **new_mc);/* Destroy an MC. */void _ipmi_cleanup_mc(ipmi_mc_t *mc);#if 0/* FIXME - need to handle this somehow. *//* This should be called from OEM code for an SMI, ONLY WHEN THE NEW MC HANDLER IS CALLED, if the slave address of the SMI is not 0x20. This will allow the bmc t know it's own address, which is pretty important. You pass in a function that the code will call (and pass in it's own function) when it wants the address. */typedef void (*ipmi_mc_got_slave_addr_cb)(ipmi_mc_t *bmc, int err, unsigned int addr, void *cb_data);typedef int (*ipmi_mc_slave_addr_fetch_cb)( ipmi_mc_t *bmc, ipmi_mc_got_slave_addr_cb handler, void *cb_data);int ipmi_bmc_set_smi_slave_addr_fetcher( ipmi_mc_t *bmc, ipmi_mc_slave_addr_fetch_cb handler);#endif/* Return the timestamp that was fetched before the first SEL fetch. This is so that OEM code can properly ignore old events. Note that this value will be set to zero after the first SEL fetch, it really not good for anything but comparing timestamps to see if the event is old. */ipmi_time_t ipmi_mc_get_startup_SEL_time(ipmi_mc_t *bmc);/* Reread the sel. When the hander is called, all the events in the SEL have been fetched into the local copy of the SEL (with the obvious caveat that this is a distributed system and other things may have come in after the read has finised). */int ipmi_mc_reread_sel(ipmi_mc_t *mc, ipmi_mc_done_cb handler, void *cb_data);/* Fetch the current time from the SEL. */typedef void (*sel_get_time_cb)(ipmi_mc_t *mc, int err, unsigned long time, void *cb_data);int ipmi_mc_get_current_sel_time(ipmi_mc_t *mc, sel_get_time_cb handler, void *cb_data);/* Set the time for the SEL. Note that this function is rather dangerous to do, especially if you don't set it to the current time, as it can cause old events to be interpreted as new events on this and other systems. */int ipmi_mc_set_current_sel_time(ipmi_mc_t *mc, const struct timeval *time, ipmi_mc_done_cb handler, void *cb_data);typedef void (*ipmi_mc_cb)(ipmi_mc_t *mc, int err, void *cb_data);typedef void (ipmi_mc_del_event_done_cb)(ipmi_mc_t *mc, int err, void *cb_data);int ipmi_mc_del_event(ipmi_mc_t *mc, ipmi_event_t *event, ipmi_mc_del_event_done_cb handler, void *cb_data);/* Add an event to the real SEL. This does not directly put it into the internal copy of the SEL. */typedef void (*ipmi_mc_add_event_done_cb)(ipmi_mc_t *mc, unsigned int record_id, int err, void *cb_data);int ipmi_mc_add_event_to_sel(ipmi_mc_t *mc, ipmi_event_t *event, ipmi_mc_add_event_done_cb handler, void *cb_data);/* Some OEM boxes may have special SEL delete requirements, so we have a special hook to let the OEM code delete events on an MC with SEL support. */typedef int (*ipmi_mc_del_event_cb)(ipmi_mc_t *mc, ipmi_event_t *event, ipmi_mc_cb done_handler, void *cb_data);void ipmi_mc_set_del_event_handler(ipmi_mc_t *mc, ipmi_mc_del_event_cb handler);typedef int (*ipmi_mc_add_event_cb)(ipmi_mc_t *mc, ipmi_event_t *event, ipmi_mc_add_event_done_cb done_handler, void *cb_data);void ipmi_mc_set_add_event_handler(ipmi_mc_t *mc, ipmi_mc_add_event_cb handler);/* Check the event receiver for the MC. */void _ipmi_mc_check_event_rcvr(ipmi_mc_t *mc);int _ipmi_mc_init(void);void _ipmi_mc_shutdown(void);/* Returns EEXIST if the event is already there. */int _ipmi_mc_sel_event_add(ipmi_mc_t *mc, ipmi_event_t *event);ipmi_event_t *ipmi_mc_first_event(ipmi_mc_t *mc);ipmi_event_t *ipmi_mc_last_event(ipmi_mc_t *mc);ipmi_event_t *ipmi_mc_next_event(ipmi_mc_t *mc, ipmi_event_t *event);ipmi_event_t *ipmi_mc_prev_event(ipmi_mc_t *mc, ipmi_event_t *event);ipmi_event_t *ipmi_mc_event_by_recid(ipmi_mc_t *mc, unsigned int record_id);int ipmi_mc_sel_count(ipmi_mc_t *mc);int ipmi_mc_sel_entries_used(ipmi_mc_t *mc);int ipmi_mc_sel_get_major_version(ipmi_mc_t *mc);int ipmi_mc_sel_get_minor_version(ipmi_mc_t *mc);int ipmi_mc_sel_get_num_entries(ipmi_mc_t *mc);int ipmi_mc_sel_get_free_bytes(ipmi_mc_t *mc);int ipmi_mc_sel_get_overflow(ipmi_mc_t *mc);int ipmi_mc_sel_get_supports_delete_sel(ipmi_mc_t *mc);int ipmi_mc_sel_get_supports_partial_add_sel(ipmi_mc_t *mc);int ipmi_mc_sel_get_supports_reserve_sel(ipmi_mc_t *mc);int ipmi_mc_sel_get_supports_get_sel_allocation(ipmi_mc_t *mc);int ipmi_mc_sel_get_last_addition_timestamp(ipmi_mc_t *mc);int _ipmi_mc_check_oem_event_handler(ipmi_mc_t *mc, ipmi_event_t *event);int _ipmi_mc_check_sel_oem_event_handler(ipmi_mc_t *mc, ipmi_event_t *event);/* Set and get the OEM data pointer in the mc. */void ipmi_mc_set_oem_data(ipmi_mc_t *mc, void *data);void *ipmi_mc_get_oem_data(ipmi_mc_t *mc);/* Used by the sensor code to report a new sensor to the MC. The new sensor call should return 1 if the sensor code should not add the sensor to its database. */void _ipmi_mc_fixup_sensor(ipmi_mc_t *mc, ipmi_sensor_t *sensor);int _ipmi_mc_new_sensor(ipmi_mc_t *mc, ipmi_entity_t *ent, ipmi_sensor_t *sensor, void *link);/* This should be called with a new device id for an MC we don't have active in the system (it may be inactive). */int _ipmi_mc_get_device_id_data_from_rsp(ipmi_mc_t *mc, ipmi_msg_t *rsp);/* Compares the data in a get device id response (in rsp) with the data in the MC, returns true if they are the same and false if not. Must be called with an error-free message. */int _ipmi_mc_device_data_compares(ipmi_mc_t *mc, ipmi_msg_t *rsp);/* Called when a new MC has been added to the system, to kick of processing it. */int _ipmi_mc_handle_new(ipmi_mc_t *mc);/* Allow sensors to keep information that came from an MC in the MC itself so that when the MC is destroyed, it can be cleaned up. */void _ipmi_mc_get_sdr_sensors(ipmi_mc_t *mc, ipmi_sensor_t ***sensors, unsigned int *count);void _ipmi_mc_set_sdr_sensors(ipmi_mc_t *mc, ipmi_sensor_t **sensors, unsigned int count);/* Used to create external references to an MC so it won't go away even if it is released. */void _ipmi_mc_use(ipmi_mc_t *mc);void _ipmi_mc_release(ipmi_mc_t *mc);/* Used to periodically check that the MC data is current and valid. */void _ipmi_mc_check_mc(ipmi_mc_t *mc);/* Create chassis conrols for an MC. */int _ipmi_chassis_create_controls(ipmi_mc_t *mc);#endif /* _IPMI_MC_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -