Blame include/ipmitool/ipmi_sol.h

Packit Service ed0f68
/*
Packit Service ed0f68
 * Copyright (c) 2003 Sun Microsystems, Inc.  All Rights Reserved.
Packit Service ed0f68
 * 
Packit Service ed0f68
 * Redistribution and use in source and binary forms, with or without
Packit Service ed0f68
 * modification, are permitted provided that the following conditions
Packit Service ed0f68
 * are met:
Packit Service ed0f68
 * 
Packit Service ed0f68
 * Redistribution of source code must retain the above copyright
Packit Service ed0f68
 * notice, this list of conditions and the following disclaimer.
Packit Service ed0f68
 * 
Packit Service ed0f68
 * Redistribution in binary form must reproduce the above copyright
Packit Service ed0f68
 * notice, this list of conditions and the following disclaimer in the
Packit Service ed0f68
 * documentation and/or other materials provided with the distribution.
Packit Service ed0f68
 * 
Packit Service ed0f68
 * Neither the name of Sun Microsystems, Inc. or the names of
Packit Service ed0f68
 * contributors may be used to endorse or promote products derived
Packit Service ed0f68
 * from this software without specific prior written permission.
Packit Service ed0f68
 * 
Packit Service ed0f68
 * This software is provided "AS IS," without a warranty of any kind.
Packit Service ed0f68
 * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
Packit Service ed0f68
 * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
Packit Service ed0f68
 * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
Packit Service ed0f68
 * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
Packit Service ed0f68
 * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
Packit Service ed0f68
 * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.  IN NO EVENT WILL
Packit Service ed0f68
 * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
Packit Service ed0f68
 * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
Packit Service ed0f68
 * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
Packit Service ed0f68
 * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
Packit Service ed0f68
 * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Packit Service ed0f68
 */
Packit Service ed0f68
Packit Service ed0f68
#ifndef IPMI_SOL_H
Packit Service ed0f68
#define IPMI_SOL_H
Packit Service ed0f68
Packit Service ed0f68
#include <ipmitool/ipmi.h>
Packit Service ed0f68
Packit Service ed0f68
#define SOL_ESCAPE_CHARACTER_DEFAULT        '~'
Packit Service ed0f68
#define SOL_KEEPALIVE_TIMEOUT               15
Packit Service ed0f68
#define SOL_KEEPALIVE_RETRIES               3
Packit Service ed0f68
Packit Service ed0f68
#define IPMI_SOL_SERIAL_ALERT_MASK_SUCCEED  0x08
Packit Service ed0f68
#define IPMI_SOL_SERIAL_ALERT_MASK_DEFERRED 0x04
Packit Service ed0f68
#define IPMI_SOL_SERIAL_ALERT_MASK_FAIL     0x00
Packit Service ed0f68
#define IPMI_SOL_BMC_ASSERTS_CTS_MASK_TRUE  0x00
Packit Service ed0f68
#define IPMI_SOL_BMC_ASSERTS_CTS_MASK_FALSE 0x02
Packit Service ed0f68
Packit Service ed0f68
Packit Service ed0f68
struct sol_config_parameters {
Packit Service ed0f68
	uint8_t  set_in_progress;
Packit Service ed0f68
	uint8_t  enabled;
Packit Service ed0f68
	uint8_t  force_encryption;
Packit Service ed0f68
	uint8_t  force_authentication;
Packit Service ed0f68
	uint8_t  privilege_level;
Packit Service ed0f68
	uint8_t  character_accumulate_level;
Packit Service ed0f68
	uint8_t  character_send_threshold;
Packit Service ed0f68
	uint8_t  retry_count;
Packit Service ed0f68
	uint8_t  retry_interval;
Packit Service ed0f68
	uint8_t  non_volatile_bit_rate;
Packit Service ed0f68
	uint8_t  volatile_bit_rate;
Packit Service ed0f68
	uint8_t  payload_channel;
Packit Service ed0f68
	uint16_t payload_port;
Packit Service ed0f68
};
Packit Service ed0f68
Packit Service ed0f68
Packit Service ed0f68
/*
Packit Service ed0f68
 * The ACTIVATE PAYLOAD command response structure
Packit Service ed0f68
 * From table 24-2 of the IPMI v2.0 spec
Packit Service ed0f68
 */
Packit Service ed0f68
#ifdef PRAGMA_PACK
Packit Service ed0f68
#pramga pack(1)
Packit Service ed0f68
#endif
Packit Service ed0f68
struct activate_payload_rsp {
Packit Service ed0f68
	uint8_t auxiliary_data[4];
Packit Service ed0f68
	uint8_t inbound_payload_size[2];  /* LS byte first */
Packit Service ed0f68
	uint8_t outbound_payload_size[2]; /* LS byte first */
Packit Service ed0f68
	uint8_t payload_udp_port[2];      /* LS byte first */
Packit Service ed0f68
	uint8_t payload_vlan_number[2];   /* LS byte first */
Packit Service ed0f68
} ATTRIBUTE_PACKING;
Packit Service ed0f68
#ifdef PRAGMA_PACK
Packit Service ed0f68
#pramga pack(0)
Packit Service ed0f68
#endif
Packit Service ed0f68
Packit Service ed0f68
/*
Packit Service ed0f68
 * Small function to validate that user-supplied SOL
Packit Service ed0f68
 * configuration parameter values we store in uint8_t
Packit Service ed0f68
 * data type falls within valid range.  With minval
Packit Service ed0f68
 * and maxval parameters we can use the same function
Packit Service ed0f68
 * to validate parameters that have different ranges
Packit Service ed0f68
 * of values.
Packit Service ed0f68
 *
Packit Service ed0f68
 * function will return -1 if value is not valid, or
Packit Service ed0f68
 * will return 0 if valid.
Packit Service ed0f68
 */
Packit Service ed0f68
int ipmi_sol_set_param_isvalid_uint8_t( const char *strval,
Packit Service ed0f68
					const char *name,
Packit Service ed0f68
					int base,
Packit Service ed0f68
					uint8_t minval,
Packit Service ed0f68
					uint8_t maxval,
Packit Service ed0f68
					uint8_t *out_value);
Packit Service ed0f68
Packit Service ed0f68
int ipmi_sol_main(struct ipmi_intf *, int, char **);
Packit Service ed0f68
int ipmi_get_sol_info(struct ipmi_intf             * intf,
Packit Service ed0f68
					  uint8_t                  channel,
Packit Service ed0f68
					  struct sol_config_parameters * params);
Packit Service ed0f68
Packit Service ed0f68
Packit Service ed0f68
#endif /* IPMI_SOL_H */