Lines Matching refs:p

136 	struct lan_param * p = NULL;  in get_lan_param_select()  local
144 p = &ipmi_lan_params[i]; in get_lan_param_select()
149 if (p == NULL) { in get_lan_param_select()
155 msg_data[1] = p->cmd; in get_lan_param_select()
167 lprintf(LOG_INFO, "Get LAN Parameter '%s' command failed", p->desc); in get_lan_param_select()
182 p->desc, val2str(rsp->ccode, completion_code_vals)); in get_lan_param_select()
183 p->data = NULL; in get_lan_param_select()
184 p->data_len = 0; in get_lan_param_select()
185 return p; in get_lan_param_select()
191 p->desc, val2str(rsp->ccode, completion_code_vals)); in get_lan_param_select()
195 p->data = rsp->data + 1; in get_lan_param_select()
196 p->data_len = rsp->data_len - 1; in get_lan_param_select()
198 return p; in get_lan_param_select()
238 struct lan_param * p; in set_lan_param_wait() local
246 p = get_lan_param(intf, chan, param); in set_lan_param_wait()
247 if (p == NULL) { in set_lan_param_wait()
254 printbuf(p->data, p->data_len, "READ DATA"); in set_lan_param_wait()
255 if (p->data_len != len) { in set_lan_param_wait()
259 p->data_len, len); in set_lan_param_wait()
264 if (memcmp(data, p->data, len) != 0) { in set_lan_param_wait()
363 struct lan_param * p; in ipmi_lanp_lock_state() local
364 p = get_lan_param(intf, chan, IPMI_LANP_SET_IN_PROGRESS); in ipmi_lanp_lock_state()
365 if (p == NULL) in ipmi_lanp_lock_state()
367 if (p->data == NULL) in ipmi_lanp_lock_state()
369 return (p->data[0] & 3); in ipmi_lanp_lock_state()
579 struct lan_param * p; in ipmi_lan_print() local
592 p = get_lan_param(intf, chan, IPMI_LANP_SET_IN_PROGRESS); in ipmi_lan_print()
593 if (p == NULL) in ipmi_lan_print()
595 if (p->data != NULL) { in ipmi_lan_print()
596 printf("%-24s: ", p->desc); in ipmi_lan_print()
597 p->data[0] &= 3; in ipmi_lan_print()
598 switch (p->data[0]) { in ipmi_lan_print()
616 p = get_lan_param(intf, chan, IPMI_LANP_AUTH_TYPE); in ipmi_lan_print()
617 if (p == NULL) in ipmi_lan_print()
619 if (p->data != NULL) { in ipmi_lan_print()
620 printf("%-24s: %s%s%s%s%s\n", p->desc, in ipmi_lan_print()
621 (p->data[0] & 1<<IPMI_SESSION_AUTHTYPE_NONE) ? "NONE " : "", in ipmi_lan_print()
622 (p->data[0] & 1<<IPMI_SESSION_AUTHTYPE_MD2) ? "MD2 " : "", in ipmi_lan_print()
623 (p->data[0] & 1<<IPMI_SESSION_AUTHTYPE_MD5) ? "MD5 " : "", in ipmi_lan_print()
624 (p->data[0] & 1<<IPMI_SESSION_AUTHTYPE_PASSWORD) ? "PASSWORD " : "", in ipmi_lan_print()
625 (p->data[0] & 1<<IPMI_SESSION_AUTHTYPE_OEM) ? "OEM " : ""); in ipmi_lan_print()
628 p = get_lan_param(intf, chan, IPMI_LANP_AUTH_TYPE_ENABLE); in ipmi_lan_print()
629 if (p == NULL) in ipmi_lan_print()
631 if (p->data != NULL) { in ipmi_lan_print()
632 printf("%-24s: Callback : %s%s%s%s%s\n", p->desc, in ipmi_lan_print()
633 (p->data[0] & 1<<IPMI_SESSION_AUTHTYPE_NONE) ? "NONE " : "", in ipmi_lan_print()
634 (p->data[0] & 1<<IPMI_SESSION_AUTHTYPE_MD2) ? "MD2 " : "", in ipmi_lan_print()
635 (p->data[0] & 1<<IPMI_SESSION_AUTHTYPE_MD5) ? "MD5 " : "", in ipmi_lan_print()
636 (p->data[0] & 1<<IPMI_SESSION_AUTHTYPE_PASSWORD) ? "PASSWORD " : "", in ipmi_lan_print()
637 (p->data[0] & 1<<IPMI_SESSION_AUTHTYPE_OEM) ? "OEM " : ""); in ipmi_lan_print()
639 (p->data[1] & 1<<IPMI_SESSION_AUTHTYPE_NONE) ? "NONE " : "", in ipmi_lan_print()
640 (p->data[1] & 1<<IPMI_SESSION_AUTHTYPE_MD2) ? "MD2 " : "", in ipmi_lan_print()
641 (p->data[1] & 1<<IPMI_SESSION_AUTHTYPE_MD5) ? "MD5 " : "", in ipmi_lan_print()
642 (p->data[1] & 1<<IPMI_SESSION_AUTHTYPE_PASSWORD) ? "PASSWORD " : "", in ipmi_lan_print()
643 (p->data[1] & 1<<IPMI_SESSION_AUTHTYPE_OEM) ? "OEM " : ""); in ipmi_lan_print()
645 (p->data[2] & 1<<IPMI_SESSION_AUTHTYPE_NONE) ? "NONE " : "", in ipmi_lan_print()
646 (p->data[2] & 1<<IPMI_SESSION_AUTHTYPE_MD2) ? "MD2 " : "", in ipmi_lan_print()
647 (p->data[2] & 1<<IPMI_SESSION_AUTHTYPE_MD5) ? "MD5 " : "", in ipmi_lan_print()
648 (p->data[2] & 1<<IPMI_SESSION_AUTHTYPE_PASSWORD) ? "PASSWORD " : "", in ipmi_lan_print()
649 (p->data[2] & 1<<IPMI_SESSION_AUTHTYPE_OEM) ? "OEM " : ""); in ipmi_lan_print()
651 (p->data[3] & 1<<IPMI_SESSION_AUTHTYPE_NONE) ? "NONE " : "", in ipmi_lan_print()
652 (p->data[3] & 1<<IPMI_SESSION_AUTHTYPE_MD2) ? "MD2 " : "", in ipmi_lan_print()
653 (p->data[3] & 1<<IPMI_SESSION_AUTHTYPE_MD5) ? "MD5 " : "", in ipmi_lan_print()
654 (p->data[3] & 1<<IPMI_SESSION_AUTHTYPE_PASSWORD) ? "PASSWORD " : "", in ipmi_lan_print()
655 (p->data[3] & 1<<IPMI_SESSION_AUTHTYPE_OEM) ? "OEM " : ""); in ipmi_lan_print()
657 (p->data[4] & 1<<IPMI_SESSION_AUTHTYPE_NONE) ? "NONE " : "", in ipmi_lan_print()
658 (p->data[4] & 1<<IPMI_SESSION_AUTHTYPE_MD2) ? "MD2 " : "", in ipmi_lan_print()
659 (p->data[4] & 1<<IPMI_SESSION_AUTHTYPE_MD5) ? "MD5 " : "", in ipmi_lan_print()
660 (p->data[4] & 1<<IPMI_SESSION_AUTHTYPE_PASSWORD) ? "PASSWORD " : "", in ipmi_lan_print()
661 (p->data[4] & 1<<IPMI_SESSION_AUTHTYPE_OEM) ? "OEM " : ""); in ipmi_lan_print()
664 p = get_lan_param(intf, chan, IPMI_LANP_IP_ADDR_SRC); in ipmi_lan_print()
665 if (p == NULL) in ipmi_lan_print()
667 if (p->data != NULL) { in ipmi_lan_print()
668 printf("%-24s: ", p->desc); in ipmi_lan_print()
669 p->data[0] &= 0xf; in ipmi_lan_print()
670 switch (p->data[0]) { in ipmi_lan_print()
689 p = get_lan_param(intf, chan, IPMI_LANP_IP_ADDR); in ipmi_lan_print()
690 if (p == NULL) in ipmi_lan_print()
692 if (p->data != NULL) in ipmi_lan_print()
693 printf("%-24s: %d.%d.%d.%d\n", p->desc, in ipmi_lan_print()
694 p->data[0], p->data[1], p->data[2], p->data[3]); in ipmi_lan_print()
696 p = get_lan_param(intf, chan, IPMI_LANP_SUBNET_MASK); in ipmi_lan_print()
697 if (p == NULL) in ipmi_lan_print()
699 if (p->data != NULL) in ipmi_lan_print()
700 printf("%-24s: %d.%d.%d.%d\n", p->desc, in ipmi_lan_print()
701 p->data[0], p->data[1], p->data[2], p->data[3]); in ipmi_lan_print()
703 p = get_lan_param(intf, chan, IPMI_LANP_MAC_ADDR); in ipmi_lan_print()
704 if (p == NULL) in ipmi_lan_print()
706 if (p->data != NULL) in ipmi_lan_print()
707 printf("%-24s: %02x:%02x:%02x:%02x:%02x:%02x\n", p->desc, in ipmi_lan_print()
708 p->data[0], p->data[1], p->data[2], p->data[3], p->data[4], p->data[5]); in ipmi_lan_print()
710 p = get_lan_param(intf, chan, IPMI_LANP_SNMP_STRING); in ipmi_lan_print()
711 if (p == NULL) in ipmi_lan_print()
713 if (p->data != NULL) in ipmi_lan_print()
714 printf("%-24s: %s\n", p->desc, p->data); in ipmi_lan_print()
716 p = get_lan_param(intf, chan, IPMI_LANP_IP_HEADER); in ipmi_lan_print()
717 if (p == NULL) in ipmi_lan_print()
719 if (p->data != NULL) in ipmi_lan_print()
721 p->desc, p->data[0], p->data[1] & 0xe0, p->data[2] & 0xe0, p->data[2] & 0x1e); in ipmi_lan_print()
723 p = get_lan_param(intf, chan, IPMI_LANP_BMC_ARP); in ipmi_lan_print()
724 if (p == NULL) in ipmi_lan_print()
726 if (p->data != NULL) in ipmi_lan_print()
727 printf("%-24s: ARP Responses %sabled, Gratuitous ARP %sabled\n", p->desc, in ipmi_lan_print()
728 (p->data[0] & 2) ? "En" : "Dis", (p->data[0] & 1) ? "En" : "Dis"); in ipmi_lan_print()
730 p = get_lan_param(intf, chan, IPMI_LANP_GRAT_ARP); in ipmi_lan_print()
731 if (p == NULL) in ipmi_lan_print()
733 if (p->data != NULL) in ipmi_lan_print()
734 printf("%-24s: %.1f seconds\n", p->desc, (float)((p->data[0] + 1) / 2)); in ipmi_lan_print()
736 p = get_lan_param(intf, chan, IPMI_LANP_DEF_GATEWAY_IP); in ipmi_lan_print()
737 if (p == NULL) in ipmi_lan_print()
739 if (p->data != NULL) in ipmi_lan_print()
740 printf("%-24s: %d.%d.%d.%d\n", p->desc, in ipmi_lan_print()
741 p->data[0], p->data[1], p->data[2], p->data[3]); in ipmi_lan_print()
743 p = get_lan_param(intf, chan, IPMI_LANP_DEF_GATEWAY_MAC); in ipmi_lan_print()
744 if (p == NULL) in ipmi_lan_print()
746 if (p->data != NULL) in ipmi_lan_print()
747 printf("%-24s: %02x:%02x:%02x:%02x:%02x:%02x\n", p->desc, in ipmi_lan_print()
748 p->data[0], p->data[1], p->data[2], p->data[3], p->data[4], p->data[5]); in ipmi_lan_print()
750 p = get_lan_param(intf, chan, IPMI_LANP_BAK_GATEWAY_IP); in ipmi_lan_print()
751 if (p == NULL) in ipmi_lan_print()
753 if (p->data != NULL) in ipmi_lan_print()
754 printf("%-24s: %d.%d.%d.%d\n", p->desc, in ipmi_lan_print()
755 p->data[0], p->data[1], p->data[2], p->data[3]); in ipmi_lan_print()
757 p = get_lan_param(intf, chan, IPMI_LANP_BAK_GATEWAY_MAC); in ipmi_lan_print()
758 if (p == NULL) in ipmi_lan_print()
760 if (p->data != NULL) in ipmi_lan_print()
761 printf("%-24s: %02x:%02x:%02x:%02x:%02x:%02x\n", p->desc, in ipmi_lan_print()
762 p->data[0], p->data[1], p->data[2], p->data[3], p->data[4], p->data[5]); in ipmi_lan_print()
764 p = get_lan_param(intf, chan, IPMI_LANP_VLAN_ID); in ipmi_lan_print()
765 if (p != NULL && p->data != NULL) { in ipmi_lan_print()
766 int id = ((p->data[1] & 0x0f) << 8) + p->data[0]; in ipmi_lan_print()
767 if (p->data[1] & 0x80) in ipmi_lan_print()
768 printf("%-24s: %d\n", p->desc, id); in ipmi_lan_print()
770 printf("%-24s: Disabled\n", p->desc); in ipmi_lan_print()
773 p = get_lan_param(intf, chan, IPMI_LANP_VLAN_PRIORITY); in ipmi_lan_print()
774 if (p != NULL && p->data != NULL) in ipmi_lan_print()
775 printf("%-24s: %d\n", p->desc, p->data[0] & 0x07); in ipmi_lan_print()
778 p = get_lan_param(intf, chan, IPMI_LANP_RMCP_CIPHER_SUPPORT); in ipmi_lan_print()
779 if (p == NULL) in ipmi_lan_print()
781 else if (p->data != NULL) in ipmi_lan_print()
783 unsigned char cipher_suite_count = p->data[0]; in ipmi_lan_print()
784 p = get_lan_param(intf, chan, IPMI_LANP_RMCP_CIPHERS); in ipmi_lan_print()
785 if (p == NULL) in ipmi_lan_print()
788 printf("%-24s: ", p->desc); in ipmi_lan_print()
792 if ((p->data != NULL) && (p->data_len <= 17)) in ipmi_lan_print()
799 p->data[i + 1]); in ipmi_lan_print()
811 p = get_lan_param(intf, chan, IPMI_LANP_RMCP_PRIV_LEVELS); in ipmi_lan_print()
812 if (p == NULL) in ipmi_lan_print()
814 if ((p->data != NULL) && (p->data_len == 9)) in ipmi_lan_print()
816 printf("%-24s: %c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n", p->desc, in ipmi_lan_print()
817 priv_level_to_char(p->data[1] & 0x0F), in ipmi_lan_print()
818 priv_level_to_char(p->data[1] >> 4), in ipmi_lan_print()
819 priv_level_to_char(p->data[2] & 0x0F), in ipmi_lan_print()
820 priv_level_to_char(p->data[2] >> 4), in ipmi_lan_print()
821 priv_level_to_char(p->data[3] & 0x0F), in ipmi_lan_print()
822 priv_level_to_char(p->data[3] >> 4), in ipmi_lan_print()
823 priv_level_to_char(p->data[4] & 0x0F), in ipmi_lan_print()
824 priv_level_to_char(p->data[4] >> 4), in ipmi_lan_print()
825 priv_level_to_char(p->data[5] & 0x0F), in ipmi_lan_print()
826 priv_level_to_char(p->data[5] >> 4), in ipmi_lan_print()
827 priv_level_to_char(p->data[6] & 0x0F), in ipmi_lan_print()
828 priv_level_to_char(p->data[6] >> 4), in ipmi_lan_print()
829 priv_level_to_char(p->data[7] & 0x0F), in ipmi_lan_print()
830 priv_level_to_char(p->data[7] >> 4), in ipmi_lan_print()
831 priv_level_to_char(p->data[8] & 0x0F)); in ipmi_lan_print()
842 printf("%-24s: Not Available\n", p->desc); in ipmi_lan_print()
845 p = get_lan_param(intf, chan, IPMI_LANP_BAD_PASS_THRESH); in ipmi_lan_print()
846 if (p == NULL) in ipmi_lan_print()
848 if ((p->data != NULL) && (p->data_len == 6)) { in ipmi_lan_print()
851 printf("%-24s: %d\n", p->desc, p->data[1]); in ipmi_lan_print()
853 p->data[0] & 1 ? "yes" : "no" ); in ipmi_lan_print()
854 tmp = p->data[2] + (p->data[3] << 8); in ipmi_lan_print()
856 tmp = p->data[4] + (p->data[5] << 8); in ipmi_lan_print()
859 printf("%-24s: Not Available\n", p->desc); in ipmi_lan_print()
872 char * p; in ipmi_lan_set_auth() local
890 p = types; in ipmi_lan_set_auth()
891 while (p) { in ipmi_lan_set_auth()
892 if (strncasecmp(p, "none", 4) == 0) in ipmi_lan_set_auth()
894 else if (strncasecmp(p, "md2", 3) == 0) in ipmi_lan_set_auth()
896 else if (strncasecmp(p, "md5", 3) == 0) in ipmi_lan_set_auth()
898 else if ((strncasecmp(p, "password", 8) == 0) || in ipmi_lan_set_auth()
899 (strncasecmp(p, "key", 3) == 0)) in ipmi_lan_set_auth()
901 else if (strncasecmp(p, "oem", 3) == 0) in ipmi_lan_set_auth()
904 lprintf(LOG_WARNING, "Invalid authentication type: %s", p); in ipmi_lan_set_auth()
905 p = strchr(p, ','); in ipmi_lan_set_auth()
906 if (p) in ipmi_lan_set_auth()
907 p++; in ipmi_lan_set_auth()
910 p = level; in ipmi_lan_set_auth()
911 while (p) { in ipmi_lan_set_auth()
912 if (strncasecmp(p, "callback", 8) == 0) in ipmi_lan_set_auth()
914 else if (strncasecmp(p, "user", 4) == 0) in ipmi_lan_set_auth()
916 else if (strncasecmp(p, "operator", 8) == 0) in ipmi_lan_set_auth()
918 else if (strncasecmp(p, "admin", 5) == 0) in ipmi_lan_set_auth()
921 lprintf(LOG_WARNING, "Invalid authentication level: %s", p); in ipmi_lan_set_auth()
922 p = strchr(p, ','); in ipmi_lan_set_auth()
923 if (p) in ipmi_lan_set_auth()
924 p++; in ipmi_lan_set_auth()
1697 struct lan_param * p; in is_alert_destination() local
1699 p = get_lan_param(intf, channel, IPMI_LANP_NUM_DEST); in is_alert_destination()
1700 if (p == NULL) in is_alert_destination()
1702 if (p->data == NULL) in is_alert_destination()
1705 if (alert <= (p->data[0] & 0xf)) in is_alert_destination()
1791 struct lan_param * p; in ipmi_lan_alert_print_all() local
1793 p = get_lan_param(intf, channel, IPMI_LANP_NUM_DEST); in ipmi_lan_alert_print_all()
1794 if (p == NULL) in ipmi_lan_alert_print_all()
1796 if (p->data == NULL) in ipmi_lan_alert_print_all()
1798 ndest = p->data[0] & 0xf; in ipmi_lan_alert_print_all()
1811 struct lan_param * p; in ipmi_lan_alert_set() local
1833 p = get_lan_param_select(intf, chan, IPMI_LANP_DEST_ADDR, alert); in ipmi_lan_alert_set()
1834 if (p == NULL) { in ipmi_lan_alert_set()
1837 memcpy(data, p->data, p->data_len); in ipmi_lan_alert_set()
1842 rc = set_lan_param_nowait(intf, chan, IPMI_LANP_DEST_ADDR, data, p->data_len); in ipmi_lan_alert_set()
1848 p = get_lan_param_select(intf, chan, IPMI_LANP_DEST_ADDR, alert); in ipmi_lan_alert_set()
1849 if (p == NULL) { in ipmi_lan_alert_set()
1852 memcpy(data, p->data, p->data_len); in ipmi_lan_alert_set()
1858 rc = set_lan_param_nowait(intf, chan, IPMI_LANP_DEST_ADDR, data, p->data_len); in ipmi_lan_alert_set()
1863 p = get_lan_param_select(intf, chan, IPMI_LANP_DEST_ADDR, alert); in ipmi_lan_alert_set()
1864 if (p == NULL) { in ipmi_lan_alert_set()
1867 memcpy(data, p->data, p->data_len); in ipmi_lan_alert_set()
1884 rc = set_lan_param_nowait(intf, chan, IPMI_LANP_DEST_ADDR, data, p->data_len); in ipmi_lan_alert_set()
1889 p = get_lan_param_select(intf, chan, IPMI_LANP_DEST_TYPE, alert); in ipmi_lan_alert_set()
1890 if (p == NULL) { in ipmi_lan_alert_set()
1893 memcpy(data, p->data, p->data_len); in ipmi_lan_alert_set()
1909 rc = set_lan_param_nowait(intf, chan, IPMI_LANP_DEST_TYPE, data, p->data_len); in ipmi_lan_alert_set()
1914 p = get_lan_param_select(intf, chan, IPMI_LANP_DEST_TYPE, alert); in ipmi_lan_alert_set()
1915 if (p == NULL) { in ipmi_lan_alert_set()
1918 memcpy(data, p->data, p->data_len); in ipmi_lan_alert_set()
1937 rc = set_lan_param_nowait(intf, chan, IPMI_LANP_DEST_TYPE, data, p->data_len); in ipmi_lan_alert_set()
1942 p = get_lan_param_select(intf, chan, IPMI_LANP_DEST_TYPE, alert); in ipmi_lan_alert_set()
1943 if (p == NULL) { in ipmi_lan_alert_set()
1946 memcpy(data, p->data, p->data_len); in ipmi_lan_alert_set()
1953 rc = set_lan_param_nowait(intf, chan, IPMI_LANP_DEST_TYPE, data, p->data_len); in ipmi_lan_alert_set()
1958 p = get_lan_param_select(intf, chan, IPMI_LANP_DEST_TYPE, alert); in ipmi_lan_alert_set()
1959 if (p == NULL) { in ipmi_lan_alert_set()
1962 memcpy(data, p->data, p->data_len); in ipmi_lan_alert_set()
1970 rc = set_lan_param_nowait(intf, chan, IPMI_LANP_DEST_TYPE, data, p->data_len); in ipmi_lan_alert_set()