ipmi_sol.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * Redistribution of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. *
  11. * Redistribution in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. *
  15. * Neither the name of Sun Microsystems, Inc. or the names of
  16. * contributors may be used to endorse or promote products derived
  17. * from this software without specific prior written permission.
  18. *
  19. * This software is provided "AS IS," without a warranty of any kind.
  20. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  21. * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
  22. * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
  23. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
  24. * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
  25. * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
  26. * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
  27. * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
  28. * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
  29. * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
  30. * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  31. */
  32. #ifndef IPMI_SOL_H
  33. #define IPMI_SOL_H
  34. #include <ipmitool/ipmi.h>
  35. #define SOL_ESCAPE_CHARACTER_DEFAULT '~'
  36. #define SOL_KEEPALIVE_TIMEOUT 15
  37. #define SOL_KEEPALIVE_RETRIES 3
  38. #define IPMI_SOL_SERIAL_ALERT_MASK_SUCCEED 0x08
  39. #define IPMI_SOL_SERIAL_ALERT_MASK_DEFERRED 0x04
  40. #define IPMI_SOL_SERIAL_ALERT_MASK_FAIL 0x00
  41. #define IPMI_SOL_BMC_ASSERTS_CTS_MASK_TRUE 0x00
  42. #define IPMI_SOL_BMC_ASSERTS_CTS_MASK_FALSE 0x02
  43. struct sol_config_parameters {
  44. uint8_t set_in_progress;
  45. uint8_t enabled;
  46. uint8_t force_encryption;
  47. uint8_t force_authentication;
  48. uint8_t privilege_level;
  49. uint8_t character_accumulate_level;
  50. uint8_t character_send_threshold;
  51. uint8_t retry_count;
  52. uint8_t retry_interval;
  53. uint8_t non_volatile_bit_rate;
  54. uint8_t volatile_bit_rate;
  55. uint8_t payload_channel;
  56. uint16_t payload_port;
  57. };
  58. /*
  59. * The ACTIVATE PAYLOAD command response structure
  60. * From table 24-2 of the IPMI v2.0 spec
  61. */
  62. #ifdef PRAGMA_PACK
  63. #pramga pack(1)
  64. #endif
  65. struct activate_payload_rsp {
  66. uint8_t auxiliary_data[4];
  67. uint8_t inbound_payload_size[2]; /* LS byte first */
  68. uint8_t outbound_payload_size[2]; /* LS byte first */
  69. uint8_t payload_udp_port[2]; /* LS byte first */
  70. uint8_t payload_vlan_number[2]; /* LS byte first */
  71. } ATTRIBUTE_PACKING;
  72. #ifdef PRAGMA_PACK
  73. #pramga pack(0)
  74. #endif
  75. /*
  76. * Small function to validate that user-supplied SOL
  77. * configuration parameter values we store in uint8_t
  78. * data type falls within valid range. With minval
  79. * and maxval parameters we can use the same function
  80. * to validate parameters that have different ranges
  81. * of values.
  82. *
  83. * function will return -1 if value is not valid, or
  84. * will return 0 if valid.
  85. */
  86. int ipmi_sol_set_param_isvalid_uint8_t( const char *strval,
  87. const char *name,
  88. int base,
  89. uint8_t minval,
  90. uint8_t maxval,
  91. uint8_t *out_value);
  92. int ipmi_sol_main(struct ipmi_intf *, int, char **);
  93. int ipmi_get_sol_info(struct ipmi_intf * intf,
  94. uint8_t channel,
  95. struct sol_config_parameters * params);
  96. #endif /* IPMI_SOL_H */