ipmi_lanp.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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_LANP_H
  33. #define IPMI_LANP_H
  34. #include <ipmitool/ipmi.h>
  35. #define IPMI_LAN_SET_CONFIG 0x01
  36. #define IPMI_LAN_GET_CONFIG 0x02
  37. #define IPMI_LAN_SUSPEND_ARP 0x03
  38. # define IPMI_LAN_SUSPEND_ARP_RESP (2)
  39. # define IPMI_LAN_SUSPEND_ARP_GRAT (1)
  40. #define IPMI_LAN_GET_STAT 0x04
  41. #define IPMI_CHANNEL_NUMBER_MAX 0xe
  42. #define IPMI_LANP_TIMEOUT 3
  43. #define IPMI_LANP_RETRIES 10
  44. #define IPMI_LANP_WRITE_UNLOCK 0
  45. #define IPMI_LANP_WRITE_LOCK 1
  46. #define IPMI_LANP_WRITE_COMMIT 2
  47. enum {
  48. IPMI_LANP_SET_IN_PROGRESS,
  49. IPMI_LANP_AUTH_TYPE,
  50. IPMI_LANP_AUTH_TYPE_ENABLE,
  51. IPMI_LANP_IP_ADDR,
  52. IPMI_LANP_IP_ADDR_SRC,
  53. IPMI_LANP_MAC_ADDR, /* 5 */
  54. IPMI_LANP_SUBNET_MASK,
  55. IPMI_LANP_IP_HEADER,
  56. IPMI_LANP_PRI_RMCP_PORT,
  57. IPMI_LANP_SEC_RMCP_PORT,
  58. IPMI_LANP_BMC_ARP, /* 10 */
  59. IPMI_LANP_GRAT_ARP,
  60. IPMI_LANP_DEF_GATEWAY_IP,
  61. IPMI_LANP_DEF_GATEWAY_MAC,
  62. IPMI_LANP_BAK_GATEWAY_IP,
  63. IPMI_LANP_BAK_GATEWAY_MAC, /* 15 */
  64. IPMI_LANP_SNMP_STRING,
  65. IPMI_LANP_NUM_DEST,
  66. IPMI_LANP_DEST_TYPE,
  67. IPMI_LANP_DEST_ADDR,
  68. IPMI_LANP_VLAN_ID, /* 20 */
  69. IPMI_LANP_VLAN_PRIORITY,
  70. IPMI_LANP_RMCP_CIPHER_SUPPORT,
  71. IPMI_LANP_RMCP_CIPHERS,
  72. IPMI_LANP_RMCP_PRIV_LEVELS,
  73. IPMI_LANP_VLAN_TAGS,
  74. IPMI_LANP_BAD_PASS_THRESH,
  75. IPMI_LANP_IP6_SUPPORT=50,
  76. IPMI_LANP_IP6_ENABLES,
  77. IPMI_LANP_IP6_TRAFFIC_CLASS,
  78. IPMI_LANP_IP6_STATIC_HOPS,
  79. IPMI_LANP_IP6_FLOW_LABEL,
  80. IPMI_LANP_IP6_STATUS,
  81. IPMI_LANP_IP6_STATIC_ADDR,
  82. IPMI_LANP_IP6_STATIC_DUID_STG,
  83. IPMI_LANP_IP6_STATIC_DUID,
  84. IPMI_LANP_IP6_DYNAMIC_ADDR,
  85. IPMI_LANP_IP6_DYNAMIC_DUID_STG,
  86. IPMI_LANP_IP6_DYNAMIC_DUID,
  87. IPMI_LANP_IP6_DHCP6_CFG_SUP,
  88. IPMI_LANP_IP6_DHCP6_CFG,
  89. IPMI_LANP_IP6_ROUTER_CFG,
  90. IPMI_LANP_IP6_STATIC_RTR1_ADDR,
  91. IPMI_LANP_IP6_STATIC_RTR1_MAC,
  92. IPMI_LANP_IP6_STATIC_RTR1_PFX_LEN,
  93. IPMI_LANP_IP6_STATIC_RTR1_PFX,
  94. IPMI_LANP_IP6_STATIC_RTR2_ADDR,
  95. IPMI_LANP_IP6_STATIC_RTR2_MAC,
  96. IPMI_LANP_IP6_STATIC_RTR2_PFX_LEN,
  97. IPMI_LANP_IP6_STATIC_RTR2_PFX,
  98. IPMI_LANP_IP6_NUM_DYNAMIC_RTRS,
  99. IPMI_LANP_IP6_DYNAMIC_RTR_ADDR,
  100. IPMI_LANP_IP6_DYNAMIC_RTR_MAC,
  101. IPMI_LANP_IP6_DYNAMIC_RTR_PFX_LEN,
  102. IPMI_LANP_IP6_DYNAMIC_RTR_PFX,
  103. IPMI_LANP_IP6_DYNAMIC_HOPS,
  104. IPMI_LANP_IP6_NDSLAAC_CFG_SUP,
  105. IPMI_LANP_IP6_NDSLAAC_CFG,
  106. IPMI_LANP_OEM_ALERT_STRING=96,
  107. IPMI_LANP_ALERT_RETRY=97,
  108. IPMI_LANP_UTC_OFFSET=98,
  109. IPMI_LANP_DHCP_SERVER_IP=192,
  110. IPMI_LANP_DHCP_SERVER_MAC=193,
  111. IPMI_LANP_DHCP_ENABLE=194,
  112. IPMI_LANP_CHAN_ACCESS_MODE=201,
  113. };
  114. static struct lan_param {
  115. int cmd;
  116. int size;
  117. char desc[24];
  118. uint8_t * data;
  119. int data_len;
  120. } ipmi_lan_params[] __attribute__((unused)) = {
  121. { IPMI_LANP_SET_IN_PROGRESS, 1, "Set in Progress", NULL, 0 },
  122. { IPMI_LANP_AUTH_TYPE, 1, "Auth Type Support", NULL, 0 },
  123. { IPMI_LANP_AUTH_TYPE_ENABLE, 5, "Auth Type Enable", NULL, 0 },
  124. { IPMI_LANP_IP_ADDR, 4, "IP Address", NULL, 0 },
  125. { IPMI_LANP_IP_ADDR_SRC, 1, "IP Address Source", NULL, 0 },
  126. { IPMI_LANP_MAC_ADDR, 6, "MAC Address", NULL, 0 }, /* 5 */
  127. { IPMI_LANP_SUBNET_MASK, 4, "Subnet Mask", NULL, 0 },
  128. { IPMI_LANP_IP_HEADER, 3, "IP Header", NULL, 0 },
  129. { IPMI_LANP_PRI_RMCP_PORT, 2, "Primary RMCP Port", NULL, 0 },
  130. { IPMI_LANP_SEC_RMCP_PORT, 2, "Secondary RMCP Port", NULL, 0 },
  131. { IPMI_LANP_BMC_ARP, 1, "BMC ARP Control", NULL, 0}, /* 10 */
  132. { IPMI_LANP_GRAT_ARP, 1, "Gratituous ARP Intrvl", NULL, 0 },
  133. { IPMI_LANP_DEF_GATEWAY_IP, 4, "Default Gateway IP", NULL, 0 },
  134. { IPMI_LANP_DEF_GATEWAY_MAC, 6, "Default Gateway MAC", NULL, 0 },
  135. { IPMI_LANP_BAK_GATEWAY_IP, 4, "Backup Gateway IP", NULL, 0 },
  136. { IPMI_LANP_BAK_GATEWAY_MAC, 6, "Backup Gateway MAC", NULL, 0 }, /* 15 */
  137. { IPMI_LANP_SNMP_STRING, 18, "SNMP Community String", NULL, 0 },
  138. { IPMI_LANP_NUM_DEST, 1, "Number of Destinations", NULL, 0 },
  139. { IPMI_LANP_DEST_TYPE, 4, "Destination Type", NULL, 0 },
  140. { IPMI_LANP_DEST_ADDR, 13, "Destination Addresses", NULL, 0 },
  141. { IPMI_LANP_VLAN_ID, 2, "802.1q VLAN ID", NULL, 0 }, /* 20 */
  142. { IPMI_LANP_VLAN_PRIORITY, 1, "802.1q VLAN Priority", NULL, 0 },
  143. { IPMI_LANP_RMCP_CIPHER_SUPPORT,1, "RMCP+ Cipher Suite Count", NULL, 0 },
  144. { IPMI_LANP_RMCP_CIPHERS, 16, "RMCP+ Cipher Suites", NULL, 0 },
  145. { IPMI_LANP_RMCP_PRIV_LEVELS, 9, "Cipher Suite Priv Max", NULL, 0 },
  146. { IPMI_LANP_BAD_PASS_THRESH, 6, "Bad Password Threshold", NULL, 0 },
  147. { IPMI_LANP_OEM_ALERT_STRING, 28, "OEM Alert String", NULL, 0 }, /* 25 */
  148. { IPMI_LANP_ALERT_RETRY, 1, "Alert Retry Algorithm", NULL, 0 },
  149. { IPMI_LANP_UTC_OFFSET, 3, "UTC Offset", NULL, 0 },
  150. { IPMI_LANP_DHCP_SERVER_IP, 4, "DHCP Server IP", NULL, 0 },
  151. { IPMI_LANP_DHCP_SERVER_MAC, 6, "DHDP Server MAC", NULL, 0},
  152. { IPMI_LANP_DHCP_ENABLE, 1, "DHCP Enable", NULL, 0 }, /* 30 */
  153. { IPMI_LANP_CHAN_ACCESS_MODE, 2, "Channel Access Mode", NULL, 0 },
  154. { -1, -1, "", NULL, -1 }
  155. };
  156. int ipmi_lanp_main(struct ipmi_intf *, int, char **);
  157. uint8_t find_lan_channel(struct ipmi_intf *intf, uint8_t start);
  158. #endif /*IPMI_LANP_H*/