| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #ifndef IPMICONSOLE_H |
| #define IPMICONSOLE_H |
| |
| #ifdef __cplusplus |
| extern "C" { |
| #endif |
| |
| #include <stdint.h> |
| #include <freeipmi/freeipmi.h> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #define LIBIPMICONSOLE_VERSION_MAJOR @LIBIPMICONSOLE_VERSION_MAJOR@ |
| #define LIBIPMICONSOLE_VERSION_MINOR @LIBIPMICONSOLE_VERSION_MINOR@ |
| #define LIBIPMICONSOLE_VERSION_PATCH @LIBIPMICONSOLE_VERSION_PATCH@ |
| |
| |
| |
| |
| #define IPMICONSOLE_ERR_SUCCESS 0 |
| #define IPMICONSOLE_ERR_CTX_NULL 1 |
| #define IPMICONSOLE_ERR_CTX_INVALID 2 |
| #define IPMICONSOLE_ERR_ALREADY_SETUP 3 |
| #define IPMICONSOLE_ERR_NOT_SETUP 4 |
| #define IPMICONSOLE_ERR_CTX_NOT_SUBMITTED 5 |
| #define IPMICONSOLE_ERR_CTX_IS_SUBMITTED 6 |
| #define IPMICONSOLE_ERR_PARAMETERS 7 |
| #define IPMICONSOLE_ERR_HOSTNAME_INVALID 8 |
| #define IPMICONSOLE_ERR_IPMI_2_0_UNAVAILABLE 9 |
| #define IPMICONSOLE_ERR_CIPHER_SUITE_ID_UNAVAILABLE 10 |
| #define IPMICONSOLE_ERR_USERNAME_INVALID 11 |
| #define IPMICONSOLE_ERR_PASSWORD_INVALID 12 |
| #define IPMICONSOLE_ERR_K_G_INVALID 13 |
| #define IPMICONSOLE_ERR_PRIVILEGE_LEVEL_INSUFFICIENT 14 |
| #define IPMICONSOLE_ERR_PRIVILEGE_LEVEL_CANNOT_BE_OBTAINED 15 |
| #define IPMICONSOLE_ERR_SOL_UNAVAILABLE 16 |
| #define IPMICONSOLE_ERR_SOL_INUSE 17 |
| #define IPMICONSOLE_ERR_SOL_STOLEN 18 |
| #define IPMICONSOLE_ERR_SOL_REQUIRES_ENCRYPTION 19 |
| #define IPMICONSOLE_ERR_SOL_REQUIRES_NO_ENCRYPTION 20 |
| #define IPMICONSOLE_ERR_BMC_BUSY 21 |
| #define IPMICONSOLE_ERR_BMC_ERROR 22 |
| #define IPMICONSOLE_ERR_BMC_IMPLEMENTATION 23 |
| #define IPMICONSOLE_ERR_CONNECTION_TIMEOUT 24 |
| #define IPMICONSOLE_ERR_SESSION_TIMEOUT 25 |
| #define IPMICONSOLE_ERR_EXCESS_RETRANSMISSIONS_SENT 26 |
| #define IPMICONSOLE_ERR_EXCESS_ERRORS_RECEIVED 27 |
| #define IPMICONSOLE_ERR_OUT_OF_MEMORY 28 |
| #define IPMICONSOLE_ERR_TOO_MANY_OPEN_FILES 29 |
| #define IPMICONSOLE_ERR_SYSTEM_ERROR 30 |
| #define IPMICONSOLE_ERR_INTERNAL_ERROR 31 |
| #define IPMICONSOLE_ERR_ERRNUMRANGE 32 |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #define IPMICONSOLE_DEBUG_STDOUT 0x00000001 |
| #define IPMICONSOLE_DEBUG_STDERR 0x00000002 |
| #define IPMICONSOLE_DEBUG_SYSLOG 0x00000004 |
| #define IPMICONSOLE_DEBUG_FILE 0x00000008 |
| #define IPMICONSOLE_DEBUG_IPMI_PACKETS 0x00000010 |
| #define IPMICONSOLE_DEBUG_DEFAULT 0xFFFFFFFF |
| |
| |
| |
| |
| |
| |
| |
| #define IPMICONSOLE_PRIVILEGE_USER 0 |
| #define IPMICONSOLE_PRIVILEGE_OPERATOR 1 |
| #define IPMICONSOLE_PRIVILEGE_ADMIN 2 |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #define IPMICONSOLE_WORKAROUND_AUTHENTICATION_CAPABILITIES 0x00000001 |
| #define IPMICONSOLE_WORKAROUND_INTEL_2_0_SESSION 0x00000002 |
| #define IPMICONSOLE_WORKAROUND_SUPERMICRO_2_0_SESSION 0x00000004 |
| #define IPMICONSOLE_WORKAROUND_SUN_2_0_SESSION 0x00000008 |
| #define IPMICONSOLE_WORKAROUND_OPEN_SESSION_PRIVILEGE 0x00000010 |
| #define IPMICONSOLE_WORKAROUND_NON_EMPTY_INTEGRITY_CHECK_VALUE 0x00000020 |
| #define IPMICONSOLE_WORKAROUND_NO_CHECKSUM_CHECK 0x00000040 |
| #define IPMICONSOLE_WORKAROUND_SERIAL_ALERTS_DEFERRED 0x00000080 |
| #define IPMICONSOLE_WORKAROUND_INCREMENT_SOL_PACKET_SEQUENCE 0x00000100 |
| #define IPMICONSOLE_WORKAROUND_IGNORE_SOL_PAYLOAD_SIZE 0x01000000 |
| #define IPMICONSOLE_WORKAROUND_IGNORE_SOL_PORT 0x02000000 |
| #define IPMICONSOLE_WORKAROUND_SKIP_SOL_ACTIVATION_STATUS 0x04000000 |
| #define IPMICONSOLE_WORKAROUND_SKIP_CHANNEL_PAYLOAD_SUPPORT 0x08000000 |
| #define IPMICONSOLE_WORKAROUND_DEFAULT 0xFFFFFFFF |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #define IPMICONSOLE_ENGINE_CLOSE_FD 0x00000001 |
| #define IPMICONSOLE_ENGINE_OUTPUT_ON_SOL_ESTABLISHED 0x00000002 |
| #define IPMICONSOLE_ENGINE_LOCK_MEMORY 0x00000004 |
| #define IPMICONSOLE_ENGINE_SERIAL_KEEPALIVE 0x00000008 |
| #define IPMICONSOLE_ENGINE_SERIAL_KEEPALIVE_EMPTY 0x00000010 |
| #define IPMICONSOLE_ENGINE_DEFAULT 0xFFFFFFFF |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #define IPMICONSOLE_BEHAVIOR_ERROR_ON_SOL_INUSE 0x00000001 |
| #define IPMICONSOLE_BEHAVIOR_DEACTIVATE_ONLY 0x00000002 |
| #define IPMICONSOLE_BEHAVIOR_DEACTIVATE_ALL_INSTANCES 0x00000004 |
| #define IPMICONSOLE_BEHAVIOR_DEFAULT 0xFFFFFFFF |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| enum ipmiconsole_ctx_status |
| { |
| IPMICONSOLE_CTX_STATUS_ERROR = -1, |
| IPMICONSOLE_CTX_STATUS_NOT_SUBMITTED = 0, |
| IPMICONSOLE_CTX_STATUS_SUBMITTED = 1, |
| IPMICONSOLE_CTX_STATUS_SOL_ERROR = 2, |
| IPMICONSOLE_CTX_STATUS_SOL_ESTABLISHED = 3, |
| }; |
| typedef enum ipmiconsole_ctx_status ipmiconsole_ctx_status_t; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| struct ipmiconsole_ipmi_config |
| { |
| char *username; |
| char *password; |
| unsigned char *k_g; |
| unsigned int k_g_len; |
| int privilege_level; |
| int cipher_suite_id; |
| unsigned int workaround_flags; |
| }; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| struct ipmiconsole_protocol_config |
| { |
| int session_timeout_len; |
| int retransmission_timeout_len; |
| int retransmission_backoff_count; |
| int keepalive_timeout_len; |
| int retransmission_keepalive_timeout_len; |
| int acceptable_packet_errors_count; |
| int maximum_retransmission_count; |
| }; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| struct ipmiconsole_engine_config |
| { |
| unsigned int engine_flags; |
| unsigned int behavior_flags; |
| unsigned int debug_flags; |
| }; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| enum ipmiconsole_ctx_config_option |
| { |
| IPMICONSOLE_CTX_CONFIG_OPTION_SOL_PAYLOAD_INSTANCE = 0, |
| }; |
| typedef enum ipmiconsole_ctx_config_option ipmiconsole_ctx_config_option_t; |
| |
| #define IPMICONSOLE_THREAD_COUNT_MAX 32 |
| |
| typedef struct ipmiconsole_ctx *ipmiconsole_ctx_t; |
| |
| |
| |
| |
| |
| |
| |
| typedef void (*Ipmiconsole_callback)(void *); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| int ipmiconsole_engine_init (unsigned int thread_count, |
| unsigned int debug_flags); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| int ipmiconsole_engine_submit (ipmiconsole_ctx_t c, |
| Ipmiconsole_callback callback, |
| void *callback_arg); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| int ipmiconsole_engine_submit_block (ipmiconsole_ctx_t c); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| void ipmiconsole_engine_teardown (int cleanup_sol_sessions); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ipmiconsole_ctx_t ipmiconsole_ctx_create (const char *hostname, |
| struct ipmiconsole_ipmi_config *ipmi_config, |
| struct ipmiconsole_protocol_config *protocol_config, |
| struct ipmiconsole_engine_config *engine_config); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| int ipmiconsole_ctx_set_config (ipmiconsole_ctx_t c, |
| ipmiconsole_ctx_config_option_t config_option, |
| void *config_option_value); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| int ipmiconsole_ctx_get_config (ipmiconsole_ctx_t c, |
| ipmiconsole_ctx_config_option_t config_option, |
| void *config_option_value); |
| |
| |
| |
| |
| |
| |
| |
| int ipmiconsole_ctx_errnum (ipmiconsole_ctx_t c); |
| |
| |
| |
| |
| |
| |
| |
| char *ipmiconsole_ctx_strerror (int errnum); |
| |
| |
| |
| |
| |
| |
| |
| char *ipmiconsole_ctx_errormsg (ipmiconsole_ctx_t c); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ipmiconsole_ctx_status_t ipmiconsole_ctx_status (ipmiconsole_ctx_t c); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| int ipmiconsole_ctx_fd (ipmiconsole_ctx_t c); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| int ipmiconsole_ctx_generate_break (ipmiconsole_ctx_t c); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| void ipmiconsole_ctx_destroy (ipmiconsole_ctx_t c); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| int ipmiconsole_username_is_valid (const char *username); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| int ipmiconsole_password_is_valid (const char *password); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| int ipmiconsole_k_g_is_valid (const unsigned char *k_g, unsigned int k_g_len); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| int ipmiconsole_privilege_level_is_valid (int privilege_level); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| int ipmiconsole_cipher_suite_id_is_valid (int cipher_suite_id); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| int ipmiconsole_workaround_flags_is_valid (unsigned int workaround_flags); |
| |
| #ifdef __cplusplus |
| } |
| #endif |
| |
| #endif |