Skip to content

Commit

Permalink
Merge branch 'lamontj-ipv6-spec'
Browse files Browse the repository at this point in the history
  • Loading branch information
chu11 committed Apr 3, 2017
2 parents 927a24e + 958cbb4 commit bd83b85
Show file tree
Hide file tree
Showing 7 changed files with 1,810 additions and 30 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2017-04-03 LaMont Jones <[email protected]>

* libfreeipmi/: Add support to read IPv6 configuration.

2017-03-20 Albert Chu <[email protected]>

* man/ipmiseld.8.pre.in: Clarify --test-run and --foreground
Expand Down
744 changes: 744 additions & 0 deletions libfreeipmi/api/ipmi-lan-cmds-api.c

Large diffs are not rendered by default.

343 changes: 343 additions & 0 deletions libfreeipmi/cmds/ipmi-lan-cmds.c

Large diffs are not rendered by default.

217 changes: 217 additions & 0 deletions libfreeipmi/include/freeipmi/api/ipmi-lan-cmds-api.h

Large diffs are not rendered by default.

67 changes: 67 additions & 0 deletions libfreeipmi/include/freeipmi/cmds/ipmi-lan-cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ extern "C" {
|| (__val) == IPMI_IP_ADDRESS_SOURCE_BIOS \
|| (__val) == IPMI_IP_ADDRESS_SOURCE_OTHER) ? 1 : 0)

#define IPMI_IPV6_IPV4_ADDRESSING_ENABLES_IPV6_DISABLED 0x0
#define IPMI_IPV6_IPV4_ADDRESSING_ENABLES_IPV6_ONLY 0x1
#define IPMI_IPV6_IPV4_ADDRESSING_ENABLES_IPV6_AND_IPV4 0x2

#define IPMI_IPV6_IPV4_ADDRESSING_ENABLES_VALID(__val) \
(((__val) == IPMI_IPV6_IPV4_ADDRESSING_ENABLES_IPV6_DISABLED \
|| (__val) == IPMI_IPV6_IPV4_ADDRESSING_ENABLES_IPV6_ONLY \
|| (__val) == IPMI_IPV6_IPV4_ADDRESSING_ENABLES_IPV6_AND_IPV4) ? 1 : 0)

#define IPMI_BMC_GENERATED_GRATUITOUS_ARPS_ENABLE 0x1
#define IPMI_BMC_GENERATED_GRATUITOUS_ARPS_DISABLE 0x0

Expand Down Expand Up @@ -156,6 +165,33 @@ extern "C" {
(((__val) == IPMI_CLEAR_ALL_STATISTICS \
|| (__val) == IPMI_DONT_CLEAR_ALL_STATISTICS) ? 1 : 0)

#define IPMI_IPV6_ADDRESS_SOURCE_STATIC 0x00
#define IPMI_IPV6_ADDRESS_SOURCE_SLAAC 0x01
#define IPMI_IPV6_ADDRESS_SOURCE_DHCPV6 0x02

#define IPMI_IPV6_STATIC_ADDRESS_SOURCE_VALID(__address_status) \
(((__address_status) == IPMI_IPV6_ADDRESS_SOURCE_STATIC) ? 1 : 0)

#define IPMI_IPV6_DYNAMIC_ADDRESS_SOURCE_VALID(__address_status) \
(((__address_status) == IPMI_IPV6_ADDRESS_SOURCE_SLAAC \
|| (__address_status) == IPMI_IPV6_ADDRESS_SOURCE_DHCPV6) ? 1 : 0)


#define IPMI_IPV6_ADDRESS_STATUS_ACTIVE 0x00
#define IPMI_IPV6_ADDRESS_STATUS_DISABLED 0x01
#define IPMI_IPV6_ADDRESS_STATUS_PENDING 0x02
#define IPMI_IPV6_ADDRESS_STATUS_FAILED 0x03
#define IPMI_IPV6_ADDRESS_STATUS_DEPRECATED 0x04
#define IPMI_IPV6_ADDRESS_STATUS_INVALID 0x05

#define IPMI_IPV6_ADDRESS_STATUS_VALID(__address_status) \
(((__address_status) == IPMI_IPV6_ADDRESS_STATUS_ACTIVE \
|| (__address_status) == IPMI_IPV6_ADDRESS_STATUS_DISABLED \
|| (__address_status) == IPMI_IPV6_ADDRESS_STATUS_PENDING \
|| (__address_status) == IPMI_IPV6_ADDRESS_STATUS_FAILED \
|| (__address_status) == IPMI_IPV6_ADDRESS_STATUS_DEPRECATED \
|| (__address_status) == IPMI_IPV6_ADDRESS_STATUS_INVALID) ? 1 : 0)

/*
* fill* functions return 0 on success, -1 on error.
*
Expand Down Expand Up @@ -220,6 +256,37 @@ extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_rmcpplus_messag
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_rmcpplus_messaging_cipher_suite_entries_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_rmcpplus_messaging_cipher_suite_privilege_levels_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_bad_password_threshold_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_ipv4_support_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_ipv4_addressing_enables_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_header_static_traffic_class_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_header_static_hop_limit_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_header_flow_label_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_status_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_static_addresses_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_dhcpv6_static_duid_storage_length_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_dhcpv6_static_duids_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_dynamic_address_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_dhcpv6_dynamic_duid_storage_length_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_dhcpv6_dynamic_duids_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_dhcpv6_timing_configuration_support_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_dhcpv6_timing_and_configuration_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_router_address_configuration_control_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_static_router_1_ip_address_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_static_router_1_mac_address_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_static_router_1_prefix_length_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_static_router_1_prefix_value_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_static_router_2_ip_address_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_static_router_2_mac_address_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_static_router_2_prefix_length_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_static_router_2_prefix_value_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_number_of_dynamic_router_info_sets_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_dynamic_router_info_ip_address_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_dynamic_router_info_mac_address_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_dynamic_router_info_prefix_length_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_dynamic_router_info_prefix_value_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_dynamic_router_received_hop_limit_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_neighbor_discovery_slaac_timing_configuration_support_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv6_neighbor_discovery_slaac_timing_configuration_rs;

extern fiid_template_t tmpl_cmd_suspend_bmc_arps_rq;
extern fiid_template_t tmpl_cmd_suspend_bmc_arps_rs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,40 +23,71 @@
extern "C" {
#endif

#define IPMI_LAN_CONFIGURATION_PARAMETER_SET_IN_PROGRESS 0
#define IPMI_LAN_CONFIGURATION_PARAMETER_AUTHENTICATION_TYPE_SUPPORT 1
#define IPMI_LAN_CONFIGURATION_PARAMETER_AUTHENTICATION_TYPE_ENABLES 2
#define IPMI_LAN_CONFIGURATION_PARAMETER_IP_ADDRESS 3
#define IPMI_LAN_CONFIGURATION_PARAMETER_IP_ADDRESS_SOURCE 4
#define IPMI_LAN_CONFIGURATION_PARAMETER_MAC_ADDRESS 5
#define IPMI_LAN_CONFIGURATION_PARAMETER_SUBNET_MASK 6
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV4_HEADER_PARAMETERS 7
#define IPMI_LAN_CONFIGURATION_PARAMETER_PRIMARY_RMCP_PORT_NUMBER 8
#define IPMI_LAN_CONFIGURATION_PARAMETER_SECONDARY_RMCP_PORT_NUMBER 9
#define IPMI_LAN_CONFIGURATION_PARAMETER_BMC_GENERATED_ARP_CONTROL 10
#define IPMI_LAN_CONFIGURATION_PARAMETER_GRATUITOUS_ARP_INTERVAL 11
#define IPMI_LAN_CONFIGURATION_PARAMETER_DEFAULT_GATEWAY_ADDRESS 12
#define IPMI_LAN_CONFIGURATION_PARAMETER_DEFAULT_GATEWAY_MAC_ADDRESS 13
#define IPMI_LAN_CONFIGURATION_PARAMETER_BACKUP_GATEWAY_ADDRESS 14
#define IPMI_LAN_CONFIGURATION_PARAMETER_BACKUP_GATEWAY_MAC_ADDRESS 15
#define IPMI_LAN_CONFIGURATION_PARAMETER_COMMUNITY_STRING 16
#define IPMI_LAN_CONFIGURATION_PARAMETER_NUMBER_OF_DESTINATIONS 17
#define IPMI_LAN_CONFIGURATION_PARAMETER_DESTINATION_TYPE 18
#define IPMI_LAN_CONFIGURATION_PARAMETER_DESTINATION_ADDRESSES 19
#define IPMI_LAN_CONFIGURATION_PARAMETER_VLAN_ID 20
#define IPMI_LAN_CONFIGURATION_PARAMETER_VLAN_PRIORITY 21
#define IPMI_LAN_CONFIGURATION_PARAMETER_RMCPPLUS_MESSAGING_CIPHER_SUITE_ENTRY_SUPPORT 22
#define IPMI_LAN_CONFIGURATION_PARAMETER_RMCPPLUS_MESSAGING_CIPHER_SUITE_ENTRIES 23
#define IPMI_LAN_CONFIGURATION_PARAMETER_RMCPPLUS_MESSAGING_CIPHER_SUITE_PRIVILEGE_LEVELS 24
#define IPMI_LAN_CONFIGURATION_PARAMETER_DESTINATION_ADDRESS_VLAN_TAGS 25
#define IPMI_LAN_CONFIGURATION_PARAMETER_BAD_PASSWORD_THRESHOLD 26
#define IPMI_LAN_CONFIGURATION_PARAMETER_OEM_MIN 192
#define IPMI_LAN_CONFIGURATION_PARAMETER_OEM_MAX 255
#define IPMI_LAN_CONFIGURATION_PARAMETER_SET_IN_PROGRESS 0
#define IPMI_LAN_CONFIGURATION_PARAMETER_AUTHENTICATION_TYPE_SUPPORT 1
#define IPMI_LAN_CONFIGURATION_PARAMETER_AUTHENTICATION_TYPE_ENABLES 2
#define IPMI_LAN_CONFIGURATION_PARAMETER_IP_ADDRESS 3
#define IPMI_LAN_CONFIGURATION_PARAMETER_IP_ADDRESS_SOURCE 4
#define IPMI_LAN_CONFIGURATION_PARAMETER_MAC_ADDRESS 5
#define IPMI_LAN_CONFIGURATION_PARAMETER_SUBNET_MASK 6
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV4_HEADER_PARAMETERS 7
#define IPMI_LAN_CONFIGURATION_PARAMETER_PRIMARY_RMCP_PORT_NUMBER 8
#define IPMI_LAN_CONFIGURATION_PARAMETER_SECONDARY_RMCP_PORT_NUMBER 9
#define IPMI_LAN_CONFIGURATION_PARAMETER_BMC_GENERATED_ARP_CONTROL 10
#define IPMI_LAN_CONFIGURATION_PARAMETER_GRATUITOUS_ARP_INTERVAL 11
#define IPMI_LAN_CONFIGURATION_PARAMETER_DEFAULT_GATEWAY_ADDRESS 12
#define IPMI_LAN_CONFIGURATION_PARAMETER_DEFAULT_GATEWAY_MAC_ADDRESS 13
#define IPMI_LAN_CONFIGURATION_PARAMETER_BACKUP_GATEWAY_ADDRESS 14
#define IPMI_LAN_CONFIGURATION_PARAMETER_BACKUP_GATEWAY_MAC_ADDRESS 15
#define IPMI_LAN_CONFIGURATION_PARAMETER_COMMUNITY_STRING 16
#define IPMI_LAN_CONFIGURATION_PARAMETER_NUMBER_OF_DESTINATIONS 17
#define IPMI_LAN_CONFIGURATION_PARAMETER_DESTINATION_TYPE 18
#define IPMI_LAN_CONFIGURATION_PARAMETER_DESTINATION_ADDRESSES 19
#define IPMI_LAN_CONFIGURATION_PARAMETER_VLAN_ID 20
#define IPMI_LAN_CONFIGURATION_PARAMETER_VLAN_PRIORITY 21
#define IPMI_LAN_CONFIGURATION_PARAMETER_RMCPPLUS_MESSAGING_CIPHER_SUITE_ENTRY_SUPPORT 22
#define IPMI_LAN_CONFIGURATION_PARAMETER_RMCPPLUS_MESSAGING_CIPHER_SUITE_ENTRIES 23
#define IPMI_LAN_CONFIGURATION_PARAMETER_RMCPPLUS_MESSAGING_CIPHER_SUITE_PRIVILEGE_LEVELS 24
#define IPMI_LAN_CONFIGURATION_PARAMETER_DESTINATION_ADDRESS_VLAN_TAGS 25
#define IPMI_LAN_CONFIGURATION_PARAMETER_BAD_PASSWORD_THRESHOLD 26
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_IPV4_SUPPORT 50
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_IPV4_ADDRESSING_ENABLES 51
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_HEADER_STATIC_TRAFFIC_CLASS 52
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_HEADER_STATIC_HOP_LIMIT 53
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_HEADER_FLOW_LABEL 54
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_STATUS 55
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_STATIC_ADDRESSES 56
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_DHCPV6_STATIC_DUID_STORAGE_LENGTH 57
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_DHCPV6_STATIC_DUIDS 58
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_DYNAMIC_ADDRESS 59
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_DHCPV6_DYNAMIC_DUID_STORAGE_LENGTH 60
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_DHCPV6_DYNAMIC_DUIDS 61
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_DHCPV6_TIMING_CONFIGURATION_SUPPORT 62
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_DHCPV6_TIMING_AND_CONFIGURATION 63
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_ROUTER_ADDRESS_CONFIGURATION_CONTROL 64
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_STATIC_ROUTER_1_IP_ADDRESS 65
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_STATIC_ROUTER_1_MAC_ADDRESS 66
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_STATIC_ROUTER_1_PREFIX_LENGTH 67
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_STATIC_ROUTER_1_PREFIX_VALUE 68
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_STATIC_ROUTER_2_IP_ADDRESS 69
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_STATIC_ROUTER_2_MAC_ADDRESS 70
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_STATIC_ROUTER_2_PREFIX_LENGTH 71
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_STATIC_ROUTER_2_PREFIX_VALUE 72
#define IPMI_LAN_CONFIGURATION_PARAMETER_NUMBER_OF_DYNAMIC_ROUTER_INFO_SETS 73
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_DYNAMIC_ROUTER_INFO_IP_ADDRESS 74
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_DYNAMIC_ROUTER_INFO_MAC_ADDRESS 75
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_DYNAMIC_ROUTER_INFO_PREFIX_LENGTH 76
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_DYNAMIC_ROUTER_INFO_PREFIX_VALUE 77
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_DYNAMIC_ROUTER_RECEIVED_HOP_LIMIT 78
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_NEIGHBOR_DISCOVERY_SLAAC_TIMING_CONFIGURATION_SUPPORT 79
#define IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_NEIGHBOR_DISCOVERY_SLAAC_TIMING_CONFIGURATION 80
#define IPMI_LAN_CONFIGURATION_PARAMETER_OEM_MIN 192
#define IPMI_LAN_CONFIGURATION_PARAMETER_OEM_MAX 255

/* To avoid gcc warnings, add +1 in comparison */
#define IPMI_LAN_CONFIGURATION_PARAMETER_SELECTOR_VALID(__parameter_selector) \
((((__parameter_selector) + 1) > (IPMI_LAN_CONFIGURATION_PARAMETER_SET_IN_PROGRESS + 1) \
&& (__parameter_selector) <= IPMI_LAN_CONFIGURATION_PARAMETER_BAD_PASSWORD_THRESHOLD) ? 1 : 0)
&& (__parameter_selector) <= IPMI_LAN_CONFIGURATION_PARAMETER_IPV6_NEIGHBOR_DISCOVERY_SLAAC_TIMING_CONFIGURATION) ? 1 : 0)

/* To avoid gcc warnings, subtract -1 in comparison */
#define IPMI_LAN_CONFIGURATION_PARAMETER_SELECTOR_IS_OEM(__parameter_selector) \
Expand Down
Loading

0 comments on commit bd83b85

Please sign in to comment.